:root {
    --primary: #1c322c;
    --primary-hover: #152620;
    --secondary: #2b7a78;
    --secondary-hover: #236663;
    --accent: #c45c26;
    --accent-soft: #f4e6dc;
    --success: #2f7d4a;
    --danger: #b42318;
    --warning: #b45309;

    --background: #f4f1ea;
    --surface: #fffcf7;
    --surface-muted: #ece7dd;
    --text: #1f2a26;
    --text-light: #5c6b66;
    --border: #ddd4c6;
    --border-strong: #c9bead;

    --shadow: 0 1px 2px rgba(28, 50, 44, 0.06), 0 8px 24px rgba(28, 50, 44, 0.06);
    --shadow-hover: 0 8px 28px rgba(28, 50, 44, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --spacing: 1rem;
    --header-h: 72px;
    --max: 1180px;
    --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
    --display: "Fraunces", "Georgia", serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(43, 122, 120, 0.08), transparent 50%),
        var(--background);
    min-height: 100vh;
}

img,
iframe {
    max-width: 100%;
}

a {
    color: var(--secondary);
}

:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}

::selection {
    background: rgba(43, 122, 120, 0.22);
}

/* Header */
.site-header {
    background: color-mix(in srgb, var(--primary) 88%, black);
    color: #f6f3ee;
    padding: 0.7rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

.nav-container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--spacing);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    min-height: 52px;
}

.logo {
    color: #fff;
    text-decoration: none;
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem 1.25rem;
    flex-wrap: wrap;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.35rem 0.15rem;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #fff;
}

/* Hero */
.hero {
    background:
        linear-gradient(160deg, rgba(28, 50, 44, 0.55), rgba(28, 50, 44, 0.2)),
        linear-gradient(135deg, #234e4a 0%, #1c322c 48%, #3d2a1f 100%);
    color: white;
    text-align: center;
    padding: clamp(3rem, 8vw, 5.5rem) 1.25rem;
}

.hero h1 {
    font-family: var(--display);
    font-size: clamp(2rem, 4.5vw, 3.15rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.hero p {
    font-size: 1.08rem;
    opacity: 0.88;
    max-width: 36rem;
    margin: 0 auto;
}

/* Container */
.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.25rem var(--spacing);
}

main {
    min-height: calc(100vh - 220px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    line-height: 1.2;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background: var(--secondary-hover);
    box-shadow: var(--shadow);
}

.btn-submit {
    background: var(--success);
    color: white;
}

.btn-submit:hover {
    background: #25633b;
}

.btn-cancel {
    background: var(--surface-muted);
    color: var(--text);
    border-color: var(--border);
}

.btn-cancel:hover {
    background: #e4ddd2;
}

.btn-block {
    width: 100%;
    margin-top: 0.75rem;
}

/* Form */
.hike-form {
    background: var(--surface);
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: var(--radius);
    margin-top: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(43, 122, 120, 0.18);
}

.form-group textarea {
    resize: vertical;
    min-height: 7rem;
}

/* Hikes Grid */
.hikes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.75rem;
}

.hike-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

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

.hike-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hike-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: var(--surface-muted);
}

.hike-thumbnail iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hike-info {
    padding: 1.2rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.hike-info h2 {
    font-family: var(--display);
    font-size: 1.28rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.hike-location,
.hike-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.hike-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 0.4rem 0.65rem;
    margin: 0.85rem 0;
    padding: 0.7rem 0.75rem;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.hike-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.55;
}

.hike-author {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: auto;
    padding-top: 0.65rem;
    font-style: italic;
}

/* Hike Detail */
.hike-detail {
    max-width: 860px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

.hike-article h1 {
    font-family: var(--display);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    margin-bottom: 0.75rem;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.hike-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    margin-bottom: 1.75rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.1rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #111;
}

.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hike-description-full {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 2rem;
}

.map-container {
    height: min(62vh, 480px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

#map {
    height: 100%;
    width: 100%;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.86);
    padding: 2rem 0;
    margin-top: 3.5rem;
}

.footer-content {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--spacing);
    text-align: center;
}

.footer-content p {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}

/* Login */
.login-container {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-box {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    font-family: var(--display);
    font-size: 1.85rem;
    margin-bottom: 0.35rem;
    color: var(--primary);
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.75rem;
}

.login-form .form-group {
    margin-bottom: 1.2rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.login-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

.alert-error {
    background: #fdecea;
    color: #8a1c14;
    border: 1px solid #f3c5c0;
}

.alert-success {
    background: #e8f5ee;
    color: #1b5c34;
    border: 1px solid #c5e4d0;
}

/* Admin */
.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.75rem;
}

.welcome-message {
    font-weight: 600;
    color: var(--primary);
}

.btn-logout,
.nav-logout {
    background: var(--danger);
    color: white;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
}

.btn-logout:hover,
.nav-logout:hover {
    background: #912018;
}

.nav-login,
.nav-logout {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
}

.nav-login {
    background: var(--secondary);
    color: #fff !important;
}

.nav-login:hover {
    background: var(--secondary-hover);
    color: #fff;
}

/* Elevation badges */
.elevation-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.4rem;
    letter-spacing: 0.02em;
}

.elevation-status.original {
    background: #e7f6ec;
    color: #1b5c34;
}

.elevation-status.generated {
    background: var(--accent-soft);
    color: #8a3d12;
}

.elevation-status.interpolated {
    background: #fdecea;
    color: #8a1c14;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 0.4rem;
        padding-bottom: 0.55rem;
    }

    .nav-menu {
        width: 100%;
        gap: 0.5rem 1rem;
    }

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

    .hike-meta {
        flex-direction: column;
        gap: 0.35rem;
    }

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

    .admin-controls {
        flex-direction: column;
        text-align: center;
    }

    .login-box {
        padding: 1.5rem 1.2rem;
    }

    .map-container {
        height: 320px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}