/* =========================================
   GRES Acadêmicos do Salgueiro — Estilos
   ========================================= */

/* ----- Variables ----- */
:root {
    --red:        #B8001F;
    --red-dark:   #8B0016;
    --red-light:  #D9002A;
    --white:      #FFFFFF;
    --off-white:  #FAF8F7;
    --light:      #F3F1EF;
    --dark:       #1A1A1A;
    --text:       #2C2C2C;
    --muted:      #6B6868;
    --border:     #E5E1DE;

    --serif: 'Playfair Display', Georgia, serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --radius: 6px;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 40px rgba(0,0,0,0.12);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ----- Container ----- */
.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ----- Buttons ----- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 14px 32px;
    border-radius: var(--radius);
    border: 2px solid var(--red);
    transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.2s var(--ease);
}
.btn-primary:hover {
    background: var(--white);
    color: var(--red);
    transform: translateY(-2px);
}
.btn-block { width: 100%; justify-content: center; }

/* =========================================
   NAVIGATION
   ========================================= */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    padding: 18px 0;
    transition: padding 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav.scrolled {
    background: rgba(255,255,255,0.97);
    padding: 10px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
}
.nav-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.nav-logo span {
    font-family: var(--serif);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
    transition: color 0.3s;
}
.nav.scrolled .nav-logo span { color: var(--dark); }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: color 0.25s, background 0.25s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.15); }
.nav.scrolled .nav-link { color: var(--text); }
.nav.scrolled .nav-link:hover { color: var(--red); background: rgba(184,0,31,0.06); }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    padding: 8px 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-8px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.has-dropdown:hover .dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}
.dropdown li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.8125rem;
    color: var(--text);
    transition: color 0.2s, background 0.2s;
}
.dropdown li a:hover { color: var(--red); background: var(--light); }

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s, background 0.3s;
}
.nav.scrolled .nav-toggle span { background: var(--dark); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================
   HERO
   ========================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--dark);
}
.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: blur(70px);
    transform: scale(1.12);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10,0,0,0.55) 0%,
        rgba(10,0,0,0.45) 60%,
        rgba(10,0,0,0.7) 100%
    );
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 120px 24px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.hero-logo {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 8px 32px rgba(0,0,0,0.4));
    margin-bottom: 8px;
}
.hero-eyebrow {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}
.hero-title {
    font-family: var(--serif);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.05;
    color: var(--white);
    letter-spacing: -0.02em;
}
.hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.65);
    max-width: 400px;
    margin-top: 4px;
}
.hero-content .btn-primary {
    margin-top: 12px;
    background: var(--white);
    color: var(--red);
    border-color: var(--white);
}
.hero-content .btn-primary:hover {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}
.hero-down {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: bounce 2s ease-in-out infinite;
}
.hero-down svg { width: 28px; height: 28px; }
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

/* Reveal hero items with staggered delay */
.reveal-hero {
    opacity: 0;
    transform: translateY(24px);
    animation: revealHero 0.8s var(--ease) forwards;
}
.hero-logo.reveal-hero      { animation-delay: 0.2s; }
.hero-eyebrow.reveal-hero   { animation-delay: 0.4s; }
.hero-title.reveal-hero     { animation-delay: 0.55s; }
.hero-sub.reveal-hero       { animation-delay: 0.7s; }
.btn-primary.reveal-hero    { animation-delay: 0.85s; }
@keyframes revealHero {
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   SECTIONS
   ========================================= */
.block {
    padding: 100px 0;
}
.block-red   { background: var(--red); }
.block-light { background: var(--light); }

.section-head {
    text-align: center;
    margin-bottom: 64px;
}
.section-head h2 {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--dark);
    margin: 8px 0 20px;
}
.section-head .white { color: var(--white); }

.tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--red);
    background: rgba(184,0,31,0.08);
    padding: 5px 14px;
    border-radius: 100px;
}
.tag-white {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.15);
}
.divider {
    width: 48px;
    height: 3px;
    background: var(--red);
    margin: 0 auto;
    border-radius: 2px;
}
.divider-white { background: rgba(255,255,255,0.6); }

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   HISTÓRIA
   ========================================= */
.historia-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 64px;
    align-items: start;
}
.historia-text p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 20px;
}
.historia-text p:last-child { margin-bottom: 0; }
.historia-text strong { color: var(--dark); font-weight: 600; }
.historia-text em { font-family: var(--serif); font-style: italic; }

