/**
 * Gallery + package image tiles (home, /gallery, package cards).
 * Loaded from public/ so it works without running `npm run build` after CSS changes.
 *
 * Important: arbitrary Tailwind classes like aspect-[3/4] and min-h-[220px] are often
 * absent from a stale Vite build — the parent then has height 0 while the img is
 * position:absolute, so only a thin border line shows.
 */

/* —— Package cards (home + /packages) —— */
.salam-package-outer {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 220px;
    overflow: hidden;
    border-radius: 1.75rem;
    border: 1px solid rgba(229, 231, 235, 0.9);
    background-color: #fafaf9;
    box-shadow:
        0 1px 2px rgb(0 0 0 / 0.04),
        0 4px 6px -1px rgb(0 0 0 / 0.07);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

@media (min-width: 640px) {
    .salam-package-outer {
        min-height: 260px;
    }
}

.salam-package-outer:hover {
    transform: translateY(-4px);
    border-color: rgba(195, 242, 208, 0.85);
    box-shadow:
        0 10px 15px -3px rgb(0 0 0 / 0.08),
        0 4px 6px -4px rgb(0 0 0 / 0.06);
}

.salam-package-outer.is-featured {
    outline: 2px solid rgba(46, 204, 110, 0.95);
    outline-offset: 2px;
}

.salam-package-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 220px;
    padding: 1rem;
    text-align: center;
    border-radius: 1.75rem;
    border: 1px dashed #d1d5db;
    background-color: #f9fafb;
    font-size: 0.875rem;
    color: #6b7280;
}

/* —— Gallery cards: same chrome as packages; image at natural height (full width of column) —— */
.salam-gallery-card-shell {
    margin: 0;
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 1.75rem;
    border: 1px solid rgba(229, 231, 235, 0.9);
    background-color: #fafaf9;
    box-shadow:
        0 1px 2px rgb(0 0 0 / 0.04),
        0 4px 6px -1px rgb(0 0 0 / 0.07);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.salam-gallery-card-shell:hover {
    transform: translateY(-4px);
    border-color: rgba(195, 242, 208, 0.85);
    box-shadow:
        0 10px 15px -3px rgb(0 0 0 / 0.08),
        0 4px 6px -4px rgb(0 0 0 / 0.06);
}

.salam-gallery-card-trigger {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    text-align: start;
    border-radius: inherit;
}

.salam-gallery-card-trigger:focus {
    outline: none;
}

.salam-gallery-card-trigger:focus-visible {
    outline: 2px solid #1db954;
    outline-offset: 2px;
}

a.salam-gallery-card-shell {
    text-decoration: none;
    color: inherit;
}

.salam-gallery-card-media {
    position: relative;
    display: block;
    line-height: 0;
    background-color: #f5f5f4;
}

/* Full width of column; height follows file (no forced 3:4 crop) */
.salam-gallery-card-img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.35s ease;
    filter: drop-shadow(0 8px 24px rgba(15, 23, 42, 0.08));
}

.salam-gallery-card-shell:hover .salam-gallery-card-img {
    transform: scale(1.02);
}

.salam-gallery-card-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.12),
        transparent 45%,
        rgba(255, 255, 255, 0.12)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.salam-gallery-card-shell:hover .salam-gallery-card-shade {
    opacity: 1;
}

.salam-gallery-card-zoomhint {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    z-index: 2;
    display: flex;
    justify-content: center;
    transform: translate(-50%, 0.35rem);
    opacity: 0;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    pointer-events: none;
}

@media (min-width: 640px) {
    .salam-gallery-card-zoomhint {
        bottom: 1rem;
    }
}

.salam-gallery-card-shell:hover .salam-gallery-card-zoomhint {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* —— Admin package thumb —— */
.salam-admin-package-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    min-height: 160px;
    background-color: #f1f5f9;
}

.salam-gallery-mat {
    overflow: hidden;
    background-image: linear-gradient(to bottom right, #f5f5f4, #fafafa, rgba(228, 228, 231, 0.95));
    padding: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(214, 211, 209, 0.35);
}

@media (min-width: 640px) {
    .salam-gallery-mat {
        padding: 1.25rem;
    }
}

.salam-gallery-mat-img {
    position: absolute;
    inset: 0;
    margin: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 500ms ease-out;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    filter: drop-shadow(0 10px 28px rgba(15, 23, 42, 0.14));
}

.group:hover .salam-gallery-mat-img {
    transform: scale(1.02);
}

.salam-gallery-lightbox-wrap {
    max-width: min(96vw, 120rem);
    max-height: calc(100vh - 4.5rem);
    border-radius: 0.75rem;
    background-image: linear-gradient(to bottom, #f5f5f4, #fafaf9, #e4e4e7);
    padding: 0.5rem;
    box-shadow:
        0 25px 80px -20px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .salam-gallery-lightbox-wrap {
        padding: 0.75rem;
    }
}

/* As large as the viewport allows while keeping controls visible */
.salam-gallery-lightbox-img {
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 5.25rem);
    border-radius: 0.375rem;
    object-fit: contain;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.35));
}

@media (min-width: 640px) {
    .salam-gallery-lightbox-img {
        max-height: calc(100vh - 4.75rem);
    }
}
