/* NTM Homepage — Latest Edition (magazine promo).
   Palette is component-local (client-approved mockup values); everything
   is scoped under .ntm-magazine so nothing leaks into other sections. */

.ntm-magazine {
    --nmag-black: #121212;
    --nmag-ink: #0A0A0A;
    --nmag-teal: #0F7B82;
    --nmag-teal-lt: #1AA0A8;
    --nmag-cream: #F3EFE7;
    --nmag-line: rgba(243, 239, 231, 0.13);
    --nmag-muted: rgba(243, 239, 231, 0.62);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 15% 0%, rgba(15, 123, 130, 0.20) 0%, rgba(15, 123, 130, 0) 58%),
        linear-gradient(180deg, var(--nmag-ink) 0%, var(--nmag-black) 45%, var(--nmag-ink) 100%);
    color: var(--nmag-cream);
    padding: clamp(72px, 10vw, 130px) 24px;
    isolation: isolate;
}

/* Decorative arc rules behind the content */
.ntm-magazine__arc {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 160%;
    max-width: 1900px;
    aspect-ratio: 3 / 1;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    border-top: 1px solid var(--nmag-line);
    pointer-events: none;
    z-index: 0;
}

.ntm-magazine__arc--top { top: -6%; }

.ntm-magazine__arc--bottom {
    bottom: -22%;
    border-top: 0;
    border-bottom: 1px solid var(--nmag-line);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.ntm-magazine__inner {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 88px);
    align-items: center;
}

/* ---------- 3D cover ---------- */

.ntm-magazine__stage {
    position: relative;
    display: flex;
    justify-content: center;
}

.ntm-magazine__glow {
    position: absolute;
    inset: -14% -10% -18%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(15, 123, 130, 0.42), rgba(15, 123, 130, 0) 70%);
    filter: blur(6px);
    z-index: 0;
}

.ntm-magazine__cover {
    position: relative;
    z-index: 1;
    width: min(100%, 370px);
    aspect-ratio: 2 / 3;
    background: linear-gradient(150deg, rgba(15, 123, 130, 0.55) 0%, #121212 62%);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.06) inset,
        -14px 0 24px -18px rgba(0, 0, 0, 0.9),
        0 40px 80px -30px rgba(0, 0, 0, 0.95);
    transform: perspective(1400px) rotateY(-9deg) rotateX(1.5deg);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    overflow: hidden;
}

.ntm-magazine__cover:hover {
    transform: perspective(1400px) rotateY(-3deg) translateY(-6px);
}

/* Spine shading on the bound edge */
.ntm-magazine__cover::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 14px;
    z-index: 4;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.18) 55%, rgba(255, 255, 255, 0.10));
}

/* The 2/3 proportion only applies to the text-fallback cover; uploaded
   art is in-flow and defines the frame height itself, so it always spans
   the full width uncropped whatever its aspect ratio. */
.ntm-magazine__cover:has(.ntm-magazine__cover-img) {
    aspect-ratio: auto;
}

/* Cover art spans the frame edge-to-edge and hides the default texts;
   uploaded covers carry their own typography */
.ntm-magazine__cover-img {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 3;
    display: block;
}

/* Default text layer behind the art: hardcoded masthead on top,
   story-record name + excerpt at the bottom. Visible only when no cover
   image is set (or it fails to load). */
.ntm-magazine__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    padding: 26px 22px 24px 30px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.9) 100%);
}

.ntm-magazine__masthead {
    font-family: 'Gloock', Georgia, serif;
    font-size: 34px;
    line-height: 0.95;
    color: #fff;
    text-transform: uppercase;
}

.ntm-magazine__mastrule {
    height: 1px;
    background: rgba(243, 239, 231, 0.35);
    margin: 12px 0 10px;
}

.ntm-magazine__mastmeta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(243, 239, 231, 0.72);
}

.ntm-magazine__coverlines { margin-top: auto; }

.ntm-magazine__cover-kicker {
    font-size: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--nmag-teal-lt);
    margin: 0 0 8px;
}

.ntm-magazine__cover-name {
    font-family: 'Gloock', Georgia, serif;
    font-size: 40px;
    line-height: 0.96;
    margin: 0 0 10px;
    color: #fff;
    text-transform: uppercase;
    max-width: 8ch;
}

.ntm-magazine__cover-line {
    font-size: 12.5px;
    line-height: 1.45;
    color: rgba(243, 239, 231, 0.8);
    margin: 0;
    max-width: 26ch;
}

.ntm-magazine__cover-line em {
    font-style: italic;
    color: var(--nmag-teal-lt);
}

