/* ============================================
   RESET E VARIÁVEIS
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0d2240;
    --secondary-color: #c9a961;
    --accent-color: #d4af37;
    --text-dark: #1a2535;
    --text-light: #ecf0f1;
    --bg-light: #f4f6f9;
    --bg-white: #ffffff;
    --border-color: #d5dde5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   NAVEGAÇÃO
   ============================================ */
.navbar {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(rgba(13, 34, 64, 0.82), rgba(13, 34, 64, 0.82)), url('./img/pedro-de-araujo-lime-marques-de-olinda-hero.png');
    background-size: cover;
    background-position: center top;
    background-attachment: scroll;
    color: var(--text-light);
    padding: 150px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(201, 169, 97, 0.10) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero-dates {
    font-size: 1.1rem;
    color: rgba(236, 240, 241, 0.9);
}

@media (max-width: 768px) {
    .hero {
        padding: 80px 20px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }
}

/* ============================================
   SEÇÕES
   ============================================ */
.section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.section:last-of-type {
    border-bottom: none;
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-color);
}

/* ============================================
   CONTEÚDO DE TEXTO
   ============================================ */
.content-text {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.content-text p {
    margin-bottom: 1.5rem;
    text-align: justify;
    color: var(--text-dark);
}

.content-text h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-text h3:first-child {
    margin-top: 0;
}

/* ============================================
   GRID DE EMPRESAS
   ============================================ */
.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.company-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.company-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.company-card p {
    color: var(--text-dark);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   GALERIA
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--bg-light);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    font-size: 0.75rem;
    color: #0d2240;
    text-align: center;
    padding: 6px 8px 8px;
    background: rgba(248, 244, 245, 0.95);
    letter-spacing: 0.2px;
    font-style: italic;
    flex-shrink: 0;
    border-top: 1px solid rgba(13, 34, 64, 0.1);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal-caption {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.15);
    text-align: center;
    margin-top: 5px;
    font-style: italic;
    letter-spacing: 0.2px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    margin: 0.5rem 0;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 768px) {
    .section {
        padding: 50px 0;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .content-text p {
        text-align: left;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .nav-brand {
        font-size: 1.2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .companies-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */
a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button:focus,
input:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ============================================
   INSÍGNIAS
   ============================================ */
.insignia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.insignia-card {
    background: var(--bg-light);
    border-radius: 8px;
    border-top: 3px solid var(--accent-color);
    padding: 1.25rem 1rem 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.insignia-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.insignia-img-wrap {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insignia-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.insignia-card h4 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.insignia-card p {
    color: var(--secondary-color);
    font-size: 0.8rem;
    margin: 0;
    font-style: italic;
}

@media (max-width: 480px) {
    .insignia-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* ============================================
   FOTOS CONTEXTUAIS (float)
   ============================================ */
.inline-photo {
    max-width: 280px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.inline-photo.float-right {
    float: right;
    margin: 0 0 1.5rem 2rem;
}

.inline-photo.float-left {
    float: left;
    margin: 0 2rem 1.5rem 0;
}

.inline-photo img {
    width: 100%;
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.inline-photo img:hover {
    transform: scale(1.03);
}

.inline-photo figcaption {
    font-size: 0.72rem;
    color: var(--primary-color);
    text-align: center;
    padding: 6px 8px 8px;
    font-style: italic;
    border-top: 1px solid var(--border-color);
    line-height: 1.4;
}

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

@media (max-width: 768px) {
    .inline-photo.float-right,
    .inline-photo.float-left {
        float: none;
        max-width: 100%;
        margin: 1.5rem auto;
    }
}

/* ============================================
   MOBILE — OTIMIZAÇÕES GERAIS
   ============================================ */
@media (max-width: 768px) {

    /* Navbar: empilha em vez de cortar */
    .navbar .container {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 20px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
        font-size: 0.82rem;
    }

    /* Hero */
    .hero {
        background-attachment: scroll; /* fixed paralax quebra no iOS */
        padding: 60px 20px;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-dates {
        font-size: 0.95rem;
    }

    /* Seções */
    .section {
        padding: 40px 0;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    /* Textos */
    .content-text p,
    .content-text h3 {
        text-align: left;
    }

    .content-text h3 {
        font-size: 1.2rem;
    }

    /* Cards */
    .companies-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .company-card {
        padding: 1.25rem;
    }

    /* Insígnias */
    .insignia-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .insignia-img-wrap {
        width: 80px;
        height: 80px;
    }

    /* Galeria */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Fotos contextuais: vira bloco centralizado */
    .inline-photo.float-right,
    .inline-photo.float-left {
        float: none;
        max-width: 100%;
        margin: 1rem auto 1.5rem;
        display: block;
    }
}

@media (max-width: 480px) {

    .nav-brand {
        font-size: 1.1rem;
    }

    .nav-menu {
        font-size: 0.75rem;
        gap: 0.4rem 0.75rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-header h2 {
        font-size: 1.35rem;
    }

    .insignia-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .gallery-caption {
        font-size: 0.65rem;
        padding: 4px 6px 6px;
    }

    .footer {
        padding: 2rem 0;
    }

    .footer-text {
        font-size: 0.8rem;
    }
}