.historia-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
}
.stat-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    border-left: 4px solid var(--red);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.stat-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}
.stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--red);
    line-height: 1;
}
.stat-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 6px;
}

/* =========================================
   TIMELINE (TÍTULOS)
   ========================================= */
.timeline {
    position: relative;
    max-width: 780px;
    margin: 0 auto 56px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.2);
    transform: translateX(-50%);
}
.tl-item {
    display: grid;
    grid-template-columns: 1fr 20px 1fr;
    align-items: center;
    margin-bottom: 32px;
    opacity: 0;
    transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.tl-item.left  { transform: translateX(-20px); }
.tl-item.right { transform: translateX(20px); }
.tl-item.visible { opacity: 1; transform: none; }

.tl-content {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius);
    padding: 20px 24px;
    backdrop-filter: blur(4px);
    transition: background 0.25s var(--ease);
}
.tl-content:hover { background: rgba(255,255,255,0.18); }
.tl-item.left  .tl-content { text-align: right; padding-right: 32px; }
.tl-item.right .tl-content { padding-left: 32px; }

.tl-year {
    display: block;
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}
.tl-enredo {
    display: block;
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.72);
    margin-top: 5px;
}
.tl-dot {
    width: 18px;
    height: 18px;
    background: var(--white);
    border: 3px solid rgba(184,0,31,0.4);
    border-radius: 50%;
    justify-self: center;
}
.tl-spacer { /* empty grid cell — takes up opposite side */ }

.titulos-note {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: rgba(255,255,255,0.72);
}
.white { color: var(--white); }

/* =========================================
   FICHA TÉCNICA
   ========================================= */
.ficha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.ficha-item {
    background: var(--white);
    padding: 20px 24px;
    transition: background 0.2s;
}
.ficha-item:hover { background: var(--off-white); }
.ficha-role {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 4px;
}
.ficha-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--dark);
}

/* =========================================
   ENREDO
   ========================================= */
.enredo-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 32px;
}
.enredo-poster {
    position: relative;
    width: 100%;
    max-width: 480px;
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.enredo-poster.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.enredo-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(184, 0, 31, 0.25), 0 8px 32px rgba(0,0,0,0.18);
    display: block;
    animation: enredoFloat 6s ease-in-out infinite;
    transform-origin: center bottom;
    position: relative;
    z-index: 1;
}
.enredo-glow {
    position: absolute;
    inset: 20% 5% -12% 5%;
    background: radial-gradient(ellipse, rgba(184,0,31,0.35) 0%, transparent 70%);
    filter: blur(32px);
    z-index: 0;
    animation: enredoGlow 6s ease-in-out infinite;
}
@keyframes enredoFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}
@keyframes enredoGlow {
    0%, 100% { opacity: 0.7; transform: scaleX(1); }
    50%       { opacity: 1;   transform: scaleX(1.08); }
}

/* =========================================
   CAROUSEL (FOTOS)
   ========================================= */
.carousel-outer {
    margin-top: 16px;
}
.carousel {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
    background: #0a0a0a;
    cursor: grab;
}
.carousel:active { cursor: grabbing; }
.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.carousel-slide {
    min-width: 100%;
    height: 100%;
    overflow: hidden;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 8s linear;
}
.carousel-slide.active img { transform: scale(1.04); }

/* Nav buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    opacity: 0.85;
}
.carousel-btn:hover { background: #fff; transform: translateY(-50%) scale(1.08); opacity: 1; }
.carousel-prev { left: 20px; }
.carousel-next { right: 20px; }
.carousel-btn svg { width: 20px; height: 20px; pointer-events: none; }

/* Progress bar */
.carousel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--red);
    z-index: 10;
}
.carousel-progress.running {
    animation: carouselProgress 5s linear forwards;
}
@keyframes carouselProgress {
    from { width: 0%; }
    to   { width: 100%; }
}

/* Footer */
.carousel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    max-width: 1160px;
    margin: 0 auto;
}
.carousel-count {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.carousel-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--red);
    letter-spacing: 0.02em;
    transition: opacity 0.2s;
}
.carousel-link:hover { opacity: 0.7; }

