/* Bible Reader — Modal + Calendar Styles */
/* Extracted from master-ui-v1.html */

/* ═══════════════════════════════════════════
       NAV MODAL TOKENS
       ═══════════════════════════════════════════ */
    :root {
      --stone-50: #fafafa; --stone-100: #f5f5f5; --stone-150: #eeeeee;
      --stone-200: #e0e0e0; --stone-300: #cccccc; --stone-400: #999999;
      --stone-500: #707070; --stone-600: #555555; --stone-700: #383838;
      --stone-800: #222222; --stone-900: #111111;
      --gold-300: #6ba3c9; --gold-400: #2a6496; --gold-500: #1e4f78; --gold-600: #1a4060;
      --wine-500: #8b2252;
      --ch-active: #8b1a1a;
      --font-serif: 'Noto Serif', Georgia, serif;
      --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* ═══════════════════════════════════════════
       NAV MODAL
       ═══════════════════════════════════════════ */
    .overlay {
      position: fixed; inset: 0; z-index: 200;
      background: rgba(26, 23, 20, 0.5);
      backdrop-filter: blur(5px);
      opacity: 0; visibility: hidden;
      transition: opacity 0.25s var(--ease-out), visibility 0.25s;
    }
    .overlay.open { opacity: 1; visibility: visible; }

    #navOverlay {
      display: flex; align-items: flex-start; justify-content: center;
      padding: clamp(0.5rem, 2vh, 1.5rem) clamp(0.5rem, 2vw, 1.5rem);
      overflow-y: auto;
    }
    .nav-modal {
      background: var(--stone-50); border-radius: 14px;
      width: 100%; max-width: 1180px; max-height: 88vh;
      display: flex; flex-direction: column;
      box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.12), 0 24px 48px rgba(0,0,0,0.08);
      transform: translateY(8px) scale(0.97); opacity: 0;
      transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease;
      overflow: hidden;
    }
    .overlay.open .nav-modal { transform: translateY(0) scale(1); opacity: 1; }

    .nav-header {
      padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--stone-200);
      background: var(--stone-50); position: sticky; top: 0; z-index: 10;
    }
    .nav-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
    .nav-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em; }
    .nav-close {
      width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
      border: 1px solid var(--stone-200); border-radius: 50%; background: #fff; cursor: pointer; color: var(--stone-500); transition: all 0.15s;
    }
    .nav-close:hover { background: var(--stone-100); color: var(--stone-800); }

    .search-bar { position: relative; }
    .search-input {
      width: 100%; padding: 0.6rem 8rem 0.6rem 2.8rem !important;
      border: 1px solid var(--stone-200); border-radius: 10px; background: #fff;
      font-family: var(--font-ui); font-size: 1.1rem !important; color: var(--stone-800); outline: none;
      box-sizing: border-box !important;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .search-input::placeholder { color: var(--stone-400); }
    .search-input:focus { border-color: var(--gold-400); box-shadow: 0 0 0 3px rgba(42, 100, 150, 0.12); }
    .search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--stone-400); pointer-events: none; }
    .search-clear {
      position: absolute; right: 10rem; top: 50%; transform: translateY(-50%);
      width: 22px; height: 22px; display: none; align-items: center; justify-content: center;
      border: none; border-radius: 50%; background: var(--stone-150); cursor: pointer; color: var(--stone-500); font-size: 0.7rem;
      z-index: 2;
    }
    .search-clear:hover { background: var(--stone-200); }
    .search-clear.visible { display: flex; }
    /* Deep search pill button */
    .search-deep-btn {
      position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
      padding: 0.35rem 0.8rem;
      border: none; border-radius: 20px;
      background: var(--stone-200); color: var(--stone-600);
      font-family: 'cf_dincondensed_light', sans-serif; font-size: 1rem;
      cursor: pointer; transition: all 0.2s; z-index: 2;
      white-space: nowrap;
    }
    .search-deep-btn.available { background: var(--gold-400); color: #fff; }
    .search-deep-btn.available:hover { background: var(--ch-active); color: #fff; }
    /* Deep search results — full content area */
    .deep-search-container { padding: 0.5rem 0; }
    .deep-search-header {
      font-family: 'cf_dincondensed_light', sans-serif; font-size: 1.2rem;
      color: var(--stone-600); padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--stone-200);
    }
    .deep-search-header small { color: var(--stone-400); font-size: 0.9rem; }
    .deep-search-loading { padding: 2rem; text-align: center; color: var(--stone-400); }
    .deep-result-item {
      display: block; padding: 0.6rem 1rem; cursor: pointer; text-decoration: none;
      transition: background 0.1s; color: var(--stone-800);
    }
    .deep-result-item:hover { background: var(--stone-100); }
    .deep-result-ref { font-family: 'cf_dincondensed_light', sans-serif; font-size: 0.8rem; color: var(--ch-active); text-transform: uppercase; }
    .deep-result-text { font-size: 1.2rem; color: var(--stone-600); margin-top: 0.15rem; }
    .deep-result-text mark { background: rgba(255, 230, 0, 0.4); color: inherit; border-radius: 2px; padding: 0 2px; }
    .deep-search-msg { padding: 1.5rem 1rem; text-align: center; color: var(--stone-400); font-size: 0.85rem; }
    .deep-search-reset { display: inline-block; margin-top: 0.5rem; padding: 0.3rem 0.8rem; border: 1px solid var(--stone-200); border-radius: 6px; background: none; cursor: pointer; color: var(--stone-600); font-size: 0.78rem; }
    .deep-search-reset:hover { background: var(--stone-100); }

    .autocomplete {
      display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
      background: #fff; border: 1px solid var(--stone-200); border-radius: 10px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.1); max-height: 280px; overflow-y: auto; z-index: 20;
    }
    .autocomplete.visible { display: block; }
    .ac-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; cursor: pointer; transition: background 0.1s; }
    .ac-item:hover, .ac-item.focused { background: var(--stone-100); }
    .ac-item:first-child { border-radius: 10px 10px 0 0; }
    .ac-item:last-child { border-radius: 0 0 10px 10px; }
    .ac-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--stone-100); color: var(--stone-500); font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }
    .ac-icon.book { background: rgba(42,100,150,0.12); color: var(--gold-600); }
    .ac-icon.chapter { background: rgba(139,26,26,0.08); color: var(--ch-active); }
    .ac-text { flex: 1; min-width: 0; }
    .ac-primary { font-size: 0.85rem; font-weight: 500; color: var(--stone-800); }
    .ac-primary mark { background: none; color: var(--gold-600); font-weight: 700; }
    .ac-secondary { font-size: 0.68rem; color: var(--stone-400); }
    .ac-hint { font-size: 0.68rem; color: var(--stone-400); flex-shrink: 0; }

    .nav-content { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

    .books-section { padding: 1rem 0.75rem 0.5rem; }
    .books-section:first-child { padding-top: 1.25rem; }
    .books-section:last-child { padding-bottom: 1.25rem; }
    .cat-divider { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
    .cat-divider::before { content: ''; width: 16px; height: 1.5px; background: var(--gold-400); flex-shrink: 0; }
    .cat-divider-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--gold-500); white-space: nowrap; }
    .cat-divider::after { content: ''; flex: 1; height: 1px; background: var(--stone-200); }

    .books-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
    .book-card {
      padding: 0.5rem 0.6rem; background: #fff; border: 1px solid var(--stone-200); border-radius: 6px;
      cursor: pointer; transition: all 0.15s var(--ease-out);
      display: flex; flex-direction: column; gap: 0.2rem; min-height: 62px; justify-content: center;
    }
    .book-card:hover { border-color: var(--stone-300); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
    .book-card.active { border-color: var(--ch-active); background: rgba(139, 26, 26, 0.05); box-shadow: 0 2px 12px rgba(139, 26, 26, 0.08); }
    .book-card-name { font-family: 'gfs_didotitalic', var(--font-serif); font-size: 1.2rem; font-weight: 600; color: var(--stone-700); }
    .book-card.active .book-card-name { color: var(--ch-active); }
    .book-card-sub { font-size: 0.9rem; color: var(--stone-400); }
    .book-card.active .book-card-sub { color: var(--stone-600); }

    .ch-accordion { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s cubic-bezier(0.32, 0.72, 0, 1); }
    .ch-accordion.open { grid-template-rows: 1fr; }
    .ch-accordion-inner { overflow: hidden; }
    .ch-accordion-content { padding: 0 0.25rem; opacity: 0; transform: translateY(-6px); transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s; }
    .ch-accordion.open .ch-accordion-content { padding: 0.6rem 0.25rem 0.25rem; opacity: 1; transform: translateY(0); }
    .ch-acc-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 0.55rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--stone-200); }
    .ch-acc-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; color: var(--stone-800); }
    .ch-acc-label { font-size: 0.68rem; color: var(--stone-400); }
    .ch-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
    .ch-pill {
      width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
      border-radius: 50%; border: 1px solid var(--stone-200); background: #fff;
      font-family: 'gfs_didot', var(--font-serif); font-size: 1rem; font-weight: 500; color: var(--stone-600);
      cursor: pointer; text-decoration: none; transition: all 0.15s var(--ease-out);
      line-height: 1; text-align: center; padding-top: 2px;
    }
    .ch-pill:hover { border-color: var(--stone-600); color: var(--stone-800); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.06); }
    .ch-pill.current { background: var(--ch-active); color: #fff; border-color: var(--ch-active); box-shadow: 0 2px 10px rgba(139, 26, 26, 0.2); }

    .today-strip { display: flex; align-items: center; gap: 1rem; padding: 0.65rem 1.5rem; background: linear-gradient(to right, rgba(42,100,150,0.06), transparent); border-bottom: 1px solid var(--stone-200); }
    .today-strip-left { display: flex; align-items: center; gap: 1rem; flex: 1; }
    .today-strip-link { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 1.4rem; font-weight: 600; color: var(--gold-600); text-decoration: none; }
    .today-strip-link:hover { text-decoration: underline; }
    .today-strip-sep { width: 1px; height: 12px; background: var(--stone-300); }
    .today-strip-cal { display: flex; align-items: center; justify-content: center; border: none; background: transparent; cursor: pointer; color: var(--stone-400); transition: color 0.15s; flex-shrink: 0; padding: 0; position: relative; }
    .today-strip-cal::after { content: ''; position: absolute; top: -2px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: #b72439; }
    .today-strip-cal svg { width: 26px; height: 26px; }
    .today-strip-cal:hover { color: var(--gold-500); }

    .modal-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
    .modal-view.active { display: flex; }
    .nav-header-back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--stone-200); border-radius: 50%; background: #fff; cursor: pointer; color: var(--stone-500); transition: all 0.15s; margin-right: 0.6rem; }
    .nav-header-back:hover { background: var(--stone-100); color: var(--stone-800); }
    .nav-header-left { display: flex; align-items: center; }

    .cal-tabs { display: flex; border-bottom: 1px solid var(--stone-200); background: var(--stone-50); }
    .cal-tab { flex: 1; padding: 0.7rem 0; border: none; background: none; font-size: 1.5rem; font-family: 'cf_dincondensed_light', sans-serif; font-weight: 600; color: var(--stone-400); cursor: pointer; position: relative; text-align: center; transition: color 0.15s; }
    .cal-tab:hover { color: var(--stone-600); }
    .cal-tab.active { color: var(--stone-800); }
    .cal-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 1.5rem; right: 1.5rem; height: 2px; background: var(--stone-800); border-radius: 2px 2px 0 0; }
    .cal-tab[data-tab="liturgical"].active { color: var(--wine-500); }
    .cal-tab[data-tab="liturgical"].active::after { background: var(--wine-500); }
    .cal-tab-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem 1.5rem; }
    .cal-tab-pane { display: none; }
    .cal-tab-pane.active { display: block; }

    .cc-hero { position: relative; padding: 1rem 1.25rem; background: var(--stone-50); border: 1px solid var(--stone-200); border-radius: 10px; margin-bottom: 1.25rem; overflow: hidden; }
    .cc-hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold-400); }
    .cc-hero.liturgical::before { background: var(--wine-500); }
    .cc-hero-badge { font-size: 0.9rem; font-family: 'cf_dincondensed_light', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #b72439; margin-bottom: 0.2rem; }
    .cc-hero-title { font-family: 'gfs_didot', var(--font-serif); font-size: 1.6rem; font-weight: 600; color: var(--stone-800); margin-bottom: 0.4rem; margin-top: 0.4rem; }
    .cc-hero-excerpt { font-family: 'gfs_didot', var(--font-serif); font-size: 1.1rem; color: var(--stone-500); margin-bottom: 0.5rem; }
    .cc-hero-go { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600; color: var(--gold-600); text-decoration: none; }
    .cc-hero-go:hover { text-decoration: underline; }
    .cc-hero.liturgical .cc-hero-go { color: var(--wine-500); }

    .cc-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
    .cc-month-label { font-weight: 600; font-size: 2rem; color: var(--stone-700); }
    .cc-month-arrow { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--stone-200); border-radius: 6px; background: none; cursor: pointer; color: var(--stone-500); font-size: 0.9rem; transition: all 0.12s; }
    .cc-month-arrow:hover { border-color: var(--stone-400); color: var(--stone-800); }

    .cc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
    .cc-dayname { text-align: center; font-size: 1rem; font-weight: 700; color: var(--stone-400); text-transform: uppercase; padding: 0.4rem 0 0.3rem; }
    .cc-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; transition: background 0.12s; padding: 0.45rem 0.2rem; gap: 3px; min-height: 64px; }
    .cc-cell:hover { background: var(--stone-100); }
    .cc-cell.has-reading:hover { background: var(--stone-200); }
    .cc-cell.has-reading:hover .cc-cell-label { color: #0b5192; }
    .cc-cell.empty { cursor: default; min-height: 0; }
    .cc-cell.empty:hover { background: none; }
    .cc-cell-num { font-family: 'gfs_didot', var(--font-serif); font-size: 3rem; font-weight: 500; color: var(--stone-700); line-height: 1; }
    .cc-cell.sun .cc-cell-num { color: var(--wine-500); font-weight: 700; }
    .cc-cell.today { background: var(--stone-800); border-radius: 10px; }
    .cc-cell.today .cc-cell-num { color: #fff; font-weight: 700; }
    .cc-cell-label { font-size: 1.1rem; color: #426d87; font-family: 'cf_dincondensed_light', sans-serif; max-width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; font-weight: 500; }
    .cc-cell.today .cc-cell-label { color: rgba(255,255,255,0.7); }
    .cc-cell.sun .cc-cell-label { color: var(--wine-500); }

    /* Liturgical cards */
    .lit-card {
      padding: 1rem 1.25rem;
      background: var(--stone-50);
      border: 1px solid var(--stone-200);
      border-radius: 8px;
      margin-bottom: 0.75rem;
    }
    .lit-card-label {
      font-family: 'cf_dincondensed_light', sans-serif;
      font-size: 1.1rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--stone-400);
      margin-bottom: 0.3rem;
    }
    .lit-card-title {
      font-family: 'gfs_didot', var(--font-serif);
      font-size: 1.2rem;
      color: var(--stone-800);
      margin-bottom: 0.5rem;
    }
    .lit-card-reading {
      font-family: 'gfs_didot', var(--font-serif);
      font-size: 1rem;
      color: var(--stone-700);
      margin-bottom: 0.2rem;
    }
    .lit-card-next {
      border-color: var(--ch-active);
      border-left: 3px solid var(--ch-active);
    }
    .lit-card-past {
      opacity: 0.5;
    }
    .lit-card-type {
      font-family: 'cf_dincondensed_light', sans-serif;
      font-size: 0.85rem;
      color: var(--ch-active);
      text-transform: uppercase;
      letter-spacing: 0.03em;
      margin-right: 0.4rem;
    }

    @media (max-width: 780px) { .books-grid { grid-template-columns: repeat(3, 1fr); } }
    @media (orientation: landscape) and (max-height: 500px) { .books-grid { grid-template-columns: repeat(3, 1fr); } }
    @media (max-width: 640px) {
      #navOverlay { padding: 0; z-index: 9999; }
      .nav-modal { border-radius: 0; max-height: 100vh; max-width: 100%; }
      .books-section { padding: 0.75rem 0.75rem 0.5rem; }
      .books-grid { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
      .book-card { min-height: 48px; padding: 0.5rem 0.6rem; }
      .book-card-name { font-size: 1rem; }
      .book-card-sub { font-size: 0.75rem; }
      .ch-pill { width: 32px; height: 32px; font-size: 0.75rem; }
      /* Modal header: smaller title, no calendar strip icon */
      .nav-title { font-size: 1rem; }
      .today-strip-cal { display: none; }
      .today-strip-link { font-size: 0.9rem; }
      .today-strip { padding: 0.5rem 0.75rem; gap: 0.5rem; }
      /* Calendar grid: scale down */
      .cc-cell-num { font-size: 2rem; }
      .cc-cell-label { font-size: 0.7rem; }
      .cc-month-label { font-size: 1.4rem; }
      .cc-dayname { font-size: 0.8rem; }
      .cc-grid { overflow-x: hidden; }
      /* Hero card */
      .cc-hero-title { font-size: 1.2rem; }
      .cc-hero-badge { font-size: 0.75rem; }
      .cc-hero-excerpt { font-size: 0.9rem; }
      .cc-hero-go { font-size: 0.7rem; }
      /* Cal tabs */
      .cal-tab { font-size: 1.1rem; }
    }

