/*
 * Magazine home hero — editorial "cover issue".
 * Motion: one load sequence (masthead → headline words → copy → cover), then only
 * slow ambient loops (glossy sheen on the cover image, seal rotation, light drift). Pointer parallax
 * lives in assets/js/magazine-hero.js. Everything stops under prefers-reduced-motion.
 */

.mag-hero {
  --mh-ink: #08231a;
  --mh-deep: #01251a;
  --mh-green: #015434;
  --mh-green-dark: #013d28;
  --mh-gold: #cfb997;
  --mh-gold-light: #e8d7b4;
  --mh-brass: #a8895f;
  --mh-paper: #fbf9f4;
  --mh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mh-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: 1.25rem 0 3.5rem;
  background: linear-gradient(180deg, var(--mh-paper) 0%, #fff 78%);
}

@media (min-width: 1024px) {
  .mag-hero {
    padding: 1.75rem 0 5rem;
  }
}

/* ─── Paper: warm light, newspaper column rules, grain ─── */
.mag-hero__paper {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.mag-hero__light {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
}

.mag-hero__light--gold {
  width: 46rem;
  height: 46rem;
  top: -22rem;
  right: -12rem;
  background: radial-gradient(circle, rgba(207, 185, 151, 0.34) 0%, rgba(207, 185, 151, 0) 65%);
  animation: mh-drift 22s ease-in-out infinite alternate;
}

.mag-hero__light--green {
  width: 40rem;
  height: 40rem;
  bottom: -18rem;
  left: -10rem;
  background: radial-gradient(circle, rgba(1, 84, 52, 0.11) 0%, rgba(1, 84, 52, 0) 65%);
  animation: mh-drift 26s ease-in-out -8s infinite alternate-reverse;
}

.mag-hero__columns {
  position: absolute;
  inset: 0;
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
  background-image: linear-gradient(90deg, rgba(8, 35, 26, 0.05) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 55%, transparent 100%);
}

.mag-hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.03 0 0 0 0 0.14 0 0 0 0 0.1 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── Masthead ─── */
.mag-masthead {
  position: relative;
}

.mag-masthead__rule {
  display: block;
  height: 2px;
  background: var(--mh-ink);
  transform-origin: center;
  animation: mh-rule 1.1s var(--mh-ease) backwards;
}

.mag-masthead__rule::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 4px;
  background: linear-gradient(90deg, transparent, var(--mh-gold) 15%, var(--mh-gold) 85%, transparent);
}

.mag-masthead__rule--thin {
  height: 1px;
  background: rgba(8, 35, 26, 0.12);
  animation-delay: 0.15s;
}

.mag-masthead__rule--thin::after {
  display: none;
}

.mag-masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0 0.7rem;
  font-size: 0.8rem;
  line-height: 1.4;
  animation: mh-fade 0.8s var(--mh-ease) 0.35s backwards;
}

.mag-masthead__name {
  font-weight: 900;
  color: var(--mh-ink);
}

.mag-masthead__issue {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--mh-brass);
}

.mag-masthead__diamond {
  width: 5px;
  height: 5px;
  background: var(--mh-gold);
  transform: rotate(45deg);
}

.mag-masthead__meta {
  display: none;
  font-weight: 600;
  color: rgba(8, 35, 26, 0.55);
}

@media (min-width: 768px) {
  .mag-masthead__meta {
    display: inline;
  }
}

/* ─── Layout ─── */
.mag-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3.25rem;
  margin-top: 2.25rem;
}

@media (min-width: 1024px) {
  .mag-hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: start;
    gap: 4.5rem;
    margin-top: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .mag-hero__copy {
    padding-top: 0.75rem;
  }
}

/* ─── Headline ─── */
.mag-hero__title {
  margin: 0;
  font-weight: 900;
  color: var(--mh-ink);
}

.mag-hero__kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 800;
  color: var(--mh-green);
  animation: mh-fade 0.8s var(--mh-ease) 0.2s backwards;
}

