/* =========================================================
   Município Theme — Main Stylesheet
   ========================================================= */

/* ----- Custom Properties ----- */
:root {
    --c-primary:      #1b3d6f;
    --c-primary-dark: #0f2240;
    --c-accent:       #2e86c1;
    --c-accent-hover: #1a6699;
    --c-light:        #f4f6f8;
    --c-white:        #ffffff;
    --c-text:         #1e2530;
    --c-muted:        #64748b;
    --c-border:       #dde3ea;
    --c-footer-bg:    #0f2240;

    --container-max:  1240px;
    --header-height:  72px;
    --gap:            2rem;
    --radius:         6px;
    --transition:     0.25s ease;

    --font-body:      'Inter', system-ui, sans-serif;
    --font-display:   'Playfair Display', Georgia, serif;
}

/* ----- 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(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-white);
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* ----- Container ----- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo img {
    max-height: 48px;
    width: auto;
}

.site-name-link {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--c-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-list li a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--c-text);
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.nav-list li a:hover,
.nav-list li.current-menu-item > a,
.nav-list li.current_page_item > a {
    color: var(--c-primary);
    background: var(--c-light);
}

/* Language Selector */
.lang-selector {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.lang-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lang-list li a {
    display: block;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--c-muted);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition);
}

.lang-list li a:hover,
.lang-list li.current-lang a {
    color: var(--c-white);
    background: var(--c-primary);
    border-color: var(--c-primary);
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.nav-toggle:hover { background: var(--c-light); }

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--c-primary);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO CAROUSEL
   ========================================================= */
.hero-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--c-primary-dark);
}

.carousel-track {
    position: relative;
    height: clamp(380px, 65vh, 700px);
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}

.carousel-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 34, 64, 0.6) 0%, transparent 50%);
}

.slide-caption {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 800px;
}

.slide-caption p {
    color: var(--c-white);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Carousel Controls */
.carousel-controls {
    position: absolute;
    bottom: 1.25rem;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.carousel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--c-white);
    cursor: pointer;
    transition: background var(--transition);
}

.carousel-btn:hover { background: rgba(255, 255, 255, 0.35); }
.carousel-btn svg { width: 18px; height: 18px; }

.carousel-dots {
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.carousel-dot.is-active,
.carousel-dot:hover {
    background: var(--c-white);
    transform: scale(1.3);
}

/* =========================================================
   HERO QUOTE
   ========================================================= */
.hero-quote {
    padding: 5rem 0;
    background: var(--c-white);
    text-align: center;
    border-bottom: 1px solid var(--c-border);
}

.quote-title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-inline: auto;
}

.quote-body {
    max-width: 680px;
    margin-inline: auto;
    position: relative;
}

.quote-body::before {
    content: '\201C';
    display: block;
    font-family: var(--font-display);
    font-size: 5rem;
    line-height: 1;
    color: var(--c-accent);
    opacity: 0.35;
    margin-bottom: -1.5rem;
}

.quote-body p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    color: var(--c-muted);
}

/* =========================================================
   MAP SECTION
   ========================================================= */
.map-section {
    padding: 4rem 0;
    background: var(--c-light);
}

.section-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.map-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    background: var(--c-white);
    min-height: 500px;
}

.map-wrapper > * {
    width: 100%;
}

.map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    color: var(--c-muted);
    font-size: 0.95rem;
    text-align: center;
    padding: 2rem;
}

/* =========================================================
   GENERIC PAGE
   ========================================================= */
.main-content {
    padding: 3rem 0 5rem;
}

.page-layout {
    max-width: 800px;
}

.page-header {
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--c-border);
}

.page-title {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1.25;
}

.page-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--c-text);
}

.page-content h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 0.75rem; color: var(--c-primary); }
.page-content h3 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.5rem; color: var(--c-primary); }
.page-content p  { margin-bottom: 1.25rem; }
.page-content a  { color: var(--c-accent); text-decoration: underline; }
.page-content a:hover { color: var(--c-accent-hover); }
.page-content ul, .page-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: 0.35rem; }

/* =========================================================
   POST GRID (index / archive)
   ========================================================= */
.archive-header {
    margin-bottom: 2.5rem;
}

.archive-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-primary);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--gap);
    margin-bottom: 3rem;
}

.post-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--c-white);
    transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.post-card-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
    gap: 0.75rem;
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
}

.post-card-title a { color: var(--c-text); transition: color var(--transition); }
.post-card-title a:hover { color: var(--c-accent); }

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--c-muted);
    flex: 1;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    align-self: flex-start;
}

.btn-primary {
    background: var(--c-accent);
    color: var(--c-white);
}

.btn-primary:hover {
    background: var(--c-accent-hover);
}

.btn-outline {
    background: transparent;
    color: var(--c-primary);
    border-color: var(--c-primary);
}

.btn-outline:hover {
    background: var(--c-primary);
    color: var(--c-white);
}

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--c-border);
    transition: all var(--transition);
}

.nav-links a:hover { background: var(--c-light); }
.nav-links .current { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    background: var(--c-footer-bg);
    color: rgba(255, 255, 255, 0.8);
    padding-top: 3.5rem;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    flex: 1;
    min-width: 180px;
}

.footer-brand img { max-height: 48px; filter: brightness(0) invert(1); opacity: 0.85; }

.footer-site-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--c-white);
}

.footer-tagline {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.65;
}

.footer-nav { flex: 2; }

.footer-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
}

.footer-nav-list li a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition);
}

.footer-nav-list li a:hover { color: var(--c-white); }

.footer-bottom {
    padding: 1.25rem 0;
    text-align: center;
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .header-inner {
        grid-template-columns: auto auto 1fr;
        grid-template-areas: "logo toggle lang";
    }

    .site-logo  { grid-area: logo; }
    .nav-toggle { grid-area: toggle; display: flex; }
    .lang-selector { grid-area: lang; justify-self: end; }

    .main-nav {
        display: none;
        position: fixed;
        inset: var(--header-height) 0 0 0;
        background: var(--c-white);
        overflow-y: auto;
        padding: 1.5rem;
        border-top: 1px solid var(--c-border);
        z-index: 99;
    }

    .main-nav.is-open { display: flex; flex-direction: column; align-items: flex-start; }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        width: 100%;
    }

    .nav-list li { width: 100%; }
    .nav-list li a { font-size: 1rem; padding: 0.75rem 1rem; width: 100%; }
}

@media (max-width: 640px) {
    .footer-inner { flex-direction: column; gap: 2rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .hero-quote { padding: 3.5rem 0; }
    .map-section { padding: 2.5rem 0; }
    .main-content { padding: 2rem 0 3rem; }
}
