/* Noticias — 4 noticies per fila, cada noticia = text + imatge quadrada flush
   Totes les cel·les comparteixen la mateixa alçada (aspect-ratio 2/1 al item)
   i no hi ha cap marge entre elements. */
.pacho-news-grid{
  display:grid;
  /* 4 columnes de 350px cadascuna = 1400px total */
  grid-template-columns:repeat(4, 350px);
  gap:0;
  width:100%;
  background:#fff;
  max-width:1400px;
  margin:0 auto;
  justify-content:center;
}
.pacho-news-item{
  display:flex;
  flex-direction:row;
  gap:0;
  text-decoration:none;
  color:#111;
  overflow:hidden;
  transition:background .2s ease;
  background:#fff;
  grid-column:span 2; /* Cada item ocupa 2 columnes (text + imatge) */
}
.pacho-news-item:hover{
  background:#f3efe7;
}
.pacho-news-item:hover .pacho-news-text{ background:#f3efe7; }

.pacho-news-text{
  background:#fff;
  padding:26px 30px;
  display:flex; flex-direction:column; justify-content:flex-start;
  transition:background .2s ease;
  overflow:hidden;
  width:50%;
  aspect-ratio:1/1;
  box-sizing:border-box;
}
.pacho-news-date{
  font-size:.82rem; color:#555; margin-bottom:14px; letter-spacing:.02em;
}
.pacho-news-title{
  font-size:1rem; font-weight:700; text-transform:uppercase;
  margin:0 0 14px; letter-spacing:.02em; line-height:1.3;
  color:#000;
}
.pacho-news-excerpt{
  font-size:.88rem; color:#222; line-height:1.5;
  display:-webkit-box; -webkit-line-clamp:3; line-clamp:3; -webkit-box-orient:vertical;
  overflow:hidden;
}
.pacho-news-more{ color:#000; font-weight:500; white-space:nowrap; }
.pacho-news-img{
  background:#000;
  overflow:hidden;
  position:relative;
  width:50%;
  aspect-ratio:1/1;
}
.pacho-news-img img{
  width:100%; height:100%; object-fit:cover; object-position:center; display:block;
}

/* Alternança de files: a la 2a, 4a, 6a… fila (cada 2 items són 1 fila)
   invertim l'ordre perquè la imatge vagi a l'esquerra i el text a la dreta.
   Patró original: fila senar [text|img][text|img], fila parell [img|text][img|text]. */
.pacho-news-item:nth-child(4n+3),
.pacho-news-item:nth-child(4n){
  flex-direction:row-reverse;
}

/* Responsive: tablets - mantenir 2 items per fila amb cel·les flexibles */
@media (max-width:1400px){
  .pacho-news-grid{ 
    grid-template-columns:repeat(2, 1fr);
    max-width:100%;
  }
  .pacho-news-item{
    grid-column:span 1;
  }
}

/* Tablets petites: amagar descripció, mantenir data i títol */
@media (max-width:1024px){
  .pacho-news-excerpt{
    display:none;
  }
  .pacho-news-title{
    font-size:.85rem;
    margin:0;
  }
  .pacho-news-date{
    margin-bottom:8px;
  }
  .pacho-news-text{
    padding:20px;
    justify-content:center;
  }
}

/* Mòbil: 1 item per fila, text esq + img dreta (alternant) */
@media (max-width:768px){
  .pacho-news-grid{ 
    grid-template-columns:1fr;
  }
  .pacho-news-item{
    grid-column:span 1;
    flex-direction:row;
  }
  .pacho-news-text,
  .pacho-news-img{
    width:50%;
    height:auto;
    aspect-ratio:1/1;
  }
  /* Files senars: text esq, imatge dreta */
  .pacho-news-item:nth-child(odd){
    flex-direction:row;
  }
  /* Files parells: imatge esq, text dreta */
  .pacho-news-item:nth-child(even){
    flex-direction:row-reverse;
  }
}

/* Sidebar dins de single post */
.pacho-news-single-sidebar{
  margin-top:40px;
  padding-top:20px;
  border-top:1px solid #eee;
}

/* Paginador modern */
.pacho-news-grid ~ .page-numbers,
.page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  height:44px;
  padding:0 14px;
  font-size:1rem;
  font-weight:500;
  color:#333;
  background:#fff;
  border:2px solid #e0e0e0;
  border-radius:8px;
  text-decoration:none;
  transition:all 0.3s ease;
  margin:0 4px;
}
.page-numbers:hover{
  background:#f3efe7;
  border-color:#c4b550;
  color:#000;
  transform:translateY(-2px);
  box-shadow:0 4px 12px rgba(196,181,80,0.2);
}
.page-numbers.current{
  background:#c4b550;
  border-color:#c4b550;
  color:#fff;
  font-weight:600;
  box-shadow:0 2px 8px rgba(196,181,80,0.3);
}
.page-numbers.dots{
  border:none;
  background:transparent;
  cursor:default;
  pointer-events:none;
}
.page-numbers.prev,
.page-numbers.next{
  font-size:1.3rem;
  font-weight:400;
  padding:0 16px;
}
/* Wrapper del paginador */
.pacho-pagination-wrap{
  text-align:center;
  margin:80px 0 60px;
  padding:30px 0;
}
.entry-content > .page-numbers:first-of-type{
  margin-top:80px;
}

/* =====================================================
   HOME LAYOUT - Destacats + Sidebar
   ===================================================== */
.pacho-home-layout{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:0;
  width:100%;
  max-width:1400px;
  margin:0 auto;
  align-items:start;
}
.pacho-home-main{ 
  min-width:0;
  grid-column:span 4;
}
.pacho-home-aside{ 
  min-width:0;
  grid-column:span 1;
}

/* Sidebar títol més petit entre 1230px-1050px */
@media (max-width:1230px) and (min-width:1051px){
  .pacho-recent-title{
    font-size:.6rem;
    -webkit-line-clamp:2;
    line-clamp:2;
  }
  .pacho-recent-date{
    font-size:.7rem;
  }
  .pacho-recent-item{
    padding:12px 30px 12px 12px;
  }
  .pacho-recent-plus{
    font-size:1.1rem;
    right:8px;
    bottom:6px;
  }
}

@media (max-width: 1050px){
  .pacho-home-layout{ 
    grid-template-columns:1fr;
  }
  .pacho-home-main,
  .pacho-home-aside{ 
    grid-column:span 1;
  }
  .pacho-home-main{
    margin-bottom:40px;
  }
}

/* =====================================================
   DESTACADOS INICIO - Noticias marcades com destacades
   ===================================================== */
.pacho-destacados-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:0;
  width:100%;
  background:#fff;
}
.pacho-dest-item{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0;
  color:#111;
  overflow:hidden;
  background:#fff;
  transition:background .2s ease;
  grid-column:span 2;
  position:relative;
}
.pacho-dest-link{
  position:absolute;
  inset:0;
  z-index:5;
}
.pacho-dest-item:hover{ background:#f3efe7; }
.pacho-dest-item:hover .pacho-dest-text{ background:#f3efe7; }

.pacho-dest-text{
  background:#fff;
  padding:26px 30px;
  display:flex; flex-direction:column; justify-content:flex-start;
  transition:background .2s ease;
  overflow:hidden;
  aspect-ratio:1/1;
  box-sizing:border-box;
}
.pacho-dest-title{
  font-size:1rem;
  text-transform:uppercase;
  font-weight:700;
  margin:0 0 14px;
  letter-spacing:.02em;
  line-height:1.3;
  color:#000;
}
.pacho-dest-excerpt{
  font-size:.88rem; line-height:1.5; color:#222;
  display:-webkit-box; -webkit-line-clamp:3; line-clamp:3; -webkit-box-orient:vertical;
  overflow:hidden;
}
.pacho-dest-img{
  background:#000;
  overflow:hidden;
  position:relative;
  aspect-ratio:1/1;
}
.pacho-dest-img img{
  width:100%; height:100%; object-fit:cover; object-position:center; display:block;
}

/* Alternança correcta:
   Fila 1: item 1 [text|img], item 2 [text|img]
   Fila 2: item 3 [img|text], item 4 [img|text] */
.pacho-dest-item:nth-child(4n+1) .pacho-dest-text{ order:1; }
.pacho-dest-item:nth-child(4n+1) .pacho-dest-img{ order:2; }
.pacho-dest-item:nth-child(4n+2) .pacho-dest-text{ order:1; }
.pacho-dest-item:nth-child(4n+2) .pacho-dest-img{ order:2; }
.pacho-dest-item:nth-child(4n+3) .pacho-dest-text{ order:2; }
.pacho-dest-item:nth-child(4n+3) .pacho-dest-img{ order:1; }
.pacho-dest-item:nth-child(4n) .pacho-dest-text{ order:2; }
.pacho-dest-item:nth-child(4n) .pacho-dest-img{ order:1; }

/* Responsive destacats */
@media (max-width:1024px){
  .pacho-dest-excerpt{
    display:none;
  }
  .pacho-dest-title{
    font-size:.85rem;
    margin:0;
  }
  .pacho-dest-text{
    padding:20px;
    justify-content:center;
  }
}

@media (max-width:768px){
  .pacho-destacados-grid{ 
    grid-template-columns:1fr;
  }
  .pacho-dest-item{
    grid-column:span 1;
    grid-template-columns:1fr 1fr;
  }
  .pacho-dest-item:nth-child(odd) .pacho-dest-text{ order:1; }
  .pacho-dest-item:nth-child(odd) .pacho-dest-img{ order:2; }
  .pacho-dest-item:nth-child(even) .pacho-dest-text{ order:2; }
  .pacho-dest-item:nth-child(even) .pacho-dest-img{ order:1; }
}

/* =====================================================
   SIDEBAR - Últimes notícies (fons gris amb imatge)
   ===================================================== */
.pacho-recent-sidebar {
  display:flex; flex-direction:column; gap:0;
  width:100%;
  height:100%;
}
.pacho-recent-item {
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:18px 40px 18px 18px;
  background-color:#6d6d6d;
  background-image:none !important;
  color:#fff;
  text-decoration:none;
  flex:1;
  min-height:0;
  border-bottom:2px solid #fff;
  transition:background-color .3s ease;
}
.pacho-recent-item:last-child{
  border-bottom:none;
}
.pacho-recent-item:hover {
  background-color:#c4b550;
}
.pacho-recent-item > * { position:relative; z-index:1; }
.pacho-recent-date {
  display:block;
  font-size:.9rem;
  font-weight:400;
  letter-spacing:.06em;
  margin-bottom:6px;
  text-transform:uppercase;
}
.pacho-recent-title {
  font-size:.8rem;
  font-weight:400;
  margin:0;
  line-height:1.25;
  letter-spacing:.02em;
  display:-webkit-box;
  -webkit-line-clamp:2;
  line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.pacho-recent-plus {
  position:absolute; right:12px; bottom:8px; font-size:1.4rem; font-weight:300; opacity:.9; z-index:1;
}
