/* assets/css/gallery.css
   Gallery grid + lightbox (caption above image + arrows left/right)
*/

/* ---------------- Tokens ---------------- */
:root {
    --c-primary: #000080; /* Deep Navy */
    --c-secondary: #808080; /* Gray */
    --c-accent: #FF5733; /* Orange */
    --c-white: #FFFFFF;
    --c-ink: #0b1120;

    --site-max: 1200px;
    --site-pad: 28px;
    --gap: 28px;
    --card-radius: 12px;
    --muted: #6b7280;
    --c-muted: var(--muted);
    --shadow: 0 14px 40px rgba(2, 6, 23, .06);
}

/* ---------------- Container ---------------- */
.gallery-page .container {
    width: 100%;
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 0 var(--site-pad);
}
.gallery-page .section-pad { padding-top: 56px; }

/* ---------------- Headings (Home-like) ---------------- */
.gallery-page .section-head {
    margin: 0 0 clamp(18px, 3vw, 28px) 0;
    text-align: center;
}
.gallery-page .kicker {
    margin: 0 0 .35rem 0;
    color: var(--c-muted);
    font-weight: 700;
    letter-spacing: .02em;
    font-size: .95rem;
}
.gallery-page .section-title,
.gallery-page .section-subtitle {
    margin: 0;
    font-weight: 900;
    line-height: 1.1;
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    color: var(--c-primary);
    position: relative;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.gallery-page .section-title-inner { display: block; width: 100%; white-space: normal; text-align: center; }
.gallery-page .section-title::after,
.gallery-page .section-subtitle::after {
    content: "";
    display: block;
    width: clamp(44px, 6vw, 72px);
    height: 3px;
    background: var(--c-accent);
    border-radius: 2px;
    margin: .6rem auto 0;
}
.gallery-page .section-intro {
    margin: .5rem auto 0;
    max-width: 70ch;
    color: var(--c-ink);
    opacity: .9;
    line-height: 1.7;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: center;
}

/* ---------------- Header ---------------- */
.gallery-page .gallery-head { padding: 34px 0 6px; }
.gallery-page .gallery-title {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    margin: 0; color: var(--c-ink); font-weight: 900; text-align: center;
}
.gallery-page .gallery-sub { margin: .5rem 0 0; color: var(--muted); font-size: .95rem; text-align: center; }

/* ---------------- Grid ---------------- */
.gallery-page .gallery-wrap { padding: 28px 0 64px; }
.gallery-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gap);
    align-items: start;
    margin-top: 18px;
}
@media (max-width: 1100px) {
    .gallery-page .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (max-width: 768px) {
    .gallery-page .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (max-width: 420px) {
    .gallery-page .gallery-grid { grid-template-columns: 1fr; gap: 14px; padding-inline: 12px; }
}

/* ---------------- Card (mapped to your markup) ---------------- */
.gallery-page .service-card {
    background: var(--c-white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    display: flex;
    transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-page .service-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(2, 6, 23, .10); }
.gallery-page .card-inner { display: block; }

.gallery-page .card-icon.image-only {
    display: block; width: 100%; aspect-ratio: 4/3; overflow: hidden;
    border-radius: 12px; background: var(--c-white);
}
.gallery-page .card-icon.image-only img {
    width: 100%; height: 100%; display: block; object-fit: cover; background: var(--c-white);
    border: 1px solid rgba(0, 0, 128, .12); border-radius: var(--card-radius);
}

/* Hide names on cards as requested */
.gallery-page .service-card .card-title,
.gallery-page .service-card .card-body { display: none !important; }

/* ---------------- Lightbox (global so it works outside .gallery-page if needed) ---------------- */
.jx-lightbox { display: none; position: fixed; inset: 0; z-index: 2099; align-items: center; justify-content: center; }
.jx-lightbox[aria-hidden="false"] { display: flex; }
.jx-lightbox__overlay { position: absolute; inset: 0; background: rgba(2, 6, 23, .65); backdrop-filter: blur(2px); }
.jx-lightbox__panel {
    position: relative; z-index: 2100; width: min(1100px, 94vw); max-height: 92vh;
    display: flex; align-items: center; justify-content: center; padding: 18px; box-sizing: border-box;
}
.jx-lightbox__img {
    max-width: calc(100% - 140px); max-height: 78vh; display: block; border-radius: 6px; object-fit: contain;
    box-shadow: 0 18px 48px rgba(2, 6, 23, .36); background: var(--c-white);
}
.jx-lightbox__caption {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2110; margin: 0;
    color: var(--c-white); font-weight: 800; font-size: 1.05rem; text-align: center;
    padding: 8px 14px; background: rgba(0, 0, 0, .28); border-radius: 8px; backdrop-filter: blur(2px);
}
.jx-lightbox__close {
    position: absolute; top: 8px; right: 8px; z-index: 2110; border: 0; background: rgba(255, 255, 255, .06);
    color: var(--c-white); font-size: 28px; width: 46px; height: 46px; border-radius: 8px; cursor: pointer;
}
.lbx-prev, .lbx-next {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2110;
    width: 54px; height: 54px; border-radius: 10px; background: rgba(255, 255, 255, .08);
    border: 0; color: var(--c-white); display: grid; place-items: center; cursor: pointer; font-size: 20px;
    transition: background .12s ease, transform .08s ease; box-shadow: 0 8px 22px rgba(2, 6, 23, .28);
}
.lbx-prev { left: 10px; }
.lbx-next { right: 10px; }
.lbx-prev:hover, .lbx-next:hover { background: rgba(255, 255, 255, .16); transform: translateY(-50%) scale(1.03); }
@media (max-width: 640px) {
    .jx-lightbox__img { max-width: calc(100% - 40px); }
    .lbx-prev, .lbx-next { width: 44px; height: 44px; left: 8px; right: 8px; }
}
.service-card:focus-within { outline: 3px solid rgba(255, 87, 51, .12); outline-offset: 4px; }
.jx-lightbox__meta { display: none; }

/* ---------------- Pagination ---------------- */
.gallery-page .gallery-pagination {
    margin: 26px 0 0; display: flex; gap: 12px; justify-content: center; align-items: center;
}
.gallery-page .gallery-pagination .page-btn {
    padding: 8px 14px; border-radius: 8px; border: 1px solid #e5e7eb; background: #f9fafb;
    color: #111827; text-decoration: none;
}
.gallery-page .gallery-pagination .page-btn:hover { background: #fff; }
.gallery-page .gallery-pagination .page-btn.disabled { opacity: .5; pointer-events: none; }
.gallery-page .gallery-pagination .page-status { color: #374151; font-size: .95rem; }

/* ---------------- Tighten header on small screens ---------------- */
@media (max-width: 640px) {
    .gallery-page .section-head { margin-bottom: 8px; }
    .gallery-page .section-title { font-size: clamp(1.35rem, 6vw, 1.75rem); }
    .gallery-page .kicker { font-size: .86rem; }
    .gallery-page .section-intro { font-size: .92rem; padding: 0 12px; }
}
