/* =============================================================
   assets/css/styles.css — MegaLoto | Projeto Base SEO
   =============================================================
   Organização:
   1. Tokens / Custom Properties
   2. Reset & Base
   3. Skip Link (acessibilidade)
   4. Header & Navegação Principal
   5. Main & Article
   6. Breadcrumb
   7. Headings & Tipografia
   8. Componentes (cards, FAQ, volante)
   9. Links Relacionados
   10. Footer
   11. Utilitários
   12. Responsivo
   ============================================================= */


/* ─────────────────────────────────────────────────────────────
   1. TOKENS — Design System via Custom Properties
   ───────────────────────────────────────────────────────────── */
:root {
    /* Paleta — harmonia com o tema WP (#823e9f / #9b48ba) */
    --clr-primary:      #823e9f;
    --clr-primary-dark: #5e2c73;
    --clr-primary-lite: #c98de0;
    --clr-accent:       #f0b429;
    --clr-surface:      #faf8fc;
    --clr-surface-2:    #f1eaf7;
    --clr-border:       #ddd3e8;
    --clr-text:         #1e1025;
    --clr-text-muted:   #6b5c7a;
    --clr-white:        #ffffff;

    /* Tipografia */
    --ff-display: 'Sora', sans-serif;
    --ff-body:    'DM Sans', sans-serif;
    --fz-sm:   0.875rem;   /* 14px */
    --fz-base: 1rem;       /* 16px */
    --fz-md:   1.125rem;   /* 18px */
    --fz-lg:   1.5rem;     /* 24px */
    --fz-xl:   2rem;       /* 32px */
    --fz-2xl:  2.5rem;     /* 40px */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-bold:   700;
    --lh-body:  1.7;
    --lh-tight: 1.2;

    /* Espaçamentos */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-12: 3rem;
    --sp-16: 4rem;

    /* Layout */
    --max-content: 780px;
    --max-wide:    1100px;

    /* Bordas & Sombras */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 4px rgba(130, 62, 159, .08);
    --shadow-md: 0 4px 16px rgba(130, 62, 159, .14);
    --shadow-lg: 0 8px 32px rgba(130, 62, 159, .2);

    /* Transições */
    --t-fast: 150ms ease;
    --t-base: 250ms ease;
}


/* ─────────────────────────────────────────────────────────────
   2. RESET & BASE
   ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--ff-body);
    font-size: var(--fz-base);
    line-height: var(--lh-body);
    color: var(--clr-text);
    background-color: var(--clr-surface);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: var(--clr-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--t-fast), opacity var(--t-fast);
}
a:hover { color: var(--clr-primary-dark); }

ul, ol { list-style: none; }

/* Focus visível para acessibilidade */
:focus-visible {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}


/* ─────────────────────────────────────────────────────────────
   3. SKIP LINK — Acessibilidade (WCAG 2.4.1)
   ───────────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--sp-4);
    z-index: 9999;
    padding: var(--sp-3) var(--sp-6);
    background: var(--clr-primary);
    color: var(--clr-white);
    font-weight: var(--fw-bold);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    text-decoration: none;
    transition: top var(--t-base);
}
.skip-link:focus { top: 0; }


/* ─────────────────────────────────────────────────────────────
   4. HEADER & NAVEGAÇÃO PRINCIPAL
   ───────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--clr-primary);
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 0 var(--sp-6);
    height: 60px;
    display: flex;
    align-items: center;
    gap: var(--sp-6);
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    color: var(--clr-white);
    font-family: var(--ff-display);
    font-weight: var(--fw-bold);
    font-size: var(--fz-md);
    flex-shrink: 0;
}
.site-logo:hover { color: var(--clr-accent); }

.logo-text {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: var(--clr-white);
    color: var(--clr-primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: var(--fw-bold);
}

/* Nav */
.nav-principal { margin-left: auto; }
.nav-principal ul {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.nav-principal a {
    display: block;
    padding: var(--sp-2) var(--sp-3);
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: var(--fz-sm);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-principal a:hover,
.nav-principal a[aria-current="page"] {
    background: rgba(255,255,255,.15);
    color: var(--clr-white);
}
.nav-principal a[aria-current="page"] {
    background: rgba(255,255,255,.2);
    font-weight: var(--fw-bold);
}

/* Botão hambúrguer (hidden desktop) */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--clr-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--sp-2);
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
}
.nav-toggle:hover { background: rgba(255,255,255,.15); }


