/*
 * Gallery.
 *
 * The images are certificates and photographs at whatever size they were
 * scanned or shot at, so nothing is cropped to a common ratio: each tile is a
 * fixed window with the image contained inside it. A certificate cropped to
 * fill would lose its letterhead, which is the part that proves anything.
 */

.gal-hero {
    background: linear-gradient(160deg, #fdf2f2 0%, #ffffff 65%);
    padding: 32px 0 44px;
}

.gal-breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.gal-breadcrumb a { color: #6b7280; text-decoration: none; }
.gal-breadcrumb a:hover { color: var(--primary-red); }
.gal-breadcrumb span { margin: 0 0.35rem; }
.gal-breadcrumb span[aria-current] { margin-left: 0; color: #111827; }

.gal-hero h1 {
    font-size: clamp(1.95rem, 3.6vw, 3rem);
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 0.9rem;
}

.gal-hero__lead {
    max-width: 40rem;
    margin: 0;
    font-size: 1.04rem;
    line-height: 1.75;
    color: #4b5563;
}

/* --------------------------------------------------------------- a group */

.gal-group { padding: 56px 0 8px; }

.gal-group h2 {
    font-size: clamp(1.5rem, 2.4vw, 2.05rem);
    font-weight: 800;
    margin-bottom: 0.6rem;
}

.gal-group__lead {
    max-width: 44rem;
    margin: 0 0 1.75rem;
    font-size: 1rem;
    line-height: 1.75;
    color: #4b5563;
}

.gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gal-tile { margin: 0; }

.gal-tile a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 15rem;
    padding: 1rem;
    background: #f8f9fb;
    border: 1px solid #eceef1;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gal-tile a:hover,
.gal-tile a:focus-visible {
    border-color: #f3d0d0;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.gal-tile img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gal-tile__zoom {
    position: absolute;
    right: 0.7rem;
    bottom: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    font-size: 0.78rem;
    opacity: 0;
    transform: translateY(0.35rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gal-tile a:hover .gal-tile__zoom,
.gal-tile a:focus-visible .gal-tile__zoom {
    opacity: 1;
    transform: translateY(0);
}

.gal-tile figcaption {
    margin-top: 0.7rem;
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.5;
    color: #374151;
}

/* ------------------------------------------------------------- lightbox */

.gal-lightbox {
    width: min(92vw, 60rem);
    max-width: none;
    max-height: 92vh;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #fff;
    overflow: visible;
}

.gal-lightbox::backdrop { background: rgba(15, 23, 42, 0.82); }

.gal-lightbox figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    margin: 0;
    padding: 1.5rem;
}

.gal-lightbox img {
    max-width: 100%;
    max-height: 74vh;
    object-fit: contain;
}

.gal-lightbox figcaption {
    font-size: 0.92rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.gal-lightbox__close,
.gal-lightbox__nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.gal-lightbox__close:hover,
.gal-lightbox__nav:hover { background: var(--primary-red); }

.gal-lightbox__close { top: -1.2rem; right: -1.2rem; }
.gal-lightbox__nav[data-step="-1"] { left: -1.4rem; top: 50%; transform: translateY(-50%); }
.gal-lightbox__nav[data-step="1"] { right: -1.4rem; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------------ cta */

.gal-cta { padding: 56px 0 72px; }

.gal-cta__panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.25rem 2.5rem;
    background: linear-gradient(160deg, #fdf2f2 0%, #ffffff 70%);
    border: 1px solid #f3d0d0;
    border-radius: 16px;
}

.gal-cta__panel h2 {
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 0.6rem;
}

.gal-cta__panel p {
    max-width: 44rem;
    margin: 0;
    font-size: 0.97rem;
    line-height: 1.75;
    color: #4b5563;
}

.gal-cta__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.gal-cta__secondary {
    font-weight: 600;
    color: #111827;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.gal-cta__secondary:hover { color: var(--primary-red); }

/* ----------------------------------------------------------- small screens */

@media (max-width: 767.98px) {
    .gal-group { padding-top: 40px; }
    .gal-grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; }
    .gal-tile a { height: 11rem; }

    /* Off-screen controls have nowhere to hang on a narrow viewport. */
    .gal-lightbox { width: 94vw; }
    .gal-lightbox__close { top: 0.5rem; right: 0.5rem; }
    .gal-lightbox__nav[data-step="-1"] { left: 0.5rem; }
    .gal-lightbox__nav[data-step="1"] { right: 0.5rem; }
    .gal-cta__panel { padding: 1.75rem 1.5rem; }
}
