/* ==========================================================================
   Associação D'Azenha — site público

   Estrutura de sítio de eventos: faixas de largura total que alternam entre
   claro e escuro, sem cantos redondos nem sombras. A separação faz-se por
   contraste de fundo e por filetes de um pixel. Títulos em serifa de display,
   etiquetas em maiúsculas espaçadas.
   ========================================================================== */

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
    /* Tinta e pedra */
    --ink: #16170f;
    --ink-2: #24261b;
    --forest: #1f2a17;
    --forest-2: #2c3a20;
    --bone: #f2efe6;
    --bone-2: #e8e3d6;
    --stone: #6d6e5f;
    --dim: #8d8e80;
    --rule: #d9d4c4;
    --rule-dark: rgba(242, 239, 230, 0.16);

    /* Único acento: o âmbar do azeite acabado de sair da prensa */
    --amber: #6b7a2a;
    --amber-light: #a3b04e;

    /* Compatibilidade com regras antigas */
    --accent: #6b7a2a;
    --accent-2: #4f5a1c;
    --paper: #ffffff;
    --paper-2: #e8e3d6;

    --display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;

    --wrap: 1440px;
    --wrap-narrow: 760px;
    --gutter: clamp(1.25rem, 4vw, 4rem);

    /* Nomes antigos, ainda usados pela área de sócios (que mantém o seu tema) */
    --primary: #6b7a2a;
    --primary-dark: #4f5a1c;
    --bg-soft: #f2efe6;
    --border-color: #d9d4c4;
    --card-shadow: none;
    --olive-soft: #e8e3d6;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
body {
    background: var(--bone);
    color: var(--stone);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* A área de sócios mantém o fundo claro que já tinha */
body.area-socio { background: #f8fafc; }

h1, h2, h3, h4 {
    font-family: var(--display);
    font-optical-sizing: auto;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.015em;
    line-height: 1.14;
    margin: 0;
}

p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }

/* Os títulos não têm margem própria; o ar fica do lado do parágrafo que os segue */
h2 + p, h3 + p, h4 + p { margin-top: 0.85rem; }

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--accent-2); }

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

strong { color: var(--ink); font-weight: 600; }

img { max-width: 100%; }

::selection { background: rgba(107, 122, 42, 0.22); }

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Coluna de leitura estreita, mas alinhada à esquerda como o resto da página */
.wrap-narrow > * { max-width: var(--wrap-narrow); }

/* ==========================================================================
   3. Tipografia
   ========================================================================== */
