/* =====================================================================
   PAEDZ v2 0.6 — one card system for news, articles, archives, search,
   author and related lists; the release calendar; social tiles.
   Loaded after refine.css. Remove this file to return to 0.5.1 visuals
   (the calendar markup then falls back to plain lists).
   ===================================================================== */
:root {
  --c-surface: #0d0f10;          /* card body on black: subtle, not grey */
  --c-surface-h: #121516;
  --c-border: rgba(255,255,255,.09);
  --c-border-h: rgba(255,255,255,.22);
  --c-pad: 16px;
  --c-radius: 12px;
}

/* ---------- 1. Framed card: image on top, text block with padding ---------- */
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc,
.feed-top .ncard,
.feat2 .feat-lead {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--c-radius);
  overflow: hidden; transition: border-color .15s ease, background-color .15s ease;
}
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc:is(:hover, :focus-within),
.feed-top .ncard:is(:hover, :focus-within),
.feat2 .feat-lead:is(:hover, :focus-within) { border-color: var(--c-border-h); background: var(--c-surface-h); }
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc > a,
.feed-top .ncard > a { display: flex; flex-direction: column; gap: 0; height: 100%; }
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc-media,
.feed-top .ncard .media { border-radius: 0; box-shadow: none; aspect-ratio: 16 / 9; flex: none; }
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc-body { padding: 14px var(--c-pad) 16px; gap: 8px; flex: 1; display: flex; flex-direction: column; }
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc-media::after { inset: 60% 0 0; opacity: .7; }
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc-title { font-size: 1.06rem; line-height: 1.55; font-weight: 800; }
:is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc-kick { font-size: .8125rem; gap: 4px 10px; }
/* lead card of an archive page */
.archive-grid .arch-lead .rc-media { aspect-ratio: 16 / 9; }
.archive-grid .arch-lead .rc-body { padding: 18px 22px 22px; gap: 10px; }
.archive-grid .arch-lead .rc-title { font-size: clamp(1.35rem, 1.05rem + .8vw, 1.85rem); line-height: 1.4; }
.archive-grid .arch-lead .rc-sum { -webkit-line-clamp: 3; }
.archive-grid { gap: 20px; }
.ap-reviews, .ap-articles { gap: 20px; }
.related-grid { gap: 16px; }

