/* Article Header Card v2.0 — CSS Variable driven */
:root{
  --ahc-radius: 18px;
  --ahc-gap: 32px;
  --ahc-pad: 28px;
  --ahc-title-size: 42px;
  --ahc-title-size-mobile: 24px;
  --ahc-title-weight: 800;
  --ahc-title-color: #121a24;
  --ahc-title-lh: 1.12;
  --ahc-subtitle-size: clamp(1rem,1.6vw,1.125rem);
  --ahc-subtitle-color: #263242;
  --ahc-bg: #f1f2f4;
  --ahc-max-width: 100%;
  --ahc-margin-bottom: 1.6rem;
  --ahc-shadow: 0 8px 22px rgba(0,0,0,0.08);
  --ahc-img-aspect: 1/1;
  --ahc-img-aspect-mobile: 16/9;
  --ahc-img-fit: cover;
  --ahc-img-max-w: 280px;
  --ahc-lb-opacity: 0.82;
  --ahc-lb-max-w: 1400px;
  --ahc-meta-color: #555;
  --ahc-meta-size: 0.9rem;
}

/* Card wrapper */
.ahc-card{ width:100%; max-width:var(--ahc-max-width); margin:0 auto var(--ahc-margin-bottom) auto; }

.ahc-inner{
  background: var(--ahc-bg);
  border-radius: var(--ahc-radius);
  box-shadow: var(--ahc-shadow);
  display: grid;
  grid-template-columns: minmax(160px, var(--ahc-img-max-w)) 1fr;
  gap: var(--ahc-gap);
  align-items: center;
  padding: var(--ahc-pad);
}
.ahc-inner--no-image{
  grid-template-columns: 1fr;
}

/* Image */
.ahc-media{
  width:100%; aspect-ratio:var(--ahc-img-aspect);
  border-radius:calc(var(--ahc-radius) - 6px);
  overflow:hidden; background:#f5f7fa;
  display:flex; align-items:center; justify-content:center;
}
.ahc-media img{ width:100%; height:100%; object-fit:var(--ahc-img-fit); }
.ahc-media--placeholder::after{ content:""; width:70%; height:70%; background:#cfd7e6; border-radius:12px; }

/* Text */
.ahc-text{ padding-right:8px; }
.ahc-title{
  margin:0 0 8px 0;
  font-size:var(--ahc-title-size) !important;
  line-height:var(--ahc-title-lh);
  font-weight:var(--ahc-title-weight);
  color:var(--ahc-title-color);
  word-break:break-word;
}
.ahc-subtitle{
  margin:0 0 6px 0;
  font-size:var(--ahc-subtitle-size);
  color:var(--ahc-subtitle-color);
  opacity:.9;
}

/* Meta row */
.ahc-meta{
  display:flex; flex-wrap:wrap; align-items:center; gap:6px;
  margin-top:10px;
  font-size:var(--ahc-meta-size); color:var(--ahc-meta-color);
}
.ahc-meta-sep{ opacity:.45; }

/* ── Tablet ── */
@media (max-width: 1024px){
  .ahc-inner{ grid-template-columns: 160px 1fr; gap:22px; padding:22px; }
  .ahc-media img{ object-fit:contain; background:#fff; }
}

/* ── Mobile ── */
@media (max-width: 640px){
  .ahc-inner{ grid-template-columns:1fr; gap:14px; padding:16px; }
  .ahc-media{ aspect-ratio:var(--ahc-img-aspect-mobile); }
  .ahc-title{ font-size: clamp(var(--ahc-title-size-mobile), 6vw, var(--ahc-title-size)) !important; }
}

/* ── Lightbox ── */
.ahc-lightbox-overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0, var(--ahc-lb-opacity));
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none; transition:opacity .2s ease;
  z-index:2147483647;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.ahc-lightbox-overlay.is-visible{ opacity:1; pointer-events:auto; }
.ahc-lightbox-img{
  max-width:min(96vw, var(--ahc-lb-max-w)); max-height:90vh;
  object-fit:contain; display:block; border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.4); background:#000;
}
.ahc-lightbox-close{
  position:absolute; top: clamp(10px, 2vw, 18px); right: clamp(12px, 2vw, 22px);
  width:40px; height:40px; border-radius:999px; border:none; cursor:pointer;
  background:#fff; color:#111; font-size:26px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.25);
}
html.ahcns-lightbox-open{ overscroll-behavior:none; }
body.ahcns-no-scroll{ overflow:hidden; }
body.ahcns-pad-right{ padding-right:var(--ahcns-scrollbar,0px); }

/* ── Mobile full image baseline ── */
@media (max-width: 1024px){
  .ahc-media{ aspect-ratio:auto !important; height:auto !important; }
  .ahc-media img{
    width:100% !important; height:auto !important;
    object-fit:contain !important; object-position:center top !important;
    max-height:none !important; background:transparent !important;
  }
}
