/* Wijdan homepage blocks: the "Showing" filter, carousel 01–06, number row, dots,
   the desktop list beside the carousel, and the list that carries on from 07 on phones.
   Everything is scoped under .wijdan-home. Colours and fonts come from the theme's
   Editor presets (theme.json) with plain fallbacks, so the blocks survive a theme change.
   Phone first; desktop from 900px. */

.wijdan-home {
  --paper: var(--wp--preset--color--paper, #fbfaf7);
  --surface: var(--wp--preset--color--surface, #ffffff);
  --mint: var(--wp--preset--color--mint, #e4f4ed);
  --mint-2: var(--wp--preset--color--mint-deep, #cfe9de);
  --mint-ink: var(--wp--preset--color--mint-ink, #2e6b58);
  --ink: var(--wp--preset--color--ink, #1d2623);
  --muted: var(--wp--preset--color--muted, #5f6c67);
  --line: var(--wp--preset--color--line, #dbe3df);
  --t-pink: #ffbcc5;
  --t-mint: #dbefee;
  --t-yellow: #fceaa0;
  --latin: var(--wp--preset--font-family--newsreader, "Newsreader", Georgia, serif);
  --arabic: var(--wp--preset--font-family--noto-naskh-arabic, "Noto Naskh Arabic", "Newsreader", serif);
  --gutter: var(--wp--style--root--padding-left, 20px);
  --radius: 4px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
}
.wijdan-home *, .wijdan-home *::before, .wijdan-home *::after { box-sizing: border-box; }
.wijdan-home a { color: inherit; text-decoration: none; }
.wijdan-home a:hover { color: inherit; }
.wijdan-home button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 0; line-height: inherit; }
.wijdan-home ol, .wijdan-home ul { list-style: none; margin: 0; padding: 0; }
.wijdan-home li { margin: 0; }
.wijdan-home figure, .wijdan-home p { margin: 0; }
.wijdan-home img { display: block; max-width: 100%; height: auto; }

/* ---------- small type pieces ---------- */
.wijdan-home .muted { color: var(--muted); }
.wijdan-home .kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mint-ink); }
.wijdan-home .meta, .wijdan-home .by { font-size: 15px; font-style: italic; color: var(--muted); }
.wijdan-home .num { font-size: 15px; font-style: italic; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.wijdan-home .item-title, .wijdan-home .slide .title { font-size: 21px; line-height: 1.25; }
.wijdan-home .text-link { font-style: italic; color: var(--mint-ink); border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.wijdan-home .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 99px; border: 1px solid var(--ink); font-size: 16px; line-height: 1; font-style: normal; }
.wijdan-home .btn.solid { background: var(--ink); color: var(--paper); }
.wijdan-home .btn.solid:hover { background: var(--mint-ink); border-color: var(--mint-ink); color: #fff; }
.wijdan-home .pin { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--mint-ink); font-style: normal; }
.wijdan-home .pin::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint-ink); }
.wijdan-home .empty { padding: 48px 0; text-align: center; color: var(--muted); font-style: italic; }

/* badges (automatic: New release, New writer, Frequent contributor) */
.wijdan-home .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.wijdan-home .badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--surface); border: 1px solid var(--line); color: var(--mint-ink); font-style: normal; }

/* Arabic: its own font, a touch bigger, taller lines, no fake italics; the small Latin lines stay left-to-right */
.wijdan-home [lang="ar"] { font-family: var(--arabic); }
.wijdan-home [lang="ar"] .item-title, .wijdan-home [lang="ar"] .title, .wijdan-home .poster-big[lang="ar"] { font-size: 1.08em; line-height: 1.6; }
.wijdan-home [lang="ar"] .kicker, .wijdan-home [lang="ar"] .meta, .wijdan-home [lang="ar"] .by, .wijdan-home [lang="ar"] .badge, .wijdan-home [lang="ar"] .btn { font-family: var(--latin); direction: ltr; unicode-bidi: plaintext; }
.wijdan-home [lang="ar"] em, .wijdan-home [lang="ar"] i { font-style: normal; }

/* ---------- "Showing: All ▾" ---------- */
.wijdan-home .filter { display: flex; align-items: center; gap: 10px; padding: 26px 0 16px; }
.wijdan-home .select { display: inline-flex; gap: 10px; align-items: center; height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.wijdan-home .select b { font-weight: 400; }
.wijdan-home .select span { font-size: 11px; color: var(--muted); }
.wijdan-home .pick { position: relative; }
.wijdan-home .pick-menu { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; min-width: 190px; padding: 6px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(29, 38, 35, .1); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .2s, transform .2s, visibility .2s; }
.wijdan-home .pick.open .pick-menu { opacity: 1; visibility: visible; transform: none; }
.wijdan-home .pick-menu button { width: 100%; padding: 10px 18px; text-align: left; }
.wijdan-home .pick-menu button:hover { background: var(--mint); }
.wijdan-home .pick-menu button[aria-selected="true"] { font-style: italic; color: var(--mint-ink); }

/* ---------- carousel (slides are 3:4, images scaled to fit) ---------- */
.wijdan-home .carousel { position: relative; min-width: 0; transition: opacity .18s ease; }
.wijdan-home .carousel.swap { opacity: 0; }
.wijdan-home .track { display: flex; gap: var(--slide-gap, 12px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.wijdan-home .track::-webkit-scrollbar { display: none; }
.wijdan-home .slide { flex: 0 0 var(--slide-w, 84%); scroll-snap-align: start; min-width: 0; }
.wijdan-home .slide .img { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--mint); }
.wijdan-home .slide .img .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.wijdan-home .slide.is-current .img .cover-img { transform: scale(1.03); }
.wijdan-home .slide .img .pin { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 6px 10px; border-radius: 99px; background: var(--paper); }
.wijdan-home .slide .badges.on-img { position: absolute; left: 12px; bottom: 12px; z-index: 2; }
.wijdan-home .slide figcaption { display: grid; gap: 4px; padding-top: 14px; }
.wijdan-home .slide figcaption[dir="rtl"] { text-align: right; }
.wijdan-home .slide.pinned figcaption .btn { justify-self: start; height: 40px; font-size: 15px; margin-top: 10px; }
.wijdan-home .slide.pinned figcaption[dir="rtl"] .btn { justify-self: end; }

/* typographic poster when there is no image */
.wijdan-home .poster { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 26px 24px; background: var(--t-mint); color: var(--ink); overflow: hidden; }
/* the tint is the category's colour (--tone, set inline from her palette); the three classes are the pre-colour fallback */
.wijdan-home .poster.tone-pink { background: var(--t-pink); }
.wijdan-home .poster.tone-yellow { background: var(--t-yellow); }
.wijdan-home .poster.tone-mint { background: var(--t-mint); }
.wijdan-home .poster[style*="--tone"] { background: var(--tone); }
.wijdan-home .poster-big { font-size: clamp(30px, 8vw, 44px); line-height: 1.05; font-style: italic; letter-spacing: -.01em; }
.wijdan-home .poster-big[lang="ar"] { font-family: var(--arabic); font-style: normal; line-height: 1.5; text-align: right; }

/* number row (phones) + line dots (desktop) */
.wijdan-home .pager { display: flex; justify-content: center; gap: 4px; padding: 18px 0 0; }
.wijdan-home .pager button { width: 40px; height: 40px; font-size: 15px; font-style: italic; color: var(--muted); border-bottom: 1px solid transparent; }
.wijdan-home .pager button.on { color: var(--ink); border-bottom-color: var(--ink); }
.wijdan-home .dots { display: flex; justify-content: center; gap: 6px; padding: 18px 0; }
.wijdan-home .dots button { width: 16px; height: 2px; background: var(--line); transition: width .3s, background .3s; }
.wijdan-home .dots button.on { width: 32px; background: var(--ink); }

/* ---------- desktop list beside the carousel (tap once = preview, tap again = open) ---------- */
.wijdan-home .index li { border-top: 1px solid var(--line); }
.wijdan-home .index li:last-child { border-bottom: 1px solid var(--line); }
.wijdan-home .index button { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; width: 100%; padding: 14px 16px 14px 12px; text-align: left; border-left: 2px solid transparent; transition: border-color .2s, background .2s; }
.wijdan-home .index button.on { border-left-color: var(--mint-ink); background: var(--mint); }
.wijdan-home .index button:not(.on):hover { background: color-mix(in srgb, var(--mint) 45%, transparent); }
.wijdan-home .index button:focus-visible { outline: 2px solid var(--mint-ink); outline-offset: -2px; }
.wijdan-home .index .pin { padding-top: 4px; }
.wijdan-home .t-text { display: grid; gap: 2px; min-width: 0; }
.wijdan-home .t-text .item-title { font-size: 19px; }
.wijdan-home .t-text[dir="rtl"] { text-align: right; }
.wijdan-home .index .badges { margin-top: 6px; }
.wijdan-home .index .side { display: grid; justify-items: end; gap: 10px; }
.wijdan-home .index .open { font-size: 14px; font-style: italic; color: var(--mint-ink); opacity: 0; transform: translateX(-4px); transition: opacity .25s, transform .25s; white-space: nowrap; }
.wijdan-home .index button.on .open { opacity: 1; transform: none; }

/* ---------- the list that carries on from 07 (phones) ---------- */
.wijdan-home .writing li { border-bottom: 1px solid var(--line); }
.wijdan-home .writing li:first-child { border-top: 1px solid var(--line); }
.wijdan-home .writing a { display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; row-gap: 2px; padding: 15px 0; }
.wijdan-home .writing .num { grid-row: span 3; }
.wijdan-home .writing .item-title { font-size: 19px; }
.wijdan-home .writing a[dir="rtl"] { text-align: right; }
.wijdan-home .see-all { display: block; text-align: center; padding-top: 18px; }
.wijdan-home.wijdan-continued-list { margin-top: 8px; }

/* ---------- a highlight's own page ---------- */
.wijdan-hl-kicker .kicker, .wijdan-hl-details .meta { display: block; }
.wijdan-hl-kicker .kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--wp--preset--color--mint-ink, #2e6b58); }
.wijdan-hl-details .lead { font-size: 19px; line-height: 1.6; margin: 0; }
.wijdan-hl-details .meta { margin: 6px 0 0; font-size: 15px; font-style: italic; color: var(--wp--preset--color--muted, #5f6c67); }
.wijdan-hl-details .actions { margin: 24px 0 0; }
.wijdan-hl-details .btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px; border-radius: 99px; border: 1px solid var(--wp--preset--color--ink, #1d2623); background: var(--wp--preset--color--ink, #1d2623); color: var(--wp--preset--color--paper, #fbfaf7); text-decoration: none; font-size: 16px; }

/* ---------- phone ---------- */
@media (max-width: 899px) {
  .wijdan-home.wijdan-carousel.alignwide, .wijdan-home.wijdan-continued-list.alignwide { max-width: 640px; }
  /* the slides run to the edge of the screen, past the page gutter, so the next one peeks in */
  .wijdan-home .track { --slide-w: 84%; --slide-gap: 12px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .wijdan-home .index, .wijdan-home .dots { display: none; }
}

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .wijdan-home .filter { padding-top: 32px; padding-bottom: 28px; }
  .wijdan-home .carousel { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "index track" "index dots"; gap: 0 64px; align-items: start; }
  .wijdan-home .track { grid-area: track; --slide-w: 100%; }
  .wijdan-home .dots { grid-area: dots; }
  .wijdan-home .index { grid-area: index; }
  .wijdan-home .slide figcaption, .wijdan-home .pager, .wijdan-home.wijdan-continued-list { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wijdan-home .track { scroll-behavior: auto; }
  .wijdan-home .slide .img .cover-img, .wijdan-home .carousel, .wijdan-home .index .open { transition: none; }
}
