/* Article listings · design P1 "Portadas sobre foto + ranking".
   components.js: leadRanking (home and section pages), rankItem (also the
   article sidebar) and coverCard; every listing of articles uses .row-cover. */

.lead-p1 { display: grid; gap: 22px; margin-top: 8px; }
.lead-p1 > .ov-hero { min-height: 460px; border-radius: 20px; }
.lead-p1 .ov-hero .ov-title { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.06; }
.lead-p1 .ov-hero .ov-excerpt { -webkit-line-clamp: 2; font-size: 16px; }
.lead-p1 .ov-img, .row-cover .ov-img { transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.lead-p1 .ov:hover .ov-img, .row-cover .ov:hover .ov-img { transform: scale(1.06); }

/* Ranking */
.rank-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-bottom: 6px; }
.rank-head .display { font-size: 28px; }
.rank-head a { font: 600 13px var(--sans); color: var(--muted); white-space: nowrap; }
.rank-head a:hover { color: var(--red); }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); counter-increment: rank; }
.rank-item:last-child { border-bottom: 0; }
.rank-item::before { content: counter(rank); font: 700 34px/1 var(--display); color: var(--red); transition: transform .25s; }
.rank-item:hover::before { transform: translateX(3px); }
.rank-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rank-kicker { font: 700 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.rank-title { margin: 0; font: 700 16px/1.28 var(--sans); color: var(--ink); letter-spacing: -.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s; }
.rank-item:hover .rank-title { color: var(--red); }
.rank-item .meta { font-size: 12px; gap: 6px; }

/* "Te puede interesar": titles on the photos */
.row-cover { display: grid; gap: 14px; }
.row-cover .ov { min-height: 300px; border-radius: 18px; }
.row-cover .ov-title { font-size: 19px; line-height: 1.12; }
.row-cover .ov-body { padding: 18px; gap: 8px; }
.row-cover .meta { font-size: 12px; }

@media (min-width: 560px) {
  .row-cover { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .row-cover.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-cover.cols-3 .ov { min-height: 380px; }
  .row-cover.cols-3 .ov-title { font-size: 22px; }
  .lead-p1 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: stretch; }
  .lead-p1 > .ov-hero { min-height: 540px; }
  .rank { display: flex; flex-direction: column; }
  .rank-list { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
  .row-cover { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .row-cover .ov { min-height: 340px; }
}
/* Section pages and the article sidebar */
.feature-ov .lead-p1 { margin-top: 0; }
.rank-side .rank-item { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 11px 0; }
.rank-side .rank-item::before { font-size: 26px; }
.rank-side .rank-title { font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .lead-p1 .ov-img, .row-cover .ov-img, .rank-item::before { transition: none; }
}
html[data-theme="dark"] .rank-item::before { color: #ff5a4e; }

/* Phones: the article rows become a compact list (photo on the left, chip,
   title and date on the right), so a section shows its articles in the
   space one big card used to take. */
@media (max-width: 599px) {
  .row-cover { gap: 0; }
  .row-cover .ov { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 0; padding: 12px 0; border-radius: 0; background: none; color: var(--ink); overflow: visible; border-top: 1px solid var(--line); }
  .row-cover .ov:first-child { border-top: 0; padding-top: 4px; }
  .row-cover .ov-img { position: relative; inset: auto; z-index: 0; width: 104px; height: 78px; border-radius: 12px; }
  .row-cover .ov:hover .ov-img { transform: none; }
  .row-cover .ov-shade { display: none; }
  .row-cover .ov-body { padding: 0; gap: 4px; min-width: 0; }
  .row-cover .ov-title { font-size: 16px; line-height: 1.18; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .row-cover .ov .meta, .row-cover .ov .meta-author { color: var(--muted); font-size: 12px; }
  .row-cover .ov .chip { align-self: flex-start; font-size: 10px; padding: 3px 7px; }
  .row-cover.cols-3 .ov { min-height: 0; }
  .row-cover.cols-3 .ov-title { font-size: 16px; }
}

/* ---------- Phones, design P5 "Titulares": text first, small photo on the
   right. The main block opens with its heading; the main story and the next
   three are rows. The four sections are one block with tabs (P3). ---------- */
.rank-thumb { display: none; }
.sec-tabs { display: none; }
@media (max-width: 767px) {
  .lead-p1 { display: flex; flex-direction: column; gap: 0; }
  .lead-p1 > .rank { display: contents; }
  .lead-p1 .rank-head { order: -1; align-items: baseline; padding-bottom: 12px; }
  .lead-p1 .rank-head .display { font-size: 22px; }
  .lead-p1 > .ov-hero { display: grid; grid-template-columns: minmax(0, 1fr) 104px; align-items: start; gap: 12px; min-height: 0; padding: 0 0 14px; border-radius: 0; background: none; color: var(--ink); overflow: visible; }
  .lead-p1 > .ov-hero .ov-img { position: relative; inset: auto; z-index: 0; grid-column: 2; grid-row: 1; width: 104px; height: 104px; border-radius: 12px; }
  .lead-p1 .ov:hover .ov-img { transform: none; }
  .lead-p1 > .ov-hero .ov-shade, .lead-p1 > .ov-hero .ov-excerpt { display: none; }
  .lead-p1 > .ov-hero .ov-body { grid-column: 1; grid-row: 1; padding: 0; gap: 6px; min-width: 0; }
  .lead-p1 > .ov-hero .ov-title { font-size: 20px; line-height: 1.15; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .lead-p1 > .ov-hero .meta { color: var(--muted); font-size: 12px; }
  .lead-p1 > .ov-hero .meta-author, .lead-p1 > .ov-hero .meta-author + span { display: none; }
  /* the section as colored text instead of a pill */
  .lead-p1 > .ov-hero .chip { padding: 0; background: none; font-size: 10.5px; letter-spacing: .1em; }
  .lead-p1 > .ov-hero .chip-cultura { color: #d7261c; }
  .lead-p1 > .ov-hero .chip-musica { color: #6b2bd9; }
  .lead-p1 > .ov-hero .chip-gastronomia { color: #b86e00; }
  .lead-p1 > .ov-hero .chip-escapese { color: #0f7b5f; }
  .lead-p1 .rank-list { order: 1; }
  .lead-p1 .rank-item { grid-template-columns: minmax(0, 1fr) 58px; align-items: start; gap: 12px; padding: 12px 0; border-bottom: 0; border-top: 1px solid var(--line); }
  .lead-p1 .rank-item::before { content: none; }
  .lead-p1 .rank-item:nth-child(n+4) { display: none; }
  .lead-p1 .rank-body { gap: 4px; }
  .lead-p1 .rank-kicker { font-size: 10.5px; }
  .lead-p1 .rank-title { font-size: 15px; line-height: 1.22; }
  .lead-p1 .rank-item .meta { font-size: 11.5px; }
  .lead-p1 .rank-thumb { display: block; width: 58px; height: 58px; border-radius: 8px; overflow: hidden; background: var(--block); }
  .lead-p1 .rank-thumb img { width: 100%; height: 100%; object-fit: cover; }

  /* sections in one block */
  .home-sec { display: none; }
  .sec-tabs { display: block; margin-top: 36px; }
  .sec-tabs .section-head { margin-bottom: 12px; }
  .sec-tabs-bar { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .sec-tabs-bar::-webkit-scrollbar { display: none; }
  .sec-tab { flex: none; height: 36px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: 700 13px/1 var(--sans); cursor: pointer; scroll-snap-align: start; }
  .sec-tab[aria-selected="true"] { color: #fff; }
  .sec-tab-cultura[aria-selected="true"] { background: #d7261c; border-color: #d7261c; }
  .sec-tab-musica[aria-selected="true"] { background: #6b2bd9; border-color: #6b2bd9; }
  .sec-tab-gastronomia[aria-selected="true"] { background: #f2a007; border-color: #f2a007; color: var(--black); }
  .sec-tab-escapese[aria-selected="true"] { background: #0f7b5f; border-color: #0f7b5f; }
  .st-feat { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: start; padding-bottom: 12px; }
  .st-feat-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .st-feat-title { margin: 0; font: 700 17px/1.2 var(--sans); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .st-feat .meta { font-size: 12px; }
  .st-feat-media { width: 96px; height: 80px; border-radius: 10px; overflow: hidden; background: var(--block); }
  .st-feat-media img { width: 100%; height: 100%; object-fit: cover; }
  .st-list { list-style: none; margin: 0; padding: 0; }
  .st-list li { border-top: 1px solid var(--line); }
  .st-list a { position: relative; display: block; padding: 10px 0 10px 16px; font: 700 14.5px/1.28 var(--sans); color: var(--ink); text-decoration: none; }
  .st-list a::before { content: ""; position: absolute; left: 0; top: 17px; width: 6px; height: 6px; border-radius: 9px; background: var(--red); }
  .st-musica a::before { background: #6b2bd9; }
  .st-gastronomia a::before { background: #f2a007; }
  .st-escapese a::before { background: #0f7b5f; }
  .st-feat:hover .st-feat-title, .st-list a:hover { color: var(--red); }
}
@media (max-width: 767px) {
  html[data-theme="dark"] .lead-p1 > .ov-hero .chip-cultura { color: #ff6a5e; }
  html[data-theme="dark"] .lead-p1 > .ov-hero .chip-musica { color: #b49bff; }
  html[data-theme="dark"] .lead-p1 > .ov-hero .chip-gastronomia { color: #ffb32c; }
  html[data-theme="dark"] .lead-p1 > .ov-hero .chip-escapese { color: #4cd4a4; }
  html[data-theme="dark"] .st-musica a::before { background: #b49bff; }
  html[data-theme="dark"] .st-escapese a::before { background: #4cd4a4; }
}
