/* ================================
   1. Global theme variables
   ================================= */

:root {
  /* Shami Breeze accent palette */
  --color-accent: #c6843a; /* Breeze Gold (main accent) */
  --color-accent-dark: #9f6429; /* Deeper gold / bronze */
  --color-accent-light: #ebd3aa; /* Soft light gold for chips/badges */

  /* نسمة logo palette — terracotta is the "dot": a punctuation accent used
     only for small high-emphasis moments (the diacritic dots in the wordmark),
     never as a broad fill. Gold above stays the structural workhorse. */
  --color-terracotta: #b4663c; /* sampled from the logo's diacritic dots */
  --color-terracotta-deep: #9c5230; /* pressed / active terracotta */
  --color-ink: #282818; /* warm brush ink from the logo (not pure black) */

  --color-primary-500: var(--color-accent);
  --color-primary: var(--color-accent);
  --color-primary-dark: var(--color-accent-dark);

  --color-link: var(--color-accent);
  --color-link-hover: var(--color-accent-dark);

  /* Arabic typography scale */
  --dd-heading-size: clamp(1.8rem, 2.2vw + 1rem, 2.6rem);
  --dd-body-size: clamp(1.1rem, 0.4vw + 0.95rem, 1.2rem); /* floor 1.05→1.1: Arabic detail reads easier a touch larger */
  --dd-line-height: 1.8;
  --dd-quote-size: clamp(1.15rem, 0.6vw + 1rem, 1.35rem);

  /* For dialect badge + chips */
  --accent-color: var(--color-accent-light);

  /* Latin (English) typography — elevated editorial pairing.
     Fraunces = display, Newsreader = body. Arabic glyphs fall through
     to Lalezar/Zain in these stacks, and the :lang(ar)/.article-content
     rules below out-specify these, so the Arabic styling is untouched. */
  --font-display: "Fraunces", "Lalezar", Georgia, "Times New Roman", serif;
  --font-body: "Newsreader", "Zain", ui-serif, Georgia, serif;
  /* Override Blowfish/Tailwind base so the whole site inherits it */
  --font-sans: var(--font-body);
  --default-font-family: var(--font-body);
}

/* ================================
   1b. Latin base typography
   ================================= */

body {
  font-family: var(--font-body);
  font-optical-sizing: auto;
}

/* Latin headings site-wide. Arabic headings keep Lalezar via the
   more-specific :lang(ar)/.article-content rules further down. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.011em;
}

/* ================================
   2. Language-level tweaks
   ================================= */

/* Arabic global shaping (scope to Arabic text only) */
html[lang="ar"] :lang(ar),
html[lang="ar"] [dir="rtl"] {
  letter-spacing: 0 !important;
  /* calt/liga/rlig: contextual + required ligatures.
     mark/mkmk/curs: explicit harakat (vowel) mark positioning so
     diacritics sit cleanly on letters across browsers — matters for
     beginner-readable vowelized text. */
  font-feature-settings: "calt" 1, "liga" 1, "rlig" 1, "mark" 1, "mkmk" 1, "curs" 1;
}

/* Arabic content typography (when page/lang is Arabic) */
:lang(ar),
[lang^="ar"] {
  /* Headings */
  /* Headings – shared base styles */
  .article-content h1,
  .article-content > h2,
  .article-content > h3,
  .article-content > h4 {
    font-family: "Lalezar", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 400; /* Lalezar has 400 only */
    line-height: 1.3; /* a touch more than 1.2 so top harakat aren't clipped */
    text-wrap: balance; /* even multi-line Arabic headings; no lonely last word */
    margin: 1.2em 0 0.6em;
  }

  /* Size hierarchy for Arabic headings */
  .article-content h1 {
    font-size: calc(var(--dd-heading-size) * 1.25);
  }

  .article-content > h2 {
    font-size: var(--dd-heading-size);
  }

  .article-content > h3 {
    font-size: calc(var(--dd-heading-size) * 0.8);
  }

  .article-content > h4 {
    font-size: calc(var(--dd-heading-size) * 0.7);
  }

  /* Body text */
  .article-content > p,
  .article-content > ul,
  .article-content > ol {
    font-family: "Zain", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 400;
    font-size: var(--dd-body-size);
    line-height: var(--dd-line-height);
    text-wrap: pretty;
  }

  /* Blockquotes */
  .article-content > blockquote {
    font-family: "Zain", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 400;
    font-style: italic;
    font-size: var(--dd-quote-size);
    line-height: var(--dd-line-height);
    padding-inline-start: 1rem;
    margin: 1.2rem 0;
    color: var(--color-text-400);
  }

  /* Direction for Arabic spans/blocks */
  .article-content :lang(ar) {
    direction: rtl;
    unicode-bidi: isolate;
    text-align: start;
    /* Arabic usually benefits from a touch more line-height */
    line-height: calc(var(--dd-line-height) + 0.05);
 
  }

  /* Avoid fake styles/weights where possible */
  .article-content {
    font-synthesis-weight: auto;
  }

  .article-content :lang(ar) {
    font-synthesis-style: none; /* Zain has real italics; Lalezar does not */
  }

  /* Utility font classes */
  .zain-200 {
    font-family: "Zain", sans-serif;
    font-weight: 200;
  }
  .zain-300 {
    font-family: "Zain", sans-serif;
    font-weight: 300;
  }
  .zain-400 {
    font-family: "Zain", sans-serif;
    font-weight: 400;
  }
  .zain-700 {
    font-family: "Zain", sans-serif;
    font-weight: 700;
  }
  .zain-800 {
    font-family: "Zain", sans-serif;
    font-weight: 800;
  }
  .zain-900 {
    font-family: "Zain", sans-serif;
    font-weight: 900;
  }
  .lalezar {
    font-family: "Lalezar", sans-serif;
    font-weight: 400;
  }
}

/* Optional standalone utility for any tagline text */
.tagline {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

/* ================================
   Post cover (hero "big") — aligned to the content measure + warm frame
   ================================= */
.dd-cover {
  max-width: 42rem;      /* a touch wider than the ~37rem text measure */
  margin-inline: auto;   /* centered */
  margin-bottom: 0.4rem;
}

/* Image lightbox — custom, self-contained.
   Blowfish makes <body> the scroll container (h-screen + overflow:hidden auto),
   which breaks medium-zoom's window-based math (image lands off-screen). We
   intercept image clicks in the capture phase (see extend-footer.html) and show
   this viewport-fixed overlay instead. */
.dd-lb {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(20, 14, 6, 0.88);
  opacity: 0; visibility: hidden; cursor: zoom-out;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.dd-lb.is-open { opacity: 1; visibility: visible; }
.dd-lb img {
  max-width: min(96vw, 1200px); max-height: 92vh; width: auto; height: auto;
  object-fit: contain; border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  transform: scale(0.96); transition: transform 0.25s ease;
}
.dd-lb.is-open img { transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .dd-lb, .dd-lb img { transition: none; }
}
.dd-cover img.single_hero_round {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(159, 100, 41, 0.18);
  box-shadow: 0 22px 50px -30px rgba(56, 38, 12, 0.55);
}
.dark .dd-cover img.single_hero_round {
  border-color: rgba(235, 211, 170, 0.16);
  box-shadow: 0 24px 54px -30px rgba(0, 0, 0, 0.6);
}

/* ================================
   3. Links, cursors & general UX
   ================================= */

/* Force hand cursor on real links everywhere, even inside rich text */
a[href] {
  cursor: pointer;
}
a[href] * {
  cursor: inherit;
}

/* Stretched links / overlays */
a[href].stretched-link,
a[href].stretched-link::after {
  cursor: pointer;
}

/* Buttons and clickable roles */
button,
[role="button"] {
  cursor: pointer;
}

/* ================================
   4. Dialect / taxonomy chips
   ================================= */

.post-dialect {
  margin: 0.5rem 0 1rem;
  opacity: 0.8;
  font-size: 0.9rem;
}

.dialect-tag {
  background: var(--accent-color, #ebd3aa);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.3rem;
  text-transform: capitalize;
}

/* label before titles linking to /derj-words/ */
.group-hover-card a[href^="/derj-words/"]::before {
  content: "DERJ WORDS";
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 6px;
  color: var(--color-secondary-600);
  background-color: #ebd15087;
  border: 1px solid var(--color-secondary-200);
  border-radius: 4px;
  margin-right: 8px;
  margin-left: 8px;
  text-transform: uppercase;
}

/* ================================
   5. Hero / homepage banner
   ================================= */

/* Neutral overlay hook */
.hero,
.hero-image {
  position: relative;
}

.hero::after,
.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  /* Subtle desaturation + darkening */
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.25) 70%
  );
  mix-blend-mode: soft-light;
}

/* Tame the red gradient Blowfish adds on the hero image */
.shadow-xl .bg-gradient-to-r {
  opacity: 0.35; /* tweak 0.3–0.45 if needed */
  mix-blend-mode: soft-light;
}

/* Hero title text */
.shadow-xl h1 {
  font-size: clamp(2.6rem, 4vw + 1rem, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fdfdfd;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
}

/* Hero Arabic tagline (base style when not wrapped) */
.shadow-xl section.prose.prose-invert h3 {
  font-size: 1.35rem;
  color: #fff7ec;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
}

/* Tagline wrapper for homepage hero (your custom container) */
.tagline-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.3rem;
  transform: translateY(-6px);
}

/* Frosted pill behind tagline text */
.tagline-container h3 {
  backdrop-filter: blur(3px);
  background: rgba(0, 0, 0, 0.22);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  color: #fffdf7;
}

/* Homepage hero body text legibility */
.tagline-container p {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #fffdf5;
  background: rgba(0, 0, 0, 0.38);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  padding: 0.6rem 1.05rem;
  border-radius: 0.6rem;
  backdrop-filter: blur(4px);
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

/* ================================
   5. Hero / homepage banner
   ================================= */

/* ================================
   Hero CTA hard override
   ================================= */

   
   /* Base (light mode) */
   .hero-cta-wrapper a[role="button"] {
     background-color: #c6843a !important; /* Breeze Gold */
     color: #fff !important;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     height: 48px;
     padding: 0 1.25rem;
     border-radius: 0.75rem !important;
     box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
     text-decoration: none !important;
     transition: background-color 0.2s ease, transform 0.2s ease,
     box-shadow 0.2s ease, opacity 0.2s ease;
    }
    
    .hero-cta-wrapper {
      width: 100%;
      display: flex;
      justify-content: center;
      gap: 1rem;
      flex-direction: row;
      flex-wrap: wrap;
    }

/* Hover / focus */
.hero-cta-wrapper a[role="button"]:hover,
.hero-cta-wrapper a[role="button"]:focus {
  background-color: rgba(87, 150, 173, 0.75) !important; /* Cooler, semi-transparent */
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0.75;
}

/* Active / pressed */
.hero-cta-wrapper a[role="button"]:active {
  background-color: #9f6429 !important; /* Active gold */
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* Dark mode tweak (optional but nice) */
.dark .hero-cta-wrapper a[role="button"] {
  background-color: #b37431 !important;
}

.dark .hero-cta-wrapper a[role="button"]:hover,
.dark .hero-cta-wrapper a[role="button"]:focus {
  background-color: rgba(87, 150, 173, 0.7) !important;
}

/* ================================
   6. YouTube embeds (Blowfish)
   ================================= */

/* Spotify embeds */
.spotify-embed {
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.spotify-embed iframe {
  display: block;
  border-radius: 12px;
}

.dark .spotify-embed {
  background: #121212;
}

/* Base responsive embed */
.yt-embed {
  margin: 1.5rem auto;
  width: 100%;
  max-width: clamp(
    560px,
    70vw,
    1100px
  ); /* replaces old fixed + media queries */
}

.yt-embed iframe {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

/* Shorts (vertical 9:16) */
.yt-embed--short {
  margin: 1.5rem auto;
  width: 100%;
  max-width: 420px; /* sane default for vertical video */
}

/* Let Shorts get a bit larger on desktop, but cap by viewport height */
@media (min-width: 1024px) {
  .yt-embed--short {
    max-width: 520px;
  }
}

@media (min-width: 1280px) {
  .yt-embed--short {
    max-width: 600px;
  }
}

.yt-embed--short iframe {
  aspect-ratio: 9 / 16;
  width: 100% !important;
  height: auto;
  max-height: 85vh; /* never exceed screen height */
}

/* Optional: full-bleed when using a wide layout (e.g., layout: "simple") */
.yt-embed--fullbleed {
  width: min(95vw, 1000px);
  max-width: none;
}

section.article-ltr {
  direction: ltr !important;
  unicode-bidi: isolate;
  text-align: start;
}

.article-content > section.article-ltr :lang(ar) > * {
  unicode-bidi: isolate !important;
  text-align: start !important;
}

/* Tutor CTA injected after vocab tables */
.tutor-cta {
  margin: 0.75rem 0 2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-primary-500);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--color-primary-500) 10%, transparent);
}

.tutor-cta__link {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
}

.tutor-cta__link:hover,
.tutor-cta__link:focus {
  text-decoration: underline;
}

/* ================================
   نسمة header wordmark + terracotta "dot" accent
   ================================= */

/* Wide calligraphic wordmark — size by height, not the theme's max-w-20
   (which would crush a 3:1/4:1 logo to a sliver). The light variant is 3:1
   and the dark 4:1; at a shared height they read at the same word size, the
   dark one's brush tail just trails a little further. */
.dd-logo {
  height: clamp(2.1rem, 1.5rem + 1.5vw, 2.7rem);
  width: auto;
  max-width: min(60vw, 15rem); /* never let the wordmark crowd the nav */
}
.dd-logo--dark { display: none; }
.dark .dd-logo--light { display: none; }
.dark .dd-logo--dark { display: block; }

/* Terracotta is the "dot": reserved for the moment of emphasis. Gold owns the
   resting state; pressing a control resolves to terracotta. */
.hero-cta-wrapper a[role="button"]:active {
  background-color: var(--color-terracotta-deep) !important;
}
.hp-hero__btn:active {
  border-color: var(--color-terracotta);
  color: var(--color-terracotta-deep) !important;
}
.dark .hp-hero__btn:active { color: var(--color-terracotta) !important; }

/* In-body links: gold on hover (unchanged), but the underline that appears is
   terracotta — a small brand fleck rather than a full restyle. */
.article-content a[href]:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-terracotta);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 2px;
}