.title-xl {
    font-size: clamp(2.75rem, 7vw, 6rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.title-l {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.06;
    letter-spacing: -0.025em;
}

.title-m {
    font-size: 1.375rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* Palavra em destaque dentro de um título */
.em-gold { color: var(--amber); font-style: italic; }

/* Etiqueta em maiúsculas, precedida de um filete */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--amber);
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.eyebrow::before {
    content: "";
    width: 2.5rem;
    height: 1px;
    flex: none;
    background: currentColor;
}

.lede {
    font-size: 1.1875rem;
    line-height: 1.7;
    color: var(--stone);
    max-width: 48ch;
}

.quote {
    font-family: var(--display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    line-height: 1.28;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.note { font-size: 0.9375rem; color: var(--dim); }

.prose { max-width: 66ch; }

/* ==========================================================================
   4. Ritmo vertical e faixas
   ========================================================================== */
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.section-tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }

/* Filete entre duas faixas do mesmo tom */
.divider { border-top: 1px solid var(--rule); }

/* Faixa escura de largura total: é ela que dá o ritmo à página */
.section-dark {
    background: var(--forest);
    color: rgba(242, 239, 230, 0.72);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark .quote,
.section-dark strong { color: var(--bone); }

.section-dark .lede { color: rgba(242, 239, 230, 0.72); }
.section-dark .note { color: rgba(242, 239, 230, 0.50); }
.section-dark .eyebrow { color: var(--amber-light); }
.section-dark.divider { border-top-color: var(--rule-dark); }

/* Faixa em pedra clara, para variar sem sair do claro */
.section-stone { background: var(--bone-2); }
.section-paper { background: var(--paper); }

.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .title-l { max-width: 18ch; }
.section-head .lede { margin-top: 1.5rem; }

/* Cabeçalho de secção com o título à esquerda e o texto à direita */
.section-head-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: end;
}

.section-head-split .lede { margin-top: 0; }

@media (max-width: 899.98px) {
    .section-head-split { grid-template-columns: 1fr; align-items: start; }
}

.stack > * + * { margin-top: 1.5rem; }

/* ==========================================================================
   5. Cabeçalho de página
   Faixa escura de largura total, igual em todas as páginas interiores.
   ========================================================================== */
.page-head {
    position: relative;
    background-color: var(--forest);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: rgba(242, 239, 230, 0.72);
    padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(3rem, 6vw, 5rem);
    overflow: hidden;
}

/* Só há véu quando a página traz fotografia por trás */
.page-head[style*="background-image"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(31, 42, 23, 0.94) 0%, rgba(31, 42, 23, 0.78) 50%, rgba(31, 42, 23, 0.42) 100%),
        linear-gradient(to bottom, rgba(31, 42, 23, 0.45), rgba(31, 42, 23, 0.75));
}

.page-head > .wrap { position: relative; z-index: 1; }

.page-head h1 { color: var(--bone); }
.page-head .eyebrow { color: var(--amber-light); }
.page-head .lede { color: rgba(242, 239, 230, 0.72); margin-top: 2rem; }

/* ==========================================================================
   6. Colunas
   ========================================================================== */
.cols {
    display: grid;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-aside { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.cols-center { align-items: center; }

@media (max-width: 899.98px) {
    .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cols-2, .cols-aside { grid-template-columns: 1fr; }
}

@media (max-width: 599.98px) {
    .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   7. Herói
   Faixa escura à altura do ecrã, título enorme e uma tira de factos em baixo.
   ========================================================================== */
.hero {
    position: relative;
    background: var(--forest) url('../img/fotos-web/azenha-galga.jpg') center / cover no-repeat;
    color: rgba(242, 239, 230, 0.72);
    overflow: hidden;
}

/* Véu escuro sobre a fotografia: sem ele o título não se lê. Mais fechado à
   esquerda, onde assenta o texto, e no fundo, onde entra a tira de factos. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(31, 42, 23, 0.95) 0%, rgba(31, 42, 23, 0.82) 42%, rgba(31, 42, 23, 0.38) 100%),
        linear-gradient(to bottom, rgba(31, 42, 23, 0.55) 0%, rgba(31, 42, 23, 0.20) 35%, rgba(31, 42, 23, 0.90) 100%);
}

.hero > .wrap { position: relative; z-index: 1; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 62ch;
    padding: clamp(4rem, 10vw, 9rem) 0 clamp(4rem, 8vw, 7rem);
}

.hero h1 { color: var(--bone); }
.hero .eyebrow { color: var(--amber-light); }
.hero .lede { color: rgba(242, 239, 230, 0.82); margin-top: 2rem; }
.hero .actions { margin-top: 2.75rem; }

/* O desenho a traço é preto sobre transparente; nas faixas escuras inverte-se
   para ficar a traço claro. */
.section-dark .drawing img,
.page-head .drawing img { filter: invert(1); }

/* Tira de factos ao fundo do herói, dividida por filetes */
.hero-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--rule-dark);
}

.hero-meta > * {
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1rem, 2vw, 2rem);
    border-left: 1px solid var(--rule-dark);
}

.hero-meta > *:first-child { border-left: 0; padding-left: 0; }

.hero-meta dt {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--amber-light);
    margin-bottom: 0.5rem;
}

.hero-meta dd {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    line-height: 1.25;
    color: var(--bone);
}

@media (max-width: 899.98px) {
    .hero-meta { grid-template-columns: 1fr; }
    .hero-meta > * { border-left: 0; border-top: 1px solid var(--rule-dark); padding-left: 0; }
    .hero-meta > *:first-child { border-top: 0; }
}

/* ==========================================================================
   8. Passos numerados
   O equivalente ao programa de um evento: uma linha por etapa.
   ========================================================================== */
.steps { border-top: 1px solid var(--rule); }
.section-dark .steps { border-top-color: var(--rule-dark); }

.step {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr) minmax(0, 1.4fr);
    gap: clamp(1rem, 3vw, 3rem);
    align-items: start;
    padding: clamp(1.75rem, 4vw, 2.75rem) 0;
    border-bottom: 1px solid var(--rule);
}

