/*
 * Spell-Caster — Irish translator widget styles.
 *
 * All rules are namespaced under .rosmerta-spell-caster so the plugin
 * coexists cleanly with the host theme (Astra). The widget uses the
 * Rosmerta cream/gold/emerald palette already established by the
 * Word-of-the-Day plugin.
 *
 * Mobile-first: base font sizes assume narrow screens; a single
 * @media (min-width: 600px) breakpoint upsizes for tablets and desktop.
 */

.rosmerta-spell-caster {
  --sc-cream:      #fbf7eb;
  --sc-cream-2:    #f4ecd6;
  --sc-gold:       #c4a86a;
  --sc-gold-deep:  #8a6d3a;
  --sc-emerald:    #2d5016;
  --sc-ink:        #4a3a1f;

  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  color: #222;
  max-width: 760px;
  margin: 0 auto;
}
.rosmerta-spell-caster *,
.rosmerta-spell-caster *::before,
.rosmerta-spell-caster *::after { box-sizing: border-box; }

/* Input */
.rosmerta-spell-caster .rosmerta-sc-input-row { display: flex; gap: 0.5rem; }
.rosmerta-spell-caster .rosmerta-sc-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--sc-gold);
  border-radius: 4px;
  resize: vertical;
  min-height: 70px;
  background: var(--sc-cream);
  color: #222;
}
.rosmerta-spell-caster .rosmerta-sc-char-count {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.2rem;
  font-family: "Courier New", monospace;
  letter-spacing: 0.05em;
}
.rosmerta-spell-caster .rosmerta-sc-char-count.near-limit { color: #b67272; }
.rosmerta-spell-caster .rosmerta-sc-char-count.over-limit { color: #c44; font-weight: 600; }

.rosmerta-spell-caster .rosmerta-sc-button-row { margin-top: 0.6rem; }
.rosmerta-spell-caster .rosmerta-sc-go {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  background: var(--sc-emerald);
  color: var(--sc-cream);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms;
}
.rosmerta-spell-caster .rosmerta-sc-go:hover { background: #1f3a0e; }
.rosmerta-spell-caster .rosmerta-sc-go:focus-visible {
  outline: 2px solid var(--sc-gold);
  outline-offset: 2px;
}

/* Output */
.rosmerta-spell-caster .rosmerta-sc-output { margin-top: 1.5rem; min-height: 4rem; }

.rosmerta-spell-caster .rosmerta-irish-output {
  font-size: 1.15rem;
  line-height: 1.4;
  padding: 1rem 1rem;
  background: var(--sc-cream);
  border-left: 4px solid var(--sc-gold);
  border-radius: 4px;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.rosmerta-spell-caster .rosmerta-token-block {
  display: inline-block;
  text-align: center;
  margin: 0.2em 0.3em 0.2em 0;
  line-height: 1.15;
  vertical-align: top;
  min-width: 3.5em;
}
.rosmerta-spell-caster .rosmerta-token-english {
  display: inline-block;
  font-size: 0.55em;
  font-style: italic;
  font-weight: 400;
  color: #888;
  letter-spacing: 0.02em;
  margin-top: 0.2em;
}
.rosmerta-spell-caster .rosmerta-token {
  padding: 0 0.05em;
  cursor: help;
  font-style: italic;
  font-weight: 600;
}
.rosmerta-spell-caster .rosmerta-token-pron {
  display: inline-block;
  font-size: 0.65em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.04em;
  opacity: 0.85;
  font-family: "Courier New", monospace;
}
.rosmerta-spell-caster .rosmerta-token-leader {
  display: inline-block;
  height: 2px;
  width: 80%;
  margin: 0.35em auto 0.25em;
  border-radius: 2px;
  opacity: 0.85;
}
.rosmerta-spell-caster .rosmerta-token-role {
  display: inline-block;
  font-size: 0.55em;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.9;
}
.rosmerta-spell-caster .rosmerta-token-sources {
  display: inline-block;
  margin-top: 0.25em;
  line-height: 1.4;
}
.rosmerta-spell-caster .rosmerta-token-sources .rosmerta-source-chip {
  font-size: 0.55em;
  padding: 0.05em 0.4em;
  margin: 0 0.1em;
  letter-spacing: 0.04em;
}

/* "How to say it" sentence-level pronunciation chain */
.rosmerta-spell-caster .rosmerta-say-it {
  margin-top: 0.8rem;
  padding: 0.6rem 0.9rem;
  background: var(--sc-cream-2);
  border-left: 3px solid var(--sc-gold);
  border-radius: 4px;
  font-size: 0.92rem;
  color: var(--sc-ink);
  word-break: break-word;
}
.rosmerta-spell-caster .rosmerta-say-it-label {
  font-style: italic;
  color: var(--sc-gold-deep);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  margin-right: 0.5em;
  display: inline-block;
}
.rosmerta-spell-caster .rosmerta-say-it-text {
  font-family: "Courier New", monospace;
  letter-spacing: 0.03em;
}

/* "How Spell-Caster did this" rules panel */
.rosmerta-spell-caster .rosmerta-rules-applied {
  background: var(--sc-cream-2);
  padding: 1rem 1.1rem;
  border-radius: 4px;
  border-left: 3px solid var(--sc-gold-deep);
  font-size: 0.92rem;
  margin-top: 0.6rem;
}
.rosmerta-spell-caster .rosmerta-rules-applied h4 {
  margin: 0 0 0.5rem;
  font-style: italic;
  color: var(--sc-gold-deep);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
}
.rosmerta-spell-caster .rosmerta-rule { margin-bottom: 0.5rem; }
.rosmerta-spell-caster .rosmerta-rule:last-child { margin-bottom: 0; }
.rosmerta-spell-caster .rosmerta-rule a { color: var(--sc-emerald); }

/* Errors */
.rosmerta-spell-caster .rosmerta-unknown-words,
.rosmerta-spell-caster .rosmerta-unsupported {
  background: #f9efef;
  padding: 0.9rem 1rem;
  border-radius: 4px;
  border-left: 3px solid #c47272;
  font-size: 0.95rem;
}
.rosmerta-spell-caster .rosmerta-help { font-size: 0.92rem; color: #666; }
.rosmerta-spell-caster .rosmerta-examples li { font-style: italic; }

/* Legend */
.rosmerta-spell-caster .rosmerta-sc-legend,
.rosmerta-spell-caster .rosmerta-legend {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin: 1.2rem 0 0.6rem;
  font-size: 0.82rem;
}
.rosmerta-spell-caster .rosmerta-legend-item {
  padding: 0.15em 0.6em;
  border-radius: 999px;
  border: 1px solid;
  background: var(--sc-cream);
}

/* Try-these example buttons */
.rosmerta-spell-caster .rosmerta-sc-examples { margin-top: 1.2rem; }
.rosmerta-spell-caster .rosmerta-sc-examples h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sc-gold-deep);
  font-weight: 500;
  margin: 0 0 0.5rem;
}
.rosmerta-spell-caster .rosmerta-sc-examples a {
  display: inline-block;
  padding: 0.3em 0.8em;
  margin: 0.2em 0.3em 0.2em 0;
  border: 1px solid var(--sc-gold);
  border-radius: 999px;
  text-decoration: none;
  color: var(--sc-ink);
  font-size: 0.92rem;
  background: var(--sc-cream);
  cursor: pointer;
}
.rosmerta-spell-caster .rosmerta-sc-examples a:hover,
.rosmerta-spell-caster .rosmerta-sc-examples a:focus {
  background: var(--sc-gold);
  color: var(--sc-cream);
  outline: none;
}

/* ===========================================================================
 * Grimoire bidirectional search widget — [grimoire_search]
 * =========================================================================== */

.rosmerta-grimoire-search {
  --sc-cream:      #fbf7eb;
  --sc-cream-2:    #f4ecd6;
  --sc-gold:       #c4a86a;
  --sc-gold-deep:  #8a6d3a;
  --sc-emerald:    #2d5016;
  --sc-ink:        #4a3a1f;

  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  color: #222;
  max-width: 760px;
  margin: 0 auto 1.5rem;
}
.rosmerta-grimoire-search *,
.rosmerta-grimoire-search *::before,
.rosmerta-grimoire-search *::after { box-sizing: border-box; }

.rosmerta-grimoire-search .rosmerta-gs-intro {
  font-size: 0.95rem;
  color: #555;
  margin: 0 0 0.6rem;
}

.rosmerta-grimoire-search .rosmerta-gs-input-row {
  display: flex;
  gap: 0.5rem;
}
.rosmerta-grimoire-search .rosmerta-gs-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--sc-gold);
  border-radius: 4px;
  background: var(--sc-cream);
  color: #222;
}
.rosmerta-grimoire-search .rosmerta-gs-input:focus {
  outline: 2px solid var(--sc-gold);
  outline-offset: 1px;
  border-color: var(--sc-gold-deep);
}

.rosmerta-grimoire-search .rosmerta-gs-count {
  font-size: 0.78rem;
  color: var(--sc-gold-deep);
  text-align: right;
  font-style: italic;
  letter-spacing: 0.05em;
  margin: 0.2rem 0 0.6rem;
  min-height: 1.1em;
}

.rosmerta-grimoire-search .rosmerta-gs-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rosmerta-grimoire-search .rosmerta-gs-state {
  font-style: italic;
  color: #666;
  padding: 0.6rem 0.9rem;
  background: var(--sc-cream);
  border-left: 3px solid var(--sc-gold);
  border-radius: 4px;
}
.rosmerta-grimoire-search .rosmerta-gs-error {
  font-style: italic;
  color: #b53d3d;
  padding: 0.6rem 0.9rem;
  background: #f9efef;
  border-left: 3px solid #c47272;
  border-radius: 4px;
}

.rosmerta-grimoire-search .rosmerta-gs-result {
  background: var(--sc-cream);
  border-left: 3px solid var(--sc-gold);
  border-radius: 4px;
  padding: 0.7rem 1rem;
}
.rosmerta-grimoire-search .rosmerta-gs-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.rosmerta-grimoire-search .rosmerta-gs-irish {
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 700;
  color: var(--sc-gold-deep);
}
.rosmerta-grimoire-search .rosmerta-gs-pron {
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: #666;
  letter-spacing: 0.04em;
}
.rosmerta-grimoire-search .rosmerta-gs-arrow {
  color: #999;
  margin: 0 0.1em;
}
.rosmerta-grimoire-search .rosmerta-gs-english {
  font-size: 1rem;
  color: #333;
  font-style: italic;
}
.rosmerta-grimoire-search .rosmerta-gs-meta {
  font-size: 0.82rem;
  font-style: italic;
  color: #777;
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}
.rosmerta-grimoire-search .rosmerta-gs-note {
  font-size: 0.92rem;
  color: #444;
  margin-top: 0.4rem;
}
.rosmerta-grimoire-search .rosmerta-gs-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.rosmerta-grimoire-search .rosmerta-gs-links a {
  color: var(--sc-emerald);
  text-decoration: none;
  border-bottom: 1px dotted var(--sc-emerald);
}
.rosmerta-grimoire-search .rosmerta-gs-links a:hover {
  border-bottom-style: solid;
}

/* ===========================================================================
 * Vocabulary list tables — consistent column widths, wrapping in the Notes
 * column. Without table-layout:fixed, browsers size columns by content width
 * which means a long note on row 5 widens the table and pushes the headers
 * out of alignment. Fixed layout + percentage widths keeps every row's
 * columns aligned with the headers, and word-wrap forces long notes to
 * break onto multiple lines instead of stretching the table.
 * =========================================================================== */

.rosmerta-vocab-table table {
  table-layout: fixed;
  width: 100%;
}
.rosmerta-vocab-table th,
.rosmerta-vocab-table td {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  text-align: left !important;
}
.rosmerta-vocab-table thead th {
  font-weight: 700;
  text-align: left !important;
}

/* 5-column tables (Irish | Pron | English | Source | Note) — letter pages,
   theme sub-pages, browse-by-tag pages */
.rosmerta-vocab-table[data-cols="5"] thead th:nth-child(1),
.rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(1) { width: 14%; }
.rosmerta-vocab-table[data-cols="5"] thead th:nth-child(2),
.rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(2) { width: 14%; }
.rosmerta-vocab-table[data-cols="5"] thead th:nth-child(3),
.rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(3) { width: 18%; }
.rosmerta-vocab-table[data-cols="5"] thead th:nth-child(4),
.rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(4) { width: 18%; }
.rosmerta-vocab-table[data-cols="5"] thead th:nth-child(5),
.rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(5) { width: 36%; }

/* 4-column tables (Irish | Pron | English | Source) — All Words A-Z */
.rosmerta-vocab-table[data-cols="4"] thead th:nth-child(1),
.rosmerta-vocab-table[data-cols="4"] tbody td:nth-child(1) { width: 24%; }
.rosmerta-vocab-table[data-cols="4"] thead th:nth-child(2),
.rosmerta-vocab-table[data-cols="4"] tbody td:nth-child(2) { width: 22%; }
.rosmerta-vocab-table[data-cols="4"] thead th:nth-child(3),
.rosmerta-vocab-table[data-cols="4"] tbody td:nth-child(3) { width: 28%; }
.rosmerta-vocab-table[data-cols="4"] thead th:nth-child(4),
.rosmerta-vocab-table[data-cols="4"] tbody td:nth-child(4) { width: 26%; }

/* 3-column tables (legacy — kept for any non-vocab tables) */
.rosmerta-vocab-table[data-cols="3"] thead th:nth-child(1),
.rosmerta-vocab-table[data-cols="3"] tbody td:nth-child(1) { width: 30%; }
.rosmerta-vocab-table[data-cols="3"] thead th:nth-child(2),
.rosmerta-vocab-table[data-cols="3"] tbody td:nth-child(2) { width: 25%; }
.rosmerta-vocab-table[data-cols="3"] thead th:nth-child(3),
.rosmerta-vocab-table[data-cols="3"] tbody td:nth-child(3) { width: 45%; }

/* On narrow screens, slightly compress the first columns and grow Notes */
@media (max-width: 600px) {
  .rosmerta-vocab-table[data-cols="5"] thead th:nth-child(1),
  .rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(1) { width: 18%; }
  .rosmerta-vocab-table[data-cols="5"] thead th:nth-child(2),
  .rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(2) { width: 16%; }
  .rosmerta-vocab-table[data-cols="5"] thead th:nth-child(3),
  .rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(3) { width: 20%; }
  .rosmerta-vocab-table[data-cols="5"] thead th:nth-child(4),
  .rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(4) { width: 18%; }
  .rosmerta-vocab-table[data-cols="5"] thead th:nth-child(5),
  .rosmerta-vocab-table[data-cols="5"] tbody td:nth-child(5) { width: 28%; }

  .rosmerta-vocab-table th,
  .rosmerta-vocab-table td {
    padding: 0.4rem 0.4rem;
    font-size: 0.88rem;
  }
}

/* Source citation chips — small monospace-feeling links in the Source column.
   Different visual weight than the cultural-tag chips (rosmerta-chip-*) so a
   reader doesn't confuse them. */
.rosmerta-source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em;
}
.rosmerta-source-chip {
  display: inline-block;
  padding: 0.1em 0.5em;
  font-size: 0.72em;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 3px;
  background: #f4ecd6;
  border: 1px solid #c4a86a;
  color: #4a3a1f;
  text-decoration: none !important;
  white-space: nowrap;
  line-height: 1.5;
}
.rosmerta-source-chip:hover,
.rosmerta-source-chip:focus {
  background: #c4a86a;
  color: #fbf7eb;
  text-decoration: none !important;
}
.rosmerta-source-chip-pending {
  opacity: 0.7;
  font-style: italic;
}
.rosmerta-source-chip-manual-review {
  background: #faecd0;
  border-color: #b8881a;
  border-style: dashed;
  color: #6b4a08;
}
.rosmerta-source-chip-manual-review:hover,
.rosmerta-source-chip-manual-review:focus {
  background: #b8881a;
  color: #fbf7eb;
}


