/* ============================================================
   NTM — Defining Moments

   Editorial photo-submission showcase. Reuses the homepage/about
   token contract from theme.css (never hardcode brand colors).

   Section rhythm:
     1. Hero       — dark (#161616), teal eyebrow + serif headline + glow
     2. Gallery    — paper bg, editorial 2-col header + responsive card grid
     3. Pull-quote — dark band, large serif quote
     4. CTA        — cream band, teal button (mirrors the About CTA)
     + Lightbox    — minimal dark overlay (driven by defining-moments.js)
   ============================================================ */

/* ---------- Shared eyebrow + button ---------- */
.ntm-dm-eyebrow {
    margin: 0;
    font-family: var(--ntm-font-sans);
    font-weight: 500;
    font-size: clamp(0.75rem, 0.85vw, 0.9rem);
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ntm-muted, rgba(20, 50, 58, 0.6));
}

.ntm-dm-eyebrow--teal {
    color: var(--ntm-accent-teal);
}

.ntm-dm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 1vw, 14px) clamp(28px, 2.4vw, 36px);
    background-color: var(--ntm-accent-teal);
    color: #ffffff;
    font-family: var(--ntm-font-sans);
    font-weight: 600;
    font-size: clamp(0.75rem, 0.85vw, 0.9rem);
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--ntm-accent-teal);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.ntm-dm-btn:hover,
.ntm-dm-btn:focus-visible {
    background-color: transparent;
    color: var(--ntm-accent-teal);
}

/* ============================================================
   1. Hero
   ============================================================ */
.ntm-dm-hero {
    position: relative;
    background-color: var(--ntm-bg-dark, #161616);
    color: #ffffff;
    padding: clamp(56px, 9vw, 128px) clamp(24px, 5vw, 64px) clamp(48px, 6vw, 88px);
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

.ntm-dm-hero__glow {
    position: absolute;
    top: 42%;
    left: 50%;
    width: clamp(260px, 30vw, 520px);
    height: clamp(260px, 30vw, 520px);
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(42, 139, 148, 0.42) 0%,
        rgba(42, 139, 148, 0.20) 30%,
        rgba(42, 139, 148, 0.06) 60%,
        rgba(42, 139, 148, 0.015) 80%,
        rgba(42, 139, 148, 0) 100%
    );
    filter: blur(12px);
}

.ntm-dm-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(20px, 2.5vw, 32px);
}

.ntm-dm-hero__eyebrow {
    margin: 0;
    font-family: var(--ntm-font-sans);
    font-weight: 500;
    font-size: clamp(0.75rem, 0.85vw, 0.9rem);
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ntm-accent-teal);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 1.4vw, 20px);
}

.ntm-dm-hero__eyebrow-rule {
    display: inline-block;
    width: clamp(28px, 3vw, 44px);
    height: 1px;
    background-color: var(--ntm-accent-teal);
    opacity: 0.85;
}

.ntm-dm-hero__headline {
    margin: 0;
    font-family: var(--ntm-font-serif);
    font-weight: 400;
    font-size: clamp(2.25rem, 5.4vw, 4.5rem);
    line-height: 1.1;
    letter-spacing: 0.005em;
    color: #ffffff;
}

.ntm-dm-hero__headline-roman,
.ntm-dm-hero__headline-italic {
    display: block;
}

.ntm-dm-hero__headline-italic {
    font-style: italic;
    color: var(--ntm-accent-teal);
}

.ntm-dm-hero__description {
    margin: 0 auto;
    max-width: 660px;
    font-family: var(--ntm-font-sans);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.05vw, 1.0625rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
}

.ntm-dm-hero__description + .ntm-dm-btn {
    margin-top: clamp(8px, 1vw, 16px);
}

/* ============================================================
   2. Gallery
   ============================================================ */
