/* ============================================================
   LEXNOMIK — Feature styles (splash, flashcards, A/B blocks)
   assets/css/features.css   — loaded by public/includes/header.php
   ============================================================ */

/* ---------- Splash ----------------------------------------- */
.lx-splash {
  position: fixed; inset: 0; z-index: 100000;
  display: grid; place-items: center;
  background: #0b1a31;
  color: #fff;
  cursor: pointer;
  animation: lxSplashOut .55s ease var(--lx-splash-ms, 1800ms) forwards;
}
.lx-splash-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px circle at 50% 46%, rgba(200,168,75,.16), transparent 62%),
    radial-gradient(900px circle at 50% 120%, rgba(42,80,128,.45), transparent 60%);
}
.lx-splash-inner { position: relative; text-align: center; padding: 0 16px; }
.lx-splash-mark {
  width: 64px; height: 64px; margin: 0 auto 18px; display: block;
  fill: none; stroke: var(--gold, #c8a84b); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.lx-splash-mark path { stroke-dasharray: 120; stroke-dashoffset: 120; animation: lxDraw .9s ease forwards; }
.lx-splash-mark .lx-m-beam { animation-delay: .15s; }
.lx-splash-mark .lx-m-pan  { animation-delay: .3s; }
.lx-splash-mark .lx-m-bowl { animation-delay: .45s; }
.lx-splash-mark .lx-m-top  { fill: var(--gold, #c8a84b); stroke: none; opacity: 0; animation: lxFade .4s ease .2s forwards; }
.lx-splash-logo { width: 88px; height: 88px; object-fit: contain; margin: 0 auto 16px; display: block; opacity: 0; animation: lxFade .6s ease forwards; }
.lx-splash-word {
  font-family: var(--font-display, 'Playfair Display', Georgia, serif);
  font-weight: 900; font-size: clamp(44px, 10vw, 84px);
  line-height: 1; letter-spacing: .01em;
}
.lx-splash-word span {
  display: inline-block; opacity: 0; transform: translateY(.35em);
  animation: lxLetter .6s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(.2s + var(--i) * .055s);
}
.lx-splash-word span:nth-child(n+4) { color: var(--gold-light, #e8c97a); }
.lx-splash-rule {
  height: 2px; width: 0; margin: 18px auto 14px;
  background: linear-gradient(90deg, transparent, var(--gold, #c8a84b), transparent);
  animation: lxRule .8s ease .7s forwards;
}
.lx-splash-tag {
  font-family: var(--font-ui, 'DM Sans', sans-serif);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .42em; padding-left: .42em; color: var(--gold-light, #e8c97a);
  opacity: 0; animation: lxFade .6s ease .95s forwards;
}
.lx-splash-sub {
  font-family: var(--font-body, 'Source Serif 4', Georgia, serif); font-style: italic;
  font-size: 15px; color: rgba(255,255,255,.62); margin-top: 10px;
  opacity: 0; animation: lxFade .6s ease 1.1s forwards;
}
.lx-splash.lx-splash-done { animation: lxSplashOut .3s ease forwards; }

@keyframes lxSplashOut { to { opacity: 0; visibility: hidden; } }
@keyframes lxLetter    { to { opacity: 1; transform: none; } }
@keyframes lxFade      { to { opacity: 1; } }
@keyframes lxRule      { to { width: min(240px, 60vw); } }
@keyframes lxDraw      { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .lx-splash { animation-duration: .3s; animation-delay: .9s; }
  .lx-splash *, .lx-splash-mark path { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
  .lx-splash-rule { width: min(240px, 60vw); }
}

/* ---------- Announcement bar ------------------------------- */
.lx-announce {
  background: var(--navy-dark, #0f2240); color: rgba(255,255,255,.9);
  font-size: 13.5px; text-align: center; padding: 9px 16px;
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.lx-announce a { color: var(--gold-light, #e8c97a); font-weight: 600; }

/* ---------- Flashcard (shared) ----------------------------- */
.fc-card {
  --fc-min-h: 380px;
  perspective: 1600px; cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent;
}
.fc-card.fc-compact { --fc-min-h: 300px; }
.fc-inner {
  display: grid; height: 100%;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.2,.75,.25,1);
}
.fc-card.is-flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  grid-area: 1 / 1;
  min-height: var(--fc-min-h);
  display: flex; flex-direction: column;
  padding: 26px 26px 20px;
  border-radius: 16px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 2px rgba(15,34,64,.06), 0 10px 30px rgba(15,34,64,.10);
  overflow: hidden;
}
.fc-back { transform: rotateY(180deg); background: #fff; color: var(--gray-800, #1f2937); border: 1px solid var(--gray-200, #e5e7eb); }
.fc-card:focus-visible .fc-face { box-shadow: 0 0 0 3px var(--gold, #c8a84b), 0 10px 30px rgba(15,34,64,.12); }

/* News front: navy */
.fc-news .fc-front {
  background: linear-gradient(160deg, #13294a 0%, var(--navy-dark, #0f2240) 70%);
  color: #fff;
}
.fc-news .fc-front::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; border: 1px solid rgba(200,168,75,.18); pointer-events: none;
}
.fc-face { position: relative; }
/* Knowledge front: parchment */
.fc-knowledge .fc-front {
  background: var(--gold-pale, #f7f0dd);
  color: var(--navy-dark, #0f2240);
  border: 1px solid #ecdfb8;
}
.fc-knowledge .fc-front::before {
  content: "?"; position: absolute; right: 18px; bottom: -34px;
  font-family: var(--font-display, Georgia, serif); font-weight: 900;
  font-size: 190px; line-height: 1; color: rgba(200,168,75,.16); pointer-events: none;
}

.fc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.fc-kind {
  font-family: var(--font-ui, sans-serif); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--gold, #c8a84b);
}
.fc-knowledge .fc-front .fc-kind { color: #9a7b22; }
.fc-cat, .fc-ref {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fc-news .fc-front .fc-cat { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); }
.fc-knowledge .fc-front .fc-cat { background: rgba(15,34,64,.07); color: var(--navy, #1a3a5c); }
.fc-ref { background: var(--gray-100, #f3f4f6); color: var(--gray-600, #4b5563); white-space: normal; text-align: right; max-width: 70%; }
.fc-emoji { font-size: 30px; line-height: 1; margin-bottom: 14px; }
.fc-title {
  color: inherit;
  font-family: var(--font-display, Georgia, serif); font-weight: 700;
  font-size: 23px; line-height: 1.3; letter-spacing: -.005em;
}
.fc-compact .fc-title { font-size: 18px; }
.fc-hint { margin-top: 10px; font-size: 13.5px; opacity: .72; }
.fc-foot {
  margin-top: auto; padding-top: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12px;
}
.fc-flip-cue { opacity: .6; font-weight: 500; }
.fc-date { opacity: .6; }
.fc-body {
  font-family: var(--font-body, Georgia, serif); font-size: 16px; line-height: 1.65;
  color: var(--gray-700, #374151);
}
.fc-compact .fc-body { font-size: 14.5px; line-height: 1.58; }
.fc-takeaway {
  margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  background: var(--gold-pale, #f7f0dd); border-left: 3px solid var(--gold, #c8a84b);
  font-size: 13.5px; line-height: 1.5; color: var(--navy-dark, #0f2240);
}
.fc-takeaway strong {
  display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: #9a7b22; margin-bottom: 3px;
}
.fc-link { font-weight: 700; color: var(--navy, #1a3a5c); font-size: 13.5px; }
.fc-link:hover { color: var(--gold, #c8a84b); }

/* Without JS: show both faces stacked, no 3D */
html:not(.lx-js) .fc-inner { display: block; transform: none !important; }
html:not(.lx-js) .fc-back  { transform: none; margin-top: 10px; }
html:not(.lx-js) .fc-flip-cue, html:not(.lx-js) .fc-toolbar, html:not(.lx-js) .fc-controls,
html:not(.lx-js) .fc-counter, html:not(.lx-js) .fc-keys, html:not(.lx-js) .fc-progress { display: none !important; }

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

/* ---------- Flashcards page -------------------------------- */
.fc-hero {
  background: linear-gradient(170deg, #13294a, var(--navy-dark, #0f2240));
  color: #fff; padding: 40px 0 0; position: relative; overflow: hidden;
}
.fc-hero::after {
  content: ""; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px;
  border-radius: 50%; border: 1px solid rgba(200,168,75,.16); pointer-events: none;
}
.fc-hero-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold, #c8a84b); margin-bottom: 10px; }
.fc-hero h1 { color: #fff; font-family: var(--font-display, Georgia, serif); font-weight: 900; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; margin-bottom: 12px; }
.fc-hero p { max-width: 560px; color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.6; }
.fc-tabs { display: flex; gap: 4px; margin-top: 24px; overflow-x: auto; scrollbar-width: none; }
.fc-tab {
  padding: 12px 18px; border-radius: 10px 10px 0 0; white-space: nowrap;
  color: rgba(255,255,255,.72); font-weight: 600; font-size: 14px;
}
.fc-tab span { font-size: 11.5px; opacity: .65; margin-left: 4px; }
.fc-tab:hover { color: #fff; }
.fc-tab.active { background: var(--off-white, #f8f7f3); color: var(--navy-dark, #0f2240); }

.fc-main { padding-top: 22px; padding-bottom: 64px; }
.fc-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fc-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.fc-mode { display: inline-flex; background: #fff; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; padding: 3px; }
.fc-mode-btn {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px;
  font: 600 13px var(--font-ui, sans-serif); color: var(--gray-600, #4b5563); cursor: pointer;
}
.fc-mode-btn.active { background: var(--navy-dark, #0f2240); color: #fff; }

.fc-stage { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.fc-progress, .fc-controls, .fc-counter, .fc-keys { display: none; }

.fc-deck.is-deck .fc-stage { grid-template-columns: 1fr; justify-items: center; }
.fc-deck.is-deck .fc-card { grid-area: 1 / 1; width: 100%; max-width: 620px; display: none; }
.fc-deck.is-deck .fc-card.is-active { display: block; }
.fc-deck.is-deck .fc-card .fc-face { min-height: 340px; padding: 30px 32px 22px; }
.fc-deck.is-deck .fc-title { font-size: 27px; }
.fc-deck.is-deck .fc-body { font-size: 17px; }
.fc-deck.is-deck .fc-progress { display: block; max-width: 620px; margin: 0 auto 18px; height: 4px; background: var(--gray-200, #e5e7eb); border-radius: 99px; overflow: hidden; }
.fc-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy, #1a3a5c), var(--gold, #c8a84b)); transition: width .3s ease; }
.fc-deck.is-deck .fc-controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 24px; }
.fc-deck.is-deck .fc-counter { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: var(--gray-500, #6b7280); font-weight: 600; }
.fc-deck.is-deck .fc-keys { display: block; text-align: center; margin-top: 4px; font-size: 12px; color: var(--gray-400, #9ca3af); }
.fc-ctrl {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--gray-300, #d1d5db);
  background: #fff; font-size: 19px; cursor: pointer; color: var(--navy-dark, #0f2240);
  transition: background .15s, border-color .15s, transform .15s;
}
.fc-ctrl:hover { border-color: var(--navy, #1a3a5c); transform: translateY(-1px); }
.fc-ctrl-main {
  width: auto; padding: 0 26px; border-radius: 99px; font: 700 14px var(--font-ui, sans-serif);
  background: var(--navy-dark, #0f2240); color: #fff; border-color: var(--navy-dark, #0f2240);
}
.fc-ctrl-main:hover { background: var(--navy, #1a3a5c); }
.fc-card.enter-next { animation: fcInNext .35s cubic-bezier(.2,.8,.2,1); }
.fc-card.enter-prev { animation: fcInPrev .35s cubic-bezier(.2,.8,.2,1); }
@keyframes fcInNext { from { opacity: 0; transform: translateX(36px) rotate(1.5deg); } }
@keyframes fcInPrev { from { opacity: 0; transform: translateX(-36px) rotate(-1.5deg); } }

.fc-empty { text-align: center; padding: 64px 16px; color: var(--gray-500, #6b7280); }
.fc-empty h2 { font-family: var(--font-display, Georgia, serif); color: var(--navy-dark, #0f2240); margin-bottom: 8px; }
.fc-empty a { color: var(--navy, #1a3a5c); font-weight: 600; }

/* ---------- Homepage: variant A strip ---------------------- */
.fc-home-a { padding: 44px 0 8px; }
.fc-home-a .section-header { align-items: flex-end; }
.fc-home-sub { font-size: 13.5px; color: var(--gray-500, #6b7280); margin-top: 4px; }
.fc-strip {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 4px 22px; margin: 0 -4px; scrollbar-width: thin;
}
.fc-strip .fc-card { flex: 0 0 280px; scroll-snap-align: start; }
.fc-strip-more {
  flex: 0 0 170px; scroll-snap-align: start; border-radius: 16px;
  border: 2px dashed var(--gray-300, #d1d5db); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  color: var(--navy, #1a3a5c); font-weight: 700; font-size: 14px;
}
.fc-strip-more b { font-size: 24px; }
.fc-strip-more:hover { border-color: var(--gold, #c8a84b); color: var(--navy-dark, #0f2240); }

/* ---------- Homepage: variant B banner --------------------- */
.fc-home-b { padding-top: 40px; }
.fc-daily {
  display: flex; align-items: center; gap: 26px; padding: 24px 28px;
  border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, var(--navy-dark, #0f2240), #1d4372);
  box-shadow: 0 10px 30px rgba(15,34,64,.18);
}
.fc-daily:hover { color: #fff; }
.fc-daily-stack { position: relative; width: 74px; height: 84px; flex: 0 0 74px; }
.fc-daily-stack span {
  position: absolute; inset: 0; border-radius: 10px; background: var(--gold-pale, #f7f0dd);
  display: grid; place-items: center; font-size: 28px; box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.fc-daily-stack span:nth-child(1) { transform: rotate(-12deg) translate(-6px, 4px); background: #d9c48a; }
.fc-daily-stack span:nth-child(2) { transform: rotate(-5deg) translate(-2px, 2px); background: #eadcb1; }
.fc-daily-text { flex: 1; min-width: 0; }
.fc-daily-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold, #c8a84b); }
.fc-daily-title { font-family: var(--font-display, Georgia, serif); font-size: 21px; font-weight: 700; line-height: 1.3; margin: 6px 0 4px; }
.fc-daily-sub { font-size: 13.5px; color: rgba(255,255,255,.7); }
.fc-daily-btn { flex: 0 0 auto; }

/* ---------- Homepage: Know your law ------------------------ */
.fc-kyl {
  display: grid; grid-template-columns: 1fr minmax(0, 1.15fr); gap: 40px; align-items: center;
  background: #fff; border-radius: 18px; padding: 36px; margin-bottom: 52px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 1px solid var(--gray-200, #e5e7eb);
}
.fc-kyl-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold, #c8a84b); margin-bottom: 8px; }
.fc-kyl h2 { font-family: var(--font-display, Georgia, serif); font-size: 30px; font-weight: 900; color: var(--navy-dark, #0f2240); margin-bottom: 10px; }
.fc-kyl p { color: var(--gray-500, #6b7280); line-height: 1.6; margin-bottom: 20px; }

/* ---------- Article quick-read card ------------------------ */
.fc-article { margin: 6px 0 24px; max-width: 560px; }
.fc-article-label { font-size: 12px; font-weight: 700; color: #9a7b22; letter-spacing: .04em; margin-bottom: 10px; }

/* ---------- Responsive ------------------------------------- */
@media (max-width: 768px) {
  .home-two-col { grid-template-columns: 1fr !important; }
  .fc-kyl { grid-template-columns: 1fr; padding: 22px; gap: 22px; }
  .fc-daily { flex-wrap: wrap; padding: 20px; gap: 16px; }
  .fc-daily-btn { width: 100%; text-align: center; }
  .fc-deck.is-deck .fc-card .fc-face { min-height: 360px; padding: 24px 22px 18px; }
  .fc-deck.is-deck .fc-title { font-size: 22px; }
  .fc-deck.is-deck .fc-body { font-size: 16px; }
  .fc-strip .fc-card { flex-basis: 78vw; max-width: 300px; }
  .fc-keys { display: none !important; }
  .fc-hero { padding-top: 28px; }
  .fc-hero h1 { font-size: 28px; }
  .fc-hero p { font-size: 14.5px; }
  .fc-tabs { margin-top: 18px; }
  .fc-tab { padding: 10px 12px; font-size: 13px; }
  .fc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px 2px; }
  .fc-chips .filter-chip { flex: 0 0 auto; }
  .fc-deck.is-deck .fc-card .fc-face { min-height: 300px; }
  .fc-controls { margin-top: 18px !important; }
}

/* ---------- Shorts: nav highlight + floating ⚡ button (A/B) ---- */
.site-nav a.nav-shorts { color: var(--gold-light, #e8c97a); }

.sh-fab {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 900;
}
.sh-fab-cta {
  display: flex; align-items: center; height: 54px; max-width: 54px; overflow: hidden; white-space: nowrap;
  border-radius: 27px; background: var(--navy-dark, #0f2240); color: #fff;
  border: 1px solid rgba(200,168,75,.6); box-shadow: 0 8px 24px rgba(15,34,64,.38);
  transition: max-width .3s cubic-bezier(.2,.85,.25,1), box-shadow .2s ease;
}
.sh-fab-icon {
  flex: 0 0 52px; height: 52px; display: grid; place-items: center; font-size: 22px; color: var(--gold-light, #e8c97a);
}
.sh-fab-text {
  padding: 0 20px 0 0; font-weight: 700; font-size: 14.5px; opacity: 0; transition: opacity .2s ease;
}
.sh-fab-text b { color: var(--gold-light, #e8c97a); }
.sh-fab-x {
  position: absolute; right: -6px; top: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: #fff; color: #0f2240; font-size: 16px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.28); display: none; place-items: center;
}
.sh-fab-cta:focus-visible { outline: 3px solid var(--gold-light, #e8c97a); outline-offset: 3px; }

/* expanded state — hover/keyboard focus on pointer devices, tap on touch */
.sh-fab.is-open .sh-fab-cta,
.sh-fab:focus-within .sh-fab-cta { max-width: min(320px, calc(100vw - 36px)); box-shadow: 0 12px 30px rgba(15,34,64,.45); }
.sh-fab.is-open .sh-fab-text,
.sh-fab:focus-within .sh-fab-text { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .sh-fab:hover .sh-fab-cta { max-width: 320px; box-shadow: 0 12px 30px rgba(15,34,64,.45); }
  .sh-fab:hover .sh-fab-text { opacity: 1; }
  .sh-fab-cta:hover { color: #fff; }
}
@media (hover: none), (max-width: 768px) {
  .sh-fab.is-open .sh-fab-x { display: grid; }
}
@media (prefers-reduced-motion: reduce) { .sh-fab-cta, .sh-fab-text { transition: none; } }
/* keep the last content + footer clear of the button on small screens */
@media (max-width: 768px) { body.has-sh-pill .site-footer { padding-bottom: 84px; } }