.section-dark .step { border-bottom-color: var(--rule-dark); }

.step-num {
    font-family: var(--display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1;
    color: var(--amber);
}

.section-dark .step-num { color: var(--amber-light); }

.step p { margin: 0; }

@media (max-width: 767.98px) {
    .step { grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem 1.25rem; }
    .step p { grid-column: 2; }
}

/* ==========================================================================
   9. Ilustração
   ========================================================================== */
.drawing { position: relative; margin: 0; }

.drawing img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 32rem;
    object-fit: contain;
}

.caption {
    display: block;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    font-size: 0.875rem;
    color: var(--dim);
}

.section-dark .caption { border-top-color: var(--rule-dark); color: rgba(242, 239, 230, 0.50); }

/* Um número sobre a ilustração, sem caixa: só tipografia */
.stat-badge {
    display: block;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}

.stat-badge strong {
    display: block;
    font-family: var(--display);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    color: var(--amber);
}

.stat-badge span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dim);
}

.section-dark .stat-badge { border-top-color: var(--rule-dark); }
.section-dark .stat-badge span { color: rgba(242, 239, 230, 0.55); }

/* ==========================================================================
   9b. Fotografia
   As fotos entram sempre cortadas a toda a largura da sua coluna, sem moldura.
   ========================================================================== */
.photo { position: relative; margin: 0; }

.photo img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.photo-4x3 img { aspect-ratio: 4 / 3; }
.photo-3x4 img { aspect-ratio: 3 / 4; }
.photo-16x9 img { aspect-ratio: 16 / 9; }
.photo-1x1 img { aspect-ratio: 1 / 1; }

/* Faixa fotográfica de largura total, entre duas secções */
.photo-band { position: relative; display: block; }

.photo-band img {
    display: block;
    width: 100%;
    height: clamp(18rem, 42vw, 32rem);
    object-fit: cover;
}

/* Legenda sobreposta ao canto da faixa */
.photo-band figcaption {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 46ch;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem);
    background: linear-gradient(to top, rgba(31, 42, 23, 0.88), rgba(31, 42, 23, 0));
    color: rgba(242, 239, 230, 0.82);
    font-size: 0.9375rem;
}

/* Mosaico dividido por filetes. O traço é o contorno de cada fotografia, e não
   o fundo da grelha: assim uma última fila incompleta não deixa células vazias
   pintadas. */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
}

.gallery .photo img { aspect-ratio: 1 / 1; }

.gallery .photo {
    overflow: hidden;
    background: var(--bone-2);
    outline: 1px solid var(--rule);
}

.section-dark .gallery .photo {
    background: rgba(242, 239, 230, 0.08);
    outline-color: var(--rule-dark);
}

.gallery .photo img { transition: transform 0.5s ease, opacity 0.3s ease; }
.gallery a.photo:hover img { transform: scale(1.04); opacity: 0.85; }

