/* ─────────────────────────────────────────────────────────────────
   IELTS Writing — Phrasebook styles.

   Mirrors the visual shape of sp-phrase-toolkit.css (the Speaking
   parallel) without sharing class names: prefix `wr-pb-` so the two
   tools can evolve independently. Cream-theme tokens come from the
   IELTS v2 shell — body.has-ielts-nav sets --ielts-* on the body.
   ───────────────────────────────────────────────────────────── */

/* ── Page surface ───────────────────────────────────────────────── */
.wr-pb-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) clamp(20px, 5vw, 64px) clamp(40px, 6vh, 72px);
  color: var(--ielts-ink, #2A1F12);
  font-family: 'Source Serif 4', Georgia, serif;
}

/* ── Hero — landing only ────────────────────────────────────────── */
.wr-pb-hero {
  margin-bottom: clamp(28px, 5vh, 48px);
  padding-bottom: clamp(18px, 3vh, 28px);
  border-bottom: 1px dashed rgba(74, 58, 38, 0.18);
}
.wr-pb-hero-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ielts-honey, #B57A2E);
  margin-bottom: 10px;
}
.wr-pb-hero-title {
  font-family: 'Fraunces', 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.05;
  color: var(--ielts-ink, #2A1F12);
  margin: 0 0 14px;
}
.wr-pb-hero-lede {
  margin: 0;
  font-size: clamp(15.5px, 1.15vw, 17px);
  line-height: 1.55;
  color: var(--ielts-ink-soft, #5C4A35);
  max-width: 62ch;
}

/* ── Category card grid ─────────────────────────────────────────── */
.wr-pb-cat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: clamp(32px, 5vh, 48px);
}
@media (min-width: 720px) {
  .wr-pb-cat-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

.wr-pb-cat-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: var(--ielts-card-lift, #FFFCF4);
  border: 1px solid var(--ielts-line, rgba(74, 58, 38, .10));
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 220ms ease;
  box-shadow: 0 1px 0 rgba(255, 250, 235, 0.55) inset,
              0 4px 12px -6px rgba(74, 58, 38, .12);
}
.wr-pb-cat-card::before {
  content: '';
  position: absolute;
  top: 14px; bottom: 14px; left: 0;
  width: 3px;
  background: var(--cat-accent, #B57A2E);
  border-radius: 3px;
}
.wr-pb-cat-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cat-accent, #B57A2E) 35%, transparent);
  box-shadow: 0 1px 0 rgba(255, 250, 235, 0.7) inset,
              0 14px 24px -12px rgba(74, 58, 38, .18);
}
.wr-pb-cat-icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--cat-accent, #B57A2E) 12%, transparent);
  color: var(--cat-accent, #B57A2E);
}
.wr-pb-cat-body { min-width: 0; }
.wr-pb-cat-name {
  font-family: 'Fraunces', 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.005em;
  color: var(--ielts-ink, #2A1F12);
  margin-bottom: 4px;
}
.wr-pb-cat-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ielts-ink-soft, #5C4A35);
}
.wr-pb-cat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.wr-pb-cat-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ielts-ink-mute, #8C7757);
  white-space: nowrap;
}
.wr-pb-cat-chev {
  color: color-mix(in srgb, var(--cat-accent, #B57A2E) 70%, transparent);
  transition: transform 180ms ease;
}
.wr-pb-cat-card:hover .wr-pb-cat-chev {
  transform: translateX(2px);
  color: var(--cat-accent, #B57A2E);
}

/* ── Personalised section ───────────────────────────────────────── */
.wr-pb-personalised {
  position: relative;
  margin-bottom: clamp(28px, 4vh, 40px);
  padding: clamp(20px, 3vh, 28px) clamp(20px, 3vw, 28px);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--ielts-honey, #B57A2E) 8%, var(--ielts-card-lift, #FFFCF4)) 0%,
    var(--ielts-card-lift, #FFFCF4) 100%);
  border: 1px solid color-mix(in srgb, var(--ielts-honey, #B57A2E) 25%, transparent);
  border-radius: 14px;
}
.wr-pb-pers-head {
  margin-bottom: 16px;
}
.wr-pb-pers-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ielts-honey, #B57A2E);
  margin-bottom: 8px;
}
.wr-pb-pers-title {
  font-family: 'Fraunces', 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.008em;
  color: var(--ielts-ink, #2A1F12);
  margin: 0 0 6px;
  line-height: 1.1;
}
.wr-pb-pers-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ielts-ink-soft, #5C4A35);
}
.wr-pb-pers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .wr-pb-pers-grid { grid-template-columns: 1fr 1fr; }
}
.wr-pb-pers-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--ielts-card-lift, #FFFCF4);
  border: 1px solid var(--ielts-line, rgba(74, 58, 38, .10));
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 200ms ease;
}
.wr-pb-pers-item::before {
  content: '';
  position: absolute;
  top: 12px; bottom: 12px; left: 0;
  width: 3px;
  background: var(--cat-accent, var(--ielts-honey, #B57A2E));
  border-radius: 3px;
}
.wr-pb-pers-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cat-accent, #B57A2E) 38%, transparent);
  box-shadow: 0 8px 18px -10px rgba(74, 58, 38, 0.22);
}
.wr-pb-pers-item-body { min-width: 0; padding-left: 8px; }
.wr-pb-pers-item-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ielts-ink, #2A1F12);
  line-height: 1.4;
  margin-bottom: 4px;
}
.wr-pb-pers-item-example {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ielts-ink-soft, #5C4A35);
  margin-bottom: 6px;
}
.wr-pb-pers-item-from {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cat-accent, var(--ielts-honey, #B57A2E));
}
.wr-pb-pers-item-chev {
  color: color-mix(in srgb, var(--cat-accent, #B57A2E) 70%, transparent);
  transition: transform 180ms ease;
}
.wr-pb-pers-item:hover .wr-pb-pers-item-chev {
  color: var(--cat-accent, #B57A2E);
  transform: translateX(2px);
}

/* ── Honest-use note ────────────────────────────────────────────── */
.wr-pb-honest-note {
  padding: 14px 18px;
  border-left: 3px solid var(--ielts-honey, #B57A2E);
  background: color-mix(in srgb, var(--ielts-honey, #B57A2E) 8%, transparent);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ielts-ink-soft, #5C4A35);
}
.wr-pb-honest-note strong {
  color: var(--ielts-ink, #2A1F12);
}

/* ── Crumb bar / back link ──────────────────────────────────────── */
.wr-pb-crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(20px, 3vh, 30px);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}
.wr-pb-back, .wr-pb-crumb-link, .wr-pb-dive-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ielts-ink-soft, #5C4A35);
  font-weight: 500;
  transition: color 180ms ease;
}
.wr-pb-back:hover, .wr-pb-crumb-link:hover, .wr-pb-dive-back:hover {
  color: var(--cat-accent, var(--ielts-honey, #B57A2E));
}
.wr-pb-crumb-sep {
  color: var(--ielts-ink-mute, #8C7757);
  opacity: 0.6;
}

/* ── Category page header ───────────────────────────────────────── */
.wr-pb-cat-head {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: clamp(28px, 4vh, 40px);
  padding-bottom: clamp(18px, 3vh, 28px);
  border-bottom: 1px dashed rgba(74, 58, 38, 0.18);
}
.wr-pb-cat-head-icon {
  width: 50px; height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cat-accent, #B57A2E) 14%, transparent);
  color: var(--cat-accent, #B57A2E);
}
.wr-pb-cat-head-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ielts-ink-mute, #8C7757);
  margin-bottom: 6px;
}
.wr-pb-cat-head-title {
  font-family: 'Fraunces', 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.05;
  color: var(--ielts-ink, #2A1F12);
  margin: 0 0 6px;
}
.wr-pb-cat-head-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ielts-ink-soft, #5C4A35);
  max-width: 70ch;
}

/* ── Sub-section ────────────────────────────────────────────────── */
.wr-pb-sub {
  margin: clamp(22px, 3vh, 30px) 0 0;
  scroll-margin-top: 24px;
  transition: background 700ms ease, box-shadow 700ms ease;
  border-radius: 10px;
}
/* Brief highlight pulse when the user arrives via a sub-section
   deep-link from the Writing Dashboard, so it's obvious which
   sub-section we just scrolled to. */
.wr-pb-sub--target {
  background: color-mix(in srgb, var(--cat-accent, #B57A2E) 8%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--cat-accent, #B57A2E) 6%, transparent);
}
.wr-pb-sub-title {
  font-family: 'Fraunces', 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  color: var(--ielts-ink, #2A1F12);
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--cat-accent, #B57A2E) 22%, transparent);
}
.wr-pb-sub-empty {
  padding: 18px 20px;
  background: rgba(74, 58, 38, 0.04);
  border: 1px dashed rgba(74, 58, 38, 0.12);
  border-radius: 10px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ielts-ink-mute, #8C7757);
}

/* ── Phrase tile ────────────────────────────────────────────────── */
.wr-pb-phrase-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.wr-pb-phrase {
  position: relative;
  padding: 12px 14px;
  background: var(--ielts-card-lift, #FFFCF4);
  border: 1px solid var(--ielts-line, rgba(74, 58, 38, .10));
  border-radius: 10px;
}
.wr-pb-phrase-link {
  padding: 0;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 200ms ease;
}
.wr-pb-phrase-link:hover {
  border-color: color-mix(in srgb, var(--cat-accent, #B57A2E) 40%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(74, 58, 38, 0.22);
}
.wr-pb-phrase-link > a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
.wr-pb-phrase-body { min-width: 0; }
.wr-pb-phrase-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ielts-ink, #2A1F12);
  line-height: 1.4;
  margin-bottom: 4px;
}
.wr-pb-phrase-example {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ielts-ink-soft, #5C4A35);
}
.wr-pb-phrase-chev {
  color: var(--ielts-ink-mute, #8C7757);
  transition: transform 180ms ease, color 180ms ease;
}
.wr-pb-phrase-link:hover .wr-pb-phrase-chev {
  color: var(--cat-accent, #B57A2E);
  transform: translateX(2px);
}

/* ── Deep-dive page ─────────────────────────────────────────────── */
.wr-pb-dive-head {
  margin-bottom: clamp(24px, 3.5vh, 36px);
  padding-bottom: clamp(18px, 3vh, 24px);
  border-bottom: 1px dashed rgba(74, 58, 38, 0.18);
}
.wr-pb-dive-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cat-accent, var(--ielts-honey, #B57A2E));
  margin-bottom: 8px;
}
.wr-pb-dive-title {
  font-family: 'Fraunces', 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.05;
  color: var(--ielts-ink, #2A1F12);
  margin: 0 0 12px;
}
.wr-pb-dive-purpose {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ielts-ink-soft, #5C4A35);
}
.wr-pb-dive-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ielts-ink-mute, #8C7757);
  margin-right: 8px;
}

.wr-pb-dive-section {
  margin-bottom: clamp(20px, 3vh, 28px);
  padding: 18px 20px;
  background: var(--ielts-card-lift, #FFFCF4);
  border: 1px solid var(--ielts-line, rgba(74, 58, 38, .10));
  border-radius: 12px;
}
.wr-pb-dive-section-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ielts-ink-mute, #8C7757);
  margin-bottom: 12px;
}
.wr-pb-dive-real {
  background: color-mix(in srgb, var(--cat-accent, #B57A2E) 6%, var(--ielts-card-lift, #FFFCF4));
  border-color: color-mix(in srgb, var(--cat-accent, #B57A2E) 25%, transparent);
}
.wr-pb-dive-quote {
  margin: 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ielts-ink, #2A1F12);
  padding-left: 16px;
  border-left: 3px solid color-mix(in srgb, var(--cat-accent, #B57A2E) 45%, transparent);
}
.wr-pb-dive-uses {
  margin: 0;
  padding-left: 18px;
}
.wr-pb-dive-uses li {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ielts-ink, #2A1F12);
  margin-bottom: 6px;
}
.wr-pb-dive-uses li:last-child { margin-bottom: 0; }
.wr-pb-dive-why-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ielts-ink-soft, #5C4A35);
}
.wr-pb-dive-why.is-caution {
  background: rgba(204, 110, 70, 0.06);
  border-color: rgba(204, 110, 70, 0.22);
}
.wr-pb-dive-why.is-caution .wr-pb-dive-section-eyebrow {
  color: #B6442C;
}
.wr-pb-dive-foot {
  margin-top: clamp(20px, 3vh, 28px);
}

/* ── Mobile tweaks ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  .wr-pb-cat-card { grid-template-columns: 44px 1fr; }
  .wr-pb-cat-meta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .wr-pb-cat-head { grid-template-columns: 1fr; }
  .wr-pb-phrase-link > a { grid-template-columns: 1fr; }
}
