/* Phase 2: magazine homepage. Scoped to .mag-home so other pages are not affected. Tokens come from magazine.css. */

.mag-home {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 56px;
  background: var(--mag-paper);
  color: var(--mag-ink);
  font-family: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
}
.mag-home .mag-cover, .mag-home .mag-sub, .mag-home .mag-cover-section { color: #F3EFE6; }
.mag-home .mag-cover-section .mag-contents { color: var(--mag-ink); }
.mag-home .mag-sub { color: var(--mag-paper); }
.mag-home a { color: inherit; text-decoration: none; }
.mag-home a:focus-visible { outline: 3px solid var(--mag-yellow); outline-offset: 3px; }
.mag-home-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mag-home .mag-kicker { color: var(--mag-red); font-weight: 700; font-size: 13px; }
.mag-home h2, .mag-home h3 { font-family: 'Alexandria', 'Noto Sans Arabic', sans-serif; margin: 0; line-height: 1.3; }

/* Cover */
.mag-cover-section { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 0; border-top: 5px solid var(--mag-red); background: var(--mag-card); }
.mag-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 560px;
  overflow: hidden;
  background: var(--mag-black);
  color: #fff;
  padding: 36px;
  isolation: isolate;
}
.mag-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.mag-cover-dots { position: absolute; inset: 0; z-index: -1; background: radial-gradient(rgba(0,0,0,.35) 1px, transparent 1.2px) 0 0 / 6px 6px, linear-gradient(90deg, rgba(11,10,9,.94) 0%, rgba(11,10,9,.7) 40%, rgba(11,10,9,.2) 72%, rgba(11,10,9,.05) 100%), linear-gradient(0deg, rgba(11,10,9,.92) 0%, rgba(11,10,9,0) 60%); }
.mag-cover-chip { position: absolute; top: 24px; right: 24px; background: var(--mag-yellow); color: var(--mag-black); font-weight: 800; font-size: 13px; padding: 6px 12px; }
.mag-cover-title { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: clamp(64px, 11vw, 140px); line-height: .9; text-transform: uppercase; color: #fff; display: block; margin-bottom: 14px; }
.mag-cover-sticker {
  position: absolute;
  top: 56px;
  left: 36px;
  width: 130px;
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--mag-yellow);
  color: var(--mag-black);
  border-radius: 50%;
  transform: rotate(-10deg);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  line-height: 1.1;
}
.mag-cover-sticker-price { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 40px; }
.mag-cover-lines { display: none; }
@media (min-width: 1024px) {
  .mag-cover-lines { display: grid; gap: 12px; position: absolute; top: 76px; right: 24px; width: 260px; z-index: 1; }
  .mag-cover-line { display: grid; gap: 2px; background: rgba(11,10,9,.72); border-right: 4px solid var(--mag-yellow); padding: 10px 12px; font-size: 14px; color: #F3EFE6; }
  .mag-cover-line-title { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 26px; line-height: 1; color: #fff; text-transform: uppercase; }
}
.mag-cover-main { display: block; max-width: 640px; }
.mag-cover-status { display: inline-block; background: var(--mag-red); color: #fff; font-weight: 700; font-size: 14px; padding: 4px 10px; margin-bottom: 12px; }
.mag-cover-desc { display: block; font-size: 17px; line-height: 1.7; color: #F3EFE6; margin-bottom: 10px; }
.mag-cover-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; background: var(--mag-yellow); color: var(--mag-black); font-weight: 800; padding: 0 20px; }

.mag-contents { padding: 26px 24px; border-right: 1px solid var(--mag-rule); background: var(--mag-paper); }
.mag-contents-head { display: flex; flex-direction: column; gap: 6px; border-bottom: 2px solid var(--mag-ink); padding-bottom: 12px; margin-bottom: 6px; }
.mag-contents-head h2 { font-size: 24px; }
.mag-toc { display: grid; }
.mag-toc a { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; min-height: 44px; padding: 12px 0; border-bottom: 1px solid var(--mag-rule); }
.mag-toc-page { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 28px; color: var(--mag-red); line-height: 1; }
.mag-toc-copy { display: flex; flex-direction: column; gap: 3px; }
.mag-toc-title { font-family: 'Alexandria', sans-serif; font-weight: 800; font-size: 17px; }
.mag-toc-dek { font-size: 14px; color: var(--mag-muted); line-height: 1.5; }
.mag-shorts { margin-top: 20px; display: grid; gap: 10px; }
.mag-short { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--mag-rule); }
.mag-short-thumb { display: block; width: 56px; height: 56px; background: var(--mag-card); border: 1px solid var(--mag-rule); overflow: hidden; }
.mag-short-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mag-short-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mag-short-title { font-weight: 800; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.mag-short-meta { font-size: 13px; color: var(--mag-muted); }

/* Section heads */
.mag-section { margin-top: 56px; }
.mag-sec-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: end; border-top: 5px solid var(--mag-ink); padding-top: 14px; margin-bottom: 22px; }
.mag-sec-num { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 56px; line-height: .9; color: var(--mag-red); }
.mag-sec-copy { display: flex; flex-direction: column; gap: 4px; }
.mag-sec-copy h2 { font-size: clamp(26px, 3.4vw, 36px); }
.mag-sec-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; border-bottom: 2px solid var(--mag-ink); white-space: nowrap; }

/* Features */
.mag-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.mag-feature { border-right: 1px solid var(--mag-rule); padding: 0 22px; }
.mag-feature:first-child { padding-right: 0; }
.mag-feature:last-child { border-right: 0; }
.mag-feature-link { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.mag-feature-art { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--mag-black); overflow: hidden; }
.mag-feature-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.mag-feature-link:hover .mag-feature-art img { transform: scale(1.03); }
.mag-feature-tag { position: absolute; top: 12px; right: 12px; background: var(--mag-yellow); color: var(--mag-black); font-weight: 800; font-size: 13px; padding: 4px 10px; }
.mag-feature-name { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 40px; line-height: 1; text-transform: uppercase; }
.mag-feature-dek { font-size: 16px; line-height: 1.7; color: var(--mag-muted-2); }
.mag-feature-platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.mag-feature-platforms span { font-size: 13px; font-weight: 700; border: 1px solid var(--mag-ink); padding: 3px 9px; }
.mag-feature-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--mag-rule); font-weight: 700; flex-wrap: wrap; }
.mag-feature-more { color: var(--mag-red); font-weight: 800; min-height: 44px; display: inline-flex; align-items: center; }

