/* ============================================================
   ذا ميرديان — Arabic edition: horizontal header + per-section
   designs. Every section is namespaced under its own .msec--X
   so no section can affect another. Loaded after styles.css + ar.css.
   ============================================================ */

/* ---------- Horizontal header: brand top-right + nav beside it ---------- */
.ar-head { position: sticky; top: 0; z-index: 60; background: var(--paper); border-bottom: 1px solid var(--rule); }
.ar-head__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 54px; padding: 5px 0; }
.ar-head__main { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); min-width: 0; flex: 1; }

/* Printed masthead logotype — soft, no hard angles, letterpress ink feel */
.ar-brand { display: flex; align-items: center; gap: 12px; flex: none; }
.ar-brand__glyph { width: 40px; height: 40px; color: var(--ink); flex: none; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 0 rgba(255,255,255,0.5)); }
.ar-brand__glyph .meridian { stroke: var(--accent); }
.ar-brand__glyph .dot { fill: var(--accent); stroke: none; }
html[data-theme='dark'] .ar-brand__glyph { filter: none; }
.ar-brand__name {
  font-family: var(--serif-display); font-weight: 700;
  font-size: clamp(24px, 3.2vw, 35px); line-height: 1; white-space: nowrap;
  letter-spacing: -0.015em; color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.6), 0 -0.5px 0 rgba(23,20,15,0.06);
}
html[data-theme='dark'] .ar-brand__name { text-shadow: 0 1px 1px rgba(0,0,0,0.55); }
.ar-nav { display: flex; align-items: center; gap: clamp(8px, 1.4vw, 20px); flex-wrap: wrap; }
.ar-nav a { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink-soft); padding: 6px 2px; position: relative; white-space: nowrap; }
.ar-nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .18s; }
.ar-nav a:hover, .ar-nav a.active { color: var(--ink); }
.ar-nav a:hover::after, .ar-nav a.active::after { transform: scaleX(1); }
.ar-head__tools { display: flex; align-items: center; gap: 12px; flex: none; }
.ar-head__tools .util-sep { height: 16px; }
.ar-head__toggle { display: none; background: none; border: none; cursor: pointer; color: var(--ink); }

/* ---------- Shared section shell ---------- */
.msec { padding: clamp(30px, 4vw, 52px) 0; border-bottom: 1px solid var(--rule); }
.msec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.msec__head h2 { font-family: var(--serif-display); font-weight: 700; font-size: clamp(22px, 3vw, 32px); display: inline-flex; align-items: center; gap: 12px; }
.msec__head h2::before { content: ""; width: 6px; height: 1.05em; background: var(--accent); border-radius: 3px; display: inline-block; }
.msec__more { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent); }
.msec__more:hover { color: var(--accent-ink); }

/* ============ 1) HERO ============ */
.msec--hero { padding-top: 16px; padding-bottom: clamp(26px, 3.5vw, 44px); overflow: hidden; }
.breaking { border-top: none; }
.mh-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 30px; align-items: start; }
.mh-lead { min-width: 0; }
.mh-lead .art { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 14px 0; }
.mh-lead h2 { font-family: var(--serif-display); font-weight: 700; font-size: clamp(26px, 4.4vw, 48px); line-height: 1.2; margin-bottom: 12px; }
.mh-lead h2 a:hover { color: var(--accent); }
.mh-lead .stand { color: var(--ink-soft); font-size: 18px; }
.mh-side { display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; gap: 4px; }
.mh-side .story { padding: 13px 0; border-top: 1px solid var(--rule); }
.mh-side .story:first-child { border-top: none; padding-top: 0; }
.mh-side h3 { font-size: 17px; }
.mh-side .story:hover h3 { color: var(--accent); }

/* Mobile auto-rotating hero slider (hidden on desktop) */
.hero-slider { display: none; }
.hs-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; direction: ltr; }
.hs-track::-webkit-scrollbar { display: none; }
.hs-slide { flex: 0 0 100%; min-width: 100%; scroll-snap-align: start; display: block; }
.hs-slide .art { aspect-ratio: 16 / 9; }
.hs-body { padding: 14px 2px 2px; direction: inherit; }
[dir='rtl'] .hs-body { text-align: right; }
.hs-body h2 { font-family: var(--serif-display); font-weight: 700; font-size: clamp(21px, 6vw, 30px); line-height: 1.3; margin-top: 8px; }
.hs-body h2 a:hover { color: var(--accent); }
.hs-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.hs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); border: none; padding: 0; cursor: pointer; transition: width .2s, background .2s; }
.hs-dot.active { background: var(--accent); width: 22px; border-radius: 4px; }
@media (max-width: 760px) {
  .msec--hero .mh-grid { display: none; }
  .msec--hero .hero-slider { display: block; }
}

/* ============ 2) WORLD — lead + ranked list, map tint ============ */
.msec--world { background:
  radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 60%),
  var(--paper); }
