@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Premium Dark Palette */
    --bg-primary: #111827;   /* тёмный, но не чисто чёрный */
    --bg-secondary: #1f2937; /* чуть светлее для карточек/блоков */
    --bg-glass: rgba(23, 23, 23, 0.7);

    --text-primary: #d1d5db;    /* светло-серый, чуть темнее заголовков */
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --heading-color: #ede9fe;   /* почти белый с лёгким фиолетовым оттенком */

    --accent-primary: #38bdf8;  /* голубой */
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    --accent-hover: #0ea5e9;

    --border-subtle: rgba(148, 163, 184, 0.3);
    --border-focus: rgba(56, 189, 248, 0.6);

    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.7), 0 4px 6px -2px rgba(15, 23, 42, 0.6);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.35);

    /* Layout */
    --container-width: 1200px;
    --header-height: 70px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    width: 100%;
}

.fade-in:not(:empty) {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1rem;
    text-align: center;
}

h1 {
    font-size: 2.6rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    width: 100%;
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

.app-main p,
.app-main li {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-primary);
}

.app-main img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

/* Content links (inside main area) */
.app-main a {
    color: var(--accent-primary);
}

.app-main a:not(:has(img)) {
    text-decoration: underline;
}

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

button {
    cursor: pointer;
    font-family: inherit;
}

/* Disable gallery clicks until JS is ready */
a.glightbox,
a.glightbox-inline,
a.glightbox-gallery {
    pointer-events: none;
    cursor: default;
}

body.gallery-ready a.glightbox,
body.gallery-ready a.glightbox-inline,
body.gallery-ready a.glightbox-gallery {
    pointer-events: auto;
    cursor: pointer;
}

/* Layout: Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--heading-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Layout: Main */
.app-main {
    padding-top: calc(var(--header-height) + 2rem);
    min-height: calc(100vh - 80px);
    /* rough footer height */
    padding-bottom: 4rem;
}

/* Layout: Footer */
.app-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 0;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.9rem;
}

/* Article galleries */
.article-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin: 1rem 0;
}

.article-gallery a {
    display: block;
}

.article-gallery img {
    display: block;
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    outline: none;
}

#show_map_btn {
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(124, 58, 237, 0.39);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.23);
}

/* Components: Cards (Generic) */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

/* Responsive Grid System for Auto-generated Content */
.fade-in {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: justify;
    justify-content: center;
}

.fade-in>* {
    width: 100%;
    /* Default block behavior for non-grid items */
}

/* Travel Grid Cards & Homepage Cards */
/* Target links that contain images - interpreted as cards */
.fade-in > a:not(.glightbox):has(img) {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    padding: 1.5rem;
    text-align: center;

    /* Desktop: 3 columns */
    width: calc(33.333% - 1.34rem);
}

.fade-in > a:not(.glightbox):has(img):hover {
    transform: translateY(-5px);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.fade-in > a:not(.glightbox):has(img) img {
    width: calc(100% + 3rem);
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-subtle);
    max-width: none;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .fade-in > a:not(.glightbox):has(img) {
        width: calc(50% - 1rem);
        /* 2 columns */
    }
}

@media (max-width: 600px) {
    .fade-in > a:not(.glightbox):has(img) {
        width: 100%;
        /* 1 column */
    }

    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 2rem;
        /* Responsive Title */
    }
}