/* Sits behind the art like the default texts — shows on fallback only */
.ntm-magazine__flag {
    position: absolute;
    z-index: 2;
    top: 26px;
    right: -1px;
    background: var(--nmag-teal);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 8px 14px 8px 16px;
}

/* ---------- Edition copy ---------- */

.ntm-magazine__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--nmag-teal-lt);
    margin: 0 0 22px;
}

.ntm-magazine__eyebrow::before {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--nmag-teal);
}

.ntm-magazine__title {
    font-family: 'Gloock', Georgia, serif;
    font-weight: 400;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.02;
    margin: 0 0 18px;
    color: #fff;
}

.ntm-magazine__title em {
    font-style: italic;
    color: var(--nmag-teal-lt);
}

.ntm-magazine__issue {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--nmag-muted);
    padding-bottom: 22px;
    border-bottom: 1px solid var(--nmag-line);
    margin: 0 0 24px;
}

.ntm-magazine__issue span + span::before {
    content: "/";
    margin-right: 18px;
    color: rgba(243, 239, 231, 0.28);
}

/* Deck holds admin rich-text (Quill) output: p, strong, em, lists, links */
.ntm-magazine__deck {
    font-size: 15.5px;
    line-height: 1.75;
    color: rgba(243, 239, 231, 0.8);
    max-width: 60ch;
    margin: 0 0 30px;
    font-weight: 300;
}

.ntm-magazine__deck p,
.ntm-magazine__deck ul,
.ntm-magazine__deck ol {
    margin: 0 0 1em;
}

.ntm-magazine__deck > :last-child {
    margin-bottom: 0;
}

.ntm-magazine__deck strong {
    font-weight: 600;
    color: #fff;
}

/* Rich-editor italic doubles as the colored accent (<em> convention);
   this theme's accent is teal */
.ntm-magazine__deck em {
    font-style: italic;
    color: var(--nmag-teal-lt);
}

.ntm-magazine__deck a {
    color: var(--nmag-teal-lt);
    text-decoration: underline;
}

.ntm-magazine__deck a:hover {
    color: var(--nmag-cream);
}

/* Stat count is admin-defined — auto-fit keeps any number of cells tidy */
.ntm-magazine__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0;
    border-top: 1px solid var(--nmag-line);
    border-bottom: 1px solid var(--nmag-line);
    margin: 0 0 30px;
}

.ntm-magazine__stats div {
    padding: 18px 14px 16px;
    text-align: center;
    border-left: 1px solid var(--nmag-line);
}

.ntm-magazine__stats div:first-child {
    border-left: 0;
    text-align: left;
    padding-left: 0;
}

.ntm-magazine__stats b {
    display: block;
    font-family: 'Gloock', Georgia, serif;
    font-weight: 400;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1;
    color: #fff;
    margin-bottom: 7px;
}

.ntm-magazine__stats span {
    display: block;
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--nmag-muted);
    line-height: 1.4;
}

.ntm-magazine__contents {
    list-style: none;
    margin: 0 0 36px;
    padding: 0;
}

.ntm-magazine__contents li {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 16px;
    align-items: baseline;
    padding: 13px 0;
    border-top: 1px solid var(--nmag-line);
}

.ntm-magazine__contents li:last-child {
    border-bottom: 1px solid var(--nmag-line);
}

.ntm-magazine__contents-pg {
    font-size: 11px;
    color: var(--nmag-teal-lt);
    font-variant-numeric: tabular-nums;
}

.ntm-magazine__contents-entry {
    font-size: 15px;
    line-height: 1.5;
    color: rgba(243, 239, 231, 0.9);
}

.ntm-magazine__contents-entry b {
    font-weight: 500;
    color: #fff;
}

.ntm-magazine__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    background: var(--nmag-teal);
    color: #fff;
    text-decoration: none;
    border: 0;
    padding: 15px 28px;
    transition: 0.25s;
}

.ntm-magazine__cta:hover {
    background: var(--nmag-teal-lt);
    color: #fff;
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .ntm-magazine__inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .ntm-magazine__cover {
        transform: none;
        width: min(78%, 320px);
    }

    .ntm-magazine__stage { order: -1; }
}

@media (max-width: 560px) {
    .ntm-magazine__stats { grid-template-columns: 1fr 1fr; }

    .ntm-magazine__stats div {
        text-align: left;
        padding-left: 14px;
        border-bottom: 1px solid var(--nmag-line);
    }

    .ntm-magazine__stats div:nth-child(odd) {
        border-left: 0;
        padding-left: 0;
    }

    .ntm-magazine__stats div:last-child,
    .ntm-magazine__stats div:nth-last-child(2):nth-child(odd) {
        border-bottom: 0;
    }
}
