/* =========================================================
   DANANG2NITE — PHASE 37
   PC MAGAZINE LIST ONLY / PREMIUM NIGHT EDITORIAL
   Loaded only at min-width: 821px.
   HOME, mobile LIST, VIEW, Places, Side Menu are untouched.
   ========================================================= */

body.page-magazine-list .site-main{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  background:
    radial-gradient(circle at 8% 2%,rgba(117,0,52,.17),transparent 26%),
    radial-gradient(circle at 91% 7%,rgba(62,0,77,.13),transparent 24%),
    linear-gradient(180deg,#070708 0%,#080709 58%,#070708 100%);
}
body.page-magazine-list .site-main::before{
  content:"";
  position:absolute;
  z-index:-1;
  inset:0 0 auto;
  height:620px;
  pointer-events:none;
  background:
    repeating-linear-gradient(90deg,transparent 0 149px,rgba(255,255,255,.011) 150px,transparent 151px),
    linear-gradient(90deg,rgba(230,37,114,.022),transparent 28%,transparent 72%,rgba(217,185,110,.018));
  mask-image:linear-gradient(to bottom,#000,transparent 100%);
}

/* ---------- HERO ---------- */
.index-hero{
  position:relative;
  padding-block:66px 37px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.d2n-magazine-index-hero{
  width:min(1480px,calc(100% - 64px));
}
.d2n-magazine-index-hero::after{
  content:"D2N / EDITORIAL ARCHIVE";
  position:absolute;
  right:0;
  top:73px;
  color:#4e4946;
  font-size:7px;
  font-weight:900;
  letter-spacing:2.4px;
}
.index-hero .eyebrow{
  color:var(--gold-soft);
  letter-spacing:1.55px;
}
.index-hero h1{
  max-width:1050px;
  margin:15px 0 0;
  font-family:Georgia,"Times New Roman",serif;
  font-size:clamp(58px,6.1vw,98px);
  font-weight:700;
  line-height:.9;
  letter-spacing:-3.7px;
  text-wrap:balance;
  background:linear-gradient(to bottom,#fbf8f3 0%,#f7f1e6 50%,#e1c77f 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.index-hero p{
  max-width:760px;
  margin:19px 0 0;
  color:#aaa39a;
  font-size:14px;
  line-height:1.72;
}

/* ---------- CATEGORY FILTER ---------- */
.d2n-index-category-nav{
  width:min(1480px,calc(100% - 64px));
  margin-top:16px;
  padding:0 0 15px;
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:7px;
  overflow:visible;
}
.d2n-index-category-nav__item{
  position:relative;
  min-width:0;
  min-height:61px;
  padding:10px 11px;
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:9px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.075);
  border-radius:13px;
  background:
    linear-gradient(145deg,rgba(255,255,255,.03),rgba(255,255,255,.005)),
    #0d0c0e;
  color:#918a84;
  text-decoration:none;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}
.d2n-index-category-nav__item::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:2px;
  background:linear-gradient(to bottom,transparent,var(--pink),transparent);
  opacity:0;
}
.d2n-index-category-nav__item span{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.075);
  border-radius:50%;
  color:#776f69;
  font-size:6px;
  font-weight:950;
}
.d2n-index-category-nav__item strong{
  min-width:0;
  color:#aaa39c;
  font-size:8px;
  font-weight:900;
  letter-spacing:.35px;
  line-height:1.2;
  text-transform:uppercase;
  white-space:normal;
}
.d2n-index-category-nav__item:hover{
  transform:translateY(-2px);
  border-color:rgba(230,37,114,.28);
  background:
    radial-gradient(circle at 0 50%,rgba(230,37,114,.075),transparent 52%),
    #0d0c0e;
  box-shadow:0 14px 32px rgba(0,0,0,.18);
}
.d2n-index-category-nav__item:hover::before{
  opacity:.65;
}
.d2n-index-category-nav__item.is-active{
  border-color:rgba(230,37,114,.39);
  background:
    radial-gradient(circle at 0 50%,rgba(230,37,114,.15),transparent 52%),
    linear-gradient(145deg,rgba(217,185,110,.045),transparent 60%),
    #0d0c0e;
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(230,37,114,.055);
}
.d2n-index-category-nav__item.is-active::before{
  opacity:1;
}
.d2n-index-category-nav__item.is-active span{
  color:var(--gold-soft);
  border-color:rgba(217,185,110,.24);
}
.d2n-index-category-nav__item.is-active strong{
  color:#fff4f7;
}

/* ---------- EDITORIAL GRID ---------- */
.d2n-magazine-index{
  width:min(1480px,calc(100% - 64px));
  padding-top:20px;
  padding-bottom:92px;
}
.d2n-index-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:12px;
  align-items:stretch;
}

