/* ============================================================
   SurLibrary — Base: reset, tipografía, layout, botones, cabecera, pie
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
    margin: 0;
    font-family: var(--f-sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--arena);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--pino); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--bosque); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--senal); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; color: var(--bosque); }
h1 { font-family: var(--f-serif); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.12rem; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
code { font-family: var(--f-mono); font-size: .88em; background: var(--arena-2); padding: .1em .4em; border-radius: 6px; }
small { font-size: .82em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--bosque); color: var(--arena); padding: 10px 16px; border-radius: var(--r-sm); }
.skip:focus { top: 16px; color: var(--arena); }
#contenido:focus { outline: none; }
[hidden] { display: none !important; }

.ico { width: 1.1em; height: 1.1em; flex: none; stroke-width: 1.9; }
i.ico { display: inline-block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(48px, 7vw, 88px) 0; position: relative; }
.section--tight { padding: clamp(28px, 4vw, 48px) 0; }
.spacer { height: 32px; }

.eyebrow {
    font-family: var(--f-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--musgo); margin: 0 0 .7em; display: flex; align-items: center; gap: .5em;
}
.eyebrow--light { color: rgba(247, 244, 233, .82); }
.sec-head { max-width: 720px; margin-bottom: 28px; }
.sec-head h2 { margin-bottom: .3em; }
.sec-head__intro { color: var(--text-2); margin: 0; }

/* ---------- Botones ---------- */
.btn {
    --bg: var(--pino); --fg: var(--arena);
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    min-height: 48px; padding: 0 22px; border-radius: var(--r-pill);
    background: var(--bg); color: var(--fg); border: 1px solid transparent;
    font: 600 .98rem/1 var(--f-sans); text-decoration: none; cursor: pointer;
    transition: transform .2s var(--ease), background-color .2s, box-shadow .2s;
}
.btn:hover { color: var(--fg); transform: translateY(-1px); text-decoration: none; }
.btn .ico { transition: transform .2s var(--ease); }
.btn:hover .ico:last-child { transform: translateX(3px); }
.btn--primary:hover { --bg: var(--bosque); }
.btn--amber { --bg: var(--senal); --fg: #2B1C04; }
.btn--amber:hover { --bg: #E4A84A; }
.btn--light { --bg: var(--arena); --fg: var(--bosque); }
.btn--light:hover { --bg: #fff; }
.btn--ghost { --bg: transparent; --fg: var(--bosque); border-color: var(--line-2); }
.btn--ghost:hover { --bg: var(--arena-2); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn.is-static { cursor: default; transform: none; }
.icon-btn {
    width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--r-pill);
    color: inherit; text-decoration: none; cursor: pointer; transition: background-color .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .22); color: inherit; }
.icon-btn .ico { width: 20px; height: 20px; }

/* ---------- Cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 14px var(--gutter) 0; margin-bottom: -76px; pointer-events: none; }
.nav-pill {
    pointer-events: auto; max-width: var(--wrap); margin: 0 auto; min-height: 62px;
    display: flex; align-items: center; gap: 18px; padding: 8px 8px 8px 12px; border-radius: var(--r-pill);
    color: var(--bosque);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; }
.brand:hover { color: inherit; }
.brand__mark { width: 40px; height: 40px; border-radius: 11px; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-weight: 800; font-size: 1.2rem; letter-spacing: -.04em; }
.brand__name span { color: var(--pino); }
.brand__desc { font-size: .58rem; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--musgo); margin-top: 4px; }
.nav-main { margin-left: auto; }
.nav-main ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-main a {
    display: block; padding: 9px 14px; border-radius: var(--r-pill); color: inherit; text-decoration: none;
    font-weight: 550; font-size: .95rem; transition: background-color .2s;
}
.nav-main a:hover { background: rgba(255, 255, 255, .35); }
.nav-main a[aria-current="page"] { background: rgba(33, 59, 45, .1); box-shadow: inset 0 0 0 1px rgba(33, 59, 45, .12); }
.nav-actions { display: flex; align-items: center; gap: 4px; }
.nav-mobile { display: none; position: static; }
.nav-mobile > summary { list-style: none; }
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile .when-open { display: none; }
.nav-mobile[open] .when-open { display: block; }
.nav-mobile[open] .when-closed { display: none; }
.nav-mobile .nav-mobile__panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 10px); padding: 14px; border-radius: var(--r-lg);
    color: var(--arena); animation: drop .25s var(--ease);
}
.nav-mobile__panel ul { list-style: none; margin: 0 0 12px; padding: 0; }
.nav-mobile__panel li + li { border-top: 1px dashed rgba(247, 244, 233, .22); }
.nav-mobile__panel a:not(.btn) { display: flex; justify-content: space-between; align-items: center; padding: 14px 8px; color: var(--arena); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.nav-mobile__panel a[aria-current="page"] { color: var(--senal); }
.nav-mobile__panel .btn { width: 100%; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* Páginas sin foto bajo la cabecera: hueco para la píldora flotante. */
body:not(.has-hero) main { padding-top: 76px; }
/* Sobre foto oscura la cabecera empieza clara. */
.has-hero .nav-pill:not(.is-scrolled) { color: var(--arena); }
.has-hero .nav-pill:not(.is-scrolled) .brand__name span { color: #CFE0C2; }
.has-hero .nav-pill:not(.is-scrolled) .brand__desc { color: rgba(247, 244, 233, .75); }
.has-hero .nav-pill:not(.is-scrolled) .nav-main a[aria-current="page"] { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }

@media (max-width: 1080px) {
    .nav-main { display: none; }
    .nav-mobile { display: block; }
    .nav-actions { margin-left: auto; }
}
@media (max-width: 560px) {
    .nav-now span { display: none; }
    .nav-now { width: 44px; padding: 0; }
    .brand__desc { display: none; }
    .brand__mark { width: 36px; height: 36px; }
}

/* ---------- Pie ---------- */
.site-footer { position: relative; overflow: hidden; background: var(--bosque); color: rgba(247, 244, 233, .82); padding: 64px 0 28px; margin-top: 40px; }
.site-footer a { color: var(--arena); }
.footer-grid { position: relative; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.brand--light { color: var(--arena); }
.brand--light .brand__name span { color: #CFE0C2; }
.brand--light .brand__desc { color: rgba(247, 244, 233, .7); }
.footer-motto { font-family: var(--f-serif); font-size: 1.25rem; color: var(--arena); margin: 18px 0 10px; }
.footer-note { display: flex; gap: 10px; font-size: .88rem; max-width: 420px; }
.footer-note .ico { margin-top: 3px; color: var(--senal); }
.footer-title { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--senal); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-legal { position: relative; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 44px; padding-top: 20px; border-top: 1px dashed rgba(247, 244, 233, .25); font-size: .85rem; }
.footer-legal a { color: rgba(247, 244, 233, .8); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

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