.gallery-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 767.98px) {
    .gallery, .gallery-3, .gallery-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   9c. Cronologia
   Uma fase por linha: a data fica agarrada à esquerda enquanto as fotografias
   dessa fase passam ao lado.
   ========================================================================== */
.timeline { border-top: 1px solid var(--rule); }
.section-dark .timeline { border-top-color: var(--rule-dark); }

.phase {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: clamp(2.5rem, 6vw, 5rem) 0;
    border-bottom: 1px solid var(--rule);
}

.section-dark .phase { border-bottom-color: var(--rule-dark); }

.phase-mark {
    position: sticky;
    top: 9rem;
    align-self: start;
    font-family: var(--display);
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    line-height: 1;
    color: var(--amber);
}

.phase-body .title-l { max-width: 20ch; }
.phase-body > p { max-width: 62ch; margin-top: 1rem; }
.phase-body .gallery { margin-top: clamp(1.75rem, 4vw, 2.5rem); }

@media (max-width: 767.98px) {
    .phase { grid-template-columns: 1fr; gap: 1rem; }
    .phase-mark { position: static; }
}

/* ==========================================================================
   10. Lista-índice
   Linhas largas com número, título e seta — sem caixas nem sombras.
   ========================================================================== */
.list { border-top: 1px solid var(--rule); }
.section-dark .list { border-top-color: var(--rule-dark); }

.list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
    align-items: center;
    gap: clamp(1rem, 3vw, 3rem);
    padding: clamp(1.5rem, 3.5vw, 2.5rem) 0;
    border-bottom: 1px solid var(--rule);
    color: var(--stone);
    transition: color 0.25s ease;
}

.section-dark .list-item { border-bottom-color: var(--rule-dark); }

.list-item .title-m { transition: color 0.25s ease; }
.list-item p { margin: 0; font-size: 0.9375rem; }

a.list-item:hover { color: var(--stone); }
a.list-item:hover .title-m { color: var(--amber); }
.section-dark a.list-item:hover .title-m { color: var(--amber-light); }

.list-item .go {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 50%;
    color: var(--ink);
    font-size: 0.9375rem;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.section-dark .list-item .go { border-color: var(--rule-dark); color: var(--bone); }

a.list-item:hover .go { background: var(--amber); border-color: var(--amber); color: var(--bone); }

@media (max-width: 767.98px) {
    .list-item { grid-template-columns: 1fr; gap: 0.5rem; }
    /* A linha inteira já é a ligação; a seta só acrescentaria ruído */
    .list-item .go { display: none; }
}

/* Lista de compromissos, numerada em contador */
.checklist { counter-reset: compromisso; border-top: 1px solid var(--rule); }
.section-dark .checklist { border-top-color: var(--rule-dark); }

.check-item {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: clamp(1.25rem, 3vw, 1.75rem) 0;
    border-bottom: 1px solid var(--rule);
}

.section-dark .check-item { border-bottom-color: var(--rule-dark); }

.check-item::before {
    counter-increment: compromisso;
    content: counter(compromisso, decimal-leading-zero);
    font-family: var(--display);
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--amber);
}

.section-dark .check-item::before { color: var(--amber-light); }

.check-item .title-m { font-size: 1.1875rem; margin-bottom: 0.35rem; }
.check-item p { margin: 0; font-size: 0.9375rem; }

/* ==========================================================================
   11. Ligações e botões
   Retângulos de canto vivo, texto em maiúsculas espaçadas.
   ========================================================================== */
.link-more {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amber);
    padding-bottom: 0.35rem;
    border-bottom: 1px solid currentColor;
}

.link-more::after { content: "→"; transition: transform 0.25s ease; }
.link-more:hover::after { transform: translateX(4px); }
.section-dark .link-more { color: var(--amber-light); }

.action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1.05rem 2.25rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.action:hover { background: var(--forest); border-color: var(--forest); color: var(--bone); }

.action-solid {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--bone);
}

.action-solid:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--bone); }

/* Mantido por compatibilidade: hoje é o botão escuro cheio */
.action-green {
    background: var(--forest);
    border-color: var(--forest);
    color: var(--bone);
}

.action-green:hover { background: var(--amber); border-color: var(--amber); color: var(--bone); }

/* Sobre fundo escuro */
.section-dark .action, .hero .action, .page-head .action {
    border-color: rgba(242, 239, 230, 0.35);
    color: var(--bone);
}

.section-dark .action:hover, .hero .action:hover, .page-head .action:hover {
    background: var(--bone);
    border-color: var(--bone);
    color: var(--ink);
}

.section-dark .action-solid, .hero .action-solid, .page-head .action-solid {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--bone);
}

.section-dark .action-solid:hover, .hero .action-solid:hover, .page-head .action-solid:hover {
    background: var(--amber-light);
    border-color: var(--amber-light);
    color: var(--ink);
}

