/* ==========================================================================
   Diafania — sistema visual base (global)
   Tokens, tipografía, botones y accesibilidad.
   ========================================================================== */

/* Fuentes autoalojadas (RGPD: sin peticiones a Google) ---------------------- */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/fraunces-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/fraunces-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/fraunces-italic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/fraunces-italic-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/inter-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens ------------------------------------------------------------------- */
:root {
    --dia-ink: #1c1f26;          /* títulos y texto fuerte */
    --dia-text: #363b47;         /* texto corrido */
    --dia-muted: #5d6370;        /* texto secundario (≥ 5.8:1 sobre blanco) */
    --dia-paper: #faf8f4;        /* fondo cálido */
    --dia-line: #e6e1d8;         /* separadores */
    --dia-accent: #cca471;       /* dorado: solo decoración / sobre fondo oscuro */
    --dia-accent-text: #8a6a2f;  /* dorado legible sobre blanco (≈ 5:1) */
    --dia-dark: #14171e;         /* fondos oscuros */

    --dia-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --dia-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

    --dia-radius: 6px;
    --dia-header-h: 110px;
}

@media (max-width: 921px) {
    :root { --dia-header-h: 84px; }
}

/* Tipografía --------------------------------------------------------------- */
body,
button,
input,
select,
textarea,
.ast-button,
.ast-custom-button {
    font-family: var(--dia-sans);
}

body {
    font-size: 17px;
    line-height: 1.65;
    color: var(--dia-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Astra reduce el texto base a ~14.5px en móvil: lo mantenemos legible */
@media (max-width: 544px) {
    body { font-size: 16.5px; }
}

h1, h2, h3, h4, h5, h6,
.entry-content :where(h1, h2, h3, h4, h5, h6),
.site-title,
.entry-title {
    font-family: var(--dia-serif);
    font-optical-sizing: auto;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--dia-ink);
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

.site-title a {
    font-family: var(--dia-serif);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.main-header-menu .menu-link {
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.01em;
}

::selection {
    background: rgba(204, 164, 113, 0.35);
    color: var(--dia-ink);
}

/* Botones: un único sistema para todo el sitio ---------------------------
   Sustituye los colores que cada bloque de Spectra trae por su cuenta (y las
   clases de color de WordPress, que usan !important): por eso la especificidad
   alta (.wp-block-button__link duplicada) y los !important.
   - Principal: dorado de la paleta con texto tinta; hover tinta con texto blanco.
   - Sobre fondo oscuro (.dia-btn-on-dark, ver home.css): contorno blanco.     */
body .entry-content .wp-block-button .wp-block-button__link.wp-block-button__link,
body .wpcf7 .wpcf7-submit.wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px !important;
    border: 2px solid var(--dia-accent) !important;
    border-radius: var(--dia-radius) !important;
    background: var(--dia-accent) !important;
    color: var(--dia-ink) !important;
    font-family: var(--dia-sans);
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

body .entry-content .wp-block-button .wp-block-button__link.wp-block-button__link:is(:hover, :focus-visible),
body .wpcf7 .wpcf7-submit.wpcf7-submit:is(:hover, :focus-visible) {
    background: var(--dia-ink) !important;
    border-color: var(--dia-ink) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(20, 23, 30, 0.18) !important;
}

body .entry-content .wp-block-button .wp-block-button__link.wp-block-button__link:active,
body .wpcf7 .wpcf7-submit.wpcf7-submit:active {
    transform: translateY(0);
    box-shadow: none !important;
}

/* Los iconos (flecha, logo de ABC) siguen el color del texto */
body .entry-content .wp-block-button__link svg {
    fill: currentColor !important;
    color: inherit !important;
    flex-shrink: 0;
}

/* Accesibilidad ------------------------------------------------------------ */
/* Foco de teclado visible. currentColor = blanco sobre fondos oscuros, tinta
   sobre claros. Sustituye el punteado de 1px de Astra, casi invisible. */
body :is(a, button, summary, [tabindex], input[type="submit"], input[type="button"]):focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 3px !important;
}

body :is(input, select, textarea):not([type="submit"]):not([type="button"]):focus {
    outline: 2px solid var(--dia-accent-text) !important;
    outline-offset: 1px !important;
    border-style: solid !important;
    border-color: var(--dia-accent-text) !important;
}

/* Al tocar (ratón/táctil) no dejar el recuadro de foco de Astra pegado.
   Astra lo pinta como outline en enlaces y como borde punteado en el botón
   del menú móvil. */
body :is(a, button, .menu-toggle):focus:not(:focus-visible) {
    outline: none !important;
}

body .ast-button-wrap .menu-toggle:focus {
    border-color: transparent !important;
}

/* Botón "volver arriba": dorado oscuro para contraste con la flecha blanca */
#ast-scroll-top {
    background-color: var(--dia-accent-text) !important;
    border-radius: var(--dia-radius);
}

#ast-scroll-top:hover {
    background-color: var(--dia-ink) !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}
