:root {
    --max-width: 1400px;
    --gap: 4px;
    --text: #111;
    --muted: #777;
    --bg: #fff;
    --border: #eee;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-header__nav {
    display: flex;
}

.site-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.site-header__nav a {
    margin-left: 28px;
    font-size: 14px;
    color: var(--muted);
}

.site-header__nav a:hover { color: var(--text); }

/* ---------- Burger ---------- */
.site-header__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.site-header__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform 0.25s, opacity 0.25s;
}

.site-header__burger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header__burger.is-active span:nth-child(2) {
    opacity: 0;
}

.site-header__burger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Gallery grid (главная) ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
}

.gallery-card { position: relative; overflow: hidden; }

.gallery-card__frame {
    display: block;
    width: 100%;
    background: #f2f2f2;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-card img.is-loaded { opacity: 1; }

.gallery-card__caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-card:hover .gallery-card__caption { opacity: 1; }

.gallery-card__caption h3 { margin: 0; font-size: 16px; font-weight: 500; }
.gallery-card__caption span { font-size: 12px; opacity: 0.8; }

/* ---------- Category filter ---------- */
.category-bar {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 8px 0 24px;
    font-size: 14px;
    color: var(--muted);
}

.category-bar a.is-active { color: var(--text); font-weight: 600; }

/* ---------- Photo feed (страница галереи) ---------- */
.gallery-header {
    max-width: 720px;
    margin: 48px auto 32px;
    padding: 0 24px;
    text-align: center;
}

.gallery-header h1 { font-size: 28px; margin-bottom: 8px; font-weight: 600; }
.gallery-header .meta { color: var(--muted); font-size: 14px; }
.gallery-header p { color: var(--muted); margin-top: 16px; line-height: 1.6; }

.photo-feed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px 80px;
}

.photo-feed__item { width: 100%; background: #f2f2f2; }

.photo-feed__item img {
    width: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.photo-feed__item img.is-loaded { opacity: 1; }

.loader-sentinel { height: 1px; }

/* ---------- Portfolio Mosaic Grid ---------- */
.gallery-mosaic {
    columns: 4;
    column-gap: 12px;
    padding-top: 12px;
    padding-bottom: 48px;
    padding-left: 24px;
    padding-right: 24px;
}

.mosaic-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.mosaic-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.2s;
    border-radius: 4px;
}

.mosaic-item:hover::after {
    background: rgba(0,0,0,0.15);
}

.mosaic-item img {
    width: 100%;
    display: block;
    border-radius: 4px;
    transition: transform 0.3s;
}

.mosaic-item:hover img {
    transform: scale(1.02);
}

/* ---------- Lightbox ---------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox.active { display: flex; }

.lightbox__img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 28px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    background: none;
    border: none;
    line-height: 1;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

.lightbox__nav:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }

/* ---------- Portfolio Hero ---------- */
.gallery-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 400px;
    max-height: 800px;
    overflow: hidden;
}

.gallery-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.65) 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 48px 24px;
}

.gallery-hero__content {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    color: #fff;
}

.gallery-hero__title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    margin: 0 0 8px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.gallery-hero__date {
    font-size: 18px;
    opacity: 0.9;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

@media (max-width: 1200px) { .gallery-mosaic { columns: 3; } }
@media (max-width: 900px)  { .gallery-mosaic { columns: 2; } }
@media (max-width: 600px)  {
    .gallery-mosaic { columns: 1; padding: 24px 16px; }
    .gallery-hero { height: 50vh; min-height: 300px; }
    .gallery-hero__overlay { padding: 32px 16px; }
    .lightbox__nav { width: 44px; height: 44px; font-size: 32px; }
    .lightbox__prev { left: 10px; }
    .lightbox__next { right: 10px; }
}

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.site-footer p { margin: 0; }

/* ---------- Hero (home) ---------- */
.home-hero {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 500px;
    max-height: 900px;
    overflow: hidden;
    /*background: #111 url("/static/img/hero.webp") center/cover no-repeat;*/
}

.home-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    padding: 0 24px;
}

.home-hero__title {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.home-hero__tagline {
    font-size: clamp(16px, 2.5vw, 22px);
    opacity: 0.85;
    margin: 0 0 32px;
    font-weight: 300;
}

.home-hero__cta {
    display: inline-block;
    padding: 14px 40px;
    background: #fff;
    color: #111;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.home-hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ---------- About ---------- */
.home-about {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
}

.home-about__inner {
    display: flex;
    gap: 64px;
    align-items: center;
}

.home-about__text {
    flex: 1;
}

.home-about__text h2 {
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: 600;
}

.home-about__text p {
    color: #333;
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 16px;
}

/* ---------- About list ---------- */
.home-about__text ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 24px;
}

.home-about__text li {
    position: relative;
    color: #333;
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 14px;
    padding-left: 24px;
}

.home-about__text li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text);
}

/* ---------- About links ---------- */
.home-about__text a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.home-about__text a:hover {
    opacity: 0.7;
}

.home-about__stats {
    flex-shrink: 0;
    display: flex;
    gap: 24px;
}

.stat-card {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 32px 28px;
    text-align: center;
    min-width: 140px;
}

.stat-card__value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.stat-card__label {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Portfolio section ---------- */
.home-portfolio {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

.home-portfolio h2 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 600;
}

.home-portfolio__subtitle {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 32px;
}

/* ---------- Contacts ---------- */
.home-contacts {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.home-contacts h2 {
    font-size: 32px;
    margin-bottom: 16px;
    font-weight: 600;
}

.home-contacts__text {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.home-contacts__links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-block;
    padding: 12px 32px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 15px;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s;
}

.contact-link:hover {
    border-color: var(--text);
    background: #f8f8f8;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .home-about__inner {
        flex-direction: column;
        gap: 40px;
    }
    .home-about__stats {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .home-hero { height: 70vh; min-height: 400px; }
    .home-about, .home-portfolio, .home-contacts { padding: 48px 16px; }
    .stat-card { min-width: 120px; padding: 24px 20px; }
    .stat-card__value { font-size: 32px; }
}
.blog-list {
    max-width: var(--max-width);
    margin: 48px auto;
    padding: 0 24px;
}

/* ---------- Blog hero ---------- */
.blog-list .hero {
    text-align: center;
    padding: 64px 0 48px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 0;
}

.blog-list .hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    margin: 0;
    position: relative;
    display: inline-block;
}

.blog-list .hero h1::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--text);
    margin: 16px auto 0;
    border-radius: 2px;
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 48px;
}

.blog-card {
    display: block;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: box-shadow .2s;
}

.blog-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.blog-card__cover {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px 8px 0 0;
}

.blog-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 14px;
}

.blog-card__body {
    padding: 20px 24px 24px;
}

.blog-card__body strong {
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.blog-card__excerpt {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 12px;
}

/* ---------- Blog Post Detail ---------- */
.back-link {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
}

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

.blog-post { max-width: 1100px; margin: 0 auto; padding: 0 24px; line-height: 1.7; }
.blog-post h1 { font-size: 36px; margin-bottom: 8px; }
.blog-post img { max-width: 100%; border-radius: 4px; margin: 24px 0; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .site-header { padding: 16px; }
    .site-header__logo { font-size: 18px; }

    /* burger */
    .site-header__burger { display: flex; }
    .site-header__nav {
        position: absolute;
        top: 56px;
        right: 16px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 12px 16px;
        display: none;
        flex-direction: column;
        gap: 12px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        z-index: 100;
    }
    .site-header__nav.is-open { display: flex; }
    .site-header__nav a {
        margin-left: 0;
        font-size: 15px;
        padding: 4px 0;
    }
}