.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* ==========================================================================
   12. Dados em pares
   ========================================================================== */
.facts {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--rule);
}

.section-dark .facts { border-top-color: var(--rule-dark); }

.facts > div {
    padding: 1.75rem clamp(1rem, 2vw, 2rem) 1.75rem 0;
    border-left: 1px solid var(--rule);
    padding-left: clamp(1rem, 2vw, 2rem);
}

.facts > div:first-child { border-left: 0; padding-left: 0; }
.section-dark .facts > div { border-left-color: var(--rule-dark); }

.facts dt {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 0.6rem;
}

.section-dark .facts dt { color: var(--amber-light); }

.facts dd {
    margin: 0;
    font-family: var(--display);
    font-size: 1.125rem;
    line-height: 1.4;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.section-dark .facts dd { color: var(--bone); }

/* Uma coluna só: os pares separam-se por filetes horizontais */
.facts-stack { grid-template-columns: 1fr; }
.facts-stack > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
.facts-stack > div:first-child { border-top: 0; }
.section-dark .facts-stack > div { border-top-color: var(--rule-dark); }

@media (max-width: 767.98px) {
    .facts { grid-template-columns: 1fr; }
    .facts > div { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
    .facts > div:first-child { border-top: 0; }
    .section-dark .facts > div { border-top-color: var(--rule-dark); }
}

/* Grelha genérica dividida por filetes, para blocos curtos lado a lado */
.grid-rules {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--rule);
}

.grid-rules-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-dark .grid-rules { border-top-color: var(--rule-dark); }

.grid-rules > * {
    padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1rem, 2vw, 2rem) clamp(1.75rem, 3vw, 2.5rem) clamp(1rem, 2vw, 2rem);
    border-left: 1px solid var(--rule);
}

.grid-rules > *:first-child { border-left: 0; padding-left: 0; }
.section-dark .grid-rules > * { border-left-color: var(--rule-dark); }
.grid-rules p { margin: 0; font-size: 0.9375rem; }
.grid-rules .title-m { margin-bottom: 0.5rem; }

@media (max-width: 899.98px) {
    .grid-rules, .grid-rules-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-rules > *:nth-child(odd) { border-left: 0; padding-left: 0; }
    .grid-rules > *:nth-child(n + 3) { border-top: 1px solid var(--rule); }
    .section-dark .grid-rules > *:nth-child(n + 3) { border-top-color: var(--rule-dark); }
}

@media (max-width: 599.98px) {
    .grid-rules, .grid-rules-3 { grid-template-columns: 1fr; }
    .grid-rules > * { border-left: 0; padding-left: 0; }
    .grid-rules > *:nth-child(n + 2) { border-top: 1px solid var(--rule); }
    .section-dark .grid-rules > *:nth-child(n + 2) { border-top-color: var(--rule-dark); }
}

/* ==========================================================================
   13. Blocos
   ========================================================================== */
.panel {
    background: var(--bone-2);
    padding: clamp(2rem, 5vw, 4rem);
}

.section-dark .panel { background: rgba(242, 239, 230, 0.06); }

/* Faixa de chamada à ação: usa-se com .section-dark na própria secção */
.band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

@media (max-width: 899.98px) {
    .band { grid-template-columns: 1fr; }
}

.sheet {
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: clamp(1.75rem, 5vw, 4rem);
    color: var(--stone);
}

.sheet h2 { font-size: 1.625rem; margin: 2.5rem 0 0.85rem; }
.sheet h2 + p, .sheet h3 + p { margin-top: 0; }
.sheet h2:first-child { margin-top: 0; }
.sheet h3 { font-size: 1.25rem; margin: 1.75rem 0 0.5rem; }
.sheet table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.sheet th, .sheet td { border-bottom: 1px solid var(--rule); padding: 0.75rem 0.5rem; text-align: left; }
.sheet th { color: var(--ink); font-weight: 600; }
.sheet img { max-width: 100%; height: auto; }
.sheet > :last-child { margin-bottom: 0; }

/* ==========================================================================
   14. Barra de topo
   Barra clara (creme) de largura total, colada ao topo.
   ========================================================================== */
