/* Modern and Minimalist Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #fcfcfc;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --accent-color: #3b82f6;
    /* Soft modern blue */
    --border-color: #eaeaea;
    --nav-bg: rgba(255, 255, 255, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

main ul, main ol {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

main li {
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2563eb;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

nav a:hover,
nav a.active {
    color: var(--text-primary);
}

nav a:hover::after,
nav a.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Main Content */
main {
    flex: 1;
    padding: 4rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    margin: 0 auto 2rem auto;
    font-size: 1.2rem;
}

section {
    margin-bottom: 4rem;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 600px;
    background-color: #f0f0f0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Simple Responsive adjustments */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .map-container {
        height: 400px;
    }
}

/* --- Dark Mode Theme --- */
[data-theme='dark'] {
    --bg-color: #121212;
    --text-primary: #f0f0f0;
    --text-secondary: #aaaaaa;
    --accent-color: #60a5fa;
    --border-color: #333333;
    --nav-bg: rgba(18, 18, 18, 0.9);
}

/* Adjust map container and boxes for dark mode */
[data-theme='dark'] .map-container,
[data-theme='dark'] input,
[data-theme='dark'] textarea {
    background-color: #1e1e1e !important;
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Theme Toggle Slider */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 2rem;
}

.theme-switch-wrapper::before,
.theme-switch-wrapper::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.3s ease;
}

.theme-switch-wrapper::before {
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E");
}

.theme-switch-wrapper::after {
    margin-left: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

[data-theme='dark'] .theme-switch-wrapper::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E");
}

[data-theme='dark'] .theme-switch-wrapper::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 18px;
    left: 3px;
    position: absolute;
    transition: .4s;
    width: 18px;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* SDG Icons */
.sdg-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
    gap: 1.5rem;
}

.sdg-link {
    display: inline-block;
}

.sdg-icon {
    width: 110px;
    height: 110px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sdg-link:hover .sdg-icon {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

[data-theme='dark'] .sdg-icon {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .sdg-link:hover .sdg-icon {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Source Links Animation */
.source-link {
    color: var(--text-secondary) !important;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 -4px;
    text-decoration: none;
}

.source-link:hover {
    background-color: #e0f2fe; /* Light blue */
    color: var(--accent-color) !important;
    text-decoration: underline !important;
}

[data-theme='dark'] .source-link:hover {
    background-color: rgba(96, 165, 250, 0.2); /* Darker mode light blue */
}

/* Gallery and Lightbox */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

[data-theme='dark'] .gallery-item {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .gallery-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Center the 5th item if it's the last in a 2-col grid */
.gallery-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 50%;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-item:last-child:nth-child(odd) {
        max-width: 100%;
    }
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    color: #bbb;
}