/* Romantika photographic story */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.gallery-hero {
    position: relative;
    display: grid;
    min-height: 610px;
    height: min(76vh, 780px);
    padding: 0 max(24px, calc((100vw - 1120px) / 2));
    align-items: center;
    overflow: hidden;
    color: var(--white);
    background:
        linear-gradient(90deg, rgba(4, 35, 49, 0.82) 0%, rgba(4, 35, 49, 0.35) 55%, rgba(4, 35, 49, 0.10) 100%),
        linear-gradient(0deg, rgba(4, 35, 49, 0.48) 0%, transparent 55%),
        url("../images/gallery-header.jpg") center 45% / cover no-repeat;
}

.gallery-hero::before {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 60%, rgba(42, 168, 121, 0.12)),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.11), transparent 24%);
}

.gallery-hero::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 120px;
    content: "";
    pointer-events: none;
    background: linear-gradient(transparent, rgba(4, 35, 49, 0.33));
}

.gallery-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    padding-bottom: 38px;
}

.gallery-kicker {
    display: block;
    color: var(--coral);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.45;
    text-transform: uppercase;
}

.gallery-hero h1 {
    max-width: 780px;
    margin: 12px 0 20px;
    color: var(--white);
    font-size: clamp(4rem, 9vw, 8.2rem);
    line-height: 0.88;
    letter-spacing: -0.045em;
    text-shadow: 0 8px 34px rgba(0, 0, 0, 0.18);
}

.gallery-hero p {
    max-width: 590px;
    margin: 0 0 30px;
    color: rgba(255, 255, 255, 0.91);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.55;
}

.gallery-hero-link {
    display: inline-flex;
    min-height: 49px;
    padding: 0 21px;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    backdrop-filter: blur(9px);
}

.gallery-hero-link:hover,
.gallery-hero-link:focus {
    color: var(--ocean-deep);
    background: var(--white);
    transform: translateY(-2px);
}

.gallery-hero-count {
    position: absolute;
    z-index: 2;
    right: max(24px, calc((100vw - 1120px) / 2));
    bottom: 52px;
    display: flex;
    width: 126px;
    height: 126px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--white);
    background: var(--coral);
    border: 8px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: 0 18px 40px rgba(4, 35, 49, 0.28);
}

.gallery-hero-count strong {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    line-height: 0.9;
}