.masthead {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bone);
    border-bottom: 1px solid var(--rule);
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    height: 7rem;
}

.brand { display: inline-flex; align-items: center; }
/* A barra é clara (creme), por isso o logótipo aparece nas cores originais. */
.brand img { height: 4.6rem; width: auto; }

.nav-list {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list a {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stone);
    transition: color 0.25s ease;
}

.nav-list a:hover { color: var(--ink); }
.nav-list a[aria-current] { color: var(--amber); }

/* O botão de destaque da barra: a barra é clara, logo o contorno é escuro */
.masthead .action {
    padding: 0.8rem 1.5rem;
    border-color: var(--forest);
    color: var(--forest);
}

.masthead .action:hover { background: var(--forest); border-color: var(--forest); color: var(--bone); }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 0;
    color: var(--ink);
    padding: 0.7rem 1.1rem;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.account { position: relative; }

.account > [data-account-toggle] {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink);
}

.account-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 1.4rem);
    min-width: 14rem;
    background: var(--bone);
    border: 1px solid var(--rule);
    padding: 0.5rem;
    display: none;
}

.account.open .account-menu { display: block; }

.account-menu a,
.account-menu button {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 0;
    border-radius: 0;
    background: none;
    text-align: left;
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--stone);
}

.account-menu a:hover,
.account-menu button:hover { background: var(--bone-2); color: var(--ink); }

@media (max-width: 1199.98px) {
    .nav-toggle { display: inline-block; }

    .masthead-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--bone);
        border-bottom: 1px solid var(--rule);
        padding: 1.5rem var(--gutter) 2.5rem;
    }

    .masthead.open .masthead-nav { display: block; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 1.25rem; }
    .masthead .action { width: 100%; }
}

@media (max-width: 599.98px) {
    .masthead-inner { height: 4.25rem; }
    .brand img { height: 2.1rem; }
    .actions { flex-direction: column; align-items: stretch; }
    .actions .action { width: 100%; }
}

/* ==========================================================================
   15. Rodapé
   ========================================================================== */
.colophon {
    background: var(--bone);
    color: var(--stone);
    padding: clamp(3.5rem, 7vw, 6rem) 0 2.5rem;
    border-top: 1px solid var(--rule);
}

.colophon-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: clamp(2rem, 5vw, 4.5rem);
}

.colophon h2 {
    font-family: var(--sans);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 1.5rem;
}

.colophon .note { color: var(--stone); }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin-bottom: 0.7rem; font-size: 0.9375rem; }
.colophon li a { color: var(--ink-2); }
.colophon li a:hover { color: var(--amber); }
.colophon img { height: 5rem; width: auto; margin-bottom: 1.5rem; }

.colophon-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    margin-top: clamp(3rem, 6vw, 4.5rem);
    padding-top: 1.75rem;
    border-top: 1px solid var(--rule);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--dim);
}

.colophon-foot a { color: var(--stone); }
.colophon-foot a:hover { color: var(--amber); }