/* ─────────────────────────────────────────────────────────────
   5. MAIN & ARTICLE
   ───────────────────────────────────────────────────────────── */
main {
    flex: 1;
    padding: var(--sp-12) var(--sp-6);
   /* margin: 0 auto; */
    border: 1px solid #ebebeb;
    border-radius: 10px;
    background: #ffffff;
    /* margin-top: 15px; Ajuste para rodar com o plugin side bar pro*/
    margin-top: 10px; /* Ajuste para rodar stand alone */
    margin-bottom: 15px;
    max-width: 950px;
    align-self: center;
}

.page-article {
    max-width: var(--max-content);
    margin: 0 auto;
}


/* ─────────────────────────────────────────────────────────────
   6. BREADCRUMB
   ───────────────────────────────────────────────────────────── */
.breadcrumb {
    margin-bottom: var(--sp-6);
}
.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: var(--fz-sm);
}
.breadcrumb-item a {
    color: var(--clr-primary);
    text-decoration: none;
}
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-sep {
    margin: 0 var(--sp-2);
    color: var(--clr-text-muted);
}
.breadcrumb-current {
    color: var(--clr-text-muted);
}


/* ─────────────────────────────────────────────────────────────
   7. HEADINGS & TIPOGRAFIA
   ───────────────────────────────────────────────────────────── */
.article-header {
    margin-bottom: var(--sp-12);
    padding-bottom: var(--sp-8);
    border-bottom: 2px solid var(--clr-border);
}

.page-title {
    font-family: var(--ff-display);
    font-size: clamp(var(--fz-xl), 5vw, var(--fz-2xl));
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--clr-primary-dark);
    margin-bottom: var(--sp-4);
    letter-spacing: -0.02em;
}

.page-lead {
    font-size: var(--fz-md);
    color: var(--clr-text-muted);
    line-height: var(--lh-body);
    margin-bottom: var(--sp-6);
    max-width: 60ch;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--fz-sm);
    color: var(--clr-text-muted);
}
.article-meta i { vertical-align: -2px; }
.meta-sep { color: var(--clr-border); }

/* Sections */
.article-body > section {
    margin-bottom: var(--sp-12);
}

h2 {
    font-family: var(--ff-display);
    font-size: clamp(var(--fz-lg), 3.5vw, var(--fz-xl));
    font-weight: var(--fw-bold);
    color: var(--clr-primary-dark);
    margin-bottom: var(--sp-6);
    line-height: var(--lh-tight);
}
h2::before {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--clr-accent);
    margin-bottom: var(--sp-3);
    border-radius: 2px;
}

h3 {
    font-family: var(--ff-display);
    font-size: 1.1rem;
    font-weight: var(--fw-bold);
    color: var(--clr-primary-dark);
    margin-bottom: var(--sp-2);
}

p + p { margin-top: var(--sp-4); }
p { max-width: 70ch; }


/* ─────────────────────────────────────────────────────────────
   8. COMPONENTES
   ───────────────────────────────────────────────────────────── */

/* Figure / Volante */
.figura-exemplo {
    margin: var(--sp-8) 0;
}
.volante-placeholder {
    background: var(--clr-surface-2);
    border: 2px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: var(--sp-6);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.volante-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 500px;
}
.volante-grid .dezena {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: var(--fw-bold);
    font-family: var(--ff-display);
    border-radius: 50%;
    border: 2px solid var(--clr-border);
    background: var(--clr-white);
    color: var(--clr-text-muted);
    transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.volante-grid .dezena.marcado {
    background: var(--clr-primary);
    color: var(--clr-white);
    border-color: var(--clr-primary);
    box-shadow: var(--shadow-sm);
    animation: pulso 0.5s ease forwards;
}

@keyframes pulso {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

figcaption {
    margin-top: var(--sp-3);
    font-size: var(--fz-sm);
    color: var(--clr-text-muted);
    line-height: 1.5;
}

/* Cards de tipos */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-6);
    margin-top: var(--sp-6);
}
.card-tipo {
    background: var(--clr-white);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    padding: var(--sp-6);
    transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}