/* ===========================================================================
 * Tag chips — small clickable labels next to vocabulary entries on list
 * pages. Each chip links to a browse page for that tag value, so a visitor
 * can navigate by mythology cycle, etymology, dialect, construction, etc.
 * Color-coded by axis so the eye learns the categories quickly.
 * =========================================================================== */

.rosmerta-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15em;
  vertical-align: middle;
  margin-left: 0.3em;
}
.rosmerta-chip {
  display: inline-block;
  padding: 0.05em 0.55em;
  font-size: 0.72em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.03em;
  border-radius: 999px;
  border: 1px solid;
  text-decoration: none !important;
  white-space: nowrap;
  background: #fbf7eb;
  line-height: 1.5;
  transition: background 120ms ease;
}
.rosmerta-chip:hover,
.rosmerta-chip:focus {
  background: #f4ecd6;
  text-decoration: none !important;
}
.rosmerta-chip-myth         { color: #8a6d3a; border-color: #8a6d3a; }
.rosmerta-chip-etymology    { color: #2d5016; border-color: #2d5016; }
.rosmerta-chip-dialect      { color: #6e4ea3; border-color: #6e4ea3; }
.rosmerta-chip-construction { color: #c47a3a; border-color: #c47a3a; }
.rosmerta-chip-era          { color: #b67272; border-color: #b67272; }


/* ===========================================================================
 * Decorative alphabet grid — used on the Vocabulary page.
 *
 * Each card is a stacked layout in the same visual language as the
 * translator's word stacks: Irish letter on top (large, italic, gold),
 * pronunciation in the middle (monospace, dimmed), a colored leader line,
 * and the English letter equivalent at the bottom (small, gray italic).
 * The whole card is a click target that goes to the letter's Grimoire page.
 * =========================================================================== */

.rosmerta-alphabet-grid {
  --sc-cream:      #fbf7eb;
  --sc-cream-2:    #f4ecd6;
  --sc-gold:       #c4a86a;
  --sc-gold-deep:  #8a6d3a;
  --sc-emerald:    #2d5016;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
}
@media (min-width: 480px) { .rosmerta-alphabet-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 720px) { .rosmerta-alphabet-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 960px) { .rosmerta-alphabet-grid { grid-template-columns: repeat(9, 1fr); } }

.rosmerta-letter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.9rem 0.6rem 0.8rem;
  background: var(--sc-cream);
  border: 1px solid var(--sc-gold);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  min-height: 12.5rem;
  justify-content: flex-start;
}
.rosmerta-letter-card:hover,
.rosmerta-letter-card:focus {
  background: var(--sc-cream-2);
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(138, 109, 58, 0.18);
  outline: none;
  text-decoration: none;
}

.rosmerta-letter-card .rosmerta-letter-irish {
  font-size: 2.4rem;
  font-style: italic;
  font-weight: 700;
  color: var(--sc-gold-deep);
  line-height: 1;
}
.rosmerta-letter-card .rosmerta-letter-irish-name {
  display: block;
  font-size: 0.65rem;
  font-style: italic;
  color: var(--sc-gold-deep);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.2rem;
  font-weight: 400;
  opacity: 0.8;
}
.rosmerta-letter-card .rosmerta-letter-pron {
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: #555;
  letter-spacing: 0.04em;
  margin-top: 0.4rem;
  line-height: 1.2;
}
.rosmerta-letter-card .rosmerta-letter-line {
  display: block;
  height: 2px;
  width: 60%;
  background: var(--sc-gold);
  border-radius: 2px;
  opacity: 0.85;
  margin: 0.4rem auto 0.3rem;
}
.rosmerta-letter-card .rosmerta-letter-english {
  font-size: 0.68rem;
  font-style: italic;
  color: #888;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* New letter-card layout (2026-05-09) — letter on top, then a labelled
   "Irish" block (ogham name + Irish pronunciation), then a labelled
   "English" block. Cards stack the four pieces vertically inside the
   existing border, and the grid above gives 9-per-row at 960px+. */
.rosmerta-letter-card .rosmerta-letter-symbol {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--sc-gold-deep);
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  margin-bottom: 0.3rem;
}
.rosmerta-letter-card .rosmerta-letter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(196, 168, 106, 0.35);
}
.rosmerta-letter-card .rosmerta-letter-section:first-of-type {
  border-top: none;
  margin-top: 0.2rem;
  padding-top: 0;
}
.rosmerta-letter-card .rosmerta-letter-section-label {
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sc-gold-deep);
  opacity: 0.75;
  margin-bottom: 0.15rem;
}
.rosmerta-letter-card .rosmerta-letter-section-value {
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: #444;
  letter-spacing: 0.03em;
  line-height: 1.25;
}
.rosmerta-letter-card .rosmerta-letter-section-value em {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--sc-gold-deep);
}

/* Ogham glyph inside the letter card — uses the Unicode Ogham block.
   Cascading font-stack falls through Windows / macOS / Linux Ogham-capable
   fonts; if none is present the user sees a fallback box. */
.rosmerta-letter-card .rosmerta-letter-ogham-glyph {
  font-family: "Segoe UI Historic", "Apple Symbols", "Noto Sans Ogham",
               "Beith-Luis-Nion", "Pollen", serif;
  font-size: 1.5rem;
  color: var(--sc-emerald);
  line-height: 1;
  margin-top: 0.1rem;
}

/* Ogham visual row — the alphabet rendered as Ogham + Latin + Irish name,
   bracketed by the feather marks. Used in Section 5 of the alphabet
   landing. */
.rosmerta-ogham-row-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.4rem 0 1rem;
  padding: 1rem 0.6rem;
  background: var(--sc-cream);
  border: 1px solid var(--sc-gold);
  border-radius: 6px;
}
.rosmerta-ogham-feather-start,
.rosmerta-ogham-feather-end {
  font-family: "Segoe UI Historic", "Apple Symbols", "Noto Sans Ogham",
               "Beith-Luis-Nion", "Pollen", serif;
  font-size: 2.2rem;
  color: var(--sc-gold-deep);
  line-height: 1;
}
.rosmerta-ogham-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.4rem;
  flex: 1 1 auto;
}
@media (max-width: 720px) {
  .rosmerta-ogham-row { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 480px) {
  .rosmerta-ogham-row { grid-template-columns: repeat(3, 1fr); }
}
.rosmerta-ogham-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.4rem 0.2rem;
  border-right: 1px solid rgba(196, 168, 106, 0.3);
}
.rosmerta-ogham-cell:last-child { border-right: none; }
.rosmerta-ogham-glyph-large {
  font-family: "Segoe UI Historic", "Apple Symbols", "Noto Sans Ogham",
               "Beith-Luis-Nion", "Pollen", serif;
  font-size: 2.2rem;
  color: var(--sc-emerald);
  line-height: 1;
  margin-bottom: 0.2rem;
}
.rosmerta-ogham-latin {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sc-gold-deep);
  line-height: 1;
  margin-bottom: 0.1rem;
}
.rosmerta-ogham-name {
  font-size: 0.65rem;
  color: var(--sc-gold-deep);
  letter-spacing: 0.05em;
  opacity: 0.8;
}
.rosmerta-ogham-name em {
  font-style: italic;
}