@media (max-width: 767.98px) {
    .colophon-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   16. Painel do sócio
   Área clara com identidade própria; mantida como estava.
   ========================================================================== */
.dashboard-container {
    padding: 2rem 1rem;
    max-width: 1100px; /* Aumentado para desktop */
    margin: 0 auto;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Grid Principal: 1 coluna mobile, 2 colunas desktop */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* O antigo .profile-card foi substituido pelo cartao de socio (.cartao-socio),
   definido em Pages/Socios/Index.cshtml. */

/* Menu Grid: Sempre 2 colunas */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.menu-item {
    background: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    text-decoration: none !important;
    color: #1e293b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--card-shadow);
}

    .menu-item:hover {
        transform: translateY(-5px);
        border-color: var(--primary);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }

.menu-icon {
    width: 56px;
    height: 56px;
    background: var(--olive-soft);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.menu-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.menu-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

/* Info List */
.info-list {
    background: white;
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: var(--card-shadow);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

    .info-row:last-child {
        border-bottom: none;
    }

.info-label {
    color: #64748b;
    font-size: 0.9rem;
}

.info-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Media Query para Desktop */
@media (min-width: 992px) {
    .main-grid {
        grid-template-columns: 380px 1fr; /* Coluna lateral fixa e resto fluido */
        align-items: start;
    }

    .sidebar-content {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        position: sticky;
        top: 2rem;
    }
}

@media (max-width: 576px) {
    .menu-grid {
        gap: 0.75rem;
    }

    .menu-item {
        padding: 1rem;
    }
}

/* ==========================================================================
   Autenticação e formulários de sócio
   Ecrã dividido: painel de imagem à esquerda, formulário à direita.
   ========================================================================== */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: calc(100vh - 72px);
    background: var(--paper);
}

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(2rem, 5vw, 4.5rem);
    color: var(--bone);
    background: var(--forest) center / cover no-repeat;
    isolation: isolate;
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(31, 42, 23, 0.92), rgba(31, 42, 23, 0.35));
}

.auth-aside h2 {
    color: var(--bone);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 0.75rem;
}

.auth-aside p { color: rgba(242, 239, 230, 0.8); max-width: 40ch; margin: 0; }

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 4rem) 1.25rem;
}

.auth-panel { width: 100%; max-width: 400px; }

.auth-panel .eyebrow-mini {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amber);
}

.auth-panel h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.auth-panel .auth-sub { color: var(--stone); font-size: 0.95rem; margin-bottom: 1.75rem; }

.auth-alert {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.45;
}
.auth-alert.error { background: #fbebe6; color: #8a2b14; }
.auth-alert.info { background: var(--bone); color: var(--ink-2); }

/* Campo com etiqueta flutuante */
.field { position: relative; margin-bottom: 1rem; }

.field input {
    width: 100%;
    height: 3.5rem;
    padding: 1.35rem 2.75rem 0.4rem 1rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--paper);
    border: 1.5px solid var(--rule);
    border-radius: 0.65rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:hover { border-color: var(--dim); }

.field input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(107, 122, 42, 0.15);
}

.field label {
    position: absolute;
    left: 1rem;
    top: 1.05rem;
    margin: 0;
    font-size: 1rem;
    color: var(--dim);
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.15s, color 0.15s;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
    transform: translateY(-0.7rem) scale(0.78);
}
.field input:focus + label { color: var(--amber); }

.field input.input-validation-error { border-color: #b3321a; }
.field .field-error { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: #b3321a; }
.field .field-error:empty { display: none; }

.field-toggle {
    position: absolute;
    right: 0.35rem;
    top: 0.45rem;
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--stone);
    cursor: pointer;
}
.field-toggle:hover { background: var(--bone); }
.field-toggle:focus-visible { outline: 2px solid var(--amber); }

.auth-check { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0 1.25rem; font-size: 0.9rem; color: var(--stone); }
.auth-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--amber); }

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    height: 3.25rem;
    border: 0;
    border-radius: 0.65rem;
    background: var(--forest);
    color: var(--bone);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn-auth:hover { background: var(--amber); }
.btn-auth:active { transform: translateY(1px); }
.btn-auth:focus-visible { outline: 3px solid rgba(107, 122, 42, 0.4); outline-offset: 2px; }

.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; font-size: 0.9rem; }
.auth-links a { color: var(--stone); text-decoration: none; }
.auth-links a:hover { color: var(--amber); text-decoration: underline; }
.auth-links .strong { color: var(--amber); font-weight: 600; }

/* Indicador de passos */
.steps { display: flex; gap: 0.4rem; margin-bottom: 1.5rem; list-style: none; padding: 0; }
.steps li { flex: 1; }
.steps li span { display: block; height: 4px; border-radius: 2px; background: var(--rule); margin-bottom: 0.4rem; }
.steps li small { font-size: 0.75rem; color: var(--dim); }
.steps li.done span, .steps li.current span { background: var(--amber); }
.steps li.current small { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { min-height: 180px; padding: 1.5rem; }
    .auth-aside p { display: none; }
    .auth-aside h2 { margin: 0; font-size: 1.4rem; }
}
