:root {
    /* Core Palette - Green Focused */
    --primary: #00A86B;
    --primary-dark: #008f5a;
    --primary-light: #66D2A6;
    
    /* Light Theme (Default) */
    --bg: #F5FBF8;
    --card: #ffffff;
    --text: #0A261A;
    --muted: #526D63;
    --stroke: rgba(0, 168, 107, 0.15);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 4px 6px -1px rgba(0, 168, 107, 0.05);
    --shadow-lg: 0 20px 40px -5px rgba(0, 50, 30, 0.08);
    --hero-overlay: linear-gradient(to bottom, rgba(245, 251, 248, 0.85), rgba(245, 251, 248, 0.95));
    --nav-bg: rgba(245, 251, 248, 0.85);
    
    /* Accent aliases */
    --accent: var(--primary);
    --accent-soft: var(--primary-light);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg: #051a10;
    --card: rgba(10, 30, 20, 0.6);
    --text: #f5f5f5;
    --muted: #a0a5b8;
    --stroke: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.55);
    --hero-overlay: linear-gradient(to bottom, rgba(5, 26, 16, 0.85), rgba(5, 26, 16, 0.95));
    --nav-bg: rgba(5, 26, 16, 0.85);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    width: 100%;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    position: relative;
    overflow-x: hidden;
}

.noise-overlay {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='%23888888' fill-opacity='0.03' d='M0 0h20v20H0z'/%3E%3C/svg%3E");
    opacity: 0.4;
    z-index: 0;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
    padding: 5rem clamp(1.5rem, 4vw, 4rem);
    position: relative;
    isolation: isolate;
    background-image: var(--hero-overlay), url('../images/san-carlos-city-pangasinan-philippines-102760-AoPZO6jQ4Nhz1DzJ.avif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background-image 0.3s ease;
    border-bottom-left-radius: 3rem;
    border-bottom-right-radius: 3rem;
    box-shadow: 0 20px 60px rgba(5, 26, 16, 0.25);
}

.hero::after {
    content: "";
    position: absolute;
    top: 15%;
    left: 55%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(0, 168, 107, 0.35), transparent 70%);
    filter: blur(40px);
    z-index: -1;
    pointer-events: none;
}

img {
    max-width: 100%;
    height: auto;
}

.hero__content h1 {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.hero__lead {
    max-width: 620px;
    color: var(--muted);
    line-height: 1.6;
}

.hero__eyebrow,
.label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    color: var(--accent-soft);
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.85rem 1.8rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text);
    transition: all 0.2s ease;
}

.btn--primary {
    background: linear-gradient(120deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 168, 107, 0.25);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 168, 107, 0.35);
}

.btn--ghost {
    border-color: var(--stroke);
    background: var(--glass);
    color: var(--text);
}

.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 168, 107, 0.05);
}

.btn-login {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    transition: all 0.2s ease;
    background: var(--glass);
}

.btn-login:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.hero__statboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-self: center;
}

.hero__statboard article {
    background: var(--card);
    padding: 1.2rem;
    border-radius: 1.2rem;
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.hero__statboard h3 {
    font-size: 1.8rem;
    margin: 0.3rem 0 0;
}

main {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding: 0 clamp(1.5rem, 4vw, 4rem) 4rem;
    position: relative;
    z-index: 1;
    margin-top: -2rem;
}

.atlas {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
    gap: 2rem;
    background: var(--card);
    border-radius: 2rem;
    border: 1px solid var(--stroke);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    box-shadow: var(--shadow-lg);
}

.atlas__panel {
    background: var(--glass);
    border-radius: 1.6rem;
    border: 1px solid var(--stroke);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    height: 100%;
    max-height: 85vh;
}

.atlas__panel__header h2 {
    margin: 0.3rem 0 0;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.filters input,
.filters select {
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 0.85rem 1rem;
    color: var(--text);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.1);
}

.filters select {
    cursor: pointer;
}

.filters select option {
    background-color: var(--bg);
    color: var(--text);
}

.atlas__panel__body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 0.3rem;
}

.barangay-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.barangay-card {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 1rem;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 0; /* Allow flex item to shrink below content size */
}

.barangay-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.barangay-card.active {
    border-color: var(--primary);
    background: rgba(0,168,107,0.04);
    box-shadow: 0 0 0 1px var(--primary);
}

.barangay-card h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.barangay-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.barangay-card .tag {
    align-self: flex-start;
    font-size: 0.65rem;
    padding: 0.25rem 0.75rem;
    background: var(--stroke);
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--glass-border);
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--text);
}