.ntm-dm-gallery {
    background-color: var(--ntm-paper, #fcfbf4);
    color: var(--ntm-ink, #14323a);
    padding: var(--ntm-section-pad-y, clamp(48px, 8vw, 96px)) clamp(24px, 5vw, 64px);
}

.ntm-dm-gallery__inner {
    max-width: var(--ntm-container-max, 1392px);
    margin: 0 auto;
}

.ntm-dm-gallery__header {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(16px, 2vw, 28px);
    align-items: end;
    margin-bottom: clamp(36px, 4.5vw, 64px);
    padding-bottom: clamp(24px, 3vw, 40px);
    border-bottom: 1px solid var(--ntm-rule, rgba(20, 50, 58, 0.15));
}

@media (min-width: 880px) {
    .ntm-dm-gallery__header {
        grid-template-columns: 1.1fr 0.9fr;
        gap: clamp(32px, 5vw, 80px);
    }
}

.ntm-dm-gallery__header-left {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.2vw, 16px);
}

.ntm-dm-gallery__title {
    margin: 0;
    font-family: var(--ntm-font-serif);
    font-weight: 400;
    font-size: var(--ntm-fs-h2, clamp(1.75rem, 3vw, 2.5rem));
    line-height: 1.15;
    color: var(--ntm-ink, #14323a);
}

.ntm-dm-gallery__lead {
    margin: 0;
    font-family: var(--ntm-font-sans);
    font-weight: 400;
    font-size: clamp(0.95rem, 1vw, 1.0625rem);
    line-height: 1.65;
    color: var(--ntm-muted, rgba(20, 50, 58, 0.6));
}

/* ---------- Card grid ---------- */
.ntm-dm-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: clamp(24px, 3vw, 44px) clamp(20px, 2vw, 32px);
}

.ntm-dm-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ntm-dm-card__media {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    margin: 0;
    background: var(--ntm-bg-cream, #efe6d6);
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    isolation: isolate;
}

.ntm-dm-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ntm-dm-card__media:hover .ntm-dm-card__img,
.ntm-dm-card__media:focus-visible .ntm-dm-card__img {
    transform: scale(1.04);
}

.ntm-dm-card__zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 22, 22, 0.55);
    color: #ffffff;
    font-size: 13px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ntm-dm-card__media:hover .ntm-dm-card__zoom,
.ntm-dm-card__media:focus-visible .ntm-dm-card__zoom {
    opacity: 1;
    transform: translateY(0);
}

.ntm-dm-card__caption {
    margin: 0;
    font-family: var(--ntm-font-serif);
    font-weight: 400;
    font-size: 1.0625rem;
    line-height: 1.4;
    color: var(--ntm-ink, #14323a);
}

.ntm-dm-card__person {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.ntm-dm-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ntm-dm-card__person-text {
    min-width: 0;
}

.ntm-dm-card__name {
    margin: 0;
    font-family: var(--ntm-font-sans);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
    color: var(--ntm-ink, #14323a);
}

.ntm-dm-card__name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease;
}

.ntm-dm-card__name a:hover,
.ntm-dm-card__name a:focus-visible {
    color: var(--ntm-accent-teal);
}

.ntm-dm-card__role {
    margin: 2px 0 0;
    font-family: var(--ntm-font-sans);
    font-weight: 400;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--ntm-muted, rgba(20, 50, 58, 0.6));
}

/* ---------- Empty state ---------- */
.ntm-dm-empty {
    max-width: 520px;
    margin: clamp(16px, 3vw, 40px) auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: clamp(40px, 6vw, 80px) 24px;
    border: 1px solid var(--ntm-rule, rgba(20, 50, 58, 0.15));
}

.ntm-dm-empty__title {
    margin: 0;
    font-family: var(--ntm-font-serif);
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    line-height: 1.2;
    color: var(--ntm-ink, #14323a);
}

.ntm-dm-empty__text {
    margin: 0;
    font-family: var(--ntm-font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ntm-muted, rgba(20, 50, 58, 0.6));
}

.ntm-dm-empty .ntm-dm-btn {
    margin-top: 8px;
}

/* ============================================================
   3. Pull-quote
   ============================================================ */
.ntm-dm-quote {
    position: relative;
    background-color: var(--ntm-bg-dark, #161616);
    color: #ffffff;
    padding: clamp(64px, 9vw, 128px) clamp(24px, 5vw, 64px);
    overflow: hidden;
    isolation: isolate;
}

.ntm-dm-quote__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(320px, 40vw, 640px);
    height: clamp(320px, 40vw, 640px);
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(42, 139, 148, 0.22) 0%,
        rgba(42, 139, 148, 0.08) 45%,
        rgba(42, 139, 148, 0) 100%
    );
    filter: blur(14px);
}

.ntm-dm-quote__inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.ntm-dm-quote__mark {
    margin: 0;
    font-family: var(--ntm-font-serif);
    font-size: clamp(3.5rem, 7vw, 6rem);
    line-height: 0.6;
    color: var(--ntm-accent-teal);
}

.ntm-dm-quote__text {
    margin: clamp(8px, 1.5vw, 20px) 0 0;
    font-family: var(--ntm-font-serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.5rem, 3.4vw, 2.75rem);
    line-height: 1.3;
    color: #ffffff;
}

/* ============================================================
   4. CTA
   ============================================================ */
.ntm-dm-cta {
    position: relative;
    background-color: var(--ntm-bg-cream, #efe6d6);
    color: var(--ntm-ink, #14323a);
    padding: clamp(72px, 10vw, 132px) clamp(24px, 5vw, 64px);
    overflow: hidden;
    isolation: isolate;
}

.ntm-dm-cta::before {
    content: '';
    position: absolute;
    top: 42%;
    left: 50%;
    width: clamp(360px, 42vw, 760px);
    height: clamp(360px, 42vw, 760px);
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 255, 255, 0.45) 28%,
        rgba(255, 255, 255, 0.15) 55%,
        rgba(255, 255, 255, 0.04) 78%,
        rgba(255, 255, 255, 0) 100%
    );
    filter: blur(14px);
}

.ntm-dm-cta__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(16px, 1.8vw, 24px);
}

.ntm-dm-cta__title {
    margin: 0;
    font-family: var(--ntm-font-serif);
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.15;
    color: var(--ntm-ink, #14323a);
}

.ntm-dm-cta__title-roman,
.ntm-dm-cta__title-tail {
    font-style: normal;
}

.ntm-dm-cta__title-italic {
    font-style: italic;
    color: var(--ntm-accent-teal);
    margin: 0 0.12em;
}

.ntm-dm-cta__title-tail {
    display: block;
}

.ntm-dm-cta__description {
    margin: 0;
    max-width: 540px;
    font-family: var(--ntm-font-sans);
    font-weight: 400;
    font-size: clamp(0.95rem, 1vw, 1.0625rem);
    line-height: 1.65;
    color: rgba(20, 50, 58, 0.78);
}

.ntm-dm-cta__btn {
    margin-top: clamp(8px, 1vw, 16px);
}

.ntm-dm-cta__secondary {
    margin: clamp(8px, 1vw, 16px) 0 0;
    font-family: var(--ntm-font-sans);
    font-weight: 500;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    line-height: 1.4;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(20, 50, 58, 0.55);
}

.ntm-dm-cta__secondary-text {
    margin-right: 6px;
}

.ntm-dm-cta__secondary-link {
    color: var(--ntm-accent-teal);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    transition: opacity 0.18s ease;
}

.ntm-dm-cta__secondary-link:hover,
.ntm-dm-cta__secondary-link:focus-visible {
    opacity: 0.7;
}

/* ============================================================
   Lightbox (progressive enhancement — created by JS)
   ============================================================ */
.ntm-dm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 56px);
    background: rgba(10, 10, 10, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ntm-dm-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.ntm-dm-lightbox__figure {
    margin: 0;
    max-width: 1000px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: center;
}

.ntm-dm-lightbox__img {
    max-width: 100%;
    max-height: 76vh;
    object-fit: contain;
    margin: 0 auto;
}

.ntm-dm-lightbox__cap {
    margin: 0;
    font-family: var(--ntm-font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.ntm-dm-lightbox__name {
    color: var(--ntm-accent-teal-light, #35ACB4);
    font-weight: 600;
}

.ntm-dm-lightbox__close {
    position: absolute;
    top: clamp(12px, 2vw, 24px);
    right: clamp(12px, 2vw, 24px);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.18s ease;
}

.ntm-dm-lightbox__close:hover,
.ntm-dm-lightbox__close:focus-visible {
    color: var(--ntm-accent-teal-light, #35ACB4);
}

/* ---------- Responsive ---------- */
@media (max-width: 575px) {
    .ntm-dm-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 24px 16px;
    }
}