.mag-hero__kicker-line {
  flex-shrink: 0;
  width: 2.25rem;
  height: 1px;
  background: var(--mh-gold);
  transform-origin: right;
  animation: mh-rule 0.9s var(--mh-ease) 0.3s backwards;
}

.mag-hero__line {
  display: block;
  font-size: clamp(2.15rem, 1.3rem + 3.5vw, 4rem);
  letter-spacing: -0.01em;
}

.mag-hero__line--light {
  font-weight: 300;
  line-height: 1.3;
  color: rgba(8, 35, 26, 0.82);
}

.mag-hero__line--bold {
  font-weight: 900;
  line-height: 1.35;
}

/* Each word rises out of its own mask. */
.mag-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.1em 0.02em 0.22em;
  margin: -0.1em -0.02em -0.22em;
}

.mag-w > span {
  display: inline-block;
  animation: mh-word 1s var(--mh-ease-out) calc(0.3s + var(--i, 0) * 0.075s) backwards;
}

.mag-mark {
  position: relative;
  display: inline-block;
  color: var(--mh-green);
}

.mag-ink {
  position: absolute;
  right: -6%;
  left: -6%;
  bottom: -0.1em;
  width: 112%;
  height: 0.36em;
  overflow: visible;
  pointer-events: none;
}

.mag-ink path {
  fill: none;
  stroke: var(--mh-gold);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: mh-ink 1s var(--mh-ease) 1.15s forwards;
}

/* ─── Lead, search, popular ─── */
.mag-hero__lead {
  max-width: 36rem;
  margin: 1.25rem 0 0;
  font-size: 1.05rem;
  line-height: 2;
  color: rgba(8, 35, 26, 0.62);
  animation: mh-up 0.9s var(--mh-ease) 0.85s backwards;
}

.mag-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 36rem;
  height: 3.85rem;
  margin-top: 1.6rem;
  padding-inline: 1.1rem 0.45rem;
  border: 1px solid rgba(8, 35, 26, 0.1);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 #fff,
    0 22px 44px -24px rgba(8, 35, 26, 0.28),
    0 2px 6px rgba(8, 35, 26, 0.04);
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: mh-up 0.9s var(--mh-ease) 0.95s backwards;
}

.mag-search:focus-within {
  border-color: rgba(207, 185, 151, 0.9);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 4px rgba(207, 185, 151, 0.22),
    0 22px 44px -24px rgba(8, 35, 26, 0.3);
}

.mag-search__icon {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: rgba(8, 35, 26, 0.42);
  stroke-width: 2;
  stroke-linecap: round;
}

.mag-search__field {
  position: relative;
  flex: 1;
  align-self: stretch;
  min-width: 0;
}

.mag-search__field input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 0.75rem;
  border: 0;
  background: transparent;
  color: var(--mh-ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.mag-search__field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.mag-search__field input::placeholder {
  color: rgba(8, 35, 26, 0.42);
}

.mag-search.is-live .mag-search__field input::placeholder {
  color: transparent;
}

.mag-search__ghost {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  padding: 0 0.75rem;
  overflow: hidden;
  white-space: nowrap;
  font-size: 1rem;
  color: rgba(8, 35, 26, 0.42);
  pointer-events: none;
}

.mag-search.is-live .mag-search__ghost {
  display: flex;
}

.mag-search.is-typing .mag-search__ghost {
  display: none;
}

.mag-search__ghost-prefix {
  flex-shrink: 0;
  white-space: pre;
}

.mag-search__ghost-word {
  font-weight: 700;
  color: rgba(8, 35, 26, 0.72);
}

.mag-search__caret {
  flex-shrink: 0;
  width: 1.5px;
  height: 1.15em;
  margin-inline-start: 2px;
  background: var(--mh-green);
  animation: mh-caret 1s steps(1) infinite;
}

.mag-search__btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.45rem;
  height: 2.95rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 0.8rem;
  background: var(--mh-green);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.25s;
}

.mag-search__btn:hover {
  background: var(--mh-green-dark);
}

