/* =========================================================================
   KAAYA GLOW — GALLERY PAGE (V3: modern-minimal redesign)
   Page-scoped stylesheet, loaded only on gallery.php after
   kaaya-editorial.css (so it inherits --kaaya-* tokens + .kg-* utilities:
   .kg-container, .kg-eyebrow, .kg-heading*, .kg-btn*, .kg-link-cta).

   Deliberate departure from the old dark-editorial layout (full-bleed
   photo hero -> floating stats card -> dark about split -> dark services
   grid). This version is light, typographic and photo-forward instead:
   split intro (no hero photo background) -> moving marquee -> filterable
   masonry archive -> one full-bleed feature break -> dark closing CTA.

   Namespace: "mg-" (Modern Gallery), to avoid any collision with the
   previous gn- classes or the older kg-gallery-*/masonry-grid/filter-btn
   rules that still live in the site-wide assets/css/gallery.css.
   ========================================================================= */

/* ================= INTRO ================= */
.mg-intro { background: var(--kaaya-white); padding: 56px 0 84px; }
.mg-intro-grid {
    display: flex;
    align-items: flex-end;
    gap: 64px;
}
.mg-intro-copy { flex: 1.15 1 0%; }
.mg-intro-photo { flex: 0.85 1 0%; }
.mg-intro-copy .kg-eyebrow { margin-bottom: 16px; }
.mg-intro-title {
    font-family: var(--kg-heading-font);
    font-weight: 500;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--kaaya-black);
    font-size: clamp(42px, 6.2vw, 98px);
    line-height: 0.98;
    margin: 0 0 26px;
}
.mg-intro-title em {
    font-style: italic;
    font-weight: 500;
    color: var(--kaaya-moss);
}
.mg-intro-text {
    font-family: var(--kg-body-font);
    font-size: 16px;
    line-height: 1.8;
    color: var(--kaaya-charcoal);
    max-width: 460px;
    margin: 0 0 36px;
}
.mg-intro-meta {
    display: flex;
    border-top: 1px solid rgba(5, 31, 32, 0.14);
    max-width: 460px;
}
.mg-intro-stat {
    flex: 1;
    padding: 18px 18px 0 0;
    border-right: 1px solid rgba(5, 31, 32, 0.14);
}
.mg-intro-stat:last-child { border-right: none; padding-right: 0; }
.mg-intro-stat b {
    display: block;
    font-family: var(--kg-heading-font);
    font-weight: 600;
    font-size: clamp(24px, 2.4vw, 32px);
    color: var(--kaaya-black);
    line-height: 1;
    margin-bottom: 8px;
}
.mg-intro-stat span {
    display: block;
    font-family: var(--kg-body-font);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kaaya-charcoal);
    opacity: 0.62;
    line-height: 1.4;
}
.mg-intro-photo {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}
.mg-intro-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-intro-photo-tag {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: var(--kaaya-white);
    color: var(--kaaya-black);
    font-family: var(--kg-body-font);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 9px 14px;
}

/* ================= MARQUEE ================= */
.mg-marquee {
    background: var(--kaaya-moss);
    border-top: 1px solid rgba(218, 241, 222, 0.18);
    border-bottom: 1px solid rgba(218, 241, 222, 0.18);
    overflow: hidden;
    padding: 15px 0;
}
.mg-marquee-track {
    display: flex;
    width: max-content;
    animation: mgMarquee 32s linear infinite;
}
.mg-marquee-track span { display: flex; align-items: center; flex-shrink: 0; }
.mg-marquee-track span span {
    font-family: var(--kg-heading-font);
    font-style: italic;
    font-weight: 500;
    font-size: 18px;
    color: var(--kaaya-ivory);
    padding: 0 26px;
    white-space: nowrap;
    position: relative;
}
.mg-marquee-track span span::after {
    content: '\2726';
    position: absolute;
    right: -3px;
    font-style: normal;
    font-size: 10px;
    color: var(--kaaya-gold);
}
.mg-marquee-track span span:last-child::after { content: ''; }
@keyframes mgMarquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .mg-marquee-track { animation: none; }
}

/* ================= FILTERABLE GRID ================= */
.mg-gallery { background: var(--kaaya-white); padding: 88px 0 40px; }
.mg-gallery-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 44px;
}
.mg-gallery-head .kg-eyebrow { margin-bottom: 12px; }
.mg-gallery-head .kg-heading { margin-bottom: 0; text-transform: none; }

.mg-filters {
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
}
.mg-filter {
    background: none;
    border: none;
    padding: 0 0 8px;
    margin: 0;
    cursor: pointer;
    font-family: var(--kg-body-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--kaaya-charcoal);
    opacity: 0.5;
    position: relative;
    transition: opacity 0.25s ease, color 0.25s ease;
}
.mg-filter::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--kaaya-black);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--kg-ease);
}
.mg-filter:hover { opacity: 0.85; }
.mg-filter.is-active { opacity: 1; color: var(--kaaya-black); }
.mg-filter.is-active::after { transform: scaleX(1); }