/* homepage news feed: the two large stories become framed tiles inside the panel */
.feed-top .ncard { background: #111415; }
.feed-top .ncard:is(:hover, :focus-within) { background: #15191a; }
.nc-body { display: flex; flex-direction: column; gap: 8px; padding: 14px var(--c-pad) 16px; flex: 1; }
.nc-body .h-m { margin: 0; }
.feed-top .ncard .media img { transform: none; }

/* archive header: result count under the title */
.hub-head { padding-bottom: 8px; }
.hub-count { margin: 6px 0 0; color: var(--d-meta); font-size: .9375rem; font-weight: 600; }
.archive-page .band { padding-top: 28px; }

/* ---------- 2. Story rows (articles list, author page) keep the panel frame ---------- */
.feat-side.panel-f, .ap-list { background: var(--c-surface); }

/* ---------- 3. Phones: list-style cards after the lead, easier to scan ---------- */
@media (max-width: 640px) {
  :is(.archive-grid, .ap-articles) .rc:not(.arch-lead) > a,
  .related-grid .rc > a { display: grid; grid-template-columns: 38% minmax(0, 1fr); align-items: stretch; }
  :is(.archive-grid, .ap-articles) .rc:not(.arch-lead) .rc-media,
  .related-grid .rc .rc-media { aspect-ratio: auto; height: 100%; min-height: 104px; }
  :is(.archive-grid, .ap-articles) .rc:not(.arch-lead) .rc-media img,
  .related-grid .rc .rc-media img { position: absolute; inset: 0; }
  :is(.archive-grid, .ap-articles) .rc:not(.arch-lead) .rc-body,
  .related-grid .rc .rc-body { padding: 10px 12px; gap: 4px; justify-content: center; }
  :is(.archive-grid, .ap-articles, .related-grid) .rc:not(.arch-lead) .rc-title { font-size: .975rem; line-height: 1.5; -webkit-line-clamp: 3; }
  :is(.archive-grid, .ap-articles) .rc:not(.arch-lead) .plats,
  .related-grid .plats { display: none; }
  .archive-grid, .ap-reviews, .ap-articles, .related-grid { gap: 12px; }
  .ap-reviews .rc-md > a { gap: 0; align-items: stretch; }
  .ap-reviews .rc-md .rc-media { aspect-ratio: auto; height: 100%; min-height: 110px; }
  .ap-reviews .rc-md .rc-media img { position: absolute; inset: 0; }
  .ap-reviews .rc-md .rc-body { padding: 10px 12px; justify-content: center; }
  .feed-top { gap: 12px; padding: 12px; }
  .nc-body { padding: 12px 14px 14px; }
}

/* ---------- 4. Social tiles: one size, centred icon, same hover everywhere ---------- */
.sx { gap: 8px; line-height: 1; }
.sx .bicon { width: 20px; height: 20px; flex: none; display: block; }
.sx-x .bicon { width: 19px; height: 19px; }
.socx-foot .sx { min-height: 48px; }
.sx:hover, .sx:focus-visible { transform: translateY(-1px); }
@media (max-width: 640px) {
  .socx-side .sx-x, .socx-foot .sx-x { justify-content: center; }
}

/* ---------- 5. Page framing: consistent rhythm on inner pages ---------- */
.archive-page .pager, .author-page .pager { margin-top: 28px; }
.empty { display: grid; gap: 6px; padding: 28px; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); text-align: center; color: var(--d-text); }
.empty strong { color: var(--d-head); font-family: var(--f-head); font-size: 1.125rem; }

@media (prefers-reduced-motion: reduce) {
  :is(.archive-grid, .ap-reviews, .ap-articles, .related-grid) .rc, .feed-top .ncard, .feat2 .feat-lead { transition: none; }
}

/* =====================================================================
   6. Release calendar («الإصدارات القادمة»)
   Desktop: one framed schedule per month (date | art | game | platforms | countdown).
   Phones: compact chronological cards.
   ===================================================================== */
.rcal { padding-block: 8px 48px; }
.rcal .paedz-hub-container { display: grid; gap: 18px; }
.rcal-tools { display: flex; gap: 10px; align-items: center; }
.rcal-search { display: flex; align-items: center; gap: 8px; width: min(100%, 360px); height: 44px; padding-inline: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: var(--c-surface); color: var(--d-meta); }
.rcal-search:focus-within { border-color: var(--d-control); }
.rcal-search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: var(--d-head); font-size: .9375rem; }
.rcal-search input::placeholder { color: var(--d-meta); opacity: 1; }
.rcal-search .icon { width: 18px; height: 18px; flex: none; }
.rcal-plats { display: flex; flex-wrap: wrap; gap: 8px; }
.rcal-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding-inline: 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; font-family: var(--f-head); font-weight: 800; font-size: .9rem; color: var(--d-text); transition: border-color .15s, background-color .15s, color .15s; }
.rcal-chip b { font-family: var(--f-num); font-weight: 400; font-size: 1.05rem; color: var(--d-meta); line-height: 1; }
.rcal-chip:hover { border-color: var(--d-control); color: #fff; }
.rcal-chip.is-on { background: var(--d-head); border-color: var(--d-head); color: #000; }
.rcal-chip.is-on b { color: #3d4242; }
/* month navigation: sticky under the header */
.rcal-months { position: sticky; top: calc(var(--head-h) + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; margin-block: 4px -4px; background: linear-gradient(180deg, #000 75%, rgba(0,0,0,0)); }
.admin-bar .rcal-months { top: calc(var(--head-h) + 32px); }
.rcal-months::-webkit-scrollbar { display: none; }
.rcal-months a { flex: none; display: inline-flex; align-items: baseline; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); font-family: var(--f-head); font-weight: 800; color: var(--d-head); transition: border-color .15s; }
.rcal-months a small { color: var(--d-meta); font-weight: 700; font-size: .8125rem; }
.rcal-months a b { font-family: var(--f-num); font-weight: 400; font-size: 1.05rem; color: var(--amber); }
.rcal-months a:hover, .rcal-months a:focus-visible { border-color: var(--c-border-h); }
/* month block */
.rcal-month { scroll-margin-top: calc(var(--head-h) + 72px); border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); overflow: hidden; }
.rcal-mhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--c-border); background: linear-gradient(90deg, rgba(226,160,58,.08), rgba(226,160,58,0) 60%); }
.rcal-mhead h2 { margin: 0; font-family: var(--f-head); font-weight: 900; font-size: 1.35rem; color: var(--d-head); display: flex; align-items: baseline; gap: 8px; }
.rcal-mhead h2 .num { font-size: 1.35rem; color: var(--amber); }
.rcal-mcount { color: var(--d-meta); font-size: .875rem; font-weight: 700; }
.rcal-list { list-style: none; margin: 0; padding: 0; }
.rcal-item + .rcal-item { border-top: 1px solid var(--c-border); }
.rcal-item a { display: grid; grid-template-columns: 76px 60px minmax(0, 1fr) minmax(0, auto) 112px; align-items: center; gap: 18px; padding: 12px 20px; transition: background-color .15s; }
.rcal-item a:hover { background: rgba(255,255,255,.035); }
.rcal-item a:focus-visible { outline-offset: -2px; border-radius: 0; }
.rcal-date { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid rgba(226,160,58,.32); border-radius: 10px; background: rgba(226,160,58,.06); }
.rcal-date b { font-family: var(--f-num); font-weight: 400; font-size: 2rem; line-height: 1; color: var(--amber); }
.rcal-date span { font-size: .75rem; font-weight: 700; color: var(--d-text); }
.rcal-date.is-open b { font-family: var(--f-head); font-size: 1.2rem; color: var(--d-meta); }
.rcal-art { position: relative; display: block; width: 60px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #15181a; box-shadow: 0 0 0 1px var(--c-border); }
.rcal-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rcal-noart { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-head); font-weight: 900; font-size: .75rem; letter-spacing: .04em; color: #4a5052; }
.rcal-name { display: grid; gap: 4px; min-width: 0; }
.rcal-name strong { font-family: var(--f-head); font-weight: 800; font-size: 1.06rem; line-height: 1.45; color: var(--d-head); }
.rcal-name small { font-size: .8125rem; color: var(--d-meta); font-weight: 600; }
.rcal-item a:hover .rcal-name strong { color: #fff; }
.rcal-pl { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.rcal-pl .plat { height: 24px; font-size: .75rem; }
.rcal-when { justify-self: end; font-size: .8125rem; font-weight: 800; color: var(--d-meta); white-space: nowrap; }
.rcal-item.is-soon .rcal-when { color: #111; background: var(--amber); padding: 3px 10px; border-radius: 999px; }
.rcal-empty { justify-items: center; }
.rcal-empty .btn { margin-top: 8px; }
/* Core hub hero sits closer to the calendar */
.paedz-hub-upcoming .paedz-hub-hero { padding-bottom: 8px; }

@media (max-width: 1000px) {
  .rcal-item a { grid-template-columns: 70px 54px minmax(0, 1fr) 96px; }
  .rcal-pl { grid-column: 3; grid-row: 2; justify-content: flex-start; margin-top: -8px; }
  .rcal-when { grid-column: 4; grid-row: 1 / span 2; }
  .rcal-art { width: 54px; grid-row: 1 / span 2; }
  .rcal-date { grid-row: 1 / span 2; }
}
@media (max-width: 640px) {
  .rcal { padding-bottom: 32px; }
  .rcal-mhead { padding: 12px 14px; }
  .rcal-mhead h2, .rcal-mhead h2 .num { font-size: 1.2rem; }
  .rcal-item a { grid-template-columns: 58px 48px minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; align-items: start; }
  .rcal-date { grid-row: 1 / span 3; padding: 5px 2px; }
  .rcal-date b { font-size: 1.7rem; }
  .rcal-art { width: 48px; grid-row: 1 / span 3; }
  .rcal-name { grid-column: 3; }
  .rcal-name strong { font-size: .975rem; }
  .rcal-pl { grid-column: 3; grid-row: 2; margin-top: 2px; }
  .rcal-when { grid-column: 3; grid-row: 3; justify-self: start; margin-top: 4px; }
  .rcal-when:empty { display: none; }
  .rcal-search { width: 100%; }
  .rcal-plats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .rcal-plats::-webkit-scrollbar { display: none; }
  .rcal-chip { flex: none; }
  .admin-bar .rcal-months { top: var(--head-h); }
}
@media (prefers-reduced-motion: reduce) { .rcal-item a, .rcal-chip, .rcal-months a { transition: none; } }
.rcal-cols { display: grid; grid-template-columns: 76px 60px minmax(0, 1fr) minmax(0, auto) 112px; gap: 18px; padding: 8px 20px; border-bottom: 1px solid var(--c-border); font-size: .75rem; font-weight: 800; color: var(--d-meta); }
.rcal-cols span:nth-child(1) { text-align: center; }
.rcal-cols span:nth-child(4), .rcal-cols span:nth-child(5) { text-align: end; }
@media (max-width: 1000px) { .rcal-cols { display: none; } }