.mag-search__btn:focus-visible {
  outline: 2px solid var(--mh-gold);
  outline-offset: 2px;
}

.mag-search__btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--mh-ease);
}

.mag-search__btn:hover svg {
  transform: translateX(-3px);
}

@media (max-width: 479.98px) {
  .mag-search__btn span {
    display: none;
  }
  .mag-search__btn {
    width: 2.95rem;
    padding: 0;
    justify-content: center;
  }
}

.mag-hero__popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 1rem 0 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: rgba(8, 35, 26, 0.5);
  animation: mh-up 0.9s var(--mh-ease) 1.05s backwards;
}

.mag-hero__popular a {
  font-weight: 700;
  color: rgba(8, 35, 26, 0.78);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  transition: color 0.25s, text-decoration-color 0.25s;
}

.mag-hero__popular a:hover {
  color: var(--mh-green);
  text-decoration-color: var(--mh-gold);
}

.mag-hero__sep {
  width: 4px;
  height: 4px;
  background: var(--mh-gold);
  transform: rotate(45deg);
}

/* ─── Ledger stats ─── */
.mag-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 34rem;
  margin: 1.75rem 0 0;
  border-top: 1px solid rgba(8, 35, 26, 0.1);
  border-bottom: 1px solid rgba(8, 35, 26, 0.1);
  animation: mh-up 0.9s var(--mh-ease) 1.15s backwards;
}

.mag-ledger__item {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 0.8rem 0;
}

.mag-ledger__item + .mag-ledger__item {
  padding-inline-start: 1.25rem;
  border-inline-start: 1px solid rgba(207, 185, 151, 0.55);
}

.mag-ledger dt {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(8, 35, 26, 0.52);
}

.mag-ledger dd {
  margin: 0;
  font-size: clamp(1.45rem, 1.1rem + 1vw, 1.95rem);
  line-height: 1.25;
  font-weight: 900;
  color: var(--mh-green);
}

.mag-ledger dd small {
  margin-inline-start: 0.1em;
  font-size: 0.7em;
  color: var(--mh-brass);
}

/* ─── Next steps ─── */
.mag-hero__next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.6rem;
  animation: mh-up 0.9s var(--mh-ease) 1.25s backwards;
}

.mag-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 3.3rem;
  padding: 0 2rem;
  overflow: hidden;
  border: 1px solid rgba(207, 185, 151, 0.4);
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--mh-green) 0%, var(--mh-deep) 100%);
  color: #fff !important;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 16px 32px -14px rgba(1, 84, 52, 0.6);
  transition: transform 0.35s var(--mh-ease), box-shadow 0.35s var(--mh-ease);
}

.mag-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 22px 40px -16px rgba(1, 84, 52, 0.7);
}

.mag-btn:focus-visible {
  outline: 2px solid var(--mh-gold);
  outline-offset: 3px;
}

.mag-btn__label {
  position: relative;
  z-index: 1;
}

/* A slow gold glint crosses the button now and then, and on hover. */
.mag-btn__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(232, 215, 180, 0.38), transparent);
  transform: translateX(-160%) skewX(-18deg);
  animation: mh-glint 7s var(--mh-ease) 2.6s infinite;
}

.mag-btn:hover .mag-btn__shine {
  animation: mh-glint-once 0.9s var(--mh-ease);
}

.mag-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(8, 35, 26, 0.72);
  background: linear-gradient(var(--mh-gold), var(--mh-gold)) no-repeat right bottom / 0 1px;
  padding-bottom: 2px;
  transition: color 0.25s, background-size 0.45s var(--mh-ease);
}

.mag-link:hover {
  color: var(--mh-green);
  background-size: 100% 1px;
}

.mag-link svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--mh-ease);
}

.mag-link:hover svg {
  transform: translateX(-4px);
}

/* ─── Cover story: the featured image is shown whole (it carries its own printed
   headline), framed like a print on a paper mat; our text lives on the paper below. ─── */
