/* Los 500 españoles más influyentes - hoja de estilos
   Imagen corporativa de merca2.es: azul #004D85, verde #72C000, PT Serif (titulares) y Open Sans (texto). */

@font-face { font-family: "PT Serif"; src: url("/assets/fonts/ptserif-normal-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("/assets/fonts/ptserif-normal-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("/assets/fonts/ptserif-italic-400.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("/assets/fonts/opensans-normal-latin.woff2") format("woff2"); font-weight: 300 800; font-stretch: 75% 100%; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("/assets/fonts/opensans-italic-latin.woff2") format("woff2"); font-weight: 300 800; font-stretch: 75% 100%; font-style: italic; font-display: swap; }

:root {
  --brand: #004d85;
  --brand-dark: #003b66;
  --brand-deep: #002a4a;
  --accent: #72c000;
  --accent-soft: #eef6e0;
  --accent-text: #3f6d00;
  --ink: #16212a;
  --text: #1f2a33;
  --text-muted: #5a6670;
  --bg: #ffffff;
  --surface: #f4f6f8;
  --line: #e2e7eb;
  --shadow: 0 1px 2px rgb(0 40 70 / .06), 0 14px 34px -18px rgb(0 40 70 / .3);
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(56px, 8vw, 104px);
  --serif: "PT Serif", Georgia, serif;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -0.005em; color: var(--ink); text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 860px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .8em 1.35em; border-radius: 999px; font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border-color: var(--brand); color: var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }

/* Cabecera oscura */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--brand); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 76px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand .m2 { height: 28px; width: auto; }
.brand .sep { width: 1px; height: 38px; background: rgb(255 255 255 / .3); }
.brand .l500 { height: 52px; width: auto; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { text-decoration: none; font-weight: 600; font-size: .975rem; color: rgb(255 255 255 / .9); padding: 8px 13px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { background: rgb(255 255 255 / .1); color: #fff; }
.nav a[aria-current="page"] { background: rgb(255 255 255 / .14); color: #fff; }
.nav .nav-search { background: var(--accent); color: var(--ink); margin-left: 8px; }
.nav .nav-search:hover { background: #84d10f; color: var(--ink); }
.menu-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; margin-right: -8px; cursor: pointer; }
.menu-toggle .icon { width: 28px; height: 28px; }
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .nav { position: absolute; inset: 76px 0 auto 0; flex-direction: column; align-items: stretch; background: var(--brand); border-top: 1px solid rgb(255 255 255 / .12); padding: 10px var(--gutter) 20px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s var(--ease), visibility .25s; }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 13px 14px; font-size: 1.1rem; }
  .nav .nav-search { margin: 10px 0 0; justify-content: center; }
}
@media (max-width: 460px) { .brand .m2 { height: 22px; } .brand .l500 { height: 44px; } .brand { gap: 12px; } }

/* Barra de ediciones */
.editions-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.editions-bar .wrap { display: flex; align-items: center; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-block: 10px; }
.editions-bar .wrap::-webkit-scrollbar { display: none; }
.editions-bar span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-right: 6px; white-space: nowrap; }
.editions-bar a { flex: none; text-decoration: none; font-weight: 700; font-size: .95rem; padding: 5px 13px; border-radius: 999px; color: var(--brand); }
.editions-bar a:hover { background: #fff; }
.editions-bar a[aria-current="page"] { background: var(--brand); color: #fff; }

/* Secciones */
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section--tint { background: var(--surface); }
.section--tint + .section, .section + .section--tint { padding-top: var(--section); }
.section-head { margin-bottom: clamp(24px, 3.5vw, 40px); max-width: 72ch; }
.section-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section-head p { margin-top: .7rem; color: var(--text-muted); font-size: 1.1rem; }
.kicker { font-family: var(--sans); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-text); }

/* Portada de edición */
.edition-hero { padding-block: clamp(36px, 6vw, 80px) clamp(32px, 5vw, 64px); }
.edition-hero-grid { display: grid; gap: 36px; align-items: center; }
.edition-hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); max-width: 14ch; margin-top: .6rem; }
.edition-hero h1 em { font-style: normal; color: var(--accent-text); }
.edition-hero .lead { margin-top: 1.1rem; font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--text-muted); max-width: 58ch; }
.edition-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }
.sponsors-box { background: var(--surface); border-radius: var(--radius); padding: 24px; }
.sponsors-box h2 { font-family: var(--sans); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); margin-bottom: 14px; }
.sponsors-box p { margin-top: 14px; color: var(--text-muted); font-size: .95rem; }
@media (min-width: 980px) { .edition-hero-grid { grid-template-columns: 1.25fr 1fr; gap: 64px; } }

.logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .logos { grid-template-columns: repeat(3, 1fr); } }
.logos li { display: grid; place-items: center; height: 92px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.logos img { max-height: 60px; width: auto; max-width: 100%; object-fit: contain; }
.logos--wide { grid-template-columns: 1fr !important; }
.logos--wide li { height: auto; padding: 16px; }
.logos--wide img { max-height: none; }

/* Buscador */
.search-box { display: flex; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 18px; align-items: center; max-width: 560px; box-shadow: var(--shadow); }
.search-box:focus-within { border-color: var(--brand); }
.search-box .icon { color: var(--text-muted); width: 22px; height: 22px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 1.05rem; padding: 8px 4px; background: transparent; color: var(--text); }
.search-box input::placeholder { color: #7b8790; }
.search-box button { flex: none; }

/* Rejilla de listas (categorías) */
.lists { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 600px) { .lists { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .lists { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.list-card a { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; text-decoration: none; padding: 12px; border-radius: var(--radius); transition: background-color .25s, box-shadow .25s, transform .3s var(--ease); }
.list-card a:hover { background: #fff; box-shadow: var(--shadow); transform: translateY(-2px); }
.section--tint .list-card a { background: #fff; }
.list-card img { width: 112px; height: 112px; object-fit: cover; object-position: center 20%; border-radius: var(--radius-sm); background: var(--surface); }
.list-card h3 { font-size: 1.2rem; line-height: 1.25; }
.list-card .top1 { margin-top: .45rem; font-size: .92rem; color: var(--text-muted); line-height: 1.4; }
.list-card .top1 strong { color: var(--brand); font-weight: 700; }

/* Cabecera de lista (banda azul) */
.list-hero { background: var(--brand); color: #fff; padding-block: clamp(36px, 6vw, 72px); }
.list-hero .kicker { color: var(--accent); }
.list-hero .kicker a { color: inherit; text-decoration: none; }
.list-hero .kicker a:hover { text-decoration: underline; }
.list-hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.6rem); max-width: 22ch; margin-top: .6rem; }
.list-hero p { margin-top: 1rem; color: rgb(255 255 255 / .82); max-width: 62ch; }

/* Top 10 */
.top { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 40px 28px; }
@media (min-width: 560px) { .top { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .top { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .top { grid-template-columns: repeat(4, 1fr); } }
.top-item { position: relative; }
.top-item .photo { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.top-item .photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.top-item .rank { position: absolute; left: 0; bottom: 0; min-width: 64px; padding: 6px 14px 4px; background: var(--accent); color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 2rem; line-height: 1; border-top-right-radius: var(--radius-sm); }
.top-item .rank--plain { position: static; display: inline-block; border-radius: 8px; margin-bottom: 10px; }
.top-item h3 { font-size: 1.35rem; margin-top: 14px; }
.top-item .cat { margin-top: 4px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-text); }
.top-item p { margin-top: .5rem; font-size: .95rem; color: var(--text-muted); line-height: 1.55; }
.top--first .top-item:first-child { grid-column: 1 / -1; display: grid; gap: 28px; align-items: center; }
@media (min-width: 760px) { .top--first .top-item:first-child { grid-template-columns: minmax(260px, 380px) 1fr; } .top--first .top-item:first-child h3 { font-size: 2.2rem; margin-top: 0; } .top--first .top-item:first-child p { font-size: 1.05rem; } }

/* Resto de la lista */
.rest { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 48px; }
@media (min-width: 900px) { .rest { columns: 2; } }
.rest li { break-inside: avoid; display: grid; grid-template-columns: 52px 1fr; gap: 4px 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.rest .n { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1.1; color: var(--brand); }
.rest .n--none { color: var(--line); }
.rest h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.rest .cat { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-text); margin-top: 2px; }
.rest p { grid-column: 2; font-size: .93rem; color: var(--text-muted); line-height: 1.55; margin-top: 2px; }
.rest li[hidden] { display: none; }

/* Filtro del ranking completo */
.filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; }
.filter select { font: inherit; font-size: 1rem; padding: 11px 38px 11px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%235a6670'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; appearance: none; color: var(--text); }
.filter .count { color: var(--text-muted); font-size: .95rem; }

/* Notas y patrocinio de la lista */
.note { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); color: var(--text-muted); font-size: .95rem; }
.note > * + * { margin-top: .8em; }
.note h2 { font-family: var(--sans); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); }
.list-foot { display: grid; gap: 24px; }
@media (min-width: 900px) { .list-foot { grid-template-columns: 2fr 1fr; align-items: start; } }

/* Navegación entre listas */
.pager { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: block; text-decoration: none; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, background-color .2s; }
.pager a:hover { border-color: var(--brand); background: var(--surface); }
.pager small { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.pager strong { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--ink); margin-top: 4px; line-height: 1.3; }
.pager .next { text-align: right; }
.pager .next small { justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips a { text-decoration: none; font-size: .9rem; padding: 6px 13px; border-radius: 999px; background: var(--surface); color: var(--brand); font-weight: 600; }
.chips a:hover { background: var(--accent-soft); }

/* Ediciones */
.years { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .years { grid-template-columns: repeat(4, 1fr); } }
.years a { display: block; text-decoration: none; background: #fff; border-radius: var(--radius); padding: 20px 22px; border: 1px solid var(--line); transition: border-color .2s, transform .3s var(--ease); }
.years a:hover { border-color: var(--brand); transform: translateY(-2px); }
.years strong { display: block; font-family: var(--serif); font-size: 2rem; color: var(--brand); line-height: 1; }
.years span { display: block; margin-top: 6px; font-size: .9rem; color: var(--text-muted); }

/* Texto */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1em; }
.prose p { color: var(--text-muted); }
.prose a { color: var(--brand); }

/* Resultados de búsqueda */
.results { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.results li a { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; text-decoration: none; padding: 12px 16px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.results li a:hover { border-color: var(--brand); background: var(--surface); }
.results img, .results .ph { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; object-position: center 20%; background: var(--surface); }
.results .ph { display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--brand); }
.results strong { display: block; font-size: 1.05rem; color: var(--ink); }
.results span { display: block; font-size: .9rem; color: var(--text-muted); line-height: 1.4; }
.results .r { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; color: var(--brand); white-space: nowrap; }
.results-empty { margin-top: 24px; color: var(--text-muted); }

/* Pie */
.site-footer { background: var(--brand-deep); color: rgb(255 255 255 / .75); padding-block: 48px 28px; font-size: .95rem; }
.footer-grid { display: grid; gap: 28px; align-items: start; }
.footer-grid .brand .l500 { height: 64px; }
.footer-grid p { margin-top: 14px; max-width: 46ch; }
.footer-grid h2 { font-family: var(--sans); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #fff; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; margin-top: 36px; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / .14); font-size: .88rem; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: #fff; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.2fr 1fr; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }

/* Móvil: top 10 en ficha compacta (foto a la izquierda) */
@media (max-width: 559px) {
  .top { gap: 22px; }
  .top-item, .top--first .top-item:first-child { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
  .top-item .rank { font-size: 1.3rem; min-width: 40px; padding: 4px 9px 3px; }
  .top-item h3, .top--first .top-item:first-child h3 { font-size: 1.15rem; margin-top: 0; }
  .top-item p { font-size: .9rem; }
}