/* ================================
   7. Main menu typography
   ================================= */

.main-menu nav > a span.text-base,
.main-menu nav .nested-menu > div > a span.text-bg {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .main-menu nav > a span.text-base,
  .main-menu nav .nested-menu > div > a span.text-bg {
    white-space: normal;
  }
}

/* ================================
   Word-of-the-day block — «نسمة كلمة»
   Manuscript specimen card for a single Shami word.
   (shortcode: layouts/shortcodes/word.html)
   ================================= */

.dd-word {
  --w-gold: var(--color-accent, #c6843a);
  --w-gold-deep: var(--color-accent-dark, #9f6429);
  --w-gold-soft: var(--color-accent-light, #ebd3aa);
  --w-ink: #322713;
  --w-ink-soft: #6a5836;
  --w-paper: #fbf4e7;
  --w-paper-2: #f1e2c9;
  --w-line: rgba(159, 100, 41, 0.26);

  position: relative;
  max-width: 41rem;
  margin: clamp(1.5rem, 4vw, 2.3rem) auto;
  font-family: "Zain", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--w-ink);
  isolation: isolate;
}

.dark .dd-word {
  --w-ink: #f1e4cc;
  --w-ink-soft: #c9b48b;
  --w-paper: #241c12;
  --w-paper-2: #2e2316;
  --w-line: rgba(235, 211, 170, 0.22);
}

.dd-word__frame {
  position: relative;
  padding: clamp(1.5rem, 4.5vw, 2.5rem) clamp(1.6rem, 5vw, 2.9rem) clamp(1.7rem, 4.5vw, 2.3rem);
  border-radius: 16px;
  background:
    radial-gradient(135% 95% at 88% -10%, rgba(198, 132, 58, 0.18), transparent 58%),
    linear-gradient(158deg, var(--w-paper) 0%, var(--w-paper-2) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 10px 26px -18px rgba(56, 38, 12, 0.4);
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.45s ease;
}

.dark .dd-word__frame {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 12px 28px -18px rgba(0, 0, 0, 0.55);
}

/* paper grain */
.dd-word__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: multiply;
}
.dark .dd-word__frame::before {
  opacity: 0.07;
  mix-blend-mode: screen;
}

/* inset manuscript frame */
.dd-word__frame::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid var(--w-line);
  border-radius: 10px;
  pointer-events: none;
}

.dd-word:hover .dd-word__frame {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 16px 34px -20px rgba(56, 38, 12, 0.45);
}

/* eyebrow */
.dd-word .dd-word__eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 0.3rem;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--w-gold-deep);
}
.dark .dd-word .dd-word__eyebrow { color: var(--w-gold-soft); }

.dd-word__breeze {
  width: 1.7em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.85;
}

/* part-of-speech chip */
.dd-word .dd-word__pos {
  position: absolute;
  top: clamp(1.2rem, 3.4vw, 1.8rem);
  left: clamp(1.3rem, 4.5vw, 2rem);
  margin: 0;
  padding: 0.28em 0.78em;
  font-family: var(--font-body); /* English POS label → Latin */
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--w-gold-deep);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--w-line);
  border-radius: 999px;
}
.dark .dd-word .dd-word__pos {
  color: var(--w-gold-soft);
  background: rgba(255, 255, 255, 0.05);
}

/* hero word */
.dd-word__hero {
  position: relative;
  margin: 0.5rem 0 0.1rem;
}
.dd-word .dd-word__ar {
  margin: 0;
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(3.2rem, 9vw, 5.2rem);
  line-height: 1;
  color: var(--w-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.dark .dd-word .dd-word__ar { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }

/* kashida flourish */
.dd-word__kashida {
  display: block;
  width: min(68%, 15rem);
  height: 1.3rem;
  margin: -0.15rem 0 0;
  overflow: visible;
}
.dd-word__kashida path {
  fill: none;
  stroke-linecap: round;
}
.dd-word__kashida-soft {
  stroke: var(--w-gold-soft);
  stroke-width: 6;
  opacity: 0.5;
}
.dd-word__kashida-ink {
  stroke: var(--w-gold);
  stroke-width: 2.6;
  stroke-dasharray: 230;
  stroke-dashoffset: 230;
  animation: ddKashidaDraw 1s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}

/* root */
.dd-word .dd-word__root {
  margin: 0.55rem 0 0;
  font-family: "Zain", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--w-gold-deep);
  opacity: 0.85;
}
.dark .dd-word .dd-word__root { color: var(--w-gold-soft); }

/* phonetics row */
.dd-word__phon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.7rem 0 0;
}
.dd-word__ipa {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--w-gold-deep);
}
.dark .dd-word__ipa { color: var(--w-gold-soft); }
.dd-word__tr {
  font-family: var(--font-body); /* transliteration → Latin */
  font-style: italic;
  font-size: 1.05rem;
  color: var(--w-ink-soft);
}
.dd-word__dialects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.7rem 0 0;
}
.dd-word__dialect {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--w-gold) 34%, transparent);
  border-radius: 999px;
  font-family: "Zain", system-ui, sans-serif;
  color: var(--w-ink-soft);
  background: color-mix(in srgb, var(--w-paper) 72%, white);
}
.dark .dd-word__dialect {
  border-color: color-mix(in srgb, var(--w-gold-soft) 26%, transparent);
  background: color-mix(in srgb, var(--w-paper) 80%, black);
}
.dd-word__dialect b {
  font-size: 0.78rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--w-gold-deep);
}
.dark .dd-word__dialect b { color: var(--w-gold-soft); }
.dd-word__dialect-word {
  font-size: 1rem;
  line-height: 1;
  color: var(--w-ink);
}
.dd-word__dialect-ipa {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--w-gold-deep);
}
.dark .dd-word__dialect-ipa { color: var(--w-gold-soft); }

/* meaning */
.dd-word .dd-word__meaning {
  margin: 0.7rem 0 0;
  font-family: var(--font-body); /* English meaning → Latin */
  font-weight: 700;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.3;
  color: var(--w-ink);
}

/* usage note */
.dd-word .dd-word__note {
  margin: 0.5rem 0 0;
  font-family: var(--font-body); /* English usage note → Latin */
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--w-ink-soft);
}

/* entrance choreography */
.dd-word__eyebrow { animation: ddRise 0.6s both 0.05s; }
.dd-word__hero   { animation: ddRise 0.7s both 0.12s; }
.dd-word__root   { animation: ddRise 0.6s both 0.2s; }
.dd-word__phon   { animation: ddRise 0.6s both 0.28s; }
.dd-word__meaning{ animation: ddRise 0.6s both 0.36s; }
.dd-word__note   { animation: ddRise 0.6s both 0.44s; }

@keyframes ddRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ddKashidaDraw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dd-word__eyebrow,
  .dd-word__hero,
  .dd-word__root,
  .dd-word__phon,
  .dd-word__meaning,
  .dd-word__note,
  .dd-word__kashida-ink,
  .dd-word__audio.is-playing::before,
  .dd-word__audio.is-playing::after {
    animation: none;
  }
  .dd-word__kashida-ink { stroke-dashoffset: 0; }
  .dd-word__frame,
  .dd-word__audio { transition: none; }
}

/* ================================
   Homepage — "today's entry" hero, browse-by-mood, earlier-entries ledger
   ================================= */

.hp-hero {
  --h-gold: var(--color-accent, #c6843a);
  --h-gold-deep: var(--color-accent-dark, #9f6429);
  --h-gold-soft: var(--color-accent-light, #ebd3aa);
  --h-terracotta: var(--color-terracotta, #b4663c);
  --h-cobalt: #1862a8;
  --h-cobalt-deep: #134e88;
  --h-accent: var(--h-gold);
  --h-accent-deep: var(--h-gold-deep);
  --h-quote: var(--h-terracotta);
  --h-ink: #2c2113;
  --h-ink-soft: #6a5836;
  --h-paper: #fbf4e7;
  --h-paper-2: #f0e0c6;
  --h-line: rgba(159, 100, 41, 0.26);

  position: relative;
  overflow: hidden;
  margin: 0.5rem 0 2.5rem;
  border: 1px solid var(--h-accent);
  border-radius: 4px;
  isolation: isolate;
  background-image:
    linear-gradient(45deg, rgba(140, 100, 32, 0.06) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(140, 100, 32, 0.06) 1px, transparent 1px),
    linear-gradient(155deg, var(--h-paper) 0%, var(--h-paper-2) 100%);
  background-size: 22px 22px, 22px 22px, auto;
  box-shadow: 0 26px 60px -34px rgba(56, 38, 12, 0.4);
}
.dark .hp-hero {
  --h-ink: #f1e4cc;
  --h-ink-soft: #cbb68d;
  --h-paper: #221a11;
  --h-paper-2: #2c2114;
  --h-line: rgba(235, 211, 170, 0.2);
  --h-cobalt: #7ab6e8;
  --h-cobalt-deep: #9cc9ee;
  box-shadow: 0 28px 64px -34px rgba(0, 0, 0, 0.7);
}
.hp-hero--tunisian {
  --h-accent: var(--h-cobalt);
  --h-accent-deep: var(--h-cobalt-deep);
  --h-quote: var(--h-cobalt);
}

.hp-hero__band {
  position: relative;
  z-index: 1;
  height: 8px;
  background-image: repeating-linear-gradient(90deg, var(--h-terracotta) 0 22px, var(--h-accent) 22px 44px);
}
.hp-hero--tunisian .hp-hero__band {
  background-image: repeating-linear-gradient(90deg, var(--h-cobalt-deep) 0 22px, var(--h-cobalt) 22px 44px);
}

.hp-hero__atmos { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 0; overflow: hidden; }
.hp-hero__watermark {
  font-family: "Amiri", serif;
  font-size: min(30vw, 22rem);
  color: var(--h-ink);
  opacity: 0.03;
  line-height: 1;
}
.dark .hp-hero__watermark { opacity: 0.05; }

.hp-hero__ring { position: absolute; inset: 14px; border: 1px solid var(--h-line); pointer-events: none; z-index: 0; }

.hp-hero__corner { position: absolute; width: 26px; height: 26px; color: var(--h-accent); z-index: 1; }
.hp-hero__corner svg { width: 100%; height: 100%; }
.hp-hero__corner--tl { top: 18px; left: 18px; }
.hp-hero__corner--tr { top: 18px; right: 18px; }
.hp-hero__corner--bl { bottom: 18px; left: 18px; }
.hp-hero__corner--br { bottom: 18px; right: 18px; }

.hp-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 400px) 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(2.2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3.75rem) clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}
@media (max-width: 860px) {
  .hp-hero__grid { grid-template-columns: 1fr; }
}

.hp-hero__media { padding-top: 0.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.hp-hero__frame {
  display: block;
  margin-top: -34px;
  border: 1px solid var(--h-accent);
  transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.hp-hero__frame:hover { transform: translateY(-2px); opacity: 0.94; }
.hp-hero__frame:focus-visible { outline: 2px solid var(--h-accent-deep); outline-offset: 4px; }
.hp-hero__img { display: block; width: 100%; height: auto; }
@media (max-width: 860px) { .hp-hero__frame { margin-top: 0; } }

.hp-hero__series {
  align-self: flex-start;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--h-ink-soft);
  text-decoration: none !important;
}
.hp-hero__series span { font-family: "Amiri", serif; font-size: 1.1em; color: var(--h-accent-deep); }
.hp-hero__series:hover { color: var(--h-ink); }

.hp-hero__quote-link { display: block; color: inherit; text-decoration: none !important; transition: opacity 0.15s ease; }
.hp-hero__quote-link:hover { opacity: 0.82; }
.hp-hero__quote-link:focus-visible { outline: 2px solid var(--h-accent-deep); outline-offset: 4px; }

.hp-hero__copy { min-width: 0; padding-top: 1.5rem; }
.hp-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 1.1rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--h-accent-deep);
}
.hp-hero__eyebrow svg { width: 1.6em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; opacity: 0.85; }

.hp-hero__quote {
  margin: 0 0 1rem;
  font-family: "Amiri", serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2.5rem);
  line-height: 1.45;
  color: var(--h-quote);
}
.hp-hero__quote--fallback {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--h-ink);
}

