/* ==========================================================================
   MAGAZINE: LAYOUT / SKIN
   Purpose: a little extra personality without changing structure.
   ========================================================================== */

.cte-mag__headerRow{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cte-mag__date{
  color: var(--cte-muted);
  font: 700 14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.cte-mag__subnote{
  margin-top: 6px;
  color: var(--cte-muted);
  font: 600 13px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.cte-mag__footer{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 14px clamp(16px,3vw,30px);
  background: rgba(0,0,0,.02);
  border-top: 1px solid rgba(0,0,0,.08);
}

.cte-mag__nav a{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  text-decoration: none;
  color: var(--cte-ink);
  font: 800 13px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* ==========================================================================
   MAGAZINE: BUTTON POLISH (scoped)
   ========================================================================== */

.cte-mag .cte-mag__actions{
  gap: 12px;
  align-items: center;
}

.cte-mag .cte-mag__actions .cte-btn{
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 16px;
  text-decoration: none !important;
  line-height: 1;
  box-shadow: none;
}

/* Primary: stronger presence */
.cte-mag .cte-mag__actions .cte-btn--primary{
  color: #fff !important;
}

/* Secondary: cleaner “outline” look */
.cte-mag .cte-mag__actions .cte-btn:not(.cte-btn--primary){
  background: #fff;
  border-color: rgba(0,0,0,.14);
}

/* Hover: subtle, not jumpy */
.cte-mag .cte-mag__actions .cte-btn:hover{
  filter: brightness(0.98);
  transform: translateY(-1px);
}

/* Focus: accessible + visible */
.cte-mag .cte-mag__actions .cte-btn:focus-visible{
  outline: 3px solid rgba(240,127,42,.35);
  outline-offset: 3px;
}

/* Mobile: stack full width */
@media (max-width: 560px){
  .cte-mag .cte-mag__actions{
    flex-direction: column;
    align-items: stretch;
  }
  .cte-mag .cte-mag__actions .cte-btn{
    width: 100%;
  }
}

/* ============================================================
   ALSO IN THIS ISSUE — archive-card reuse (magazine singles)
   Goal: make .cte-archive__item look identical here as on archive pages.
   ============================================================ */

.cte-mag .cte-archive__item{
  align-items: start; /* avoid weird vertical centering/stretch */
}

.cte-mag .cte-archive__title{
  color: rgba(0,0,0,.92) !important;
  text-decoration: none !important;
}
.cte-mag .cte-archive__title:hover{
  text-decoration: underline !important;
}

/* Buttons inside these cards should not inherit odd typography spacing */
.cte-mag .cte-archive__item .cte-btn{
  margin-top: 4px;
}

/* AUTOP/EDITOR-PROOFING (in case any p/br slip in) */
.cte-mag .cte-archive__item br{ display:none !important; }
.cte-mag .cte-archive__item p{
  margin:0 !important;
  padding:0 !important;
}

/* ============================================================
   ALSO IN THIS ISSUE — GRID HARDENING
   Fix "every other card renders wrong" by preventing auto-placement drift.
   ============================================================ */

/* Ensure predictable stacking */
.cte-mag .cte-archive__grid{
  grid-auto-flow: row;
}

/* Each card: re-assert the two-column template (some theme CSS can override) */
.cte-mag .cte-archive__item{
  display: grid !important;
  grid-template-columns: 140px 1fr !important;
  align-items: start !important;
}

/* If no thumb anchor exists, collapse to one column (robust even if class is missing) */
.cte-mag .cte-archive__item:has(.cte-archive__thumb){ grid-template-columns: 140px 1fr !important; }
.cte-mag .cte-archive__item:not(:has(.cte-archive__thumb)){ grid-template-columns: 1fr !important; }

/* Explicit placement (prevents auto-placement from treating body as col 1 sometimes) */
.cte-mag .cte-archive__thumb{ grid-column: 1 !important; }
.cte-mag .cte-archive__body { grid-column: 2 !important; min-width:0 !important; }

/* No-image variant: body spans full width */
.cte-mag .cte-archive__item--noimg .cte-archive__body{
  grid-column: 1 / -1 !important;
}

/* Mobile: match archive behavior */
@media (max-width: 820px){
  .cte-mag .cte-archive__item{ grid-template-columns: 1fr !important; }
  .cte-mag .cte-archive__body{ grid-column: 1 / -1 !important; }
}