/* Store index */
.mag-index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--mag-rule); border-left: 1px solid var(--mag-rule); }
.mag-index-item { position: relative; display: grid; gap: 4px; min-height: 120px; padding: 18px; border-right: 1px solid var(--mag-rule); border-bottom: 1px solid var(--mag-rule); background: var(--mag-card); transition: background .2s ease; }
.mag-index-item:hover { background: var(--mag-yellow); }
.mag-index-count { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 52px; line-height: .9; }
.mag-index-unit { font-size: 14px; color: var(--mag-muted); }
.mag-index-name { font-family: 'Alexandria', sans-serif; font-weight: 800; font-size: 18px; }
.mag-index-arrow { position: absolute; top: 18px; left: 18px; font-weight: 800; }
.mag-types { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.mag-types-label { font-weight: 800; margin-left: 6px; }
.mag-types a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--mag-ink); font-weight: 700; }
.mag-types a:hover { background: var(--mag-ink); color: var(--mag-paper); }

/* Deals: yellow classifieds panel with ad-style cards */
.mag-deals-section { background: var(--mag-yellow); border: 2px solid var(--mag-black); box-shadow: 10px 10px 0 var(--mag-black); padding: 26px; }
.mag-deals-section .mag-sec-head { border-top: 0; padding-top: 0; padding-bottom: 14px; border-bottom: 2px solid var(--mag-black); margin-bottom: 26px; }
.mag-deals-section .mag-sec-link { border-bottom-color: var(--mag-black); }
.mag-deal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.mag-ad { position: relative; display: flex; flex-direction: column; background: var(--mag-card); border: 2px solid var(--mag-black); box-shadow: 6px 6px 0 var(--mag-black); }
.mag-ad-art { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--mag-black); overflow: hidden; }
.mag-ad-stamp { position: absolute; top: 14px; left: 14px; transform: rotate(-6deg); background: var(--mag-red); color: #fff; border: 2px solid var(--mag-black); box-shadow: 3px 3px 0 var(--mag-black); font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 28px; line-height: 1; padding: 6px 12px; }
.mag-ad-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.mag-ad-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--mag-muted-2); }
.mag-ad h3 { font-size: 17px; }
.mag-ad h3 a { display: inline-block; min-height: 44px; line-height: 1.4; }
.mag-ad-price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mag-ad-price > span { font-size: 13px; font-weight: 700; }
.mag-ad-price strong { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: 30px; line-height: 1; color: var(--mag-red); }
.mag-ad-price del { color: var(--mag-muted); font-size: 15px; }
.mag-ad-end { font-size: 13px; font-weight: 700; color: var(--mag-deep-red); }

