/* ============================================================
   system.css — tokens, fonts, reset, base, utilities, buttons
   ============================================================ */

/* ---------- fonts ---------- */

@font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-600-latin.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-600-italic-latin.woff2") format("woff2");
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("../fonts/source-sans-3-latin.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Sans 3";
    src: url("../fonts/source-sans-3-600-latin.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ---------- tokens ---------- */

:root {
    --c-green: #339933;
    --c-green-deep: #1e7a2e;
    --c-sun: #ffcc33;
    --c-sea: #336699;
    --c-dark: #1c3324;
    --c-ink: #22301f;
    --c-muted: #55654f;
    --c-paper: #f4f7f4;
    --c-white: #ffffff;
    --c-line: #d8e2d6;
    /* TODO: revisar el tono de --c-accent-soft antes del rediseno de otono */
    --c-accent-soft: #eef7d9;
    --f-display: "Fraunces", georgia, serif;
    --f-body: "Source Sans 3", "Segoe UI", arial, sans-serif;
    --s-1: 0.5rem;
    --s-2: 1rem;
    --s-3: 1.5rem;
    --s-4: 2rem;
    --s-6: 3rem;
    --s-8: 4rem;
    --s-12: 6rem;
    --radius: 6px;
}

/* ---------- reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- base ---------- */

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-body);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--c-ink);
    background: var(--c-paper);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--f-display);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--c-dark);
}

h1 {
    font-size: clamp(2.25rem, 6vw, 4.25rem);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

h3 {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
}

a {
    color: var(--c-sea);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--c-green-deep);
}

ul,
ol {
    padding-left: 1.25rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem var(--s-2);
    border-bottom: 1px solid var(--c-line);
    text-align: left;
}

th {
    font-weight: 600;
    color: var(--c-dark);
    background: var(--c-white);
}

/* ---------- utilities ---------- */

.wrap {
    max-width: 75rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--s-3);
    padding-right: var(--s-3);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-to-content {
    position: absolute;
    top: -120px;
    left: var(--s-2);
    z-index: 1200;
    padding: var(--s-1) var(--s-2);
    background: var(--c-dark);
    color: var(--c-white);
    border-radius: var(--radius);
    transition: top 0.2s;
}

.skip-to-content:focus {
    top: var(--s-1);
    color: var(--c-white);
}

:focus-visible {
    outline: 3px solid var(--c-sea);
    outline-offset: 2px;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-block;
    min-height: 3rem;
    padding: 0.8rem 1.75rem;
    font-family: var(--f-body);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    color: var(--c-dark);
    background: var(--c-sun);
    border: 2px solid var(--c-sun);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    color: var(--c-dark);
    background: #f5bd0e;
    border-color: #f5bd0e;
}

.btn.line {
    color: var(--c-dark);
    background: transparent;
    border-color: var(--c-dark);
}

.btn.line:hover {
    color: var(--c-white);
    background: var(--c-dark);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .btn,
    .skip-to-content {
        transition: none;
    }
}