/* Ogham sample inscription — a single rendered word in Ogham, surrounded
   by the feather marks, with the Latin source caption below. */
.rosmerta-ogham-inscription {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
  padding: 1.4rem 1rem 1rem;
  background: var(--sc-cream);
  border-left: 4px solid var(--sc-gold);
  border-radius: 4px;
}
.rosmerta-ogham-glyph-inscription {
  font-family: "Segoe UI Historic", "Apple Symbols", "Noto Sans Ogham",
               "Beith-Luis-Nion", "Pollen", serif;
  font-size: 2.6rem;
  color: var(--sc-emerald);
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.rosmerta-ogham-inscription-caption {
  font-size: 0.85rem;
  color: var(--sc-gold-deep);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rosmerta-ogham-inscription-caption em {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

/* Ogham block on the per-letter page (sits between the big-letter hero
   and the pronunciation card). Centered, cream background, large Ogham
   glyph with a small "Ogham" label above and the Irish letter-name +
   tree gloss below. */
.rosmerta-letter-ogham-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 1rem auto;
  padding: 1rem 1rem 0.9rem;
  max-width: 22rem;
  background: var(--sc-cream);
  border: 1px solid var(--sc-gold);
  border-radius: 6px;
}
.rosmerta-letter-ogham-block .rosmerta-letter-ogham-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sc-gold-deep);
  opacity: 0.75;
  margin-bottom: 0.3rem;
}
.rosmerta-letter-ogham-block .rosmerta-letter-ogham-char {
  font-family: "Segoe UI Historic", "Apple Symbols", "Noto Sans Ogham",
               "Beith-Luis-Nion", "Pollen", serif;
  font-size: 3.2rem;
  color: var(--sc-emerald);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.rosmerta-letter-ogham-block .rosmerta-letter-ogham-aside {
  font-size: 0.78rem;
  color: var(--sc-gold-deep);
  letter-spacing: 0.06em;
}
.rosmerta-letter-ogham-block .rosmerta-letter-ogham-aside em {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

/* ===========================================================================
 * Aicme breakdown (the four families of Ogham). Used in the alphabet
 * landing's Ogham section.
 * =========================================================================== */
.rosmerta-aicme-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 1.4rem 0;
}
.rosmerta-aicme-block {
  padding: 1rem 1rem 0.9rem;
  background: var(--sc-cream);
  border: 1px solid var(--sc-gold);
  border-radius: 6px;
}
.rosmerta-aicme-heading {
  margin: 0 0 0.2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  color: var(--sc-gold-deep);
  letter-spacing: 0.05em;
}
.rosmerta-aicme-gloss {
  margin: 0 0 0.8rem;
  font-size: 0.85rem;
  color: #555;
  font-style: italic;
}
.rosmerta-aicme-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}
@media (max-width: 480px) {
  .rosmerta-aicme-row { grid-template-columns: repeat(2, 1fr); }
}
.rosmerta-aicme-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0.3rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  min-height: 7rem;
}
.rosmerta-aicme-cell .rosmerta-ogham-glyph-large {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}
.rosmerta-aicme-strokes {
  font-size: 0.65rem;
  color: var(--sc-gold-deep);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.3rem;
}
.rosmerta-aicme-cell .rosmerta-ogham-latin {
  font-size: 1rem;
  margin-bottom: 0.05rem;
}
.rosmerta-aicme-cell .rosmerta-ogham-name {
  font-size: 0.65rem;
  margin-bottom: 0.1rem;
}
.rosmerta-aicme-tree {
  font-size: 0.62rem;
  color: #777;
  font-style: italic;
}

