/*
 * Vondra.cz – fotografie a odkazy na galerie
 * Verze 1.0.0
 */

.rv-photo-links {
    --rv-gallery-bg: #000000;
    --rv-gallery-text: #ffffff;
    --rv-gallery-muted: rgba(255, 255, 255, 0.68);
    --rv-gallery-border: rgba(255, 255, 255, 0.16);
    --rv-gallery-gap: 16px;

    width: 100%;
    margin: 0;
    padding: clamp(54px, 6vw, 92px) 24px clamp(64px, 7vw, 110px);
    color: var(--rv-gallery-text);
    background: var(--rv-gallery-bg);
}

.rv-photo-links,
.rv-photo-links * {
    box-sizing: border-box;
}

.rv-photo-links__inner {
    width: min(100%, 1380px);
    margin: 0 auto;
}

.rv-photo-links__header {
    max-width: 760px;
    margin: 0 auto clamp(34px, 4vw, 54px);
    text-align: center;
}

.rv-photo-links__eyebrow {
    margin: 0 0 11px;
    padding: 0;
    color: var(--rv-gallery-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.rv-photo-links__header h2 {
    margin: 0;
    padding: 0;
    color: var(--rv-gallery-text);
    font-size: clamp(32px, 4vw, 54px);
    font-weight: 300;
    line-height: 1.12;
    letter-spacing: 0.01em;
}

.rv-photo-links__intro {
    margin: 14px 0 0;
    padding: 0;
    color: var(--rv-gallery-muted);
    font-size: clamp(15px, 1.3vw, 18px);
    font-weight: 400;
    line-height: 1.65;
}

.rv-photo-links__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--rv-gallery-gap);
}

.rv-photo-links__card {
    display: block;
    min-width: 0;
    color: var(--rv-gallery-text);
    background: #111111;
    text-decoration: none;
    overflow: hidden;
}

.rv-photo-links__card--wide {
    grid-column: span 2;
}

.rv-photo-links__figure {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    margin: 0;
    overflow: hidden;
    background: #111111;
}

.rv-photo-links__card--wide .rv-photo-links__figure {
    aspect-ratio: 1200 / 390;
}

.rv-photo-links__image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition:
        transform 500ms cubic-bezier(0.2, 0.65, 0.3, 1),
        filter 350ms ease;
}

.rv-photo-links__figure::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.82) 0%,
            rgba(0, 0, 0, 0.34) 34%,
            rgba(0, 0, 0, 0.03) 67%,
            rgba(0, 0, 0, 0) 100%
        );
    pointer-events: none;
    transition: background 300ms ease;
}

.rv-photo-links__caption {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;
    min-height: 76px;
    padding: 24px 22px 18px;
    color: var(--rv-gallery-text);
}

.rv-photo-links__title {
    display: block;
    font-size: clamp(13px, 1.2vw, 17px);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-wrap: balance;
}

.rv-photo-links__arrow {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--rv-gallery-border);
    border-radius: 50%;
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
    opacity: 0;
    transform: translateX(-8px);
    transition:
        opacity 220ms ease,
        transform 220ms ease,
        border-color 220ms ease,
        background-color 220ms ease;
}

.rv-photo-links__card:hover .rv-photo-links__image {
    transform: scale(1.045);
    filter: brightness(0.92);
}

.rv-photo-links__card:hover .rv-photo-links__figure::after {
    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.9) 0%,
            rgba(0, 0, 0, 0.4) 40%,
            rgba(0, 0, 0, 0.03) 70%,
            rgba(0, 0, 0, 0) 100%
        );
}

.rv-photo-links__card:hover .rv-photo-links__arrow {
    opacity: 1;
    transform: translateX(0);
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.18);
}

.rv-photo-links__card:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

.rv-photo-links__card:focus-visible .rv-photo-links__arrow {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 1100px) {
    .rv-photo-links__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .rv-photo-links {
        --rv-gallery-gap: 10px;

        padding: 46px 18px 66px;
    }

    .rv-photo-links__header {
        margin-bottom: 32px;
    }

    .rv-photo-links__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rv-photo-links__caption {
        min-height: 58px;
        padding: 18px 13px 11px;
    }

    .rv-photo-links__title {
        font-size: clamp(11px, 3.2vw, 14px);
        line-height: 1.3;
        letter-spacing: 0.045em;
    }

    .rv-photo-links__arrow {
        display: none;
    }
    .rv-photo-links__grid {
        grid-auto-flow: dense;
    }

   .rv-photo-links__card--wide .rv-photo-links__figure {
        aspect-ratio: 2 / 1;
   }

}

@media (max-width: 380px) {
    .rv-photo-links {
        padding-right: 14px;
        padding-left: 14px;
    }

    .rv-photo-links__caption {
        padding-right: 10px;
        padding-left: 10px;
    }
}

@media (hover: none) {
    .rv-photo-links__arrow {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rv-photo-links__image,
    .rv-photo-links__arrow,
    .rv-photo-links__figure::after {
        transition: none;
    }
}