/* Curated picks keep the compact cards from app.css */
.mag-curated-section .mag-sec-head { grid-template-columns: 1fr; }
.mag-curated-grid { margin-top: 0; }

/* Subscriptions */
.mag-subs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.mag-sub { display: flex; flex-direction: column; gap: 10px; min-height: 180px; padding: 26px; background: var(--mag-ink); color: var(--mag-paper); }
.mag-sub-platform { font-size: 13px; font-weight: 800; color: var(--mag-yellow); }
.mag-sub-name { font-family: 'Big Shoulders Display', sans-serif; font-weight: 900; font-size: clamp(36px, 5vw, 56px); line-height: .95; text-transform: uppercase; }
.mag-sub-count { font-size: 15px; color: #E9E2D3; }
.mag-sub-action { margin-top: auto; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--mag-yellow); }

/* Tablet 760–1023 */
@media (max-width: 1023px) {
  .mag-cover-section { grid-template-columns: 1fr; }
  .mag-contents { border-right: 0; border-top: 1px solid var(--mag-rule); }
  .mag-cover { min-height: 520px; }
  .mag-features { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .mag-feature:nth-child(2n) { border-right: 0; padding-right: 0; }
  .mag-feature:nth-child(2n+1) { padding-left: 22px; }
  .mag-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mag-deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone ≤759 */
@media (max-width: 759px) {
  .mag-home { padding: 18px 16px 40px; }
  .mag-cover { min-height: 540px; padding: 22px; }
  .mag-cover-chip { top: 16px; right: 16px; }
  .mag-cover-sticker { width: 104px; height: 104px; top: 52px; left: 14px; font-size: 12px; }
  .mag-cover-sticker-price { font-size: 32px; }
  .mag-cover-title { font-size: clamp(56px, 20vw, 96px); }
  .mag-cover-desc { font-size: 16px; }
  .mag-cover-cta { width: 100%; justify-content: center; }
  .mag-contents { padding: 20px 16px; }
  .mag-section { margin-top: 44px; }
  .mag-sec-head { grid-template-columns: auto 1fr; }
  .mag-sec-link { grid-column: 1 / -1; }
  .mag-sec-num { font-size: 44px; }
  .mag-features { grid-template-columns: 1fr; row-gap: 36px; }
  .mag-feature, .mag-feature:nth-child(2n), .mag-feature:nth-child(2n+1) { border-right: 0; padding: 0; }
  .mag-feature-art { aspect-ratio: 16 / 10; }
  .mag-feature-name { font-size: 34px; }
  .mag-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mag-index-item { min-height: 108px; padding: 14px; }
  .mag-index-count { font-size: 42px; }
  .mag-types a { flex: 1 1 auto; justify-content: center; }
  .mag-deal-grid { grid-template-columns: 1fr; }
  .mag-subs-grid { grid-template-columns: 1fr; }
  .mag-sub { padding: 20px; min-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .mag-feature-art img, .mag-index-item { transition: none; }
}

/* Phase 2 review fixes */
.mag-feature-art img, .mag-ad-art img, .mag-short-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mag-short-thumb { position: relative; }
.mag-sub-gp { background: #0E7A3C; }
.mag-sub-ps { background: #1F4FD1; }
.mag-sub-gp .mag-sub-platform, .mag-sub-ps .mag-sub-platform, .mag-sub-gp .mag-sub-action, .mag-sub-ps .mag-sub-action { color: #fff; }
.mag-sub-gp .mag-sub-count, .mag-sub-ps .mag-sub-count { color: #F3EFE6; }
@media (max-width: 759px) { .mag-deals-section { padding: 18px 14px; box-shadow: 6px 6px 0 var(--mag-black); } }

.mag-feature-art { flex: 0 0 auto; }
.mag-feature-art, .mag-ad-art { aspect-ratio: auto; height: 0; padding-bottom: 125%; }
.mag-ad-art { padding-bottom: 75%; }
@media (max-width: 759px) { .mag-feature-art { padding-bottom: 62.5%; } }
/* Equal feature columns: gap instead of uneven padding, dividers drawn as lines */
.mag-features { gap: 44px; }
.mag-features .mag-feature { padding: 0; border-right: 0; position: relative; }
.mag-features .mag-feature:not(:last-child)::after { content: ""; position: absolute; top: 0; bottom: 0; right: -22px; width: 1px; background: var(--mag-rule); }
@media (max-width: 1023px) {
  .mag-features .mag-feature:nth-child(2n)::after { content: none; }
  .mag-features .mag-feature:nth-child(2n+1) { padding-left: 0; }
}
@media (max-width: 759px) {
  .mag-features { gap: 36px; }
  .mag-features .mag-feature::after { content: none; }
}

/* Tablet: with three featured games in two columns, the odd third card spans the row instead of leaving an empty cell. */
@media (min-width: 760px) and (max-width: 1023px) { .mag-features > .mag-feature:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* Store index: the arrow moves to the far edge. It sat on the first digit of each count (the stray glyph at 768 and 1024). */
.mag-index-arrow { left: auto; right: 18px; }

/* Audit 4: payment strip under the cover (same width as the cover), thin ink rules, one tone logos. */
.mag-home .mag-pay-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; min-height: 48px; padding: 8px 0; margin: 0; border-top: 1px solid var(--mag-ink); border-bottom: 1px solid var(--mag-ink); }
.mag-home .mag-pay-label { font-family: var(--mag-f-display); font-weight: 800; font-size: 15px; color: var(--mag-ink); margin-inline-end: 4px; }
.mag-home .mag-pay { display: inline-flex; align-items: center; gap: 8px; color: var(--mag-ink); font-weight: 700; font-size: 13px; line-height: 1.2; }
.mag-home .mag-pay img { display: block; width: auto; height: 32px; filter: grayscale(1) contrast(1.2) brightness(.5); transition: filter .2s; }
.mag-home .mag-pay:hover img, .mag-home .mag-pay:focus-within img { filter: none; }
@media (max-width: 768px) {
  .mag-home .mag-pay-strip { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; gap: 8px 16px; }
  .mag-home .mag-pay-strip::-webkit-scrollbar { display: none; }
  .mag-home .mag-pay { flex: 0 0 auto; white-space: nowrap; }
  .mag-home .mag-pay-label { flex: 0 0 auto; }
  .mag-home .mag-pay img { height: 28px; }
}