/*!
 * Copyright (c) 2026 Digital Line Center. All rights reserved.
 * Categorised gallery: filter pills, responsive card grid and lightbox caption.
 * Loaded by dlc_gallery() (includes/components.php). Colours come from dlc-tokens.css; RTL uses logical properties,
 * so no separate Arabic rules are needed. The lightbox shell (.dlc-lightbox) is defined in dlc-layout.css.
 */

.dlc-gal { max-width: 74rem; margin: 0 auto; }

/* ---------- section header: eyebrow, title, rule, lead ---------- */
.dlc-gal-head { max-width: 46rem; margin: 0 auto 1.9rem; text-align: center; }
.dlc-gal-head__eyebrow { display: inline-flex; align-items: center; gap: .8rem; margin: 0 0 .7rem; color: var(--dlc-gold-strong); font-size: .74rem; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; }
.dlc-gal-head__eyebrow::before, .dlc-gal-head__eyebrow::after { content: ""; width: 2rem; height: 1px; background: linear-gradient(90deg, rgba(184,134,43,0), var(--dlc-gold)); }
.dlc-gal-head__eyebrow::after { transform: scaleX(-1); }
html[dir="rtl"] .dlc-gal-head__eyebrow::before { transform: scaleX(-1); }
html[dir="rtl"] .dlc-gal-head__eyebrow::after { transform: none; }
html[lang="ar"] .dlc-gal-head__eyebrow { letter-spacing: .04em; text-transform: none; font-size: .88rem; }
.dlc-gal-head__title { margin: 0; color: var(--dlc-charcoal); font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
html[lang="ar"] .dlc-gal-head__title { line-height: 1.45; letter-spacing: 0; }
.dlc-gal-head__rule { display: block; width: 3.5rem; height: 3px; margin: 1.05rem auto 1.1rem; background: var(--dlc-metal); border-radius: 2px; }
.dlc-gal-head__lead { max-width: 38rem; margin: 0 auto; color: var(--dlc-gray); font-size: 1.02rem; line-height: 1.75; }
html[lang="ar"] .dlc-gal-head__lead { line-height: 1.95; }

/* entrance: only when dlc-main.js enabled it (IntersectionObserver available, no reduced-motion preference) */
.dlc-gal-anim [data-rise] { opacity: 0; transform: translateY(14px); }
.dlc-gal-anim .dlc-gal-head__rule[data-rise] { transform: scaleX(0); }
.dlc-gal-anim.is-in-view [data-rise] { opacity: 1; transform: none; transition: opacity .7s var(--dlc-ease), transform .7s var(--dlc-ease); transition-delay: calc(var(--rise, 0) * 90ms); }

/* ---------- category navigation: a soft segmented rail (wraps on desktop, scrolls on small screens) ---------- */
.dlc-gal__filterwrap { margin: 0 0 2rem; text-align: center; }
.dlc-gal__filters { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .3rem; max-width: 100%; padding: .4rem; border: 1px solid var(--dlc-border); border-radius: 1.7rem; background: var(--dlc-offwhite); }
.dlc-gal__filters[hidden] { display: none; }
.dlc-gal__pill { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.6rem; padding: .45rem 1.05rem; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--dlc-charcoal-soft); font-weight: 600; font-size: .9rem; line-height: 1.2; white-space: nowrap; cursor: pointer; transition: background .3s var(--dlc-ease), color .3s, border-color .3s, box-shadow .3s; }
.dlc-gal__pill:hover { background: #fff; border-color: var(--dlc-border); color: var(--dlc-charcoal); }
.dlc-gal__pill:focus-visible { outline: 2px solid var(--dlc-gold); outline-offset: 2px; }
.dlc-gal__pill[aria-pressed="true"] { background: linear-gradient(135deg, var(--dlc-charcoal), var(--dlc-charcoal-soft)); border-color: var(--dlc-gold); color: #fff; box-shadow: 0 6px 16px rgba(29,29,32,.22); }
/* categories that exist in the taxonomy but have no media yet: quieter, no count */
.dlc-gal__pill.is-empty { color: var(--dlc-gray); font-weight: 500; }
.dlc-gal__pill.is-empty[aria-pressed="true"] { color: #fff; }
.dlc-gal__n { min-width: 1.4rem; padding: .08rem .38rem; border-radius: 999px; background: #fff; color: var(--dlc-gray); font-size: .72rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.dlc-gal__pill[aria-pressed="true"] .dlc-gal__n { background: var(--dlc-gold-strong); color: #fff; }
.dlc-gal__empty { max-width: 34rem; margin: .5rem auto 0; padding: 2rem 1.5rem; border: 1px dashed var(--dlc-gold); border-radius: .85rem; background: var(--dlc-offwhite); color: var(--dlc-gray); text-align: center; line-height: 1.7; }
.dlc-gal__empty[hidden] { display: none; }

/* ---------- grid + cards ---------- */
.dlc-gal__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.dlc-gal__item { margin: 0; }
.dlc-gal__item[hidden] { display: none; }
.dlc-gal__item.is-in { animation: dlc-gal-in .55s var(--dlc-ease) both; }
@keyframes dlc-gal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.dlc-gal__card { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--dlc-border); border-radius: .85rem; overflow: hidden; background: var(--dlc-charcoal); cursor: zoom-in; box-shadow: 0 6px 18px rgba(29,29,32,.12); text-align: start; transition: transform .45s var(--dlc-ease), box-shadow .45s, border-color .45s; }
.dlc-gal__card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--dlc-ease); }
.dlc-gal__card:hover, .dlc-gal__card:focus-visible { transform: translateY(-5px); border-color: var(--dlc-gold); box-shadow: 0 18px 38px rgba(29,29,32,.24); }
.dlc-gal__card:hover img, .dlc-gal__card:focus-visible img { transform: scale(1.06); }
.dlc-gal__card:focus-visible { outline: 2px solid var(--dlc-gold); outline-offset: 3px; }

/* caption overlay: slides up on hover/focus; always visible on touch screens (no hover there) */
.dlc-gal__cap { position: absolute; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; gap: .15rem; padding: 2.6rem 1rem .9rem; background: linear-gradient(0deg, rgba(18,18,20,.88) 0%, rgba(18,18,20,.55) 55%, rgba(18,18,20,0) 100%); color: #fff; opacity: 0; transform: translateY(10px); transition: opacity .4s var(--dlc-ease), transform .4s var(--dlc-ease); }
.dlc-gal__card:hover .dlc-gal__cap, .dlc-gal__card:focus-visible .dlc-gal__cap { opacity: 1; transform: none; }
.dlc-gal__cat { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dlc-champagne); }
html[lang="ar"] .dlc-gal__cat { letter-spacing: 0; text-transform: none; font-size: .78rem; }
.dlc-gal__title { font-size: .98rem; font-weight: 600; line-height: 1.3; }
.dlc-gal__zoom { position: absolute; top: .7rem; inset-inline-end: .7rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid var(--dlc-champagne); background: rgba(29,29,32,.72); color: #fff; display: grid; place-items: center; font-size: .8rem; opacity: 0; transform: scale(.8); transition: opacity .35s, transform .35s var(--dlc-ease), background .3s; }
.dlc-gal__card:hover .dlc-gal__zoom, .dlc-gal__card:focus-visible .dlc-gal__zoom { opacity: 1; transform: none; }
@media (hover: none) {
    .dlc-gal__cap { opacity: 1; transform: none; }
    .dlc-gal__zoom { opacity: 1; transform: none; }
}

/* ---------- show more ---------- */
.dlc-gal__morewrap { text-align: center; margin: 2rem 0 0; }
.dlc-gal__more[hidden] { display: none; }
.dlc-gal__more { margin: 0; padding-inline: 2rem; border-radius: 999px; }

@media (max-width: 575px) {
    .dlc-gal__grid { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 767px) {
    /* one scrollable strip: touch scroll, snap, no page-level overflow, native direction (starts at the right in Arabic) */
    .dlc-gal__filterwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scrollbar-width: none; margin-bottom: 1.5rem; padding-bottom: .15rem; }
    .dlc-gal__filterwrap::-webkit-scrollbar { display: none; }
    .dlc-gal__filters { display: flex; flex-wrap: nowrap; width: max-content; max-width: none; margin-inline: auto; border-radius: 999px; }
    .dlc-gal__pill { scroll-snap-align: center; }
    .dlc-gal-head { margin-bottom: 1.5rem; }
}

/* ---------- lightbox (caption + sizing; shell is in dlc-layout.css) ---------- */
.dlc-lightbox__nav[hidden] { display: none; }
.dlc-lightbox__fig { margin: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.dlc-lightbox .dlc-lightbox__fig img { max-height: calc(100vh - 11.5rem); border-radius: .5rem; opacity: 0; transform: scale(.98); transition: opacity .45s var(--dlc-ease), transform .55s var(--dlc-ease); }
.dlc-lightbox .dlc-lightbox__fig img.is-loaded { opacity: 1; transform: none; }
.dlc-lightbox__cap { display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; color: #fff; }
.dlc-lightbox__cat { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dlc-champagne); }
html[lang="ar"] .dlc-lightbox__cat { letter-spacing: 0; text-transform: none; font-size: .8rem; }
.dlc-lightbox__title { font-size: 1.05rem; font-weight: 600; }
.dlc-lightbox__desc { max-width: 36rem; margin-top: .25rem; font-size: .9rem; color: var(--dlc-silver-light); line-height: 1.6; }
@media (max-width: 575px) { .dlc-lightbox .dlc-lightbox__fig img { max-height: calc(100vh - 12.5rem); } }

@media (prefers-reduced-motion: reduce) {
    .dlc-gal__pill, .dlc-gal__card, .dlc-gal__card img, .dlc-gal__cap, .dlc-gal__zoom, .dlc-lightbox .dlc-lightbox__fig img { transition: none; }
    .dlc-gal__item.is-in { animation: none; }
    .dlc-gal-anim [data-rise], .dlc-gal-anim.is-in-view [data-rise] { opacity: 1; transform: none; transition: none; }
    .dlc-gal__pill { transition: none; }
    .dlc-gal__card:hover, .dlc-gal__card:focus-visible, .dlc-gal__pill:hover { transform: none; }
    .dlc-gal__card:hover img, .dlc-gal__card:focus-visible img { transform: none; }
    .dlc-lightbox .dlc-lightbox__fig img { opacity: 1; transform: none; }
}