/* Default cards are 4-column modules */
.d2n-index-card{
  grid-column:span 4;
  min-width:0;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.075);
  border-radius:19px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.018),transparent 55%),
    #0c0c0e;
  text-decoration:none;
  box-shadow:0 18px 44px rgba(0,0,0,.18);
  transition:
    transform .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}
.d2n-index-card:hover{
  transform:translateY(-4px);
  border-color:rgba(230,37,114,.27);
  box-shadow:0 26px 62px rgba(0,0,0,.30);
}
.d2n-index-card__media{
  position:relative;
  aspect-ratio:1.48/1;
  overflow:hidden;
  background:#121114;
}
.d2n-index-card__media::before{
  content:"";
  position:absolute;
  z-index:1;
  inset:0;
  background:
    radial-gradient(circle at 88% 12%,rgba(230,37,114,.10),transparent 30%),
    linear-gradient(90deg,rgba(57,0,24,.08),transparent 54%);
}
.d2n-index-card__media::after{
  content:"";
  position:absolute;
  z-index:2;
  inset:0;
  background:linear-gradient(180deg,rgba(0,0,0,.01) 50%,rgba(0,0,0,.42) 100%);
  pointer-events:none;
}
.d2n-index-card__media img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  transition:transform .6s cubic-bezier(.2,.7,.2,1),filter .3s ease;
}
.d2n-index-card:hover .d2n-index-card__media img{
  transform:scale(1.035);
  filter:saturate(1.05);
}
.d2n-index-card__number{
  position:absolute;
  z-index:3;
  right:11px;
  bottom:10px;
  width:31px;
  height:31px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.14);
  border-radius:50%;
  background:rgba(7,7,8,.48);
  color:#ebe3dc;
  font-size:7px;
  font-weight:950;
  backdrop-filter:blur(8px);
}
.d2n-index-card__body{
  padding:18px 17px 16px;
}
.d2n-index-card__category{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--pink-soft);
  font-size:7px;
  font-weight:950;
  letter-spacing:1.05px;
  text-transform:uppercase;
}
.d2n-index-card__category::before{
  content:"";
  width:13px;
  height:1px;
  background:currentColor;
  opacity:.8;
}
.d2n-index-card h2{
  margin:9px 0 0;
  font-family:Georgia,"Times New Roman",serif;
  color:#fffaf4;
  font-size:22px;
  font-weight:700;
  line-height:1.13;
  letter-spacing:-.55px;
  text-wrap:balance;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.d2n-index-card p{
  margin:9px 0 0;
  color:#9e9790;
  font-size:10px;
  line-height:1.52;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.d2n-index-card__foot{
  margin-top:15px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.065);
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:#7d7670;
  font-size:6px;
  font-weight:900;
  letter-spacing:.75px;
  text-transform:uppercase;
}
.d2n-index-card__foot b{
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border:1px solid rgba(217,185,110,.15);
  border-radius:50%;
  color:var(--gold-soft);
  font-size:9px;
}

/* The first story becomes the editorial lead. */
.d2n-index-card:first-child{
  grid-column:span 8;
  grid-row:span 2;
  position:relative;
  min-height:535px;
}
.d2n-index-card:first-child .d2n-index-card__media{
  position:absolute;
  inset:0;
  aspect-ratio:auto;
}
.d2n-index-card:first-child .d2n-index-card__media::after{
  background:
    linear-gradient(180deg,rgba(0,0,0,.01) 10%,rgba(0,0,0,.12) 46%,rgba(0,0,0,.74) 79%,rgba(4,4,5,.98) 100%),
    linear-gradient(90deg,rgba(50,0,20,.11),transparent 55%);
}
.d2n-index-card:first-child .d2n-index-card__body{
  position:absolute;
  z-index:4;
  left:0;
  right:0;
  bottom:0;
  padding:36px 31px 27px;
}
.d2n-index-card:first-child .d2n-index-card__category{
  color:var(--gold-soft);
}
.d2n-index-card:first-child h2{
  max-width:880px;
  margin-top:10px;
  font-size:clamp(34px,3.1vw,48px);
  line-height:1.02;
  letter-spacing:-1.25px;
  text-shadow:0 6px 24px rgba(0,0,0,.56);
}
.d2n-index-card:first-child p{
  max-width:760px;
  color:#c3bbb2;
  font-size:11px;
  line-height:1.58;
  -webkit-line-clamp:2;
}
.d2n-index-card:first-child .d2n-index-card__foot{
  max-width:760px;
  margin-top:17px;
}

/* Second and third cards become compact supporting covers beside the lead. */
.d2n-index-card:nth-child(2),
.d2n-index-card:nth-child(3){
  grid-column:span 4;
}
.d2n-index-card:nth-child(2) .d2n-index-card__media,
.d2n-index-card:nth-child(3) .d2n-index-card__media{
  aspect-ratio:1.72/1;
}
.d2n-index-card:nth-child(2) h2,
.d2n-index-card:nth-child(3) h2{
  font-size:20px;
}

/* From story 4 onward, return to a clean 3-column archive rhythm. */
.d2n-index-card:nth-child(n+4){
  grid-column:span 4;
}

/* When the list has only one card, make it cinematic but not absurdly tall. */
.d2n-index-grid > .d2n-index-card:only-child{
  grid-column:1 / -1;
  min-height:500px;
}
.d2n-index-grid > .d2n-index-card:only-child .d2n-index-card__body{
  max-width:950px;
}

/* ---------- EMPTY ---------- */
.d2n-index-empty{
  min-height:210px;
  border:1px solid rgba(230,37,114,.14);
  border-radius:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:
    radial-gradient(circle at 50% 0,rgba(230,37,114,.06),transparent 56%),
    rgba(255,255,255,.01);
}
.d2n-index-empty strong{
  color:var(--gold-soft);
  font-family:Georgia,"Times New Roman",serif;
  font-size:22px;
  font-style:italic;
  letter-spacing:.5px;
}
.d2n-index-empty span{
  color:#77706e;
  font-size:10px;
}

/* ---------- SCRIPT COMPENSATION ---------- */
html[lang^="zh"] .index-hero h1,
html[lang="ja"] .index-hero h1,
html[lang="ko"] .index-hero h1,
html[lang="th"] .index-hero h1,
html[lang="hi"] .index-hero h1,
html[lang="ar"] .index-hero h1,
html[lang^="zh"] .d2n-index-card h2,
html[lang="ja"] .d2n-index-card h2,
html[lang="ko"] .d2n-index-card h2,
html[lang="th"] .d2n-index-card h2,
html[lang="hi"] .d2n-index-card h2,
html[lang="ar"] .d2n-index-card h2{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",sans-serif;
}
html[lang^="zh"] .index-hero h1,
html[lang="ja"] .index-hero h1,
html[lang="ko"] .index-hero h1{
  font-size:clamp(48px,4.7vw,75px);
  line-height:1.01;
  letter-spacing:-2px;
}
html[lang="th"] .index-hero h1,
html[lang="hi"] .index-hero h1,
html[lang="ar"] .index-hero h1{
  font-size:clamp(45px,4.4vw,72px);
  line-height:1.05;
  letter-spacing:-1.6px;
}
html[lang^="zh"] .d2n-index-card:first-child h2,
html[lang="ja"] .d2n-index-card:first-child h2,
html[lang="ko"] .d2n-index-card:first-child h2,
html[lang="th"] .d2n-index-card:first-child h2,
html[lang="hi"] .d2n-index-card:first-child h2,
html[lang="ar"] .d2n-index-card:first-child h2{
  font-size:clamp(29px,2.6vw,42px);
  line-height:1.08;
}

/* ---------- MEDIUM PC ---------- */
@media(max-width:1220px) and (min-width:821px){
  .d2n-magazine-index-hero,
  .d2n-index-category-nav,
  .d2n-magazine-index{
    width:min(1180px,calc(100% - 40px));
  }
  .index-hero h1{
    font-size:74px;
  }
  .d2n-index-category-nav{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .d2n-index-card:first-child{
    grid-column:span 8;
    min-height:485px;
  }
  .d2n-index-card{
    grid-column:span 4;
  }
  .d2n-index-card:first-child h2{
    font-size:38px;
  }
}

/* ---------- SMALL DESKTOP / TABLET LANDSCAPE ---------- */
@media(max-width:980px) and (min-width:821px){
  .d2n-index-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .d2n-index-card,
  .d2n-index-card:nth-child(n),
  .d2n-index-card:first-child{
    grid-column:auto;
    grid-row:auto;
    min-height:0;
  }
  .d2n-index-card:first-child{
    grid-column:1 / -1;
    min-height:430px;
  }
  .d2n-index-card:first-child h2{
    font-size:35px;
  }
}
