/*
Theme Name: Associação Figueiredo de Rey Theme
Theme URI: https://figueiredoderey.pt
Author: Antigravity
Author URI: https://figueiredoderey.pt
Description: Tema Mobile-First 100% responsivo para a Associação Figueiredo de Rey.
Version: 3.0.0
Text Domain: figueiredo-de-rey-theme
*/

/* ==============================================================
   1. VARIÁVEIS & RESET GLOBAL
   ============================================================== */
:root {
    --gold:        #C49258;
    --gold-dark:   #9B6E38;
    --gold-light:  #F4E8D8;
    --dark:        #1E1E1E;
    --carbon:      #2B2B2B;
    --muted:       #5A5A5A;
    --surface:     #F9F9F8;
    --white:       #FFFFFF;
    --border:      #E6E6E3;
    --r-sm:        6px;
    --r-md:        10px;
    --r-lg:        16px;
    --shadow-sm:   0 2px 8px rgba(0,0,0,.06);
    --shadow-md:   0 6px 20px rgba(0,0,0,.10);
    --pad:         20px;   /* margem lateral mínima em mobile */
}

html {
    box-sizing: border-box;
    overflow-x: hidden;
}
*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--carbon);
    background: var(--white);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dark);
    word-break: break-word;
    overflow-wrap: break-word;
    margin: 0 0 .75em;
}

a {
    color: var(--gold);
    text-decoration: none;
}
a:hover { color: var(--gold-dark); text-decoration: underline; }

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

/* ==============================================================
   2. UTILITÁRIOS
   ============================================================== */
.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 var(--pad);
}

.section-padding { padding: clamp(32px,6vw,64px) 0; }
.bg-white   { background: var(--white); }
.bg-surface { background: var(--surface); }

/* ==============================================================
   3. BOTÕES
   ============================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    font-size: .95rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}
.btn-primary  { background: var(--gold);      color: #fff !important; }
.btn-primary:hover { background: var(--gold-dark); color: #fff !important; }
.btn-outline  { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: #fff !important; }
.btn-sm       { padding: 8px 16px; font-size: .85rem; }
.btn-hero-alt { color: #fff !important; border-color: #fff !important; }
.btn-hero-alt:hover { background: #fff !important; color: var(--dark) !important; }
.btn-full-width { width: 100%; }

/* ==============================================================
   4. HEADER & NAVEGAÇÃO  (MOBILE-FIRST)
   ============================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 72px;
    padding: 0 var(--pad);
    position: relative;
}

/* Logótipo — tamanho aumentado e nítido */
.site-logo a {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    flex-shrink: 0;
}
.site-logo img {
    width: 170px !important;
    height: auto !important;
    max-height: 48px !important;
    object-fit: contain;
    display: block !important;
}
.brand-text-logo {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
}

/* Hamburger */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--carbon);
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: background .2s;
}
.mobile-menu-toggle:hover { background: var(--surface); }

/* Navegação: OCULTA em mobile, aparece como gaveta ao ganhar .active */
.main-navigation {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: var(--white);
    border-top: 3px solid var(--gold);
    overflow-y: auto;
    z-index: 9999;
    padding: 24px var(--pad) 40px;
}
.main-navigation.active {
    display: block;
}

/* Lista de itens do menu mobile */
.main-navigation ul,
.main-navigation .primary-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.main-navigation li {
    border-bottom: 1px solid var(--border);
    position: relative;
}

.main-navigation li a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--carbon);
    text-decoration: none;
}
.main-navigation li a:hover,
.main-navigation li.current-menu-item > a {
    color: var(--gold);
}

/* Área Reservada destacada */
.main-navigation .menu-area-reservada > a,
.main-navigation li[class*="area-reservada"] > a {
    color: var(--gold-dark);
    font-weight: 700;
}

