/* Word & Worship shell: the four tabs, the account menu and the page header.
   Loaded on every route, in the new design and in pages not yet rebuilt, so the
   navigation looks and behaves the same everywhere. Every value comes from the
   design tokens (lib/v2/tokens.ts); do not add raw colors here. Selectors set
   their own type and colors so the older page styles cannot leak into them. */

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin-wght.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  /* Preloaded on every route. Used when it arrives before first paint, otherwise
     from the next page on, so text never re-wraps after it is on screen. */
  font-display: optional;
}

/* Tabs: a bottom bar on a phone, a top bar on a wide screen. */
.v2-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--layer-tab-bar);
  background: var(--c-surface);
  color: var(--c-ink);
  border-top: var(--size-hairline) solid var(--c-line);
  padding-bottom: env(safe-area-inset-bottom);
  font-family: var(--font-interface);
  letter-spacing: normal;
}
.v2-tabs *, .v2-tabs *::before, .v2-tabs *::after { box-sizing: border-box; }
.v2-tabs-brand { display: none; }
.v2-tabs-row { position: relative; margin: 0 auto; max-width: var(--size-page-max-width); }
.v2-tabs-row ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: var(--size-tab-bar-height);
}
.v2-tabs-row li { margin: 0; padding: 0; }
.v2-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--size-touch-target); height: 100%;
  color: var(--c-ink-2); text-decoration: none;
  font-family: var(--t-tab-family); font-size: var(--t-tab-size); line-height: var(--t-tab-line); font-weight: var(--t-tab-weight); letter-spacing: var(--t-tab-tracking);
}
.v2-tab[aria-current="page"] { color: var(--c-green); }
.v2-tab svg { display: block; width: 24px; height: 24px; }
.v2-tab-indicator {
  position: absolute; top: 0; left: 0; height: 3px; width: 25%;
  display: flex; justify-content: center; pointer-events: none;
}
.v2-tab-indicator[hidden] { display: none; }
.v2-tab-indicator::before { content: ""; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c-green); }

@media (min-width: 900px) {
  .v2-tabs { top: 0; bottom: auto; border-top: 0; border-bottom: var(--size-hairline) solid var(--c-line); padding-bottom: 0; }
  .v2-tabs-bar {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px) minmax(0, 1fr); align-items: center;
    gap: var(--space-4); margin: 0 auto; padding: 0 var(--space-6); max-width: 1280px;
  }
  .v2-tabs-brand { display: flex; }
  .v2-tabs-row { max-width: 560px; width: 100%; }
  .v2-tab { flex-direction: row; gap: var(--space-2); font-size: var(--t-meta-size); }
  .v2-tab svg { width: 20px; height: 20px; }
  .v2-tab-indicator { top: auto; bottom: 0; }
  .v2-tab-indicator::before { border-radius: 3px 3px 0 0; width: 56px; }
}

.v2-tabs-brand {
  align-items: center; gap: var(--space-2); min-height: var(--size-touch-target); justify-self: start;
  color: var(--c-ink); text-decoration: none; white-space: nowrap;
  font-family: var(--font-interface); font-size: var(--t-subheading-size); font-weight: 650; letter-spacing: -0.01em;
}
.v2-tabs-brand img { display: block; width: 28px; height: 28px; border-radius: 8px; }
.v2-tabs-brand i { font-style: normal; color: var(--c-green); }

/* Account menu */
.ww-account { position: relative; font-family: var(--font-interface); }
.ww-account-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--size-touch-target); min-width: var(--size-touch-target);
  margin: 0; padding: 0 var(--space-3);
  border: var(--size-hairline) solid var(--c-line); border-radius: var(--radius-chip);
  background: var(--c-raised); color: var(--c-ink);
  font-family: var(--font-interface); font-size: var(--t-meta-size); font-weight: 600; line-height: 1; letter-spacing: normal;
  cursor: pointer; opacity: 1;
}
.ww-account-btn svg { display: block; width: 20px; height: 20px; flex: none; }
.ww-account-btn .ww-account-chevron { width: 16px; height: 16px; color: var(--c-ink-2); transition: transform 160ms ease-out; }
.ww-account-btn[aria-expanded="true"] .ww-account-chevron { transform: rotate(180deg); }
.ww-account-panel {
  position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: var(--layer-sheet);
  width: min(300px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-2);
  border: var(--size-hairline) solid var(--c-line); border-radius: var(--radius-control);
  background: var(--c-raised); color: var(--c-ink);
  box-shadow: var(--shadow-sheet);
  text-align: left;
}
.ww-account-panel[hidden] { display: none; }
.ww-account-intro { display: grid; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-4); border-bottom: var(--size-hairline) solid var(--c-line); margin-bottom: var(--space-2); }
.ww-account-intro p { margin: 0; color: var(--c-ink-2); font-size: var(--t-meta-size); line-height: var(--t-meta-line); }
.ww-account-signin {
  display: flex; align-items: center; justify-content: center; min-height: var(--size-touch-target);
  border-radius: var(--radius-chip); background: var(--c-green); color: var(--c-on-green);
  font-weight: 650; font-size: var(--t-label-size); text-decoration: none;
}
.ww-account-panel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 2px; height: auto; }
.ww-account-panel li { margin: 0; padding: 0; }
.ww-account-panel nav a, .ww-account-signout {
  display: flex; align-items: center; width: 100%; min-height: var(--size-touch-target);
  margin: 0; padding: 0 var(--space-3);
  border: 0; border-radius: 10px; background: transparent; color: var(--c-ink);
  font-family: var(--font-interface); font-size: var(--t-label-size); font-weight: 500; line-height: 1.3; text-align: left; text-decoration: none; letter-spacing: normal;
  cursor: pointer; opacity: 1;
}
.ww-account-panel nav a:hover, .ww-account-signout:hover { background: var(--c-green-soft); }
.ww-account-panel nav a[aria-current="page"] { color: var(--c-green); font-weight: 650; }
.ww-account-signout { margin-top: var(--space-2); border-top: var(--size-hairline) solid var(--c-line); border-radius: 0 0 10px 10px; color: var(--c-ink-2); }
.v2-tabs :focus-visible, .ww-pagehead :focus-visible, .ww-account :focus-visible {
  outline: var(--size-focus-ring-width) solid var(--c-focus); outline-offset: var(--size-focus-ring-offset);
}

