/* ═════════════════════════════════════════════════════════════════
   SHARED CARD STYLES
   GOES INTO preview.html <style> AND pt_anki/steps/s6_build_deck.py
   CSS CONSTANT — keep these two surfaces byte-for-byte identical.
   ─────────────────────────────────────────────────────────────────
   Rules for this block:
   • Only widely-supported CSS. Flex/grid/transform/transition OK.
   • No @font-face self-hosted. Google Fonts via @import only.
   • No :has(), no container queries, no CSS nesting.
   • Renders in browser AND Anki's WebView.
   ═════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Inter:wght@400;500;600&display=swap");

/* Tokens (kept local to this block so Anki cards don't depend on outer CSS) */
.glot-card-root {
  --c-bg: #f5ede0;
  --c-surface: #fffdf8;
  --c-divider: #e7d5c0;
  --c-ink: #1c1917;
  --c-ink-soft: #44403c;
  --c-ink-mute: #78716c;
  --c-umber: #92400e;
  --c-umber-soft: #b45309;
  --c-umber-deep: #7c3612;

  --f-serif: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --f-sans: "Inter", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Card outer wrapper — the 'page' the card sits on */
.glot-card-root {
  font-family: var(--f-sans);
  background: var(--c-bg);
  color: var(--c-ink);
  padding: 24px 16px;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.glot-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-divider);
  border-radius: 18px;
  padding: 28px 28px 24px;
  box-shadow: 0 4px 24px rgba(146, 64, 14, 0.06);
  position: relative;
  overflow: hidden;
}

/* Top stripe — brand motif */
.glot-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c-umber);
}

/* Card meta row */
.glot-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-mute);
  margin-bottom: 14px;
}
.glot-meta .glot-meta-rank {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--c-ink-mute);
}

/* ── Word row ───────────────────────────────────────────────── */
.glot-word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.glot-word {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--c-umber);
  word-break: break-word;
  font-variation-settings: "opsz" 144;
  flex: 1;
}

/* Play button — circular, warm cream, umber icon */
.glot-play {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 999px;
  border: 1px solid rgba(146, 64, 14, 0.22);
  background: #fef3e2;
  color: var(--c-umber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 180ms cubic-bezier(.4,0,.2,1), background 180ms cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.glot-play:hover { transform: scale(1.06); background: #fae5c7; }
.glot-play:active { transform: scale(0.97); }
.glot-play svg { width: 14px; height: 14px; display: block; margin-left: 2px; }
.glot-play svg path { fill: var(--c-umber); }

/* Divider */
.glot-divider {
  height: 1px;
  background: var(--c-divider);
  margin: 20px 0;
  border: 0;
}

/* Definition */
.glot-definition {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  color: var(--c-umber-soft);
  margin: 0 0 18px;
  font-variation-settings: "opsz" 36;
}

/* Sentence — the star of the card back */
.glot-sentence {
  font-family: var(--f-sans);
  font-size: 18px;
  line-height: 1.55;
  color: var(--c-ink);
  margin: 0 0 14px;
}

/* Translation reveal affordance + revealed translation */
.glot-trans-toggle {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid var(--c-divider);
  margin-bottom: 14px;
  user-select: none;
  transition: color 140ms ease, border-color 140ms ease;
}
.glot-trans-toggle:hover {
  color: var(--c-umber);
  border-bottom-color: var(--c-umber);
}
.glot-translation {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.45;
  color: var(--c-umber-soft);
  margin: 0 0 14px;
  font-variation-settings: "opsz" 24;
}

/* Sentence play button sits at the bottom */
.glot-sent-play {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-ink-mute);
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Utility */
.glot-hidden { display: none !important; }

/* ═════════════════════════════════════════════════════════════════
   END SHARED CARD STYLES
   ═════════════════════════════════════════════════════════════════ */