/* =========================================
   ELEIÇÃO
   ========================================= */
.eleicao-wrap {
    display: flex;
    justify-content: center;
}
.eleicao-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 56px 64px;
    max-width: 560px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--red);
}
.eleicao-icon {
    width: 56px;
    height: 56px;
    background: rgba(184,0,31,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--red);
}
.eleicao-icon svg { width: 28px; height: 28px; }
.eleicao-card h3 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.eleicao-card p {
    font-size: 0.9375rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 28px;
}

/* =========================================
   CONTATO
   ========================================= */
.form-wrap {
    max-width: 680px;
    margin: 0 auto;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 20px;
}
.form-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--dark);
    text-transform: uppercase;
}
.form-group input,
.form-group textarea {
    background: var(--light);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 16px;
    font-size: 0.9375rem;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(184,0,31,0.1);
    background: var(--white);
}
.form-group input.error,
.form-group textarea.error {
    border-color: #cc3300;
}
.form-success {
    display: none;
    background: rgba(0, 140, 60, 0.08);
    border: 1px solid rgba(0, 140, 60, 0.3);
    color: #006630;
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 0.9375rem;
    text-align: center;
    margin-top: 16px;
}
.form-success.show { display: block; }

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 80px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 56px;
    padding-bottom: 64px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 16px;
}
.footer-name {
    font-family: var(--serif);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 6px;
}
.footer-sub {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
}
.footer-nav h4,
.footer-info h4 {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 20px;
}
.footer-nav li { margin-bottom: 10px; }
.footer-nav a {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.65);
    transition: color 0.2s;
}
.footer-nav a:hover { color: var(--white); }
.footer-info p {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 16px;
}
.footer-tagline {
    font-family: var(--serif);
    font-style: italic;
    color: rgba(255,255,255,0.4);
}
.footer-bottom {
    padding: 24px 0;
    text-align: center;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.3);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .block { padding: 72px 0; }
    .historia-grid { grid-template-columns: 1fr; gap: 40px; }
    .historia-stats {
        flex-direction: row;
        position: static;
    }
    .stat-card { flex: 1; }

    /* Timeline collapses to left-aligned on tablet/mobile */
    .timeline::before { left: 9px; transform: none; }
    .tl-item,
    .tl-item.left,
    .tl-item.right {
        grid-template-columns: 20px 1fr;
        transform: none;
    }
    .tl-item .tl-dot { grid-column: 1; grid-row: 1; }
    .tl-item .tl-content,
    .tl-item.right .tl-content {
        grid-column: 2;
        grid-row: 1;
        text-align: left !important;
        padding: 16px 20px !important;
    }
    .tl-item .tl-spacer { display: none; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .footer-brand { grid-column: 1 / -1; }

    .carousel { height: 400px; }
    .eleicao-card { padding: 40px 32px; }
}

@media (max-width: 680px) {
    .nav-menu {
        position: fixed;
        inset: 0 0 0 30%;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 100px 24px 40px;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.35s var(--ease);
        box-shadow: -4px 0 32px rgba(0,0,0,0.15);
        overflow-y: auto;
    }
    .nav-menu.open { transform: translateX(0); }
    .nav-link {
        color: var(--text) !important;
        padding: 14px 8px;
        font-size: 1rem;
        width: 100%;
    }
    .nav-link:hover { background: var(--light); color: var(--red) !important; }
    .has-dropdown { width: 100%; }
    .dropdown {
        position: static;
        transform: none !important;
        opacity: 1;
        pointer-events: all;
        box-shadow: none;
        padding-left: 16px;
        background: transparent;
    }
    .dropdown li a { padding: 10px 8px; font-size: 0.9375rem; color: var(--muted); }
    .nav-toggle { display: flex; z-index: 201; }

    .hero-logo { width: 100px; height: 100px; }

    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-brand { grid-column: auto; }

    .ficha-grid { grid-template-columns: 1fr; }
    .historia-stats { flex-direction: column; }
}

@media (max-width: 480px) {
    .section-head { margin-bottom: 40px; }
    .block { padding: 56px 0; }
    .carousel { height: 300px; }
    .carousel-btn { width: 36px; height: 36px; }
    .carousel-btn svg { width: 16px; height: 16px; }
    .carousel-prev { left: 10px; }
    .carousel-next { right: 10px; }
}
