/* ============================================
   Turmwächter - Lost Places & Aussichtspunkte
   Grainy, dark, atmospheric design
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: rgba(13,13,13,0.65);
    --color-bg-card: rgba(26,26,26,0.6);
    --color-bg-hover: rgba(36,36,36,0.6);
    --color-text: #d4d4d4;
    --color-text-muted: #8a8a8a;
    --color-accent: #b8956a;
    --color-accent-dark: #9a7c58;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-serif: 'Courier New', Courier, monospace;
}

/* Background on the root html element so it reliably sits behind all content */
html {
    /* darken bg by layering a semi-transparent black gradient over the image */
    background-image: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url('../img/bg.jpg');
    background-attachment: fixed;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #0d0d0d;
}

/* Film Grain Noise Texture */
body::before {
    content: '';
    position: fixed;
    inset: 0; /* full viewport */
    pointer-events: none;
    opacity: 0.05;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 400% 400%;
    /* static grain: no animation to avoid visible movement */
    background-position: 0% 0%;
}

body {
    background: transparent !important; /* let html background show through */
    font-family: var(--font-sans);
    color: var(--color-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

/* Header */
.header {
    background: rgba(26, 26, 26, 0.85); /* slightly translucent */
    border-bottom: 1px solid rgba(42,42,42,0.6);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.logo {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-accent);
    text-decoration: none;
    font-family: var(--font-serif);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav {
    display: flex;
    gap: 1.8rem;
    flex-wrap: wrap;
}

.nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
    text-transform: lowercase;
}

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

/* Main */
.main {
    flex: 1;
}

/* Hero Section */
.hero {
    background: linear-gradient(180deg, rgba(26,26,26,0.45) 0%, rgba(13,13,13,0.45) 100%);
    padding: 8rem 0 6rem;
    text-align: center;
    border-bottom: 1px solid rgba(42,42,42,0.6);
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.hero > .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-family: var(--font-serif);
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Button */
.btn {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: var(--color-accent);
    color: #0d0d0d;
    text-decoration: none;
    border-radius: 2px;
    font-weight: 500;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border: 1px solid var(--color-accent);
}

.btn:hover {
    background: transparent;
    color: var(--color-accent);
}

/* Places Grid */
/* Let the global background image show through */
.latest-places,
.places-section {
    padding: 5rem 0;
    background: transparent; /* allow body background-image to be visible */
}

.latest-places h2,
.page-header h1 {
    font-size: 2.2rem;
    font-family: var(--font-serif);
    color: var(--color-accent);
    margin-bottom: 3.5rem;
    text-align: center;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.places-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
}

/* Place Card */
.place-card {
    background: var(--color-bg-card);
    border-radius: 0;
    overflow: hidden;
    transition: all 0.4s;
    border: 1px solid #222;
    position: relative;
}

.place-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 1;
}

.place-card:hover::before {
    opacity: 1;
}

.place-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border-color: var(--color-accent);
}

.place-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.place-card-image {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    position: relative;
    filter: grayscale(20%) contrast(1.1);
    transition: filter 0.4s;
}

.place-card:hover .place-card-image {
    filter: grayscale(0%) contrast(1.15);
}

.place-card-content {
    padding: 1.8rem;
    background: var(--color-bg-card);
}

.place-card-content h3 {
    font-size: 1.4rem;
    font-family: var(--font-serif);
    color: var(--color-accent);
    margin-bottom: 0.8rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.place-card-content p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.place-card-date {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Page Header */
.page-header {
    background: var(--color-bg-card);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Place Detail */
.place-detail-header {
    background: rgba(26,26,26,0.6); /* semi-transparent so BG shows through */
    padding: 3.5rem 0 2.5rem;
    border-bottom: 1px solid rgba(42,42,42,0.8);
}

.back-link {
    display: inline-block;
    color: var(--color-accent);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.3s;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.back-link:hover {
    color: var(--color-accent-dark);
}

.place-detail-header h1 {
    font-size: 2.8rem;
    font-family: var(--font-serif);
    color: var(--color-accent);
    margin-bottom: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
}

.place-date {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Gallery */
.gallery {
    background: rgba(0,0,0,0.45); /* let bg image show through */
    padding: 0;
}

.gallery-main {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: rgba(0,0,0,0.6);
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: contrast(1.05);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-accent);
    border: 1px solid rgba(184, 149, 106, 0.3);
    font-size: 2.5rem;
    width: 55px;
    height: 55px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 300;
}

.gallery-nav:hover {
    background: rgba(184, 149, 106, 0.2);
    border-color: var(--color-accent);
}

.gallery-nav-prev {
    left: 1.5rem;
}

.gallery-nav-next {
    right: 1.5rem;
}

/* Thumbnails strip */
.gallery-thumbnails {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding: 0 1.5rem 1.5rem;
    overflow-x: auto;
    justify-content: center;
    background: rgba(0,0,0,0.45);
}

.gallery-thumbnail {
    width: 110px;
    height: 75px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #222;
    transition: all 0.3s;
    flex-shrink: 0;
    filter: grayscale(40%);
}

.gallery-thumbnail:hover {
    border-color: var(--color-accent);
    filter: grayscale(0%);
}

.gallery-thumbnail.active {
    border-color: var(--color-accent);
    filter: grayscale(0%);
}

/* Place Content */
.place-detail-content {
    padding: 4rem 0;
    background: transparent; /* allow body background-image to be visible */
}

.content {
    max-width: 800px;
    margin: 0 auto;
}

.content h1,
.content h2,
.content h3 {
    font-family: var(--font-serif);
    color: var(--color-accent);
    margin: 2.5rem 0 1.2rem;
    font-weight: 400;
    letter-spacing: 1px;
}

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

.content h2 {
    font-size: 1.7rem;
}

.content h3 {
    font-size: 1.4rem;
}

.content p {
    margin-bottom: 1.6rem;
    line-height: 1.8;
    color: var(--color-text);
}

.content a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.content a:hover {
    border-bottom-color: var(--color-accent);
}

.content strong {
    color: var(--color-accent);
    font-weight: 500;
}

/* Site Content Pages */
.site-content {
    padding: 4rem 0;
    background: transparent; /* allow body background-image to be visible */
}

.site-content .content {
    max-width: 800px;
    margin: 0 auto;
}

/* Error Page */
.error-page {
    text-align: center;
    padding: 8rem 2rem;
}

.error-code {
    font-size: 9rem;
    font-weight: 300;
    color: var(--color-accent);
    line-height: 1;
    font-family: var(--font-serif);
    letter-spacing: 4px;
}

.error-page h2 {
    font-size: 2rem;
    margin: 1.5rem 0;
    color: var(--color-text);
    font-weight: 400;
}

.error-page p {
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
}

/* Footer */
.footer {
    background: rgba(26, 26, 26, 0.85); /* slightly translucent so bg peeks through */
    border-top: 1px solid rgba(42,42,42,0.8);
    padding: 2.5rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--color-text-muted);
}

.footer p {
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: 300;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }

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

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

    .place-detail-header h1 {
        font-size: 2rem;
    }

    .nav {
        gap: 1.2rem;
        font-size: 0.85rem;
    }

    .gallery-nav {
        font-size: 1.8rem;
        width: 45px;
        height: 45px;
    }

    .error-code {
        font-size: 5rem;
    }

    .logo {
        font-size: 1.1rem;
    }
}

/* Final fallbacks */
body { background-color: transparent; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(13,13,13,0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(42,42,42,0.6);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}
