/* ================================================================
   THEME.CSS — Lenguaje común de todas las páginas (27.1)
   Se carga después del CSS propio de cada página. Fondo con panal y
   halo del color de la sección (--section, de css/nav.css), cabecera
   de página única (.pg-hero) y piezas comunes sin cajas: títulos de
   bloque, cifras grandes, listas con filetes y enlaces de sección.
   ================================================================ */

/* ── Fondo: fuera las cadenas, entra el panal ── */
.grid-tex, .ambient, .chain-bg, .grid-bg, .grid-texture, .chain-deco { display: none !important; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(42% 52% at 90% 6%, color-mix(in srgb, var(--section, #E8C06A) 16%, transparent), transparent 70%),
    radial-gradient(34% 44% at 4% 96%, rgba(145,70,255,.07), transparent 70%),
    #070910;
  mix-blend-mode: normal; opacity: 1 !important; filter: none; will-change: auto;
}
body::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 820px; z-index: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='145.5'%3E%3Cpath d='M42 0 84 24.25v48.5L42 97 0 72.75v-48.5zM42 97v48.5' fill='none' stroke='%23C89B3C' stroke-opacity='.16' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 84px 145.5px;
  -webkit-mask-image: radial-gradient(48% 60% at 86% 12%, #000, transparent 72%);
  mask-image: radial-gradient(48% 60% at 86% 12%, #000, transparent 72%);
}

/* ── Contenedor ── */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pg-wrap { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 max(32px, env(safe-area-inset-right, 0px)) 0 max(32px, env(safe-area-inset-left, 0px)); }

/* ── Cabecera de página ── */
.pg-hero { position: relative; z-index: 1; padding: calc(var(--nav-h, 56px) + clamp(40px, 6vw, 84px)) 0 clamp(36px, 5vw, 64px); text-align: left; }
.pg-hero::before, .pg-hero::after {
  content: ''; position: absolute; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115.5'%3E%3Cpath d='M50 1.5 98.5 29.5v56.5L50 114 1.5 86V29.5z' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 115.5'%3E%3Cpath d='M50 1.5 98.5 29.5v56.5L50 114 1.5 86V29.5z' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pg-hero::before { right: max(4vw, 24px); top: calc(var(--nav-h, 56px) + 28px); width: clamp(120px, 14vw, 190px); aspect-ratio: 100 / 115.5; background: var(--section, #E8C06A); opacity: .55; }
.pg-hero::after { right: calc(max(4vw, 24px) - 24px); top: calc(var(--nav-h, 56px) + clamp(130px, 14vw, 186px)); width: clamp(56px, 6vw, 84px); aspect-ratio: 100 / 115.5; background: #B57BFF; opacity: .8; }
.pg-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; font-family: var(--font-body); font-size: 15px; font-weight: 600; color: #80879A; }
.pg-crumbs a { color: #9AA0A8; text-decoration: none; }
.pg-crumbs a:hover { color: var(--section); }
.pg-title {
  margin: 0; max-width: 20ch;
  font-family: var(--font-display, 'Cinzel', serif); font-weight: 900; font-size: clamp(44px, 6.6vw, 92px); line-height: .98; letter-spacing: .01em;
  color: #F4EAD6; text-transform: none;
}
.pg-title span { display: block; color: var(--section); }
.pg-lead { margin: 20px 0 0; max-width: 62ch; font-family: var(--font-body); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: #B9B2A4; }
.pg-lead strong { color: #F4EAD6; }
.pg-stats { display: flex; flex-wrap: wrap; gap: 18px 48px; margin: 36px 0 0; }
.pg-stats div { display: grid; gap: 2px; }
.pg-stats dt { order: 2; font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #9AA0A8; }
.pg-stats dd { order: 1; margin: 0; font-family: var(--font-accent); font-size: clamp(40px, 4.4vw, 60px); line-height: .9; color: var(--tone, var(--section)); }
.pg-note { display: inline-flex; gap: 10px; align-items: baseline; margin-top: 24px; font-size: 15px; color: #9AA0A8; }
.pg-note strong { color: var(--section); }

/* El pie va siempre a todo el ancho, aunque la página lo tenga dentro de su contenedor */
:not(body) > .site-footer { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* ── Piezas comunes ── */
.pg-h2 {
  display: flex; align-items: flex-start; gap: 14px; margin: 0;
  font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.1; color: #F4EAD6; text-transform: none; letter-spacing: .01em;
}
.pg-h2::before { content: ''; flex-shrink: 0; width: .42em; height: .48em; margin-top: .3em; background: var(--tone, var(--section)); clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%); }
.pg-section { position: relative; z-index: 1; padding-top: clamp(56px, 7vw, 104px); }
.pg-rows { display: grid; margin: 0; padding: 0; list-style: none; }
.pg-rows > * { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.07); }
.pg-rows > *:last-child { border-bottom: 1px solid rgba(255,255,255,.07); }
.pg-link { font-family: var(--font-body); font-weight: 700; letter-spacing: .06em; color: var(--tone, var(--section)); text-decoration: none; }
.pg-link:hover { color: #F4EAD6; }

/* ── Controles de las herramientas: buscador subrayado y filtros planos ── */
.search-input, .mu-search {
  height: 52px !important; padding: 0 12px 0 40px !important;
  font-family: var(--font-body) !important; font-size: 19px !important; font-weight: 600 !important; color: #F4EAD6 !important;
  background: transparent !important; border: 0 !important; border-bottom: 2px solid color-mix(in srgb, var(--section) 70%, transparent) !important; border-radius: 0 !important;
  clip-path: none !important; box-shadow: none !important; caret-color: var(--section);
}
.search-input:focus, .mu-search:focus { border-bottom-color: var(--gold-light) !important; outline: none; }
.search-input::placeholder, .mu-search::placeholder { color: #646B7C; }
.filter-btn, .mu-filter-btn {
  min-height: 34px; padding: 0 12px;
  font-family: var(--font-body); font-weight: 700; letter-spacing: .08em;
  background: transparent !important; border: 1px solid rgba(255,255,255,.1) !important; border-radius: 0;
  clip-path: none !important; box-shadow: none !important; filter: none !important; color: #9AA0A8;
}
.filter-btn:hover, .mu-filter-btn:hover { color: #F4EAD6; border-color: rgba(255,255,255,.28) !important; }
.filter-btn.active-gold, .filter-btn.active-cyan, .mu-filter-btn.mu-filter-active {
  color: var(--section) !important; border-color: var(--section) !important;
  background: color-mix(in srgb, var(--section) 12%, transparent) !important;
}

/* Botones y campos con el color de la sección donde las páginas no fijan otro */
:where(input[type="search"], input[type="text"]):focus-visible { outline-color: var(--section) !important; }

@media (max-width: 860px) {
  .pg-hero::before { width: 96px; top: calc(var(--nav-h, 56px) + 18px); opacity: .35; }
  .pg-hero::after { display: none; }
}
@media (max-width: 700px) {
  .pg-wrap { padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
  .pg-hero { padding-top: calc(var(--nav-h, 56px) + 32px); }
  .pg-stats { gap: 16px 32px; }
  body::after { height: 520px; }
}