/* One account menu per page. On a wide screen it docks at the right of the top
   bar. On a phone it sits at the top of the page header on routes under a tab;
   on Today, Bible, Explore and You the You tab is the account hub. */
.ww-account-dock { display: none; }
html[data-shell="classic"] .ww-account-dock {
  display: block; position: absolute; z-index: var(--layer-verse-bar);
  top: var(--space-3); right: var(--page-gutter, var(--size-page-gutter));
}
html[data-shell="classic"] .ww-account-dock .ww-account-label { display: none; }
@media (min-width: 900px) {
  .ww-account-dock, html[data-shell="classic"] .ww-account-dock {
    display: block; position: fixed; z-index: var(--layer-sheet);
    top: calc((var(--size-tab-bar-height) - var(--size-touch-target)) / 2);
    right: max(var(--space-6), calc((100vw - 1280px) / 2 + var(--space-6)));
  }
  html[data-shell="classic"] .ww-account-dock .ww-account-label { display: inline; }
}

/* Page header for routes under a tab: where you are, and the account menu on a phone. */
.ww-pagehead {
  display: flex; align-items: center; min-height: calc(var(--size-touch-target) + 2 * var(--space-3));
  max-width: var(--page-width, 1240px); margin: 0 auto;
  padding: var(--space-3) calc(var(--page-gutter, var(--size-page-gutter)) + var(--size-touch-target) + var(--space-6)) var(--space-3) var(--page-gutter, var(--size-page-gutter));
  font-family: var(--font-interface); color: var(--c-ink);
}
@media (min-width: 900px) { .ww-pagehead { padding-right: var(--page-gutter, var(--size-page-gutter)); } }
.ww-breadcrumb { min-width: 0; }
.ww-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--t-meta-size); line-height: var(--t-meta-line); }
.ww-breadcrumb li { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; }
.ww-breadcrumb li + li::before { content: "/"; color: var(--c-ink-2); }
.ww-breadcrumb a { display: inline-flex; align-items: center; min-height: var(--size-touch-target); color: var(--c-ink-2); text-decoration: none; }
.ww-breadcrumb a:hover { text-decoration: underline; }
.ww-breadcrumb [aria-current="page"] { color: var(--c-ink); font-weight: 650; overflow-wrap: anywhere; }
.product-skip-link {
  position: fixed; left: var(--space-4); top: var(--space-2); z-index: var(--layer-toast);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-control);
  background: var(--c-raised); color: var(--c-ink); font-family: var(--font-interface); font-weight: 650; text-decoration: none;
  transform: translateY(-200%);
}
.product-skip-link:focus { transform: none; }
.product-route-start { height: 0; scroll-margin-top: calc(var(--size-tab-bar-height) + var(--space-4)); }
.product-route-start:focus { outline: none; }

/* Routes not yet rebuilt take their colors and interface type from the same
   design tokens as the new design, so a page under a tab looks like the tab it
   belongs to in light and dark. The tokens already follow the reader's theme,
   so one mapping covers both. The selector outranks the older theme rules in
   app/globals.css. Blocks that set their own palette (the green feature
   panels) keep it. */
html[data-shell="classic"]:root {
  --background: var(--c-ground); --paper: var(--c-ground); --bg: var(--c-ground);
  --foreground: var(--c-ink); --ink: var(--c-ink);
  --card: var(--c-raised); --card-foreground: var(--c-ink);
  --popover: var(--c-raised); --popover-foreground: var(--c-ink);
  --surface: var(--c-raised); --surface-soft: var(--c-surface); --surface-strong: var(--c-green-soft);
  --secondary: var(--c-surface); --secondary-foreground: var(--c-ink);
  --muted: var(--c-ink-2); --muted-foreground: var(--c-ink-2);
  --line: var(--c-line); --border: var(--c-line);
  --green: var(--c-green); --primary: var(--c-green); --accent: var(--c-green); --journey-accent: var(--c-green); --ring: var(--c-focus);
  --primary-foreground: var(--c-on-green); --accent-foreground: var(--c-on-green); --on-accent: var(--c-on-green);
  --glass: color-mix(in srgb, var(--c-surface) 90%, transparent);
  --sans: var(--font-interface);
}

/* Routes not yet rebuilt: room for the bar, top on a wide screen, bottom on a phone. */
body:has(.ww-pagehead) { padding-bottom: calc(var(--size-tab-bar-height) + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  body:has(.ww-pagehead) { padding-top: var(--size-tab-bar-height); padding-bottom: 0; }
}

/* The floating Ask/theme pill is retired: Philip opens from the page, and the
   theme lives in You > Settings. */
.wm-utilities { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .ww-account-btn .ww-account-chevron { transition: none; }
}
@media print {
  .v2-tabs, .ww-pagehead, .product-skip-link { display: none !important; }
  body:has(.ww-pagehead) { padding: 0; }
}