.mag-hero__visual {
  width: 100%;
  max-width: 31rem;
  margin-inline: auto;
}

@media (min-width: 1024px) {
  .mag-hero__visual {
    max-width: none;
  }
}

.mag-cover {
  --px: 0px;
  --py: 0px;
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  margin: 0.75rem 0.75rem 0;
  perspective: 1400px;
}

@media (min-width: 1024px) {
  .mag-cover {
    margin: 0 1.25rem 0 1.75rem;
  }
}

.mag-cover__card {
  position: relative;
  z-index: 3;
  transform: translate3d(var(--px), var(--py), 0) rotateX(var(--rx)) rotateY(var(--ry));
  animation: mh-cover-in 1.25s var(--mh-ease-out) 0.35s backwards;
}

.mag-cover__link {
  position: relative;
  display: block;
  padding: 0.7rem 0.7rem 0;
  border-radius: 1.6rem;
  background: linear-gradient(180deg, #fff 0%, #fdfbf6 100%);
  color: var(--mh-ink);
  box-shadow:
    0 0 0 1px rgba(8, 35, 26, 0.07),
    0 40px 80px -42px rgba(8, 35, 26, 0.5),
    0 14px 30px -18px rgba(8, 35, 26, 0.22);
  transition: box-shadow 0.5s var(--mh-ease), translate 0.5s var(--mh-ease);
}

.mag-cover__link:hover {
  translate: 0 -4px;
  box-shadow:
    0 0 0 1px rgba(207, 185, 151, 0.55),
    0 50px 90px -42px rgba(8, 35, 26, 0.55),
    0 18px 36px -18px rgba(8, 35, 26, 0.25);
}

.mag-cover__link:focus-visible {
  outline: 2px solid var(--mh-gold);
  outline-offset: 4px;
}

/* Editor's pick ribbon sits on the mat's top edge, never on the image. */
.mag-cover__tag {
  position: absolute;
  top: -0.8rem;
  right: 1.5rem;
  z-index: 2;
  padding: 0.3rem 0.95rem;
  border: 1px solid rgba(168, 137, 95, 0.35);
  border-radius: 9999px;
  background: linear-gradient(180deg, #f1e4c8 0%, #e2cfa8 100%);
  color: var(--mh-ink);
  font-size: 0.76rem;
  line-height: 1.4;
  font-weight: 800;
  box-shadow: 0 6px 14px -6px rgba(168, 137, 95, 0.6);
}

.mag-cover__media {
  position: relative;
  display: block;
  aspect-ratio: var(--mh-ratio, 1.6);
  overflow: hidden;
  border-radius: 1.05rem;
  background: #eef1ec;
  box-shadow: inset 0 0 0 1px rgba(8, 35, 26, 0.06);
}

.mag-cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Portrait / very wide images: whole image on a blurred copy of itself. */
.mag-cover__media.is-contain::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: var(--mh-bg) center / cover;
  filter: blur(22px) saturate(0.9);
  opacity: 0.7;
}

.mag-cover__media.is-contain .mag-cover__img {
  object-fit: contain;
}

/* Glossy-print light: a soft band crosses the image now and then (no crop, no overlay text). */
.mag-cover__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.22) 48%, rgba(255, 248, 230, 0.08) 54%, transparent 64%);
  background-size: 250% 100%;
  background-position: 130% 0;
  animation: mh-sheen 9s var(--mh-ease) 2s infinite;
}

.mag-cover__link:hover .mag-cover__sheen {
  animation: mh-sheen-once 1.1s var(--mh-ease);
}

.mag-cover__caption {
  position: relative;
  display: block;
  padding: 1.15rem 0.75rem 1.3rem;
}

/* Keep the caption text clear of the seal on the left edge. */
@media (min-width: 640px) {
  .mag-cover__caption {
    padding-left: 4.75rem;
  }
}

.mag-cover__caption::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0.75rem;
  left: 0.75rem;
  height: 1px;
  background: linear-gradient(to left, rgba(207, 185, 151, 0.8), rgba(207, 185, 151, 0));
}