.atlas__map {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--glass);
    border-radius: 1.6rem;
    border: 1px solid var(--stroke);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.map__chrome {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.map__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-width: 100%;
}

.map__legend span {
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.map {
    width: 100%;
    height: 520px;
    border-radius: 1.5rem;
    border: 1px solid var(--stroke);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

.map__info {
    background: var(--card);
    border-radius: 1.5rem;
    border: 1px solid var(--stroke);
    padding: 0;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.info-cover {
    width: 100%;
    height: 500px;
    min-height: 500px;
    flex-shrink: 0;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.info-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.info-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-content h3 {
    font-size: 2rem;
    margin: 0;
    line-height: 1.1;
    font-family: "Space Grotesk", sans-serif;
}

.barangay-info-box {
    margin: 1rem 0;
    padding: 1.2rem;
    background: var(--glass);
    border-radius: 1rem;
    border: 1px solid var(--stroke);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.barangay-info-item small {
    color: var(--muted);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.barangay-info-item strong {
    color: var(--text);
    font-size: 1rem;
    display: block;
}

.info-content ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.8rem;
}

.info-content li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--muted);
    line-height: 1.5;
}

.info-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.leaflet-tooltip-top:before {
    border-top-color: var(--primary);
}

.muted {
    color: var(--muted);
}

.insights {
    background: var(--card);
    border-radius: 2rem;
    border: 1px solid var(--stroke);
    padding: clamp(1.8rem, 3vw, 2.8rem);
    box-shadow: var(--shadow-lg);
}

.insights header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.insights__grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.insight-card {
    border-radius: 1.2rem;
    padding: 1.4rem;
    background: var(--glass);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.insight-card:hover {
    border-color: var(--primary);
    background: rgba(0, 168, 107, 0.05);
    box-shadow: var(--shadow-sm);
}

.insight-card h4 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.footer {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

.footer p {
    margin: 0.2rem 0;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.75rem 0;
    box-shadow: 0 10px 40px rgba(5, 26, 16, 0.15);
}

.navbar__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--text);
}

.navbar__brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    display: grid;
    place-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.navbar__brand-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.navbar__brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.navbar__brand-copy span {
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--muted);
}

.navbar__brand-copy strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.1rem;
}

.navbar__navgroup {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

.navbar__menu {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.navbar__menu li a {
    display: inline-flex;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    transition: background 0.2s ease, color 0.2s ease;
}

.navbar__menu li a:hover,
.navbar__menu li a.active {
    color: var(--text);
    background: rgba(0, 168, 107, 0.12);
}

.navbar__cta {
    white-space: nowrap;
    padding-inline: 1.4rem;
    font-size: 0.85rem;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
    border-color: var(--primary-light);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-login {
    border-radius: 12px;
    padding: 0.45rem 1rem;
    backdrop-filter: blur(8px);
}

.navbar__toggle {
    background: var(--glass);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.6rem;
    display: none;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.hamburger {
    width: 20px;
    height: 2px;
    background: var(--text);
    position: relative;
    display: block;
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s ease;
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

/* History Section */
.history-section {
    padding: 6rem 1.5rem;
    background: linear-gradient(180deg, rgba(0,168,107,0.04), var(--bg));
    position: relative;
}

.history__container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card);
    border-radius: 2.5rem;
    padding: clamp(2rem, 4vw, 3rem);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--stroke);
}

.history__header {
    margin-bottom: 3rem;
    text-align: center;
}

.history__header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.history__content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--muted);
}

.history__block {
    margin-bottom: 3rem;
}

.history__block h3 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.history__block strong {
    color: var(--text);
    font-weight: 600;
}

.history__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.history__gallery figure {
    margin: 0;
}

.history__gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    transition: transform 0.3s ease;
}

.history__gallery img:hover {
    transform: scale(1.03);
}

.history__gallery figcaption {
    font-size: 0.85rem;
    color: var(--accent-soft);
    margin-top: 0.5rem;
    text-align: center;
}

/* Contact Section */
.contact-section {
    padding: 6rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 168, 107, 0.05), transparent);
    border-top: 1px solid var(--stroke);
}

.contact__container {
    max-width: 1000px;
    margin: 0 auto;
}

.contact__header {
    margin-bottom: 4rem;
    text-align: center;
}

.contact__header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact__info h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.contact__info p {
    color: var(--muted);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.contact__info a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
}