.mg-grid {
    column-count: 4;
    column-gap: 22px;
}
.mg-tile {
    break-inside: avoid;
    margin: 0 0 22px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--kaaya-ivory);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.mg-tile.is-hidden { display: none; }
.mg-tile img {
    width: 100%;
    display: block;
    transition: transform 0.7s var(--kg-ease);
}
.mg-tile:hover img { transform: scale(1.045); }

.mg-tile-index {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    font-family: var(--kg-body-font);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--kaaya-white);
    background: rgba(5, 31, 32, 0.55);
    padding: 4px 9px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mg-tile:hover .mg-tile-index { opacity: 1; }

.mg-tile-overlay {
    position: absolute;
    inset: 0;
    margin: 0;
    background: linear-gradient(180deg, rgba(5, 31, 32, 0) 52%, rgba(5, 31, 32, 0.82) 100%);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    transition: opacity 0.35s ease;
}
.mg-tile:hover .mg-tile-overlay { opacity: 1; }
.mg-tile-cat {
    font-family: var(--kg-body-font);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--kaaya-sage);
    margin-bottom: 5px;
}
.mg-tile-cap {
    font-family: var(--kg-heading-font);
    font-size: 15px;
    font-weight: 500;
    color: var(--kaaya-white);
    line-height: 1.3;
}

.mg-empty {
    text-align: center;
    font-family: var(--kg-body-font);
    font-size: 14px;
    color: var(--kaaya-charcoal);
    opacity: 0.6;
    padding: 60px 0;
}

/* ================= FULL-BLEED FEATURE BREAK ================= */
.mg-feature {
    position: relative;
    height: clamp(360px, 56vw, 620px);
    overflow: hidden;
}
.mg-feature img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-feature::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(5, 31, 32, 0.78) 0%, rgba(5, 31, 32, 0) 48%);
}
.mg-feature-quote {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: 0 32px 46px;
    text-align: center;
}
.mg-feature-quote p {
    font-family: var(--kg-heading-font);
    font-style: italic;
    font-weight: 500;
    color: var(--kaaya-white);
    font-size: clamp(21px, 2.8vw, 34px);
    line-height: 1.35;
    max-width: 760px;
    margin: 0 auto 14px;
}
.mg-feature-quote span {
    font-family: var(--kg-body-font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--kaaya-taupe);
}

/* ================= CLOSING CTA ================= */
.mg-cta { background: var(--kaaya-black); padding: 110px 0; text-align: center; }
.mg-cta .kg-eyebrow { justify-content: center; color: var(--kaaya-taupe); margin-bottom: 20px; }
.mg-cta .kg-eyebrow::before { background: var(--kaaya-gold); }
.mg-cta h2 {
    font-family: var(--kg-heading-font);
    font-weight: 500;
    text-transform: none;
    color: var(--kaaya-white);
    font-size: clamp(32px, 4.2vw, 54px);
    line-height: 1.16;
    max-width: 680px;
    margin: 0 auto 34px;
}
.mg-cta .kg-btn { margin: 0 auto; }

/* ================= LIGHTBOX ADD-ONS (nav + counter) =================
   Base #lightbox/.lightbox-content/.close/#caption rules already live in
   the site-wide assets/css/gallery.css; these only add prev/next + a
   counter for browsing the full set without closing the preview. */
.mg-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--kaaya-white, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.mg-lb-nav:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.45); }
.mg-lb-nav svg { width: 20px; height: 20px; }
.mg-lb-prev { left: 22px; }
.mg-lb-next { right: 22px; }
.mg-lb-counter {
    position: absolute;
    left: 0; right: 0;
    bottom: 22px;
    z-index: 1001;
    text-align: center;
    font-family: var(--kg-body-font, 'Inter', sans-serif);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.75);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
    .mg-intro-grid { flex-direction: column; gap: 36px; }
    .mg-intro-copy, .mg-intro-photo { flex: 1 1 auto; width: 100%; }
    .mg-intro-photo { aspect-ratio: 16 / 9; order: -1; }
    .mg-grid { column-count: 3; }
}
@media (max-width: 780px) {
    .mg-intro { padding: 44px 0 60px; }
    .mg-intro-meta { max-width: 100%; }
    .mg-gallery-head { flex-direction: column; align-items: flex-start; }
    .mg-filters { gap: 18px; }
    .mg-grid { column-count: 2; column-gap: 14px; }
    .mg-tile { margin-bottom: 14px; }
    .mg-cta { padding: 80px 0; }
    .mg-lb-nav { width: 42px; height: 42px; }
    .mg-lb-prev { left: 10px; }
    .mg-lb-next { right: 10px; }
}
@media (max-width: 480px) {
    .mg-intro-title { font-size: clamp(36px, 11vw, 52px); }
    .mg-intro-stat { padding-right: 10px; }
    .mg-marquee-track span span { font-size: 15px; padding: 0 18px; }
    .mg-grid { column-count: 1; }
    .mg-feature-quote { padding: 0 20px 34px; }
}