.mw-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; align-items: start; }
.mw-lead { position: relative; }
.mw-lead .art { aspect-ratio: 16/10; }
.mw-lead h3 { font-family: var(--serif-display); font-weight: 700; font-size: clamp(20px, 2.6vw, 30px); margin: 12px 0 8px; line-height: 1.25; }
.mw-lead:hover h3 { color: var(--accent); }
.mw-lead .stand { color: var(--ink-soft); }
.mw-list { list-style: none; margin: 0; padding: 0; counter-reset: w; display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; }
.mw-list li { counter-increment: w; display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule); }
.mw-list li:first-child { border-top: none; padding-top: 0; }
.mw-list li::before { content: "0" counter(w); font-family: var(--serif-display); font-weight: 700; color: var(--accent); font-size: 17px; }
.mw-list .k { font-family: var(--sans); font-size: 11px; color: var(--ink-mute); display: block; margin-bottom: 2px; }
.mw-list a { font-size: 16px; line-height: 1.4; }
.mw-list a:hover { color: var(--accent); }

/* ============ 3) MARKETS & BUSINESS — dark terminal panel ============ */
.msec--markets { background: #14110D; color: #ECE7DC; border-bottom: none; }
html[data-theme='dark'] .msec--markets { background: #0D0C0A; }
.msec--markets .msec__head h2 { color: #fff; }
.msec--markets .msec__more { color: #F0A5A7; }
.mm-ticker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.mm-chip { border: 1px solid rgba(255,255,255,0.14); border-radius: 8px; padding: 14px 16px; background: rgba(255,255,255,0.03); }
.mm-chip .name { font-family: var(--sans); font-size: 12px; color: #A79E90; }
.mm-chip .val { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 24px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -0.02em; }
.mm-chip .chg { font-family: ui-monospace, monospace; font-size: 13px; }
.mm-up { color: #56c78a; } .mm-dn { color: #F0696D; }
.mm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mm-card { border-top: 1px solid rgba(255,255,255,0.16); padding-top: 14px; }
.mm-card .k { font-family: var(--sans); font-size: 11px; color: #F0A5A7; letter-spacing: .04em; }
.mm-card h3 { font-family: var(--serif-display); font-weight: 700; font-size: 19px; color: #F3EEE4; margin: 6px 0; line-height: 1.35; }
.mm-card:hover h3 { color: #fff; }
.mm-card .stand { font-size: 14px; color: #B4AB9C; }

/* ============ 4) TECHNOLOGY — rounded node cards ============ */
.mt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.mt-card { border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: 12px; overflow: hidden; background: var(--surface); transition: transform .2s, box-shadow .2s; }
.mt-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px var(--shadow); }
.mt-card .art { border: none; border-radius: 0; aspect-ratio: 16/10; }
.mt-card .pad { padding: 14px 16px 18px; }
.mt-card .k { font-family: var(--sans); font-size: 11px; color: var(--accent); font-weight: 700; }
.mt-card h3 { font-size: 17px; margin-top: 6px; line-height: 1.4; }

/* ============ 5) SCIENCE — split feature ============ */
.msc-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: start; }
.msc-main .art { aspect-ratio: 16/9; }
.msc-main h3 { font-family: var(--serif-display); font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); margin: 12px 0 8px; }
.msc-main:hover h3 { color: var(--accent); }
.msc-main .cap { font-family: var(--sans); font-size: 12px; color: var(--ink-mute); margin-top: 6px; }
.msc-list .story { display: grid; grid-template-columns: 1fr 76px; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
.msc-list .story:first-child { border-top: none; padding-top: 0; }
.msc-list .story .art { aspect-ratio: 1/1; border-radius: 50%; }
.msc-list h3 { font-size: 16px; }
.msc-list .story:hover h3 { color: var(--accent); }

/* ============ 6) CULTURE — overlay gallery ============ */
.msec--culture { background: var(--paper-2); }
.mcx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mcx-item { position: relative; display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; }
.mcx-item .art { position: absolute; inset: 0; border: none; border-radius: 0; }
.mcx-item .art svg { height: 100%; }
.mcx-item .cap { position: absolute; inset-inline: 0; bottom: 0; padding: 40px 18px 18px; background: linear-gradient(to top, rgba(10,8,6,0.9), transparent); color: #fff; }
.mcx-item .k { font-family: var(--sans); font-size: 11px; font-weight: 700; color: #F0A5A7; }
.mcx-item h3 { font-family: var(--serif-display); font-weight: 700; font-size: 20px; color: #fff; margin-top: 6px; line-height: 1.3; }
.mcx-item:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

/* ============ 7) OPINION — tinted quote panel ============ */
.msec--opinion { background:
  linear-gradient(0deg, color-mix(in srgb, var(--accent) 6%, var(--paper)), var(--paper)); }
.mo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.mo-card { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--rule); }
.mo-card:first-child, .mo-col > .mo-card:first-child { border-top: none; padding-top: 0; }
.mo-mono { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif-display); font-weight: 700; font-size: 22px; flex: none; }
.mo-card h3 { font-size: 19px; font-weight: 500; line-height: 1.5; }
.mo-card .who { font-family: var(--sans); font-size: 12px; color: var(--ink-mute); margin-top: 8px; }

/* ============ 8) SPORT — results strip + bold cards ============ */
.msp-scores { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 24px; }
.msp-fix { flex: none; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 16px; background: var(--surface); min-width: 190px; }
.msp-fix .lg { font-family: var(--sans); font-size: 10.5px; color: var(--accent); font-weight: 700; letter-spacing: .05em; }
.msp-fix .row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 15px; }
.msp-fix .row b { font-family: ui-monospace, monospace; font-size: 18px; }
.msp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.msp-card .art { aspect-ratio: 16/10; }
.msp-card .k { font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--accent); margin-top: 10px; display: block; }
.msp-card h3 { font-family: var(--serif-display); font-weight: 700; font-size: 20px; margin-top: 4px; line-height: 1.3; }
.msp-card:hover h3 { color: var(--accent); }

/* ============================================================
   ARTICLE PAGE components (share / key-points / read-also / tags /
   author / suggestions). Logical props → work in LTR + RTL.
   ============================================================ */
.article-wrap { max-width: 720px; margin: 0 auto; }

/* Key points */
.key-points { border: 1px solid var(--rule); border-inline-start: 4px solid var(--accent); background: var(--paper-2); border-radius: 8px; padding: 18px 22px; margin: 26px 0; }
.key-points h4 { font-family: var(--sans); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.key-points ul { margin: 0; padding-inline-start: 20px; }
.key-points li { font-family: var(--serif-text); font-size: 16.5px; line-height: 1.5; margin-bottom: 9px; }
.key-points li::marker { color: var(--accent); }

/* Share bar */
.share-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; }
.share-bar__label { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); }
.share-btns { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.share-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--rule); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); background: var(--surface); cursor: pointer; transition: transform .16s, background .16s, color .16s, border-color .16s; }
.share-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.share-btn svg { width: 18px; height: 18px; }
.share-copied { font-family: var(--sans); font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .2s; }
.share-copied.show { opacity: 1; }

/* Inline "read also" inside the body */
.read-also-inline { border-inline-start: 3px solid var(--accent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent); padding: 14px 18px; margin: 28px 0; border-radius: 0 8px 8px 0; }
[dir='rtl'] .read-also-inline { border-radius: 8px 0 0 8px; }
.read-also-inline .l { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 5px; }
.read-also-inline a { font-family: var(--serif-display); font-weight: 700; font-size: 18px; line-height: 1.35; }
.read-also-inline a:hover { color: var(--accent); }

/* Tags */
.tags-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 28px 0 8px; }
.tags-row .t-label { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); margin-inline-end: 4px; }
.tag-chip { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 100px; padding: 6px 15px; transition: .15s; }
.tag-chip:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* Author box */
.author-box { display: flex; gap: 16px; align-items: center; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 20px 0; margin: 26px 0; }
.author-box .av { width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif-display); font-weight: 700; font-size: 24px; flex: none; }
.author-box .nm { font-family: var(--serif-display); font-weight: 700; font-size: 18px; }
.author-box .rl { font-family: var(--sans); font-size: 12.5px; color: var(--ink-mute); margin-top: 3px; }
.author-box .follow { margin-inline-start: auto; }

/* Article end sections */
.article-end { margin-top: 34px; }
.article-end .msec__head { border-top: 3px solid var(--ink); padding-top: 10px; }
.suggest-list { list-style: none; margin: 0; padding: 0; }
.suggest-list li { counter-increment: sg; }
.suggest-list { counter-reset: sg; }
.suggest-list a { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--rule); }
.suggest-list li:first-child a { border-top: none; }
.suggest-list a::before { content: "0" counter(sg); font-family: var(--serif-display); font-weight: 700; color: var(--accent); font-size: 16px; }
.suggest-list h3 { font-family: var(--serif-display); font-weight: 700; font-size: 17px; line-height: 1.4; }
.suggest-list .k { font-family: var(--sans); font-size: 11px; color: var(--ink-mute); display: block; margin-bottom: 2px; }
.suggest-list a:hover h3 { color: var(--accent); }

/* ---------- Mobile drawer trigger for header ---------- */
@media (max-width: 900px) {
  .mm-ticker, .mt-grid { grid-template-columns: repeat(2, 1fr); }
  .mm-grid, .msp-grid, .mcx-grid { grid-template-columns: 1fr 1fr; }
  .mh-grid, .mw-grid, .msc-split, .mo-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ar-nav { display: none; }
  .ar-head__toggle { display: block; }
  .ar-head__tools .subscribe-txt { display: none; }
  .mm-ticker, .mt-grid, .mm-grid, .msp-grid, .mcx-grid { grid-template-columns: 1fr; }
}