.hp-hero__caption {
  margin: 0 0 1.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--h-ink-soft);
}
.hp-hero__caption a { color: var(--h-ink); font-style: normal; font-weight: 700; text-decoration: none; }
.hp-hero__caption a:hover { color: var(--h-accent-deep); }

.hp-hero__seal {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 1.3em;
  border: 1px solid var(--h-terracotta);
  border-radius: 999px;
  color: var(--h-terracotta);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.hp-hero--tunisian .hp-hero__seal { border-color: var(--h-cobalt); color: var(--h-cobalt-deep); }
.hp-hero__seal:hover { background: var(--h-terracotta); color: var(--h-paper); transform: translateY(-1px); }
.hp-hero--tunisian .hp-hero__seal:hover { background: var(--h-cobalt); }
.hp-hero__seal svg { width: 1.1em; height: 1.1em; }
.hp-hero__seal:focus-visible { outline: 2px solid var(--h-accent-deep); outline-offset: 3px; }

.hp-hero__stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0 clamp(1.5rem, 4vw, 3.75rem) clamp(1.6rem, 3vw, 2.2rem);
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.hp-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.35em 0.9em;
  border-radius: 999px;
  border: 1px solid var(--h-gold);
  color: var(--h-gold-deep);
  text-decoration: none !important;
  transition: background-color 0.15s ease;
}
.hp-stat b { font-family: "Amiri", serif; font-weight: 400; }
.hp-stat--tunisian { border-color: var(--h-cobalt); color: var(--h-cobalt-deep); }
.hp-stat--tunisian b { font-family: "Reem Kufi", sans-serif; }
.hp-stat:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.hp-hero__link { color: var(--h-ink-soft); text-decoration: none; padding: 0.35em 0.4em; }
.hp-hero__link:hover { color: var(--h-ink); }

