/* ==========================================================================
   Viveiros Magnólias Viajantes — base
   Reset moderno, tipos de letra auto-hospedados e design tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tipos de letra (ficheiros variáveis, servidos localmente)
   -------------------------------------------------------------------------- */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    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: 100 900;
    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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/lora-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: 'Lora';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/lora-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
    /* Cor — derivada do logótipo: verde-oliva, sálvia e carvão */
    --color-green-900: #232b14;
    --color-green-800: #2f3a1b;
    --color-green-700: #414f26;
    --color-green-600: #5b6a34;
    --color-green-300: #a9b688;
    --color-green-100: #d9dfc8;
    --color-green-50: #eff2e5;

    --color-cream-50: #fdfcf7;
    --color-cream-100: #f7f4ea;
    --color-cream-200: #efeadb;
    --color-cream-300: #e0d9c4;
    --color-gold-500: #a98b3e;

    --color-ink-900: #212126;
    --color-ink-700: #3c3d40;
    --color-ink-500: #61625f;
    --color-ink-300: #909189;

    --color-danger-700: #8c2f22;
    --color-danger-50: #fbeeec;

    /* Papéis semânticos */
    --surface-page: var(--color-cream-50);
    --surface-raised: #ffffff;
    --surface-muted: var(--color-cream-100);
    --surface-inverse: var(--color-green-900);

    --text-primary: var(--color-ink-900);
    --text-secondary: var(--color-ink-700);
    --text-muted: var(--color-ink-500);
    --text-on-dark: var(--color-cream-100);
    --text-on-dark-muted: #dbe0cc;

    --accent: var(--color-green-700);
    --accent-strong: var(--color-green-800);
    --accent-soft: var(--color-green-50);

    --border-subtle: var(--color-cream-300);
    --border-strong: #cdbfa4;

    /* Tipografia */
    --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --text-xs: 0.78rem;
    --text-sm: 0.875rem;
    --text-base: clamp(1rem, 0.97rem + 0.14vw, 1.075rem);
    --text-lg: clamp(1.1rem, 1.04rem + 0.3vw, 1.3rem);
    --text-xl: clamp(1.3rem, 1.2rem + 0.5vw, 1.6rem);
    --text-3xl: clamp(1.6rem, 1.42rem + 0.8vw, 2.15rem);
    --text-4xl: clamp(1.9rem, 1.6rem + 1.35vw, 2.85rem);

    --leading-tight: 1.18;
    --leading-snug: 1.35;
    --leading-normal: 1.7;

    --tracking-wide: 0.06em;
    --tracking-wider: 0.14em;

    /* Espaçamento */
    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: clamp(4rem, 3rem + 4vw, 7rem);

    /* Formas e profundidade — cantos praticamente rectos e sombras mínimas.
       A separação é feita por filetes, não por cartões flutuantes. */
    --radius-sm: 2px;
    --radius-md: 2px;
    --shadow-md: 0 1px 2px rgba(27, 31, 28, 0.08);
    --shadow-lg: 0 10px 30px rgba(27, 31, 28, 0.16);

    /* Estrutura */
    --container-max: 1180px;
    --container-pad: clamp(1.15rem, 4vw, 2.5rem);
    --header-height: 4.5rem;

    /* Movimento */
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --duration-fast: 140ms;
    --duration-base: 240ms;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--space-md));
}

/* Coluna flexível: em páginas curtas o rodapé fica no fundo da janela, sem
   uma faixa vazia por baixo. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--surface-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

main {
    flex: 1 0 auto;
}

img,
picture,
svg,
video,
iframe {
    display: block;
    max-width: 100%;
}

img,
video {
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: var(--leading-tight);
    text-wrap: balance;
    color: var(--color-green-900);
}

h1 {
    font-size: var(--text-4xl);
    letter-spacing: -0.015em;
}

h2 {
    font-size: var(--text-3xl);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--text-xl);
}

h4 {
    font-size: var(--text-lg);
}

p,
li {
    text-wrap: pretty;
}

p {
    color: var(--text-secondary);
}

ul,
ol {
    padding-inline-start: 1.25em;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--accent-strong);
}

hr {
    border: 0;
    border-top: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Acessibilidade
   -------------------------------------------------------------------------- */

:focus-visible {
    outline: 3px solid var(--color-gold-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

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

.skip-link {
    position: absolute;
    top: var(--space-2xs);
    left: var(--space-2xs);
    z-index: 200;
    padding: var(--space-2xs) var(--space-sm);
    background: var(--surface-raised);
    color: var(--accent-strong);
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transform: translateY(-160%);
    transition: transform var(--duration-base) var(--ease-out);
}

.skip-link:focus-visible {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