.mag-cover__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--mh-brass);
}

.mag-cover__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.mag-cover__title {
  display: -webkit-box;
  margin-top: 0.45rem;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: clamp(1.1rem, 0.95rem + 0.55vw, 1.32rem);
  line-height: 1.75;
  font-weight: 900;
  color: var(--mh-ink);
  transition: color 0.3s;
}

.mag-cover__link:hover .mag-cover__title {
  color: var(--mh-green);
}

.mag-cover__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding-bottom: 3px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--mh-green);
}

.mag-cover__cta::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--mh-gold);
  transform: scaleX(0.35);
  transform-origin: right;
  transition: transform 0.5s var(--mh-ease);
}

.mag-cover__link:hover .mag-cover__cta::after {
  transform: scaleX(1);
}

.mag-cover__cta svg,
.mag-toc svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.4s var(--mh-ease);
}

.mag-cover__link:hover .mag-cover__cta svg {
  transform: translateX(-4px);
}

/* Two paper sheets fanned behind (the next picks). */
.mag-cover__sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.6rem;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(8, 35, 26, 0.07),
    0 26px 50px -30px rgba(8, 35, 26, 0.4);
  transform: translate3d(calc(var(--px) * var(--d)), calc(var(--py) * var(--d)), 0);
  transition: rotate 0.8s var(--mh-ease), translate 0.8s var(--mh-ease);
}

.mag-cover__sheet--0 {
  --d: 0.55;
  z-index: 2;
  rotate: -5deg;
  translate: -7% 2.5%;
  scale: 0.94;
  animation: mh-sheet-0 1.2s var(--mh-ease-out) 0.85s backwards;
}

.mag-cover__sheet--1 {
  --d: 0.3;
  z-index: 1;
  rotate: 4.5deg;
  translate: 6% 5%;
  scale: 0.88;
  animation: mh-sheet-1 1.2s var(--mh-ease-out) 0.95s backwards;
}

.mag-cover:hover .mag-cover__sheet--0 {
  rotate: -7.5deg;
  translate: -11% 2%;
}

.mag-cover:hover .mag-cover__sheet--1 {
  rotate: 7deg;
  translate: 10% 4%;
}

.mag-cover__sheet-img {
  position: relative;
  flex: 0 0 62%;
  overflow: hidden;
  border-radius: 1rem;
  background: #eef1ec;
}

.mag-cover__sheet-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  filter: saturate(0.8);
}

.mag-cover__sheet-lines {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
}

.mag-cover__sheet-lines i {
  display: block;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(8, 35, 26, 0.08);
}

.mag-cover__sheet-lines i + i {
  width: 60%;
  background: rgba(207, 185, 151, 0.35);
}

/* Rotating seal — bottom corner, on the paper side, clear of the image. */
.mag-seal {
  --d: 1.6;
  position: absolute;
  bottom: 1.6rem;
  left: -2.4rem;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 6.75rem;
  height: 6.75rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #f6f1e6 70%);
  box-shadow:
    0 0 0 1px rgba(207, 185, 151, 0.6),
    0 0 0 6px rgba(251, 249, 244, 0.92),
    0 0 0 7px rgba(207, 185, 151, 0.35),
    0 18px 36px -14px rgba(8, 35, 26, 0.35);
  transform: translate3d(calc(var(--px) * var(--d)), calc(var(--py) * var(--d)), 0);
  animation: mh-seal-in 1s var(--mh-ease-out) 1.35s backwards;
}

@media (max-width: 639.98px) {
  .mag-seal {
    bottom: auto;
    top: -3rem;
    left: -0.75rem;
    width: 5.5rem;
    height: 5.5rem;
  }
}

.mag-seal__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: mh-spin 40s linear infinite;
}

.mag-cover:hover .mag-seal__ring {
  animation-duration: 14s;
}

.mag-seal__ring text {
  font-size: 10.2px;
  font-weight: 800;
  fill: var(--mh-ink);
}