.card-tipo:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--clr-primary-lite);
    transform: translateY(-3px);
}
.card-icon {
    font-size: 1.75rem;
    color: var(--clr-primary);
    margin-bottom: var(--sp-4);
}
.card-tipo p {
    font-size: var(--fz-sm);
    color: var(--clr-text-muted);
    max-width: none;
}

/* FAQ com details/summary */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-6);
}
.faq-item {
    background: var(--clr-white);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--t-base);
}
.faq-item[open] {
    border-color: var(--clr-primary-lite);
}
.faq-pergunta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-6);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.faq-pergunta::-webkit-details-marker { display: none; }
.faq-pergunta h3 {
    font-size: var(--fz-base);
    margin: 0;
    color: var(--clr-text);
}
.faq-icon {
    font-size: 1.25rem;
    color: var(--clr-primary);
    flex-shrink: 0;
    transition: transform var(--t-base);
}
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-resposta {
    padding: 0 var(--sp-6) var(--sp-6);
    color: var(--clr-text-muted);
    font-size: var(--fz-sm);
}
.faq-resposta p { max-width: none; }


/* ─────────────────────────────────────────────────────────────
   9. LINKS RELACIONADOS
   ───────────────────────────────────────────────────────────── */
.related-links {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-6);
}
.related-links a {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-6);
    background: var(--clr-white);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--clr-text);
    font-weight: var(--fw-medium);
    transition: background var(--t-base), border-color var(--t-base), color var(--t-base);
}
.related-links a:hover {
    background: var(--clr-surface-2);
    border-color: var(--clr-primary);
    color: var(--clr-primary);
}
.related-links i {
    font-size: 1.2rem;
    color: var(--clr-primary);
    flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────────────
   10. FOOTER
   ───────────────────────────────────────────────────────────── */
.article-footer {
    margin-top: var(--sp-12);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--clr-border);
}
.article-update-notice {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fz-sm);
    color: var(--clr-text-muted);
}
.article-update-notice i { vertical-align: -2px; }

.site-footer {
    background: var(--clr-primary);
    color: rgba(255,255,255,.8);
    margin-top: auto;
}
.footer-inner {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: var(--sp-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-4);
}
.footer-copyright { font-size: var(--fz-sm); }
.footer-links {
    display: flex;
    gap: var(--sp-4);
}
.footer-links a {
    font-size: var(--fz-sm);
    color: rgba(255,255,255,.75);
    text-decoration: none;
}
.footer-links a:hover { color: var(--clr-white); }


/* ─────────────────────────────────────────────────────────────
   11. UTILITÁRIOS
   ───────────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


/* ─────────────────────────────────────────────────────────────
   12. RESPONSIVO
   ───────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {

    main { padding: var(--sp-8) var(--sp-4); }

    /* Nav mobile */
    .nav-toggle { display: block; }
    .nav-principal {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--clr-primary-dark);
        padding: var(--sp-4);
        display: none;
        z-index: 99;
    }
    .nav-principal.aberto { display: block; }
    .nav-principal ul { flex-direction: column; gap: var(--sp-1); }
    .nav-principal a { font-size: var(--fz-base); padding: var(--sp-3) var(--sp-4); }

    /* Volante menor */
    .volante-grid { grid-template-columns: repeat(8, 1fr); }
}

/* Mobile */
@media (max-width: 480px) {
    .header-inner { padding: 0 var(--sp-4); }
    .article-meta { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
    .meta-sep { display: none; }
    .cards-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
    .volante-grid { grid-template-columns: repeat(6, 1fr); }
}