@media (prefers-reduced-motion: no-preference) {
  .hp-hero__media, .hp-hero__copy { animation: hpSettle 0.6s ease-out both; }
  .hp-hero__copy { animation-delay: 0.1s; }
  @keyframes hpSettle {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ================================
   Browse by mood — real tag chips (auto-populated, top by post count)
   ================================= */

.hp-browse {
  --br-ink-soft: #6a5836;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0 0 2.5rem;
}
.dark .hp-browse { --br-ink-soft: #cbb68d; }
.hp-browse__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--br-ink-soft);
  margin-inline-end: 0.2rem;
}
.hp-chip {
  padding: 0.45em 1em;
  border-radius: 999px;
  border: 1px solid var(--color-accent, #c6843a);
  color: var(--color-accent-dark, #9f6429);
  font-family: var(--font-body);
  font-size: 0.88rem;
  text-decoration: none !important;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.hp-chip:nth-of-type(4n+2) { border-color: #1862a8; color: #134e88; }
.hp-chip:nth-of-type(4n+3) { border-color: var(--color-terracotta, #b4663c); color: var(--color-terracotta, #b4663c); }
.hp-chip:nth-of-type(4n+4) { border-color: var(--color-accent-light, #ebd3aa); color: var(--color-accent-dark, #9f6429); }
.dark .hp-chip:nth-of-type(4n+2) { color: #7ab6e8; }
.hp-chip:hover { transform: translateY(-2px); background: color-mix(in srgb, currentColor 8%, transparent); }
.hp-chip--all { border-color: var(--h-line, rgba(159, 100, 41, 0.3)); color: var(--br-ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .hp-chip, .hp-stat, .hp-hero__seal, .hp-hero__media, .hp-hero__copy { transition: none; animation: none; }
}

/* ================================
   Homepage — earlier-entries ledger (replaces card grid on homepage only)
   ================================= */

.hp-recent {
  --lg-ink: #2c2113;
  --lg-ink-soft: #6a5836;
}
.dark .hp-recent {
  --lg-ink: #f1e4cc;
  --lg-ink-soft: #cbb68d;
}

.hp-ledger__h {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0 0 0.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--color-accent, #c6843a);
  font-family: "Amiri", serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--lg-ink);
}
.hp-ledger__h span { font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; color: var(--lg-ink-soft); }

.hp-ledger { display: flex; flex-direction: column; }
.hp-ledger__row {
  display: flex;
  align-items: flex-start;
  gap: 1.4rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--h-line, rgba(159, 100, 41, 0.22));
  text-decoration: none !important;
  color: inherit;
}
.hp-ledger__glyph { flex-shrink: 0; width: 18px; height: 18px; margin-top: 0.3rem; color: var(--color-accent-dark, #9f6429); }
.hp-ledger__glyph--tunisian { color: #1862a8; }
.dark .hp-ledger__glyph--tunisian { color: #7ab6e8; }
.hp-ledger__glyph svg { width: 100%; height: 100%; }
.hp-ledger__body { display: flex; flex-direction: column; gap: 0.35rem; flex-grow: 1; min-width: 0; }
.hp-ledger__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--lg-ink);
  transition: color 0.15s ease;
}
.hp-ledger__row:hover .hp-ledger__title { color: var(--color-terracotta, #b4663c); }
.hp-ledger__summary { font-family: var(--font-body); font-size: 0.92rem; line-height: 1.55; color: var(--lg-ink-soft); max-width: 42rem; }
.hp-ledger__series { font-family: "Amiri", serif; font-size: 0.85rem; color: var(--color-accent-dark, #9f6429); }
.dark .hp-ledger__series { color: var(--color-accent-light, #ebd3aa); }
.hp-ledger__date { flex-shrink: 0; font-family: var(--font-body); font-size: 0.85rem; color: var(--lg-ink-soft); white-space: nowrap; padding-top: 0.2rem; }

.hp-ledger__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  margin: 2.2rem 0 1rem;
  padding: 1.3rem;
  border: 1px solid var(--color-accent, #c6843a);
  color: var(--lg-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.hp-ledger__cta svg { width: 1em; height: 1em; }
.hp-ledger__cta:hover { background: var(--color-terracotta, #b4663c); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .hp-ledger__title, .hp-ledger__cta { transition: none; }
}

@media (max-width: 560px) {
  .hp-ledger__row { flex-wrap: wrap; }
  .hp-ledger__date { order: -1; width: 100%; }
}
/* ================================
   Ear-training playlist card (learn page)
   ================================= */

.et-playlist {
  --etp: #1a6b4a;
  --etp-dark: #145539;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #1a6b4a 22%, transparent);
  box-shadow: 0 8px 28px -16px rgba(26, 107, 74, 0.32);
  margin-bottom: 0.25rem;
}

/* header strip */
.et-playlist__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  background: var(--etp);
  color: #fff;
}
.dark .et-playlist__head { background: #104030; }

.et-playlist__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.et-playlist__icon svg { width: 1.4rem; height: 1.4rem; }

.et-playlist__info { flex: 1 1 auto; min-width: 0; }
.et-playlist__name {
  display: block;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.1;
  color: #fff;
}
.et-playlist__sub {
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.72);
}

/* animated equalizer bars */
.et-playlist__bars {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1.6rem;
  padding-bottom: 2px;
}
.et-playlist__bars span {
  width: 3px;
  border-radius: 2px 2px 0 0;
  background: rgba(255, 255, 255, 0.65);
  transform-origin: bottom;
  animation: etBarPulse 1.4s ease-in-out infinite;
}
.et-playlist__bars span:nth-child(1) { height: 35%; animation-delay: 0.0s; }
.et-playlist__bars span:nth-child(2) { height: 75%; animation-delay: 0.15s; }
.et-playlist__bars span:nth-child(3) { height: 95%; animation-delay: 0.3s; }
.et-playlist__bars span:nth-child(4) { height: 55%; animation-delay: 0.1s; }
.et-playlist__bars span:nth-child(5) { height: 70%; animation-delay: 0.25s; }
@keyframes etBarPulse {
  0%, 100% { transform: scaleY(0.45); }
  50%       { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .et-playlist__bars span { animation: none; transform: scaleY(0.7); }
}

/* track list */
.et-playlist__tracks {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--wf-paper, white);
}
.dark .et-playlist__tracks { background: #1a1814; }

.et-playlist__track {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.75rem 1.4rem;
  text-decoration: none !important;
  color: inherit;
  border-bottom: 1px solid color-mix(in srgb, #1a6b4a 10%, transparent);
  transition: background 0.14s ease;
}
.et-playlist__track:last-child { border-bottom: none; }
.et-playlist__track:hover { background: color-mix(in srgb, #1a6b4a 6%, transparent); }

.et-playlist__num {
  flex: none;
  font-family: "Zain", monospace, system-ui;
  font-size: 0.72rem;
  font-weight: 700;
  color: color-mix(in srgb, #1a6b4a 55%, transparent);
  letter-spacing: 0.05em;
  min-width: 1.5rem;
  text-align: right;
}
.dark .et-playlist__num { color: color-mix(in srgb, #4ecb96 55%, transparent); }

.et-playlist__title {
  flex: 1 1 auto;
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.97rem;
  font-weight: 700;
  color: #2a2218;
  line-height: 1.3;
  min-width: 0;
}
.dark .et-playlist__title { color: #f0ebe0; }
.et-playlist__track:hover .et-playlist__title { color: #1a6b4a; }
.dark .et-playlist__track:hover .et-playlist__title { color: #4ecb96; }

.et-playlist__date {
  flex: none;
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9a8e7e;
  white-space: nowrap;
}
.dark .et-playlist__date { color: #6a6052; }

/* footer */
.et-playlist__footer {
  padding: 0.7rem 1.4rem;
  text-align: right;
  background: color-mix(in srgb, #1a6b4a 5%, var(--wf-paper, white));
  border-top: 1px solid color-mix(in srgb, #1a6b4a 12%, transparent);
}
.dark .et-playlist__footer { background: #141210; }
.et-playlist__all {
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #1a6b4a;
  text-decoration: none !important;
  transition: color 0.15s ease;
}
.dark .et-playlist__all { color: #4ecb96; }
.et-playlist__all:hover { color: #145539; }
.dark .et-playlist__all:hover { color: #6edba8; }

/* ================================
   Ear-training series filter
   ================================= */

.et-filter {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  flex-wrap: wrap;
}
.et-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.38rem 0.9rem 0.38rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1.5px solid color-mix(in srgb, #1a6b4a 30%, transparent);
  background: transparent;
  color: #6a6052;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.dark .et-filter__btn { color: #8a8070; border-color: color-mix(in srgb, #4ecb96 25%, transparent); }
.et-filter__btn svg { width: 0.85rem; height: 0.85rem; opacity: 0.7; }
.et-filter__btn:hover {
  background: color-mix(in srgb, #1a6b4a 8%, transparent);
  color: #1a6b4a;
  border-color: color-mix(in srgb, #1a6b4a 50%, transparent);
}
.dark .et-filter__btn:hover { color: #4ecb96; }

.et-filter__btn--active {
  background: #1a6b4a;
  color: #fff !important;
  border-color: #1a6b4a;
}
.dark .et-filter__btn--active {
  background: #4ecb96;
  color: #0a2a1e !important;
  border-color: #4ecb96;
}
.et-filter__btn--active svg { opacity: 1; }

.et-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3em;
  height: 1.3em;
  padding: 0 0.3em;
  border-radius: 999px;
  font-size: 0.78em;
  background: rgba(255, 255, 255, 0.22);
  line-height: 1;
}
.et-filter__btn:not(.et-filter__btn--active) .et-filter__count {
  background: color-mix(in srgb, currentColor 15%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .et-filter__btn { transition: none; }
}

/* ================================
   Ear-training feature card (learn page)
   ================================= */

.et-feature {
  --etf: #1a6b4a;
  --etf-deep: #145539;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  border-radius: 16px;
  text-decoration: none !important;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #1a6b4a 7%, var(--wf-paper, #faf6f0)),
    color-mix(in srgb, #1a6b4a 3%, var(--wf-paper, #faf6f0)) 70%
  );
  border: 1px solid color-mix(in srgb, #1a6b4a 22%, transparent);
  border-top: 3px solid var(--etf);
  box-shadow: 0 8px 24px -16px rgba(26, 107, 74, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.25rem;
}
.et-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -16px rgba(26, 107, 74, 0.45);
}
.dark .et-feature {
  --etf: #4ecb96;
  --etf-deep: #3db882;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #4ecb96 9%, #1c1a16),
    color-mix(in srgb, #4ecb96 4%, #1c1a16) 70%
  );
  border-color: color-mix(in srgb, #4ecb96 28%, transparent);
  border-top-color: #4ecb96;
}

.et-feature__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 14px;
  color: #fff;
  background: var(--etf);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 4px 12px -4px rgba(26, 107, 74, 0.55);
}
.et-feature__icon svg { width: 1.6rem; height: 1.6rem; }

.et-feature__body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1 1 auto;
  min-width: 0;
}
.et-feature__series {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--etf-deep);
  line-height: 1.1;
}
.dark .et-feature__series { color: var(--etf); }
.et-feature__title {
  font-family: var(--font-display); /* English heading → Latin display */
  font-size: 1.05rem;
  font-weight: 800;
  color: #2a2218;
  line-height: 1.15;
}
.dark .et-feature__title { color: #f0ebe0; }
.et-feature__meta {
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--etf) 70%, #555);
  line-height: 1.3;
}
.dark .et-feature__meta { color: color-mix(in srgb, #4ecb96 60%, #aaa); }

.et-feature__wave {
  flex: none;
  display: flex;
  align-items: center;
  width: 5rem;
  height: 2rem;
  color: color-mix(in srgb, var(--etf) 30%, transparent);
  opacity: 0.7;
}
.et-feature__wave svg { width: 100%; height: 100%; }

@media (max-width: 480px) {
  .et-feature__wave { display: none; }
  .et-feature__icon { width: 2.6rem; height: 2.6rem; }
  .et-feature__icon svg { width: 1.3rem; height: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .et-feature { transition: none; }
}

/* ================================
   Series catalogue — "Nasmat" cards
   (layouts/_default/terms.html, series branch)
   ================================= */

.sx {
  --s-gold: var(--color-accent, #c6843a);
  --s-gold-deep: var(--color-accent-dark, #9f6429);
  --s-gold-soft: var(--color-accent-light, #ebd3aa);
  --s-ink: #2c2113;
  --s-ink-soft: #6a5836;
  --s-paper: #fbf4e7;
  --s-paper-2: #f1e2c9;
  --s-line: rgba(159, 100, 41, 0.26);
  position: relative;
  margin-top: 1rem;
}
.dark .sx {
  --s-ink: #f1e4cc;
  --s-ink-soft: #cbb68d;
  --s-paper: #241c12;
  --s-paper-2: #2e2316;
  --s-line: rgba(235, 211, 170, 0.2);
}

.sx__atmos {
  position: absolute;
  inset: -1rem 0 auto 0;
  height: 16rem;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.sx__watermark {
  position: absolute;
  right: -2%;
  top: -3rem;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: clamp(8rem, 18vw, 16rem);
  line-height: 1;
  color: var(--s-gold);
  opacity: 0.06;
  white-space: nowrap;
  user-select: none;
}

.sx__head {
  position: relative;
  z-index: 2;
  margin: 0.5rem 0 2rem;
}
.sx__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.05rem;
  color: var(--s-gold-deep);
}
.dark .sx__eyebrow { color: var(--s-gold-soft); }
.sx__eyebrow svg {
  width: 1.7em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.85;
}
.sx__title {
  margin: 0.4rem 0 0;
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  line-height: 1.05;
  color: var(--s-ink);
}
.sx__intro {
  margin: 0.5rem 0 0;
  max-width: 42rem;
  font-family: var(--font-body); /* English → Latin body */
  font-size: clamp(1.05rem, 1.3vw, 1.18rem);
  line-height: 1.6;
  color: var(--s-ink-soft);
}
.sx__intro p { margin: 0; }

.sx__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.1rem;
}

.sx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.4rem 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none !important;
  color: var(--s-ink) !important;
  background:
    radial-gradient(120% 90% at 92% -10%, rgba(198, 132, 58, 0.14), transparent 56%),
    linear-gradient(158deg, var(--s-paper) 0%, var(--s-paper-2) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 14px 34px -22px rgba(56, 38, 12, 0.5);
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.32s ease;
}
.sx-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--s-line);
  border-radius: 10px;
  pointer-events: none;
}
.dark .sx-card {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 16px 38px -22px rgba(0, 0, 0, 0.65);
}
.sx-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 22px 44px -22px rgba(56, 38, 12, 0.6);
}

.sx-card__glyph {
  color: var(--s-gold);
  opacity: 0.5;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sx-card__glyph svg {
  width: 2rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.sx-card:hover .sx-card__glyph {
  opacity: 0.95;
  transform: translateX(3px);
}

.sx-card__count {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  color: #fff8ec;
  background: radial-gradient(circle at 35% 28%, #e6b873, var(--s-gold) 55%, var(--s-gold-deep));
  box-shadow: 0 5px 12px -4px rgba(159, 100, 41, 0.6);
}
.sx-card__count b {
  font-family: var(--font-body); /* English → Latin body */
  font-size: 1.15rem;
  font-weight: 800;
}
.sx-card__count span {
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.92;
}
.sx-card__count--soon {
  flex-direction: row;
  padding: 0.3rem 0.6rem;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0;
  color: var(--s-gold-deep);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--s-line);
  box-shadow: none;
}
.dark .sx-card__count--soon {
  color: var(--s-gold-soft);
  background: rgba(255, 255, 255, 0.06);
}

.sx-card__ar {
  margin: 0.9rem 0 0;
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.5rem);
  line-height: 1.1;
  color: var(--s-ink);
  transition: color 0.3s ease;
}
.sx-card:hover .sx-card__ar { color: var(--s-gold-deep); }
.dark .sx-card:hover .sx-card__ar { color: var(--s-gold-soft); }

.sx-card__ipa {
  display: block;
  margin-top: 0.3rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--s-gold-deep);
  opacity: 0.85;
}
.dark .sx-card__ipa { color: var(--s-gold-soft); }

.sx-card__en {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--font-body); /* English → Latin body */
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--s-ink-soft);
}

.sx-card__desc {
  margin: 0.6rem 0 0;
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--s-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sx-card__go {
  margin-top: 1rem;
  align-self: flex-end;
  color: var(--s-gold-deep);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.dark .sx-card__go { color: var(--s-gold-soft); }
.sx-card__go svg { width: 1.3rem; height: 1.3rem; display: block; }
.sx-card:hover .sx-card__go {
  opacity: 1;
  transform: translateX(0);
}

/* empty / upcoming series */
.sx-card--empty {
  opacity: 0.66;
  filter: saturate(0.7);
}
.sx-card--empty .sx-card__glyph { opacity: 0.3; }
.sx-card--empty:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .sx-card,
  .sx-card__glyph,
  .sx-card__ar,
  .sx-card__go { transition: none; }
}

/* ================================
   Single post — reading enhancements
   (layouts/_default/single.html + .article-content)
   ================================= */

.article-content {
  --ac-gold: var(--color-accent, #c6843a);
  --ac-gold-deep: var(--color-accent-dark, #9f6429);
  --ac-gold-soft: var(--color-accent-light, #ebd3aa);
  --ac-line: rgba(159, 100, 41, 0.22);
  --ac-line-soft: rgba(159, 100, 41, 0.12);
  --ac-fill: rgba(198, 132, 58, 0.06);
}
.dark .article-content {
  --ac-line: rgba(235, 211, 170, 0.18);
  --ac-line-soft: rgba(235, 211, 170, 0.09);
  --ac-fill: rgba(235, 211, 170, 0.05);
}

/* --- scene-break: a breeze glyph instead of a rule --- */
.article-content hr {
  border: 0;
  height: 1.4rem;
  margin: 2.6rem 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='18' fill='none' stroke='%23c6843a' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 5h13a3 3 0 1 0-3-3'/%3E%3Cpath d='M2 9h18a3.4 3.4 0 1 1-3.4 3.4'/%3E%3Cpath d='M2 13h9a2.4 2.4 0 1 0-2.4 2.4'/%3E%3C/svg%3E")
    center / 2.1rem no-repeat;
  opacity: 0.75;
}

/* --- horizontal scroll wrapper so wide tables don't clip on mobile --- */
.article-content .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.9rem 0;
  border-radius: 13px;
}
.article-content .table-scroll > table { margin: 0; }

/* --- manuscript tables (the كلام / vocab tables) --- */

/* Scroll wrapper: table becomes the scroll container itself on narrow screens.
   display:block + overflow-x:auto preserves table structure while allowing
   horizontal scroll — safer than stacking since column count varies (3–5). */
.article-content table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.9rem 0;
  /* Latin-aware: IPA + English "Meaning" column render in Newsreader,
     Arabic glyphs fall back to Zain; first column is Lalezar (below). */
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  border: 1px solid var(--ac-line);
  border-radius: 13px;
  box-shadow: 0 14px 32px -22px rgba(56, 38, 12, 0.5);
}
.article-content thead th {
  padding: 0.7rem 1rem;
  text-align: start;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ac-gold-deep);
  background: linear-gradient(180deg, rgba(198, 132, 58, 0.16), rgba(198, 132, 58, 0.07));
  border-bottom: 1px solid var(--ac-line);
  white-space: nowrap;
  /* Match tbody td: resolve each header's own alignment from its own
     content language, not the page's inherited RTL context — otherwise
     a plain-English header like "IPA" stays right-aligned while the
     left-aligned English data below it (see the tbody rule) drifts out
     of line with it. */
  unicode-bidi: plaintext !important;
}
/* Tailwind Typography's prose defaults zero the outer-edge padding on
   thead th:first-child/:last-child (padding-inline-start/end: 0), assuming
   a flush table whose text lines up with surrounding prose. This table
   design is a bordered/boxed card instead, so that leaves the header text
   touching the table's outer border on one side — restore symmetric padding. */
.article-content thead th:first-child,
.article-content thead th:last-child {
  padding-inline-start: 1rem;
  padding-inline-end: 1rem;
}
.dark .article-content thead th { color: var(--ac-gold-soft); }
.article-content tbody td {
  padding: 0.65rem 1rem;
  vertical-align: top;
  border-top: 1px solid var(--ac-line-soft);
  /* كلام tables mix Arabic/IPA/English per cell with no fixed column
     order across posts; plaintext lets each cell resolve its own bidi
     direction from its own first-strong character instead of inheriting
     the page's RTL context, which otherwise mirrors/reorders neutral
     punctuation (guillemets, dashes, slashes) at line wraps.
     !important is needed: every cell inherits lang="ar" from <html>,
     so the blanket `.article-content :lang(ar) { unicode-bidi: isolate }`
     rule above (two class-level selectors) otherwise wins the cascade
     over this one (one class + two type selectors) regardless of
     source order. */
  unicode-bidi: plaintext !important;
}
.article-content tbody tr:first-child td { border-top: 0; }
.article-content tbody tr:nth-child(even) { background: var(--ac-fill); }
/* first column of vocab tables usually holds the Arabic term */
.article-content tbody td:first-child {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--ac-gold-deep);
  white-space: nowrap;
}
.dark .article-content tbody td:first-child { color: var(--ac-gold-soft); }

/* Mobile: tighten padding and font sizes so the table fits more comfortably
   before the user needs to scroll. */
@media (max-width: 640px) {
  .article-content table {
    font-size: 0.9rem;
  }
  .article-content thead th {
    padding: 0.55rem 0.7rem;
    font-size: 0.7rem;
  }
  .article-content thead th:first-child,
  .article-content thead th:last-child {
    padding-inline-start: 0.7rem;
    padding-inline-end: 0.7rem;
  }
  .article-content tbody td {
    padding: 0.5rem 0.7rem;
  }
  .article-content tbody td:first-child {
    font-size: 1.2rem;
    padding: 0.5rem 0.7rem;
  }
}

/* --- blockquote: gold breeze callout --- */
.article-content blockquote {
  position: relative;
  margin: 1.7rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 3px solid var(--ac-gold);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, var(--ac-fill), transparent 72%);
}
[dir="rtl"] .article-content blockquote,
.article-content [dir="rtl"] blockquote { border-radius: 12px 0 0 12px; }

/* --- body text links --- */
.article-content p a,
.article-content li a {
  color: var(--ac-gold-deep);
  text-decoration: underline;
  text-decoration-color: var(--ac-line);
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.18s ease, color 0.18s ease;
}
.article-content p a:hover,
.article-content li a:hover {
  color: var(--ac-gold);
  text-decoration-color: var(--ac-gold);
}
.dark .article-content p a,
.dark .article-content li a { color: var(--ac-gold-soft); }

/* --- article header: gold kicker + dialect-coloured tag pills --- */
#single_header h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 0.7rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-accent, #c6843a), var(--color-accent-light, #ebd3aa));
}
#single_header a[href*="/tags/"] span,
#single_header a[href*="/categories/"] span,
#single_header a[href*="/dialects/"] span {
  border-color: var(--color-accent, #c6843a) !important;
  color: var(--color-accent-dark, #9f6429) !important;
  background: rgba(198, 132, 58, 0.08);
  border-radius: 999px !important;
  padding: 0.12rem 0.62rem !important;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}
.dark #single_header a[href*="/tags/"] span,
.dark #single_header a[href*="/categories/"] span,
.dark #single_header a[href*="/dialects/"] span {
  color: var(--color-accent-light, #ebd3aa) !important;
}
#single_header a[href*="/tags/"]:hover span,
#single_header a[href*="/categories/"]:hover span,
#single_header a[href*="/dialects/"]:hover span {
  background: var(--color-accent, #c6843a);
  color: #fff8ec !important;
}

/* ================================
   Dialect indicators — Tunisian vs Shami
   ================================= */

.post-dialects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.55rem 0 1rem;
}

/* When both dialect + ear-training badges share a row wrapper,
   collapse the inner .post-dialects so all pills sit on one flex line */
.post-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.7rem 0 0;
}
.post-badges .post-dialects {
  display: contents;
}

.dialect-badge {
  --dc: var(--color-accent, #c6843a);
  --tile: var(--color-accent, #c6843a);
  --pat: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.28rem 0.85rem 0.28rem 0.28rem;
  border-radius: 999px;
  font-family: var(--font-body); /* English → Latin body */
  line-height: 1;
  color: var(--dc);
  background: color-mix(in srgb, var(--dc) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--dc) 32%, transparent);
  text-decoration: none !important;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
a.dialect-badge:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--dc) 16%, transparent);
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--dc) 60%, transparent);
}
a.dialect-badge:focus-visible {
  outline: 2px solid var(--dc);
  outline-offset: 2px;
}

/* the little ceramic-tile motif */
.dialect-badge__motif {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
  color: #fff;
  background: var(--tile);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 2px 6px -2px rgba(0, 0, 0, 0.45);
}
.dialect-badge__motif::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--pat);
  background-size: var(--pat-size, 16px) var(--pat-size, 16px);
  opacity: 0.28;
}
.dialect-badge__motif svg {
  position: relative;
  width: 1.05rem;
  height: 1.05rem;
}

.dialect-badge b {
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.2em;
}
.dialect-badge i {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  opacity: 0.82;
}

/* Tunisian → Sidi Bou Said cobalt + tile lattice */
.dialect-badge--tunisian {
  --dc: #1862a8;
  --tile: #1b6ec2;
  --pat-size: 17px;
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.3'%3E%3Ccircle cx='0' cy='0' r='12'/%3E%3Ccircle cx='24' cy='0' r='12'/%3E%3Ccircle cx='0' cy='24' r='12'/%3E%3Ccircle cx='24' cy='24' r='12'/%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/g%3E%3C/svg%3E");
}
.dark .dialect-badge--tunisian { --dc: #7ab6e8; }

/* Shami → Damascene mosaic gold + star grid */
.dialect-badge--shami {
  --dc: #a96f1c;
  --tile: #c6843a;
  --pat-size: 14px;
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Crect x='4' y='4' width='12' height='12'/%3E%3Crect x='4' y='4' width='12' height='12' transform='rotate(45 10 10)'/%3E%3C/g%3E%3C/svg%3E");
}
.dark .dialect-badge--shami { --dc: #e2ba6e; }

/* compact variant for list cards */
.post-dialects--sm { gap: 0.4rem; margin: 0.7rem 0 0; }
.post-dialects--sm .dialect-badge {
  gap: 0.45em;
  padding: 0.2rem 0.6rem 0.2rem 0.2rem;
}
.post-dialects--sm .dialect-badge__motif {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
}
.post-dialects--sm .dialect-badge__motif svg { width: 0.85rem; height: 0.85rem; }
.post-dialects--sm .dialect-badge b { font-size: 1.05em; }
.post-dialects--sm .dialect-badge i { font-size: 0.64rem; letter-spacing: 0.08em; }

@media (prefers-reduced-motion: reduce) {
  .dialect-badge { transition: none; }
}

/* ================================
   Dialect term pages — accented cultural headers
   (/dialects/shami/, /dialects/tunisian/)
   ================================= */

.dterm {
  --dt: #9f6429;
  --dt-soft: #b5781f;
  --dt-tile: #c6843a;
  --dt-text: #6a5836;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 0.5rem 0 2.4rem;
  padding: clamp(2rem, 5vw, 3.6rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: 22px;
  box-shadow: 0 24px 54px -34px rgba(56, 38, 12, 0.5);
}
.dterm__pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: 44px 44px;
  opacity: 0.16;
}
.dterm::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 1;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--dt) 22%, transparent);
  border-radius: 15px;
}
.dterm__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.dterm__eyebrow {
  display: block;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1;
  color: var(--dt-soft);
}
.dterm__title {
  margin: 0.25rem 0 0;
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(4rem, 13vw, 7.5rem);
  line-height: 0.95;
  color: var(--dt);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.dterm__en {
  margin: 0.55rem 0 0;
  font-family: var(--font-body); /* English → Latin body */
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--dt-soft);
}
.dterm__desc {
  margin: 0.7rem 0 0;
  max-width: 34rem;
  font-family: var(--font-body); /* English → Latin body */
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.6;
  color: var(--dt-text);
}
.dterm__count {
  display: inline-block;
  margin-top: 1.15rem;
  padding: 0.32rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-body); /* English → Latin body */
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--dt-tile);
  box-shadow: 0 6px 14px -5px color-mix(in srgb, var(--dt-tile) 65%, transparent);
}

.dterm__emblem {
  display: flex;
  justify-content: center;
  align-items: center;
}
.dterm__tile {
  position: relative;
  overflow: hidden;
  width: clamp(8rem, 17vw, 11rem);
  aspect-ratio: 1;
  border-radius: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--dt-tile);
  box-shadow:
    0 20px 44px -18px color-mix(in srgb, var(--dt-tile) 70%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transform: rotate(-3deg);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.dterm:hover .dterm__tile { transform: rotate(0deg); }
.dterm__tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--tile-pat);
  background-size: 24px 24px;
  opacity: 0.26;
}
.dterm__tile svg {
  position: relative;
  width: 54%;
  height: 54%;
}

/* ---- Shami → Damascene mosaic, gold on cream ---- */
.dterm--shami {
  --dt: #9f6429;
  --dt-soft: #b5781f;
  --dt-tile: #c6843a;
  --dt-text: #6a5836;
  background:
    radial-gradient(120% 130% at 88% -12%, rgba(198, 132, 58, 0.22), transparent 55%),
    linear-gradient(155deg, #fbf4e7 0%, #f0e0c6 100%);
}
.dterm--shami .dterm__pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23c6843a' stroke-width='1.1'%3E%3Crect x='13' y='13' width='18' height='18'/%3E%3Crect x='13' y='13' width='18' height='18' transform='rotate(45 22 22)'/%3E%3Crect x='-9' y='-9' width='18' height='18' transform='rotate(45 0 0)'/%3E%3Crect x='35' y='35' width='18' height='18' transform='rotate(45 44 44)'/%3E%3C/g%3E%3C/svg%3E");
}
.dterm--shami .dterm__tile {
  --tile-pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Crect x='4' y='4' width='12' height='12'/%3E%3Crect x='4' y='4' width='12' height='12' transform='rotate(45 10 10)'/%3E%3C/g%3E%3C/svg%3E");
}
.dark .dterm--shami {
  --dt: #e2ba6e;
  --dt-soft: #e0b667;
  --dt-text: #cbb68d;
  background:
    radial-gradient(120% 130% at 88% -12%, rgba(198, 132, 58, 0.16), transparent 55%),
    linear-gradient(155deg, #241c12 0%, #2c2114 100%);
}

/* ---- Tunisian → Sidi Bou Said, cobalt on white ---- */
.dterm--tunisian {
  --dt: #155a9e;
  --dt-soft: #1862a8;
  --dt-tile: #1b6ec2;
  --dt-text: #3a5f80;
  background:
    radial-gradient(120% 130% at 88% -12%, rgba(27, 110, 194, 0.18), transparent 55%),
    linear-gradient(155deg, #f5f9fd 0%, #e6f0fa 100%);
}
.dterm--tunisian .dterm__pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%231b6ec2' stroke-width='1.1'%3E%3Ccircle cx='0' cy='0' r='22'/%3E%3Ccircle cx='44' cy='0' r='22'/%3E%3Ccircle cx='0' cy='44' r='22'/%3E%3Ccircle cx='44' cy='44' r='22'/%3E%3Ccircle cx='22' cy='22' r='22'/%3E%3C/g%3E%3C/svg%3E");
}
.dterm--tunisian .dterm__tile {
  --tile-pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.3'%3E%3Ccircle cx='0' cy='0' r='12'/%3E%3Ccircle cx='24' cy='0' r='12'/%3E%3Ccircle cx='0' cy='24' r='12'/%3E%3Ccircle cx='24' cy='24' r='12'/%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/g%3E%3C/svg%3E");
}
.dark .dterm--tunisian {
  --dt: #7ab6e8;
  --dt-soft: #6fb0e6;
  --dt-text: #9fc3e4;
  background:
    radial-gradient(120% 130% at 88% -12%, rgba(27, 110, 194, 0.22), transparent 55%),
    linear-gradient(155deg, #0e1a28 0%, #13243a 100%);
}

@media (max-width: 760px) {
  .dterm__inner { grid-template-columns: 1fr; }
  .dterm__emblem { order: -1; justify-content: flex-start; }
  .dterm__tile { width: 7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dterm__tile { transition: none; }
}

/* ================================
   Blog index — accented header + warm list cards
   (layouts/_default/list.html, blog section)
   ================================= */

/* post-count chip reused in the breeze header */
.sx__count {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  margin-top: 1.15rem;
  padding: 0.34rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-body); /* English → Latin body */
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #fff8ec;
  background: radial-gradient(circle at 32% 28%, #e6b873, var(--s-gold, #c6843a) 55%, var(--s-gold-deep, #9f6429));
  box-shadow: 0 6px 14px -5px rgba(159, 100, 41, 0.6);
}
.sx__count b { font-size: 1.1rem; font-weight: 800; }

/* year separators in the list */
.bloglist-year {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2.4rem 0 0.3rem;
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.65rem;
  letter-spacing: 0.02em;
  color: var(--color-accent-dark, #9f6429);
}
.bloglist-year:first-child { margin-top: 0.8rem; }
.dark .bloglist-year { color: var(--color-accent-light, #ebd3aa); }
.bloglist-year::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--color-accent, #c6843a) 38%, transparent), transparent);
}

/* warm up the simple list cards (blog list, dialect/term lists, recent) */
.article-link--simple {
  border-radius: 14px;
  border-color: rgba(159, 100, 41, 0.2) !important;
  background: linear-gradient(160deg, rgba(251, 244, 231, 0.6), rgba(241, 226, 201, 0.32));
  box-shadow: 0 10px 26px -20px rgba(56, 38, 12, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.dark .article-link--simple {
  border-color: rgba(235, 211, 170, 0.16) !important;
  background: linear-gradient(160deg, rgba(46, 35, 22, 0.5), rgba(34, 26, 16, 0.4));
}
.article-link--simple:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--color-accent, #c6843a) 55%, transparent) !important;
  box-shadow: 0 18px 40px -22px rgba(56, 38, 12, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .article-link--simple { transition: none; }
}

/* ================================
   About page — bespoke breeze hero
   (layouts/about/single.html)
   ================================= */

.about {
  --about-ink: #2c2419;
  --about-ink-soft: #5c5040;
  --about-ink-mute: #8a7c66;
  --about-gold: var(--color-accent, #c6843a);
  --about-gold-deep: var(--color-accent-dark, #9f6429);
  --about-gold-soft: var(--color-accent-light, #ebd3aa);
  font-family: var(--font-body);
  color: var(--about-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.dark .about {
  --about-ink: #f1e4cc;
  --about-ink-soft: #cbb68d;
  --about-ink-mute: #a99574;
}
.about :where(h1, h2, h3) {
  font-family: var(--font-display);
  font-weight: 500;
}

.about-hero {
  --a-gold: var(--about-gold);
  --a-gold-deep: var(--about-gold-deep);
  --a-gold-soft: var(--about-gold-soft);
  --a-ink: var(--about-ink);
  --a-ink-soft: var(--about-ink-soft);
  --a-paper: #fbf4e7;
  --a-paper-2: #f0e0c6;
  --a-line: rgba(159, 100, 41, 0.26);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 0.5rem 0 0;
  padding: clamp(1.9rem, 4vw, 3.3rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: 22px;
  background:
    radial-gradient(120% 130% at 88% -12%, rgba(198, 132, 58, 0.22), transparent 55%),
    linear-gradient(155deg, var(--a-paper) 0%, var(--a-paper-2) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 26px 60px -34px rgba(56, 38, 12, 0.55);
}
.dark .about-hero {
  --a-paper: #221a11;
  --a-paper-2: #2c2114;
  --a-line: rgba(235, 211, 170, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 28px 64px -34px rgba(0, 0, 0, 0.7);
}
.about-hero::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 1;
  pointer-events: none;
  border: 1px solid var(--a-line);
  border-radius: 15px;
}
.about-hero__atmos {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.about-hero__wm {
  position: absolute;
  right: -3%;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: clamp(11rem, 26vw, 26rem);
  line-height: 0.8;
  color: var(--a-gold);
  opacity: 0.06;
  white-space: nowrap;
  user-select: none;
}

.about-hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.about-hero__copy { min-width: 0; }

.about-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--a-gold-deep);
}
.dark .about-hero__eyebrow { color: var(--a-gold-soft); }
.about-hero__eyebrow svg {
  width: 1.7em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.85;
}
.about-hero__title {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.011em;
  color: var(--a-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.dark .about-hero__title { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.about-hero__brand {
  margin: 0.35rem 0 0;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.3;
  color: var(--a-gold-deep);
}
.dark .about-hero__brand { color: var(--a-gold-soft); }
.about-hero__lead {
  margin: 0.85rem 0 0;
  max-width: 34rem;
  font-family: var(--font-body);
  font-size: 1.18rem;
  line-height: 1.62;
  color: var(--a-ink-soft);
}
.about-hero__byline {
  margin: 0.8rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.14rem;
  color: var(--a-ink);
}

.about-hero__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.2rem;
}
.about-hero__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  color: var(--a-ink-soft);
  border: 1px solid var(--a-line);
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.about-hero__social-link:hover {
  transform: translateY(-2px);
  color: var(--a-gold-deep);
  border-color: var(--a-gold);
  background: rgba(255, 255, 255, 0.5);
}
.dark .about-hero__social-link:hover { color: var(--a-gold-soft); background: rgba(255, 255, 255, 0.06); }
.about-hero__social-link svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }

.about-hero__media { display: flex; justify-content: center; }
.about-hero__frame {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 22rem;
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--a-gold-soft), var(--a-gold));
  box-shadow: 0 26px 54px -26px rgba(56, 38, 12, 0.62);
  transform: rotate(2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.about-hero:hover .about-hero__frame { transform: rotate(0deg) scale(1.012); }
.about-hero__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.about-hero__seal {
  position: absolute;
  right: -14px;
  bottom: -14px;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #e6b873, var(--a-gold) 55%, var(--a-gold-deep));
  color: #fff8ec;
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 8px 18px -6px rgba(159, 100, 41, 0.7), 0 0 0 4px var(--a-paper);
}
.about-hero__seal svg {
  width: 1.4em;
  height: 0.9em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.9;
}

/* about body */
.about__body {
  width: 100%;
  max-width: 60ch;
  margin: 3rem auto 4.5rem;
  font-family: var(--font-body);
  font-size: 1.22rem;
  line-height: 1.72;
  color: var(--about-ink);
}
.about__body :where(p, li, blockquote) {
  font-family: var(--font-body);
}
.about__body > p {
  margin: 0 0 1.3rem;
}
.about__body > p:first-of-type::first-letter {
  float: left;
  padding: 0.12em 0.12em 0 0;
  font-family: var(--font-display);
  font-size: 3.9rem;
  font-weight: 600;
  line-height: 0.76;
  color: var(--about-gold-deep);
}
.dark .about__body > p:first-of-type::first-letter {
  color: var(--about-gold-soft);
}

/* entrance */
.about-hero__eyebrow { animation: hpRise 0.6s both 0.05s; }
.about-hero__title { animation: hpRise 0.7s both 0.12s; }
.about-hero__brand { animation: hpRise 0.6s both 0.18s; }
.about-hero__lead { animation: hpRise 0.6s both 0.26s; }
.about-hero__byline { animation: hpRise 0.6s both 0.32s; }
.about-hero__social { animation: hpRise 0.6s both 0.4s; }
.about-hero__frame { animation: aboutPhoto 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards 0.2s; }

@keyframes aboutPhoto {
  from { opacity: 0; transform: rotate(6deg) translateY(22px) scale(0.96); }
  to { opacity: 1; transform: rotate(2deg) translateY(0) scale(1); }
}

@media (max-width: 860px) {
  .about-hero__grid { grid-template-columns: 1fr; }
  .about-hero__media { order: -1; }
  .about-hero__frame { max-width: 17rem; transform: rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .about-hero__eyebrow,
  .about-hero__title,
  .about-hero__brand,
  .about-hero__lead,
  .about-hero__byline,
  .about-hero__social,
  .about-hero__frame { animation: none; }
  .about-hero__frame { transition: none; }
}

/* ================================
   Tutors page — dialect-keyed tutor cards
   (layouts/tutors/single.html + tutor shortcode)
   ================================= */

.tutors {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.tutors__body {
  width: 100%;
  max-width: 46rem;
  margin: 1.6rem auto 4rem;
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.68;
}

.tutors .sx__title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.011em;
}
.tutors .sx__intro {
  max-width: 44ch;
  font-family: var(--font-body);
  font-size: 1.18rem;
  line-height: 1.62;
}
.tutors__body :where(p, li, blockquote) {
  font-family: var(--font-body);
}
.tutors__body :where(h2, h3) {
  font-family: var(--font-display);
  font-weight: 500;
}

.tutor-card {
  --tc: #9f6429;
  --tc-tile: #c6843a;
  --tc-text: #5a4a2e;
  --tc-pat: none;
  position: relative;
  overflow: hidden;
  margin: 1.6rem 0;
  padding: clamp(1.3rem, 3vw, 1.7rem) clamp(1.4rem, 3vw, 1.9rem);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--tc) 26%, transparent);
  border-inline-start: 5px solid var(--tc-tile);
  box-shadow: 0 16px 36px -26px rgba(56, 38, 12, 0.5);
}
.tutor-card__head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tutor-card__motif {
  position: relative;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--tc-tile);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 4px 10px -3px rgba(0, 0, 0, 0.4);
}
.tutor-card__motif::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--tc-pat);
  background-size: 18px 18px;
  opacity: 0.25;
}
.tutor-card__motif svg { position: relative; width: 1.7rem; height: 1.7rem; }

.tutor-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--tc);
}
.tutor-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--tc-text);
}
.tutor-card__meta span { opacity: 0.78; }
.tutor-card__meta span + span::before {
  content: "·";
  margin-inline-end: 0.45rem;
  opacity: 0.6;
}
.tutor-card__tag {
  opacity: 1 !important;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  color: #fff;
  background: var(--tc-tile);
  font-weight: 600;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tutor-card__tag + span::before { content: none; }

.tutor-card__body {
  margin: 1rem 0 0;
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--tc-text);
}
.tutor-card__body p { margin: 0; }

.tutor-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.15rem;
  padding: 0.62rem 1.35rem;
  border-radius: 999px;
  text-decoration: none !important;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: #fff !important;
  background: var(--tc-tile);
  box-shadow:
    0 8px 18px -7px color-mix(in srgb, var(--tc-tile) 65%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.tutor-card__cta:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow:
    0 12px 24px -8px color-mix(in srgb, var(--tc-tile) 75%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.tutor-card__cta svg { width: 1.1rem; height: 1.1rem; transition: transform 0.2s ease; }
.tutor-card__cta:hover svg { transform: translateX(3px); }

/* Shami → Damascene mosaic, gold */
.tutor-card--shami {
  --tc: #9f6429;
  --tc-tile: #c6843a;
  --tc-text: #5a4a2e;
  --tc-pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Crect x='4' y='4' width='12' height='12'/%3E%3Crect x='4' y='4' width='12' height='12' transform='rotate(45 10 10)'/%3E%3C/g%3E%3C/svg%3E");
  background: linear-gradient(160deg, #fbf4e7 0%, #f4e8d2 100%);
}
.dark .tutor-card--shami {
  --tc: #e2ba6e;
  --tc-text: #cbb68d;
  background: linear-gradient(160deg, #241c12 0%, #2c2114 100%);
}

/* Tunisian → Sidi Bou Said, cobalt */
.tutor-card--tunisian {
  --tc: #155a9e;
  --tc-tile: #1b6ec2;
  --tc-text: #3a5f80;
  --tc-pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.3'%3E%3Ccircle cx='0' cy='0' r='12'/%3E%3Ccircle cx='24' cy='0' r='12'/%3E%3Ccircle cx='0' cy='24' r='12'/%3E%3Ccircle cx='24' cy='24' r='12'/%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/g%3E%3C/svg%3E");
  background: linear-gradient(160deg, #f4f9fd 0%, #e7f0fa 100%);
}
.dark .tutor-card--tunisian {
  --tc: #7ab6e8;
  --tc-text: #9fc3e4;
  background: linear-gradient(160deg, #0f1d2c 0%, #13243a 100%);
}

@media (prefers-reduced-motion: reduce) {
  .tutor-card__cta { transition: none; }
}

/* ================================
   Bilingual meta & series banner (English + Arabic)
   ================================= */

/* Arabic companion text — muted, secondary to the English.
   The span is dir="rtl", so its inline-START resolves to the RIGHT edge;
   the gap we want sits on the LEFT (between the English and this companion).
   Use margin-left so the space lands between them, not after the Arabic. */
.bi-ar {
  margin-left: 0.4em;
  font-size: 0.9em;
  font-weight: 400;
  opacity: 0.6;
}
.bi-en + .bi-ar { unicode-bidi: isolate; }

/* ---- series banner: clearly an expandable toggle ---- */
.series-details {
  --se-gold: var(--color-accent, #c6843a);
  --se-gold-deep: var(--color-accent-dark, #9f6429);
  --se-line: rgba(159, 100, 41, 0.25);
  --se-paper: #fbf4e7;
  --se-ink: #4a3a1f;
  margin: 1.3rem 0 1.7rem !important;
  padding: 0 !important;
  border: 1px solid var(--se-line);
  border-radius: 13px !important;
  background: var(--se-paper);
  box-shadow: 0 12px 30px -22px rgba(56, 38, 12, 0.45);
}
.dark .series-details {
  --se-line: rgba(235, 211, 170, 0.2);
  --se-paper: #241c12;
  --se-ink: #e7d6b4;
  --se-gold: #e0b667;
  --se-gold-deep: #e0b667;
}

.series-summary {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em 0.7em;
  margin: 0;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  font-family: var(--font-body); /* English → Latin body */
  color: var(--se-gold-deep);
  background: linear-gradient(90deg, rgba(198, 132, 58, 0.16), rgba(198, 132, 58, 0.06));
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.series-summary::-webkit-details-marker { display: none; }
.series-summary::marker { content: ""; }
.series-summary:hover {
  background: linear-gradient(90deg, rgba(198, 132, 58, 0.26), rgba(198, 132, 58, 0.12));
}
.series-details[open] .series-summary {
  border-bottom: 1px solid var(--se-line);
}

.series-summary__eyebrow {
  padding: 0.16rem 0.55rem;
  border: 1px solid var(--se-line);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  opacity: 0.85;
}
.series-summary__eyebrow .bi-ar { opacity: 0.8; }
.series-summary__name {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--se-ink);
}
.dark .series-summary__name { color: var(--se-ink); }
.series-summary__name-en {
  font-style: italic;
  font-weight: 600;
  opacity: 0.85;
}

.series-summary__toggle {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.34rem 0.55rem 0.34rem 0.85rem;
  border-radius: 999px;
  color: #fff8ec;
  background: radial-gradient(circle at 30% 25%, #e6b873, var(--se-gold) 55%, var(--color-accent-dark, #9f6429));
  box-shadow: 0 5px 13px -5px rgba(159, 100, 41, 0.6);
}
.series-summary__count { font-size: 0.84rem; font-weight: 800; letter-spacing: 0.02em; }
.series-summary__count .bi-ar { color: #fff8ec; opacity: 0.8; }
.series-chevron {
  width: 1.15rem;
  height: 1.15rem;
  transition: transform 0.28s ease;
}
.series-details[open] .series-chevron { transform: rotate(180deg); }
.series-summary:hover .series-summary__toggle { filter: saturate(1.08); }

/* revealed list */
.series-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.15rem;
  border-top: 1px dashed var(--se-line);
  font-family: var(--font-body); /* English → Latin body */
  font-size: 1rem;
  color: var(--se-ink);
}
.series-item__link {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}
.series-item a.series-item__link:hover { color: var(--se-gold-deep); }
.dark .series-item a.series-item__link:hover { color: var(--se-gold); }
.series-item--current {
  background: rgba(198, 132, 58, 0.07);
  font-style: italic;
}
.series-item__ext {
  margin-inline-start: 0.3em;
  font-size: 0.85em;
  color: var(--se-gold-deep);
  opacity: 0.8;
}
.dark .series-item__ext { color: var(--se-gold); }

/* per-post dialect markers in the dropdown */
.series-dialects {
  flex: none;
  display: inline-flex;
  gap: 0.3rem;
}
.series-dialect {
  --sd: var(--color-accent, #c6843a);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--sd);
  background: color-mix(in srgb, var(--sd) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--sd) 30%, transparent);
  white-space: nowrap;
}
.series-dialect::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--sd);
}
.series-dialect--tunisian { --sd: #1862a8; }
.series-dialect--shami { --sd: #a96f1c; }
.dark .series-dialect--tunisian { --sd: #7ab6e8; }
.dark .series-dialect--shami { --sd: #e2ba6e; }
@media (max-width: 520px) {
  .series-dialect { font-size: 0; padding: 0.3rem; gap: 0; }
  .series-dialect::before { width: 0.5rem; height: 0.5rem; }
}
.series-part {
  font-weight: 800;
  color: var(--se-gold-deep);
  margin-inline-end: 0.3em;
}
.dark .series-part { color: var(--se-gold); }
.series-part .bi-ar { font-weight: 400; }
.series-sep { opacity: 0.4; margin: 0 0.2em; }

/* ================================
   Cheat sheet — reference card grid
   (shortcodes: cheatsheet / cheat)
   ================================= */

.cheat-block {
  --cs-gold: var(--color-accent, #c6843a);
  --cs-gold-deep: var(--color-accent-dark, #9f6429);
  --cs-ink: #322713;
  --cs-ink-soft: #6a5836;
  --cs-line: rgba(159, 100, 41, 0.2);
  --cs-paper: rgba(251, 244, 231, 0.72);
  --cs-paper-2: rgba(241, 226, 201, 0.4);
  margin: 1.6rem 0 2rem;
}
.dark .cheat-block {
  --cs-gold-deep: #e0b667;
  --cs-ink: #f1e4cc;
  --cs-ink-soft: #cbb68d;
  --cs-line: rgba(235, 211, 170, 0.16);
  --cs-paper: rgba(46, 35, 22, 0.5);
  --cs-paper-2: rgba(34, 26, 16, 0.4);
}

.cheat-block__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cs-line);
}
.cheat-block__title {
  font-family: var(--font-display); /* English heading → Latin display */
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--cs-ink);
}
.cheat-block__title-ar {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--cs-gold-deep);
}

.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.8rem;
}

.cheat-card {
  position: relative;
  padding: 0.85rem 1rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--cs-line);
  background: linear-gradient(160deg, var(--cs-paper), var(--cs-paper-2));
  box-shadow: 0 8px 22px -18px rgba(56, 38, 12, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cheat-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--cs-gold) 50%, transparent);
  box-shadow: 0 14px 30px -18px rgba(56, 38, 12, 0.55);
}
.cheat-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.cheat-card__ar {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--cs-gold-deep);
}
.cheat-card__ipa {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--cs-gold-deep);
  opacity: 0.75;
  white-space: nowrap;
}
.cheat-card__en {
  margin: 0.35rem 0 0;
  font-family: var(--font-body); /* English → Latin body */
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--cs-ink);
}
.cheat-card__tag {
  margin-inline-start: 0.2em;
  padding: 0.06rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cs-gold-deep);
  background: color-mix(in srgb, var(--cs-gold) 14%, transparent);
  vertical-align: middle;
  white-space: nowrap;
}
.cheat-card__ex {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--cs-line);
}
.cheat-card__ex-ar {
  font-family: "Zain", system-ui, sans-serif;
  font-size: 1.12rem;
  line-height: 1.4;
  color: var(--cs-ink);
}
.cheat-card__ex-gloss {
  font-family: var(--font-body); /* English → Latin body */
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--cs-ink-soft);
}
.cheat-card__ex-ipa {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  opacity: 0.55;
  color: var(--cs-ink-soft);
}

/* quick-pick summary row */
.cheat-block--pick .cheat-card {
  border-inline-start: 4px solid var(--cs-gold);
}
.cheat-block--pick .cheat-card__ar { font-size: 1.7rem; }

/* dialect comparison cards */
.cheat-block--compare .cheat-grid {
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.compare-card {
  padding: 0.9rem 1rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--cs-line);
  background: linear-gradient(160deg, var(--cs-paper), var(--cs-paper-2));
  box-shadow: 0 8px 22px -18px rgba(56, 38, 12, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.compare-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(56, 38, 12, 0.55);
}
.compare-card__en {
  margin: 0 0 0.65rem;
  font-family: var(--font-body); /* English → Latin body */
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--cs-ink);
}
.compare-card__pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0.5rem;
}
.compare-card__side {
  --side: var(--cs-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--side) 30%, transparent);
  background: color-mix(in srgb, var(--side) 9%, transparent);
}
.compare-card__lang {
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--side);
  opacity: 0.9;
}
.compare-card__word {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.65rem;
  line-height: 1.15;
  color: var(--side);
  text-align: center;
}
.compare-card__side--tunisian {
  --side: #1862a8;
  --aud: #1b6ec2;
  --aud-deep: #155a9e;
  --aud-hi: #6fb0e6;
}
.compare-card__side--shami {
  --side: #a96f1c;
  --aud: #c6843a;
  --aud-deep: #9f6429;
  --aud-hi: #e6b873;
}
.dark .compare-card__side--tunisian { --side: #7ab6e8; }
.dark .compare-card__side--shami { --side: #e2ba6e; }
.compare-card__side .dd-aud-wrap { margin-top: 0.4rem; }
.compare-card__vs {
  align-self: center;
  font-size: 0.95rem;
  color: var(--cs-ink-soft);
  opacity: 0.6;
}
.compare-card__note {
  margin: 0.7rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--cs-line);
  font-family: var(--font-body); /* English → Latin body */
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--cs-ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .cheat-card,
  .compare-card { transition: none; }
}

/* cheat-card top row: word ··· (ipa + audio) */
.cheat-card__top { align-items: center; }
.cheat-card__top-r {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
}

/* ================================
   Sentence examples — compact study rows
   (shortcodes: examples / example)
   ================================= */

.example-block {
  --ex-gold: var(--color-accent, #c6843a);
  --ex-gold-deep: var(--color-accent-dark, #9f6429);
  --ex-gold-soft: var(--color-accent-light, #ebd3aa);
  --ex-ink: #322713;
  --ex-ink-soft: #6a5836;
  --ex-line: rgba(159, 100, 41, 0.18);
  --ex-paper: rgba(251, 244, 231, 0.6);
  --ex-paper-2: rgba(241, 226, 201, 0.28);
  margin: 1.45rem 0 1.9rem;
}
.dark .example-block {
  --ex-gold-deep: #e0b667;
  --ex-ink: #f1e4cc;
  --ex-ink-soft: #cbb68d;
  --ex-line: rgba(235, 211, 170, 0.16);
  --ex-paper: rgba(46, 35, 22, 0.44);
  --ex-paper-2: rgba(34, 26, 16, 0.34);
}

/* Tunisian variant */
.example-block--tunisian {
  --ex-gold: #1b6ec2;
  --ex-gold-deep: #155a9e;
  --ex-gold-soft: #e7f1f9;
  --ex-ink: #0f1d2c;
  --ex-ink-soft: #3a5f80;
  --ex-line: rgba(27, 110, 194, 0.16);
  --ex-paper: #f5f9fd;
  --ex-paper-2: #e6f0fa;
  --aud: #1b6ec2;
  --aud-deep: #155a9e;
  --aud-hi: #6fb0e6;
}
.dark .example-block--tunisian {
  --ex-gold-deep: #7ab6e8;
  --ex-ink: #9fc3e4;
  --ex-ink-soft: #7ab6e8;
  --ex-line: rgba(122, 182, 232, 0.16);
  --ex-paper: rgba(15, 29, 44, 0.44);
  --ex-paper-2: rgba(19, 36, 58, 0.34);
  --aud: #7ab6e8;
}

.example-block__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--ex-line);
}
.example-block__title {
  font-family: var(--font-display); /* English heading → Latin display */
  font-weight: 800;
  font-size: 1.16rem;
  color: var(--ex-ink);
}
.example-block__title-ar {
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.38rem;
  line-height: 1;
  color: var(--ex-gold-deep);
}

.example-list {
  display: grid;
  gap: 0.7rem;
}

.example-card {
  position: relative;
  padding: 0.85rem 1rem 0.9rem;
  border: 1px solid var(--ex-line);
  border-radius: 12px;
  background: linear-gradient(160deg, var(--ex-paper), var(--ex-paper-2));
  box-shadow: 0 8px 22px -19px rgba(56, 38, 12, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.example-card::before {
  content: "";
  position: absolute;
  inset-block: 0.75rem;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ex-gold), color-mix(in srgb, var(--ex-gold) 35%, transparent));
  opacity: 0.75;
}
.example-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ex-gold) 45%, transparent);
  box-shadow: 0 14px 30px -20px rgba(56, 38, 12, 0.5);
}

.example-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}
.example-card__ar {
  margin: 0;
  font-family: "Zain", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.22rem, 2.4vw, 1.48rem);
  line-height: 1.45;
  color: var(--ex-ink);
  text-align: start;
}
.example-card__top .dd-aud-wrap {
  flex: none;
  margin-top: 0.08rem;
}
.example-card__en {
  margin: 0.28rem 0 0;
  font-family: var(--font-body); /* English → Latin body */
  font-size: 1.03rem;
  line-height: 1.4;
  color: var(--ex-ink-soft);
}
.example-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-top: 0.48rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--ex-line);
  font-family: var(--font-body); /* English → Latin body */
  color: var(--ex-ink-soft);
}
.example-card__tag {
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ex-gold-deep);
  background: color-mix(in srgb, var(--ex-gold) 14%, transparent);
}
.example-card__ipa {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--ex-gold-deep);
  opacity: 0.78;
}
.example-card__note {
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .example-card {
    padding: 0.8rem 0.85rem 0.85rem;
  }
  .example-card__top {
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .example-card { transition: none; }
}

/* ================================
   Recall block — mnemonic + flashcard
   (shortcode: recall)
   ================================= */

.recall-block {
  --rc-gold: var(--color-accent, #c6843a);
  --rc-gold-deep: var(--color-accent-dark, #9f6429);
  --rc-gold-soft: var(--color-accent-light, #ebd3aa);
  --rc-ink: #322713;
  --rc-ink-soft: #6a5836;
  --rc-line: rgba(159, 100, 41, 0.2);
  --rc-paper: rgba(251, 244, 231, 0.66);
  --rc-paper-2: rgba(241, 226, 201, 0.36);
  margin: 1.45rem 0 2rem;
  font-family: var(--font-body); /* English → Latin body */
}
.dark .recall-block {
  --rc-gold-deep: #e0b667;
  --rc-ink: #f1e4cc;
  --rc-ink-soft: #cbb68d;
  --rc-line: rgba(235, 211, 170, 0.16);
  --rc-paper: rgba(46, 35, 22, 0.48);
  --rc-paper-2: rgba(34, 26, 16, 0.36);
}

.recall-block__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rc-line);
}
.recall-block__title {
  font-weight: 800;
  font-size: 1.16rem;
  color: var(--rc-ink);
}
.recall-block__title-ar {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.38rem;
  line-height: 1;
  color: var(--rc-gold-deep);
}

.recall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.8rem;
}
.recall-card {
  position: relative;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--rc-line);
  border-radius: 12px;
  background: linear-gradient(160deg, var(--rc-paper), var(--rc-paper-2));
  box-shadow: 0 8px 22px -19px rgba(56, 38, 12, 0.42);
}
.recall-card__label {
  display: inline-flex;
  margin-bottom: 0.45rem;
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rc-gold-deep);
  background: color-mix(in srgb, var(--rc-gold) 14%, transparent);
}
.recall-card__line {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.25rem, 2.8vw, 1.65rem);
  line-height: 1.18;
  color: var(--rc-ink);
}
.recall-card__line strong,
.recall-flash__cue strong {
  color: var(--rc-gold-deep);
}
.recall-card__note {
  margin: 0.45rem 0 0;
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--rc-ink-soft);
}

.recall-flash {
  display: grid;
  gap: 0.65rem;
}
.recall-flash__front,
.recall-flash__back {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 4.2rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px dashed var(--rc-line);
}
.recall-flash__front {
  background: color-mix(in srgb, var(--rc-gold) 9%, transparent);
}
.recall-flash__back {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.recall-flash__ar {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 2.15rem;
  line-height: 1;
  color: var(--rc-gold-deep);
}
.recall-flash__translit {
  margin-inline-start: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  color: var(--rc-ink-soft);
}
.recall-flash__answer {
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--rc-ink);
}
.recall-flash__cue {
  font-size: 0.98rem;
  line-height: 1.35;
  color: var(--rc-ink-soft);
}
.recall-flash__cue p {
  margin: 0;
}
.recall-flash-image {
  margin: 0;
}
.recall-flash-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--rc-line);
  box-shadow: 0 10px 24px -18px rgba(56, 38, 12, 0.55);
}
.recall-flash-image figcaption {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  margin-top: 0.65rem;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--rc-ink);
}
.recall-flash-image__word {
  font-family: "Lalezar", system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--rc-gold-deep);
}

@media (max-width: 520px) {
  .recall-flash__front {
    align-items: flex-start;
    flex-direction: column;
  }
  .recall-flash__translit {
    margin-inline-start: 0;
  }
}

/* ================================
   Pronunciation control — compact gold "coin"
   (partial: audio-pron.html; class: .dd-aud)
   ================================= */

.dd-aud-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  line-height: 0;
}
.dd-aud {
  /* themeable: ancestors can set --aud / --aud-deep / --aud-hi (e.g. dialect sides) */
  position: relative;
  flex: none;
  width: 1.95rem;
  height: 1.95rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  color: #fff8ec;
  background: radial-gradient(circle at 32% 28%,
    var(--aud-hi, #e6b873),
    var(--aud, var(--color-accent, #c6843a)) 55%,
    var(--aud-deep, var(--color-accent-dark, #9f6429)));
  box-shadow:
    0 3px 8px -2px color-mix(in srgb, var(--aud, #c6843a) 55%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.dd-aud__text {
  font-family: var(--font-body); /* English → Latin body */
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--aud-deep, var(--color-accent-dark, #9f6429));
}
.dark .dd-aud__text { color: var(--aud, var(--color-accent-light, #ebd3aa)); }
/* in the word-block phon row, push the control to the trailing edge */
.dd-word__phon .dd-aud-wrap { margin-inline-start: auto; }

/* inline pronunciation (audio shortcode): coin + caption */
.dd-aud-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.dd-aud-cap {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--color-accent-dark, #9f6429);
}
.dark .dd-aud-cap { color: var(--color-accent-light, #ebd3aa); }
.dd-aud:hover {
  transform: translateY(-1px) scale(1.06);
  filter: saturate(1.06);
  box-shadow:
    0 5px 12px -3px rgba(159, 100, 41, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.dd-aud:active { transform: scale(0.96); }
.dd-aud:focus-visible {
  outline: 2px solid var(--aud-deep, var(--color-accent-dark, #9f6429));
  outline-offset: 2px;
}
.dd-aud svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
}
.dd-aud__play { margin-inline-start: 1px; }
.dd-aud__pause { display: none; }
.dd-aud.is-playing .dd-aud__play { display: none; }
.dd-aud.is-playing .dd-aud__pause { display: block; }

/* radiating rings while playing */
.dd-aud::before,
.dd-aud::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--aud, var(--color-accent, #c6843a));
  opacity: 0;
  pointer-events: none;
}
.dd-aud.is-playing::before { animation: ddAudRing 1.7s ease-out infinite; }
.dd-aud.is-playing::after { animation: ddAudRing 1.7s ease-out 0.55s infinite; }
@keyframes ddAudRing {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.25); }
}

@media (prefers-reduced-motion: reduce) {
  .dd-aud { transition: none; }
  .dd-aud.is-playing::before,
  .dd-aud.is-playing::after { animation: none; }
}

/* ================================
   Ear-training badge
   ================================ */

.et-badge {
  --etc: #1a6b4a;
  --et-tile: #1a6b4a;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.28rem 0.85rem 0.28rem 0.28rem;
  border-radius: 999px;
  font-family: var(--font-body); /* English → Latin body */
  line-height: 1;
  color: var(--etc);
  background: color-mix(in srgb, var(--etc) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--etc) 32%, transparent);
  text-decoration: none !important;
}
.dark .et-badge { --etc: #4ecb96; }

.et-badge__motif {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
  color: #fff;
  background: var(--et-tile);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 2px 6px -2px rgba(0, 0, 0, 0.45);
}
.et-badge__motif svg {
  width: 1.05rem;
  height: 1.05rem;
}

.et-badge b {
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.2em;
}
.et-badge i {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  opacity: 0.82;
}

/* compact variant for list cards */
.et-badge--sm {
  gap: 0.45em;
  padding: 0.2rem 0.6rem 0.2rem 0.2rem;
}
.et-badge--sm .et-badge__motif {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
}
.et-badge--sm .et-badge__motif svg { width: 0.85rem; height: 0.85rem; }
.et-badge--sm .et-badge b { font-size: 1.05em; }
.et-badge--sm .et-badge i { font-size: 0.64rem; letter-spacing: 0.08em; }


@media (prefers-reduced-motion: reduce) {
  .et-badge { transition: none; }
}

/* ================================
   Difficulty badge — easy / intermediate / advanced
   Rising-bars meter fills 1 / 2 / 3 bars per level.
   ================================ */

.difficulty-badge {
  --dl: var(--color-accent, #c6843a);
  --dl-tile: var(--color-accent, #c6843a);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.28rem 0.85rem 0.28rem 0.28rem;
  border-radius: 999px;
  font-family: var(--font-body); /* English → Latin body */
  line-height: 1;
  color: var(--dl);
  background: color-mix(in srgb, var(--dl) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--dl) 32%, transparent);
  text-decoration: none !important;
}

.difficulty-badge__motif {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
  color: #fff;
  background: var(--dl-tile);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 2px 6px -2px rgba(0, 0, 0, 0.45);
}
.difficulty-badge__motif svg {
  width: 1.05rem;
  height: 1.05rem;
}
/* bars default to dimmed; per-level rules light up the active ones */
.difficulty-badge__motif .bar { fill: rgba(255, 255, 255, 0.32); }
.difficulty-badge--easy .bar.b1,
.difficulty-badge--intermediate .bar.b1,
.difficulty-badge--intermediate .bar.b2,
.difficulty-badge--advanced .bar.b1,
.difficulty-badge--advanced .bar.b2,
.difficulty-badge--advanced .bar.b3 { fill: #fff; }

.difficulty-badge b {
  font-family: "Lalezar", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.2em;
}
.difficulty-badge i {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  opacity: 0.82;
}

/* Level color ramp — tuned to the site's fire palette */
.difficulty-badge--easy         { --dl: #2f8f57; --dl-tile: #34995d; }
.dark .difficulty-badge--easy   { --dl: #57c98a; }
.difficulty-badge--intermediate { --dl: #b9821b; --dl-tile: #d49524; }
.dark .difficulty-badge--intermediate { --dl: #ecc063; }
.difficulty-badge--advanced     { --dl: #b34326; --dl-tile: #cc4d2c; }
.dark .difficulty-badge--advanced     { --dl: #f08a64; }

/* compact variant for list cards */
.difficulty-badge--sm {
  gap: 0.45em;
  padding: 0.2rem 0.6rem 0.2rem 0.2rem;
}
.difficulty-badge--sm .difficulty-badge__motif {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
}
.difficulty-badge--sm .difficulty-badge__motif svg { width: 0.85rem; height: 0.85rem; }
.difficulty-badge--sm b { font-size: 1.05em; }
.difficulty-badge--sm i { font-size: 0.64rem; letter-spacing: 0.08em; }

/* ================================
   Image display: 16:9 enforcement
   ================================ */

/* Single-post hero (heroStyle: big): let 16:9 images breathe at natural ratio */
.single_hero_round {
  aspect-ratio: 16 / 9;
  max-height: none;
  object-fit: cover;
  width: 100%;
  height: auto;
}