.mag-seal__core {
  display: grid;
  place-items: center;
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(207, 185, 151, 0.7), inset 0 0 0 3px #fff, inset 0 0 0 4px rgba(207, 185, 151, 0.35);
}

.mag-seal__core img {
  width: 72%;
  height: auto;
}

/* «در این شماره» — the other picks as a text-only table of contents. */
.mag-toc {
  margin: 2.25rem 0.75rem 0;
}

@media (min-width: 1024px) {
  .mag-toc {
    margin: 2.5rem 1.25rem 0 1.75rem;
  }
}

.mag-toc__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(8, 35, 26, 0.55);
  animation: mh-fade 0.8s var(--mh-ease) 1.4s backwards;
}

.mag-toc__label span {
  width: 5px;
  height: 5px;
  background: var(--mh-gold);
  transform: rotate(45deg);
}

.mag-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mag-toc li {
  border-bottom: 1px solid rgba(8, 35, 26, 0.09);
  animation: mh-up 0.8s var(--mh-ease) calc(1.5s + var(--n, 0) * 0.12s) backwards;
}

.mag-toc a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  color: var(--mh-ink);
}

.mag-toc__num {
  flex-shrink: 0;
  width: 2.4rem;
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 300;
  color: var(--mh-brass);
  transition: color 0.3s;
}

.mag-toc__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.mag-toc__cat {
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(8, 35, 26, 0.48);
}

.mag-toc__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  line-height: 1.8;
  font-weight: 800;
  transition: color 0.3s;
}

.mag-toc a > svg {
  flex-shrink: 0;
  color: rgba(8, 35, 26, 0.35);
}

.mag-toc a:hover .mag-toc__title,
.mag-toc a:hover > svg {
  color: var(--mh-green);
}

.mag-toc a:hover .mag-toc__num {
  color: var(--mh-green);
}

.mag-toc a:hover > svg {
  transform: translateX(-4px);
}

/* ─── Keyframes ─── */
@keyframes mh-rule {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes mh-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mh-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mh-word {
  from {
    transform: translateY(108%);
  }
  to {
    transform: none;
  }
}

@keyframes mh-ink {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes mh-caret {
  50% {
    opacity: 0;
  }
}

@keyframes mh-glint {
  0%,
  78% {
    transform: translateX(-160%) skewX(-18deg);
  }
  100% {
    transform: translateX(330%) skewX(-18deg);
  }
}

@keyframes mh-glint-once {
  from {
    transform: translateX(-160%) skewX(-18deg);
  }
  to {
    transform: translateX(330%) skewX(-18deg);
  }
}

@keyframes mh-cover-in {
  from {
    opacity: 0;
    clip-path: inset(100% 0 0 0 round 1.6rem);
    translate: 0 40px;
  }
  to {
    opacity: 1;
    clip-path: inset(-2rem -2rem -2rem -2rem round 1.6rem);
    translate: 0 0;
  }
}

@keyframes mh-sheet-0 {
  from {
    opacity: 0;
    rotate: 0deg;
    translate: 0 6%;
  }
}

@keyframes mh-sheet-1 {
  from {
    opacity: 0;
    rotate: 0deg;
    translate: 0 8%;
  }
}

@keyframes mh-seal-in {
  from {
    opacity: 0;
    scale: 0.55;
    rotate: -60deg;
  }
  to {
    opacity: 1;
    scale: 1;
    rotate: 0deg;
  }
}

@keyframes mh-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mh-sheen {
  0%,
  70% {
    background-position: 130% 0;
  }
  100% {
    background-position: -40% 0;
  }
}

@keyframes mh-sheen-once {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -40% 0;
  }
}

@keyframes mh-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-6%, 8%) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mag-hero *,
  .mag-hero *::before,
  .mag-hero *::after {
    animation: none !important;
    transition: none !important;
  }
  .mag-ink path {
    stroke-dashoffset: 0;
  }
  .mag-search__caret {
    display: none;
  }
}