/* Botão de expansão do submenu */
.submenu-toggle {
    position: absolute;
    right: 0;
    top: 8px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Submenus FECHADOS por defeito no mobile */
.main-navigation .sub-menu,
.main-navigation li > ul {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
    border-top: 1px solid var(--border);
}

/* Submenu ABERTO quando item pai tem .submenu-open */
.main-navigation li.submenu-open > .sub-menu,
.main-navigation li.submenu-open > ul {
    display: block;
}

.main-navigation .sub-menu li a,
.main-navigation li > ul li a {
    font-size: .92rem;
    font-weight: 500;
    padding: 11px 0;
    color: var(--muted);
}
.main-navigation .sub-menu li a:hover { color: var(--gold); }

/* ==============================================================
   4B. NAVEGAÇÃO DESKTOP (≥ 960px)
   ============================================================== */
@media (min-width: 960px) {
    .header-inner { height: 76px; }

    .mobile-menu-toggle { display: none; }

    .main-navigation {
        display: flex !important;
        position: static;
        background: none;
        border: none;
        padding: 0;
        overflow: visible;
        width: auto;
        height: auto;
    }

    .main-navigation ul,
    .main-navigation .primary-menu-list {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .main-navigation li {
        border: none;
    }

    .main-navigation li a {
        padding: 8px 12px;
        font-size: .9rem;
        border-radius: var(--r-sm);
    }
    .main-navigation li a:hover {
        background: var(--surface);
    }

    .main-navigation .menu-area-reservada > a,
    .main-navigation li[class*="area-reservada"] > a {
        background: var(--gold-light);
        padding: 8px 14px;
        border-radius: var(--r-sm);
    }

    /* Submenus dropdown no desktop */
    .submenu-toggle { display: none; }

    .main-navigation .sub-menu,
    .main-navigation li > ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 240px;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        box-shadow: var(--shadow-md);
        padding: 6px 0;
        z-index: 1100;
    }
    .main-navigation li:hover > .sub-menu,
    .main-navigation li:hover > ul,
    .main-navigation li:focus-within > .sub-menu,
    .main-navigation li:focus-within > ul {
        display: block;
    }

    .main-navigation .sub-menu li a,
    .main-navigation li > ul li a {
        padding: 10px 18px;
        font-size: .88rem;
        display: block;
        white-space: nowrap;
        border-radius: 0;
    }
    .main-navigation .sub-menu li a::after { display: none; }
}

/* ==============================================================
   5. HERO SECTIONS
   ============================================================== */
.hero-section {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #fff;
    padding: clamp(40px,8vw,90px) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-compact { padding: clamp(32px,5vw,60px) 0; }

.hero-title {
    font-size: clamp(1.6rem,5vw,2.8rem);
    color: #fff;
    margin-bottom: .5em;
}
.hero-title span { color: var(--gold); }

.hero-subtitle {
    font-size: clamp(.9rem,2vw,1.1rem);
    color: #ccc;
    max-width: 680px;
    margin: 0 auto 1.5em;
    font-weight: 300;
}

.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==============================================================
   6. SECTION HEADER
   ============================================================== */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.section-title   { font-size: clamp(1.3rem,3vw,2rem); margin: 0; }
.section-subtitle { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* ==============================================================
   7. GRIDS (Mobile-First: 1 coluna por defeito em mobile)
   ============================================================== */
.grid-1,
.grid-2,
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
}

/* ==============================================================
   8. CARDS
   ============================================================== */
.card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card-img-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img-wrap img { transform: scale(1.04); }

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-title   { font-size: 1.1rem; margin-bottom: .5em; }
.card-title a { color: inherit; }
.card-excerpt { font-size: .9rem; color: var(--muted); margin-bottom: 1em; flex: 1; }

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(30,30,30,.85);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.event-date-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 6px 12px;
    border-radius: var(--r-sm);
    width: fit-content;
    margin-bottom: 12px;
}
.event-day { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.event-month-year { font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.event-location-sm { font-size: .83rem; color: var(--muted); }

/* ==============================================================
   9. SPOTLIGHT CARD
   ============================================================== */
.spotlight-card {
    position: relative;
    display: flex;
    flex-direction: column;   /* mobile: empilhado */
    border: 1.5px solid var(--gold);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #fafafa;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}
.spotlight-media {
    position: relative;
    min-height: 200px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}
.spotlight-img         { max-height: 260px; width: 100%; object-fit: contain; }
.spotlight-img-fallback { max-height: 180px; width: auto; object-fit: contain; }
.spotlight-content {
    padding: clamp(18px,4vw,36px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.spotlight-date   { font-size: .85rem; font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.spotlight-title  { font-size: clamp(1.2rem,3vw,1.8rem); margin-bottom: 10px; }
.spotlight-title a { color: inherit; }
.spotlight-excerpt { font-size: .95rem; color: var(--muted); margin-bottom: 18px; }
.spotlight-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.event-spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.event-location { font-size: .85rem; color: var(--muted); font-weight: 600; }

/* ==============================================================
   10. FORMULÁRIOS
   ============================================================== */
.form-standard { width: 100%; }

.form-group   { margin-bottom: 14px; width: 100%; }
.form-label   { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 5px; }

.form-control {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-size: .95rem;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--white);
    color: var(--carbon);
    transition: border-color .2s;
}
.form-control:focus { border-color: var(--gold); outline: none; }

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.honeypot-field { display: none !important; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .85rem;
    color: var(--muted);
    cursor: pointer;
}

/* ==============================================================
   11. ÁREA RESERVADA
   ============================================================== */
.reserved-layout-grid {
    display: grid;
    grid-template-columns: 1fr;   /* mobile: 1 col */
    gap: 24px;
    max-width: 1060px;
    margin: 0 auto;
}

.reserved-area-card,
.registration-card {
    background: var(--white);
    padding: clamp(20px,4vw,32px);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}

.reserved-card-icon     { font-size: 2rem; margin-bottom: 8px; }
.reserved-card-title    { font-size: 1.3rem; margin-bottom: 6px; }
.reserved-card-subtitle { font-size: .87rem; color: var(--muted); margin-bottom: 20px; }
.reserved-help-text     { font-size: .82rem; color: var(--muted); margin-top: 18px; line-height: 1.55; }

.registration-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.registration-icon   { font-size: 1.8rem; }
.registration-title  { color: var(--gold-dark); font-size: 1.25rem; margin: 0; }
.registration-subtitle { font-size: .83rem; color: var(--muted); }

/* ==============================================================
   12. ALERTAS
   ============================================================== */
.alert-success {
    background: #e6f4ea; border: 1px solid #ceead6; color: #137333;
    padding: 20px; border-radius: var(--r-sm); text-align: center; margin-top: 16px;
}
.alert-error {
    background: #fce8e6; border: 1px solid #fad2cf; color: #c5221f;
    padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: .9rem;
}
.alert-icon  { font-size: 1.8rem; margin-bottom: 6px; }
.alert-title { font-size: 1.1rem; margin-bottom: 4px; color: #137333; }
.alert-desc  { font-size: .9rem; margin: 0; line-height: 1.6; }

/* ==============================================================
   13. SINGLE / ARTIGOS
   ============================================================== */
.single-content,
.single-article,
.entry-content {
    max-width: 820px;
    margin: 0 auto;
    word-break: break-word;
    overflow-wrap: break-word;
}

.entry-content p      { margin-bottom: 20px; line-height: 1.85; }
.entry-content h2,
.entry-content h3     { margin: 32px 0 14px; }
.entry-content ul,
.entry-content ol     { padding-left: 24px; margin-bottom: 20px; }
.entry-content li     { margin-bottom: 6px; }
.entry-content img    { max-width: 100% !important; height: auto !important; border-radius: var(--r-sm); margin: 16px 0; }

.single-banner-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 28px;
    text-align: center;
    padding: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.single-banner-img { max-height: 400px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto; }

.single-share-block { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 36px; }
.single-share-title { font-size: .95rem; font-weight: 700; color: var(--carbon); margin-bottom: 12px; }
.single-footer-nav  { margin-top: 36px; text-align: center; border-top: 1px dashed var(--border); padding-top: 28px; }

/* Sidebar flutuante: só em desktop largo */
.sticky-share-sidebar {
    display: none;
    position: fixed;
    top: 35%;
    left: 14px;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

/* ==============================================================
   14. SOCIAL SHARE
   ============================================================== */
.social-share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.social-share-label { font-size: .88rem; font-weight: 700; color: var(--carbon); }

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff !important;
    text-decoration: none !important;
    transition: opacity .2s, transform .2s;
}
.share-btn:hover { opacity: .85; transform: translateY(-2px); }
.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-instagram { background: #E4405F; }
.share-twitter  { background: #000; }
.share-copy     { background: var(--carbon); cursor: pointer; }

/* ==============================================================
   15. FOOTER
   ============================================================== */
.site-footer {
    background: var(--carbon);
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 48px;
    overflow: hidden;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;   /* mobile: 1 col */
    gap: 28px;
    margin-bottom: 28px;
}

.footer-logo-img {
    width: 180px !important;
    height: auto !important;
    max-height: 52px !important;
    object-fit: contain;
    display: block;
    margin-bottom: 10px;
}

.footer-col h4      { color: #fff; font-size: .9rem; margin-bottom: 10px; }
.footer-nav-list    { list-style: none; margin: 0; padding: 0; }
.footer-nav-list li { margin-bottom: 6px; }
.footer-nav-list a  { color: #aaa; font-size: .84rem; }
.footer-nav-list a:hover { color: var(--gold); }

.footer-contacts-list { list-style: none; margin: 0; padding: 0; }
.footer-contacts-list li { margin-bottom: 6px; font-size: .84rem; word-break: break-word; }
.footer-contacts-list a  { color: #ccc; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 18px;
    text-align: center;
    font-size: .78rem;
    color: #888;
}

/* ==============================================================
   16. BREAKPOINTS RESPONSIVOS  (TABLET → DESKTOP)
   ============================================================== */

/* Tablet: 600px+ */
@media (min-width: 600px) {
    .grid-3         { grid-template-columns: repeat(2,1fr); }
    .footer-grid    { grid-template-columns: 1fr 1fr; }
    .form-row-2col  { grid-template-columns: 1fr 1fr; }

    .spotlight-card {
        flex-direction: row;
    }
    .spotlight-media {
        flex: 0 0 42%;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }
    .spotlight-content { flex: 1; }
}

/* Desktop: 960px+ */
@media (min-width: 960px) {
    .grid-3      { grid-template-columns: repeat(3,1fr); }
    .footer-grid { grid-template-columns: 1.2fr .9fr 2fr 1.1fr; }

    .reserved-layout-grid { grid-template-columns: .9fr 1.1fr; gap: 32px; }

    .sticky-share-sidebar { display: flex; }
}

/* Ajuste fino quando o hero está dentro de um .container */
.hero-section .container {
    padding-left: 0;
    padding-right: 0;
}