.gallery-hero-count span {
    margin-top: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body:not(#home) #main.gallery-page {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin-top: -46px;
    padding: 26px 42px 82px;
}

.gallery-breadcrumb {
    display: flex;
    margin-bottom: 55px;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 13px;
}

.gallery-breadcrumb a {
    color: var(--ocean-deep);
    font-weight: 700;
}

.gallery-breadcrumb i {
    color: var(--coral);
}

.gallery-introduction {
    display: grid;
    max-width: 1040px;
    margin: 0 auto 76px;
    align-items: end;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 70px;
}

.gallery-introduction h2,
.gallery-closing-copy h2 {
    margin: 8px 0 0;
    color: var(--ocean-deep);
    font-size: clamp(2.45rem, 5vw, 4.5rem);
    line-height: 1.02;
}

.gallery-introduction > p {
    margin: 0;
    padding-left: 30px;
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.72;
    border-left: 3px solid var(--coral);
}

.gallery-experience {
    scroll-margin-top: 100px;
}

.gallery-filter-bar {
    position: sticky;
    z-index: 12;
    top: 84px;
    display: flex;
    margin: 0 0 22px;
    padding: 11px 13px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 14px 35px rgba(18, 61, 76, 0.11);
    backdrop-filter: blur(14px);
}

.gallery-filters {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.gallery-filter {
    min-height: 41px;
    padding: 0 16px;
    color: var(--ink-soft);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.045em;
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.gallery-filter:hover,
.gallery-filter:focus {
    color: var(--ocean-deep);
    background: var(--sand);
}

.gallery-filter.is-active {
    color: var(--white);
    background: var(--ocean-deep);
    box-shadow: 0 8px 18px rgba(4, 35, 49, 0.16);
}

.gallery-result-count {
    display: flex;
    flex: 0 0 auto;
    margin: 0 5px 0 0;
    align-items: baseline;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-result-count strong {
    color: var(--coral);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    line-height: 1;
}

.story-gallery {
    display: grid;
    grid-auto-flow: dense;
    grid-auto-rows: 205px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
}

.story-photo {
    position: relative;
    display: block;
    overflow: hidden;
    grid-column: span 4;
    color: var(--white);
    background: var(--ocean-deep);
    border-radius: 15px;
    box-shadow: 0 10px 28px rgba(18, 61, 76, 0.10);
    isolation: isolate;
    margin: 0;
    cursor: default;
}

.story-photo-feature {
    grid-column: span 8;
    grid-row: span 2;
}

.story-photo-tall {
    grid-row: span 2;
}

.story-photo.is-filtered-out {
    display: none;
}

.story-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 550ms cubic-bezier(0.2, 0.75, 0.25, 1), opacity 250ms ease;
}

.story-photo-shade {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(0deg, rgba(4, 35, 49, 0.68), transparent 47%);
    opacity: 0.78;
    transition: opacity 250ms ease;
}

.story-photo-label {
    position: absolute;
    z-index: 2;
    bottom: 16px;
    left: 17px;
    color: var(--white);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.gallery-closing {
    display: grid;
    margin-top: 105px;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
    background: var(--sand-light);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(18, 61, 76, 0.12);
}

.gallery-closing-image {
    min-height: 510px;
    background:
        linear-gradient(0deg, rgba(4, 35, 49, 0.10), transparent),
        url("../images/romantika_beach.jpg") center / cover no-repeat;
}

.gallery-closing-copy {
    display: flex;
    padding: 56px;
    justify-content: center;
    flex-direction: column;
}

.gallery-closing-copy h2 {
    font-size: clamp(2.25rem, 4vw, 3.8rem);
}

.gallery-closing-copy p {
    margin: 20px 0 30px;
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.7;
}

.gallery-closing-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-primary-action,
.gallery-secondary-action {
    display: inline-flex;
    min-height: 49px;
    padding: 0 21px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-radius: 999px;
}

.gallery-primary-action {
    color: var(--white);
    background: var(--ocean-deep);
}

.gallery-primary-action:hover,
.gallery-primary-action:focus {
    color: var(--white);
    background: var(--ocean);
    transform: translateY(-2px);
}

.gallery-secondary-action {
    color: var(--ocean-deep);
    border: 1px solid var(--line);
}

.gallery-secondary-action:hover,
.gallery-secondary-action:focus {
    color: var(--ocean);
    border-color: var(--ocean);
}

@media only screen and (max-width: 920px) {
    .gallery-introduction,
    .gallery-closing {
        grid-template-columns: 1fr;
    }

    .gallery-introduction {
        gap: 28px;
    }

    .gallery-introduction > p {
        padding: 0 0 0 22px;
    }

    .story-gallery {
        grid-auto-rows: 190px;
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .story-photo {
        grid-column: span 4;
    }

    .story-photo-feature {
        grid-column: span 8;
    }

    .gallery-closing-image {
        min-height: 430px;
    }
}

@media only screen and (max-width: 820px) {
    .gallery-hero {
        min-height: 540px;
        height: 68vh;
        padding-right: 28px;
        padding-left: 28px;
        background-position: 58% center;
    }

    .gallery-hero-count {
        right: 28px;
        bottom: 32px;
        width: 104px;
        height: 104px;
        border-width: 6px;
    }

    .gallery-hero-count strong {
        font-size: 2.1rem;
    }

    body:not(#home) #main.gallery-page {
        margin-top: -38px;
        padding: 30px 24px 64px;
    }

    .gallery-filter-bar {
        top: 75px;
        overflow: hidden;
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }

    .gallery-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .gallery-filter {
        width: 100%;
        padding-right: 10px;
        padding-left: 10px;
    }

    .gallery-filter:last-child {
        grid-column: 1 / -1;
    }

    .gallery-result-count {
        padding-left: 12px;
    }
}

@media only screen and (max-width: 560px) {
    .gallery-hero {
        min-height: 500px;
        height: 72vh;
        padding-right: 22px;
        padding-left: 22px;
    }

    .gallery-hero h1 {
        font-size: clamp(3.5rem, 19vw, 5.1rem);
    }

    .gallery-hero p {
        max-width: calc(100% - 25px);
        font-size: 16px;
    }

    .gallery-hero-count {
        display: none;
    }

    body:not(#home) #main.gallery-page {
        padding-right: 15px;
        padding-left: 15px;
    }

    .gallery-breadcrumb {
        margin-bottom: 38px;
    }

    .gallery-introduction {
        margin-bottom: 54px;
    }

    .gallery-introduction h2 {
        font-size: 2.5rem;
    }

    .gallery-introduction > p {
        font-size: 15px;
    }

    .gallery-filter-bar {
        margin-right: -5px;
        margin-left: -5px;
        padding: 9px;
        border-radius: 14px;
    }

    .gallery-filter {
        min-height: 44px;
        padding: 0 8px;
        font-size: 12px;
    }

    .story-gallery {
        grid-auto-rows: 145px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .story-photo {
        grid-column: span 1;
        border-radius: 11px;
    }

    .story-photo-feature {
        grid-column: span 2;
        grid-row: span 2;
    }

    .story-photo-tall {
        grid-row: span 2;
    }

    .story-photo-label {
        bottom: 11px;
        left: 12px;
        font-size: 9px;
    }

    .gallery-closing {
        margin: 78px -5px 0;
        border-radius: 21px;
    }

    .gallery-closing-image {
        min-height: 310px;
    }

    .gallery-closing-copy {
        padding: 36px 24px 40px;
    }

    .gallery-closing-copy h2 {
        font-size: 2.45rem;
    }

    .gallery-closing-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .gallery-primary-action,
    .gallery-secondary-action {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-photo img,
    .gallery-hero-link,
    .gallery-primary-action {
        transition: none;
    }
}