/* Forfeda row — five supplementary letters as standalone cards. */
.rosmerta-forfeda-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}
@media (max-width: 720px) {
  .rosmerta-forfeda-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .rosmerta-forfeda-row { grid-template-columns: 1fr; }
}
.rosmerta-forfeda-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.8rem 0.6rem;
  background: var(--sc-cream-2);
  border: 1px dashed var(--sc-gold);
  border-radius: 6px;
  min-height: 9rem;
}
.rosmerta-forfeda-cell .rosmerta-ogham-glyph-large {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
}
.rosmerta-forfeda-cell .rosmerta-ogham-latin {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.rosmerta-forfeda-cell .rosmerta-ogham-name {
  font-size: 0.65rem;
  margin: 0.15rem 0;
}
.rosmerta-forfeda-cell .rosmerta-aicme-tree {
  margin-bottom: 0.4rem;
}
.rosmerta-forfeda-note {
  font-size: 0.7rem;
  color: #555;
  line-height: 1.3;
  margin-top: auto;
}

/* ===========================================================================
 * Per-word page (custom post type grimoire_word singular)
 * =========================================================================== */

.rosmerta-grimoire-word {
  --sc-cream:      #fbf7eb;
  --sc-cream-2:    #f4ecd6;
  --sc-gold:       #c4a86a;
  --sc-gold-deep:  #8a6d3a;
  --sc-emerald:    #2d5016;
  --sc-ink:        #4a3a1f;

  font-family: Georgia, "Times New Roman", serif;
  margin: 0 0 1.5rem;
}
.rosmerta-grimoire-word .rosmerta-gw-breadcrumb {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.8rem;
}
.rosmerta-grimoire-word .rosmerta-gw-breadcrumb a {
  color: var(--sc-gold-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--sc-gold-deep);
}
.rosmerta-grimoire-word .rosmerta-gw-card {
  background: var(--sc-cream);
  border-left: 4px solid var(--sc-gold);
  border-radius: 4px;
  padding: 1.4rem 1.6rem;
}
.rosmerta-grimoire-word .rosmerta-gw-irish {
  font-size: 2.6rem;
  font-style: italic;
  font-weight: 700;
  color: var(--sc-gold-deep);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}
.rosmerta-grimoire-word .rosmerta-gw-pron {
  font-family: "Courier New", monospace;
  font-size: 1rem;
  color: #666;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}
.rosmerta-grimoire-word .rosmerta-gw-english {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 0.4rem;
}
.rosmerta-grimoire-word .rosmerta-gw-meta {
  font-size: 0.92rem;
  color: #777;
  font-style: italic;
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}
.rosmerta-grimoire-word .rosmerta-gw-note {
  font-size: 1rem;
  color: #444;
  margin: 0.6rem 0 0.8rem;
  line-height: 1.55;
}
.rosmerta-grimoire-word .rosmerta-gw-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}
.rosmerta-grimoire-word .rosmerta-gw-links a {
  color: var(--sc-emerald);
  text-decoration: none;
  border-bottom: 1px dotted var(--sc-emerald);
}
.rosmerta-grimoire-word .rosmerta-gw-links a:hover {
  border-bottom-style: solid;
}

/* Tablet+ */
@media (min-width: 600px) {
  .rosmerta-spell-caster .rosmerta-sc-input { font-size: 1.1rem; }
  .rosmerta-spell-caster .rosmerta-irish-output {
    font-size: 1.35rem;
    padding: 1.2rem 1.4rem;
  }
  .rosmerta-spell-caster .rosmerta-token-block { margin: 0.2em 0.35em 0.2em 0; min-width: 4em; }
  .rosmerta-spell-caster .rosmerta-say-it { font-size: 0.95rem; }
  .rosmerta-spell-caster .rosmerta-sc-output { margin-top: 2rem; }
}