.contact__form {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--stroke);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--stroke);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Tourism Section */
.tourism-section {
    padding: 6rem 1.5rem;
    background: linear-gradient(to bottom, var(--bg), rgba(0, 168, 107, 0.05));
}

.tourism__container {
    max-width: 1000px;
    margin: 0 auto;
}

.tourism__header {
    margin-bottom: 4rem;
    text-align: center;
}

.tourism__header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.highlight-card {
    display: flex;
    gap: 4rem;
    align-items: center;
    margin-bottom: 6rem;
    background: var(--card);
    border-radius: 2rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.highlight-card:last-child {
    margin-bottom: 0;
}

.highlight-card--reverse {
    flex-direction: row-reverse;
}

.highlight-card__image {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--stroke);
    aspect-ratio: 4/3;
}

.highlight-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.highlight-card:hover .highlight-card__image img {
    transform: scale(1.05);
}

.highlight-card__content {
    flex: 1;
}

.highlight-card__content h3 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.highlight-card__content p {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

/* Assets Section */
.assets-section {
    padding: 6rem 1.5rem;
    background: var(--card);
}

.assets__container {
    max-width: 1200px;
    margin: 0 auto;
}

.assets__header {
    text-align: center;
    margin-bottom: 4rem;
}

.assets__header .label {
    color: var(--primary);
    font-weight: 600;
}

.assets__header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.assets__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.asset-card {
    padding: 2rem;
    border: 1px solid var(--stroke);
    border-radius: 1rem;
    background: var(--bg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.asset-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.asset-card h3 {
    color: var(--primary);
    margin-top: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.3rem;
}

.asset-card ul {
    padding-left: 1.2rem;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 0;
}

.asset-card li {
    margin-bottom: 0.5rem;
}

/* Events Section */
.events-section {
    padding: 6rem 1.5rem;
    background: var(--bg);
}

.events__container {
    max-width: 1200px;
    margin: 0 auto;
}

.events__header {
    text-align: center;
    margin-bottom: 4rem;
}

.events__header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.events__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.event-card {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 1.2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.event-card__image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.event-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-card__image img {
    transform: scale(1.05);
}

.event-card__date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.event-card__content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-card__content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    font-family: "Space Grotesk", sans-serif;
}

.event-card__content .location {
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.event-card__content p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Gallery Section */
.gallery-section {
    padding: 6rem 1.5rem;
    background: linear-gradient(to top, var(--bg), rgba(0, 168, 107, 0.03));
}

.gallery__container {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery__header {
    text-align: center;
    margin-bottom: 4rem;
}

.gallery__header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
}

.gallery__item {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.gallery__item--large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery__item:hover img {
    transform: scale(1.05);
}

.gallery__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery__item:hover .gallery__overlay {
    opacity: 1;
}

.gallery__overlay span {
    color: var(--primary-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.gallery__overlay h3 {
    color: #fff;
    margin: 0;
    font-size: 1.2rem;
}

/* Event Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.event-modal-content {
    background-color: var(--card);
    width: 90%;
    max-width: 800px;
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    border: 1px solid var(--stroke);
}

@keyframes modalSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.close-modal:hover {
    transform: scale(1.1);
}

.event-modal-body {
    display: flex;
    flex-direction: column;
}

.event-modal-image {
    width: 100%;
    height: 300px;
    position: relative;
}

.event-modal-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-modal-details {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-modal-media img,
.event-modal-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-date-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.event-modal-details h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2rem;
    margin: 0 0 1rem;
    color: var(--text);
}

.event-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.event-modal-details p {
    line-height: 1.8;
    color: var(--muted);
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .event-modal-body {
        flex-direction: row;
    }
    .event-modal-media {
        width: 45%;
        height: auto;
        min-height: 400px;
    }
    .event-modal-details {
        width: 55%;
        padding: 3rem;
    }
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .navbar__container {
        padding: 0 1rem;
    }

    .navbar__brand-logo {
        width: 48px;
        height: 48px;
    }

    .navbar__brand-copy strong {
        font-size: 1rem;
    }

    .navbar__navgroup {
        display: none;
    }

    .navbar__actions {
        gap: 0.35rem;
        margin-left: auto;
    }

    .navbar__toggle {
        display: inline-flex;
    }

    /* Prevent background scroll when mobile menu is open */
    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .atlas {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        display: flex;
        flex-direction: column-reverse;
        padding: 1rem;
    }

    .atlas__map {
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .atlas__panel {
        height: auto;
        max-height: none;
        padding: 1rem;
    }
    
    .atlas__panel__body {
        height: 300px;
        max-height: none;
        flex: none;
        overflow-y: auto;
        overscroll-behavior: contain; /* Prevent scroll chaining */
        border: 1px solid var(--stroke); /* Visual boundary */
        border-radius: 1rem;
        padding: 0.5rem;
    }
    
    .map {
        height: 50vh;
        min-height: 350px;
    }

    .assets__grid {
        grid-template-columns: 1fr; /* Stack cards on mobile */
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 6rem 1.5rem 3rem;
        text-align: center;
        gap: 2rem;
        justify-items: center;
    }

    .hero__content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .hero__content h1 {
        font-size: 2.2rem;
    }

    .hero__cta {
        justify-content: center;
        margin-top: 1.5rem;
    }

    .contact__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .highlight-card {
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 4rem;
    }

    .highlight-card--reverse {
        flex-direction: column;
    }

    .highlight-card__image {
        width: 100%;
        aspect-ratio: 16/9;
    }

    .events__grid {
        grid-template-columns: 1fr;
    }
    
    .gallery__grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar__container {
        max-width: 100%;
        padding: 0 1rem;
        margin: 0;
        gap: 0.5rem;
        height: 50px; /* Even smaller for very small screens */
    }

    .navbar__brand {
        flex: 1;
        min-width: 0;
    }

    .navbar__brand-logo {
        width: 40px;
        height: 40px;
    }

    .navbar__brand-copy span {
        font-size: 0.55rem;
    }

    .navbar__brand-copy strong {
        font-size: 0.9rem;
    }

    .navbar__actions {
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .theme-toggle svg {
        width: 16px;
        height: 16px;
    }

    .btn-login {
        padding: 0.3rem 0.65rem;
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .hero {
        padding: 4.5rem 1rem 2rem;
        gap: 1.5rem;
    }

    .hero__content h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .hero__lead {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .hero__cta {
        margin-top: 1rem;
    }

    .assets__header h2,
    .events__header h2,
    .gallery__header h2 {
        font-size: 1.8rem;
    }
    
    .atlas__panel__body {
        height: 300px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
        padding: 0.7rem 1.5rem;
    }

    .map {
        height: 300px;
    }
    
    .history-section,
    .tourism-section,
    .contact-section,
    .assets-section {
        padding: 3rem 1rem;
    }
}

/* Routes Section */
.routes-section {
    padding: 6rem 1.5rem;
    background: var(--bg);
}

.routes__container {
    max-width: 1200px;
    margin: 0 auto;
}

.routes__header {
    text-align: center;
    margin-bottom: 4rem;
}

.routes__header h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    margin-top: 0.5rem;
}

.routes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.route-card {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.route-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.route-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 168, 107, 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.route-card h3 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.5rem;
    margin: 0 0 1rem;
    color: var(--primary);
}

.route-card p {
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.route-stops {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    text-align: left;
    width: 100%;
}

.route-stops li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--stroke);
    color: var(--text);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.route-stops li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
}

.route-stops li:last-child {
    border-bottom: none;
}

.route-duration {
    margin-top: auto;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--stroke);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

/* Mobile Navigation (New) */
.mobile-nav {
    display: none;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    justify-content: flex-end;
    backdrop-filter: blur(4px);
}

.mobile-menu-overlay.active {
    display: flex;
}

.mobile-menu-content {
    background: var(--bg);
    width: 80%;
    max-width: 300px;
    height: 100%;
    padding: 2rem;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
    border-left: 1px solid var(--stroke);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mobile-menu-header h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.5rem;
}

.close-mobile-menu {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text);
    padding: 0;
    line-height: 1;
}

.mobile-menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-menu-links a {
    text-decoration: none;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 500;
    display: block;
    transition: color 0.2s ease;
}

.mobile-menu-links a:hover {
    color: var(--primary);
}

/* Mobile View Overrides */
@media (max-width: 900px) {
    .mobile-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }

    /* Adjust Navbar for Mobile */
    .navbar__container {
        justify-content: space-between;
        height: 60px; /* Fixed height for mobile navbar */
        padding: 0 1rem;
        gap: 0.75rem;
    }
    
    .navbar__logo img {
        height: 40px; /* Smaller logo for mobile */
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
    
    .navbar__actions {
        gap: 0.5rem;
    }

    .btn-login {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .navbar__toggle {
        display: block;
    }

    /* Ensure Theme Toggle is visible and positioned correctly */
    .theme-toggle {
        display: flex !important;
        margin-left: 0;
    }
}
