/* The wide screen (design canvas "Daily Word - Site Shell": wide-home-a, wide-history, wide-generate; design system
   README "Layout" and patterns.md "Wide top bar"). Loaded last. Every rule is behind min-width: 1024px, so a phone
   (390 px) and the 760 px tablet rule in site.css are untouched. The background spans the window; the inner
   container carries wide-max (1280 px) with 40 px padding. Only theme tokens; no colors are written here. */

/* The search link's word is for the wide bar only. */
.nav-search-t, .top-nav { display: none; }

@media (min-width: 1024px) {
  :root { --wide-max: 1280px; --wide-pad: 40px; }

  /* ---- the top bar: 72 px, the same container as the page ---------------------------------------------- */
  .top, .top.top-page {
    height: 72px; border-bottom: 1px solid var(--line); gap: 24px;
    padding: 0 max(var(--wide-pad), calc((100% - var(--wide-max)) / 2 + var(--wide-pad)));
  }
  .top.top-scrolled { border-bottom-color: var(--line); }
  .brand { font-size: 22px; flex: none; }
  .top-nav { display: flex; align-self: stretch; gap: 22px; margin: 0 auto; }
  .top-nav a, .top-nav button {
    display: flex; align-items: center; margin-bottom: -1px; border-bottom: 2px solid transparent;
    font: 400 14px/1.2 var(--ui); color: var(--muted); text-decoration: none; white-space: nowrap;
  }
  /* Sign out (login), last in the bar: a button styled as one of its links. */
  .top-nav button { border-top: 0; border-left: 0; border-right: 0; background: none; padding: 0; cursor: pointer; }
  .top-nav a:hover, .top-nav button:hover { color: var(--text); }
  .top-nav a:focus-visible, .top-nav button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 4px; }
  body[data-view="home"] .top-nav [data-view="home"],
  body[data-view="history"] .top-nav [data-view="history"],
  body[data-view="ask"] .top-nav [data-view="ask"],
  body[data-view="upnext"] .top-nav [data-view="upnext"],
  body[data-view="verses"] .top-nav [data-view="verses"],
  body[data-view="notes"] .top-nav [data-view="notes"],
  body[data-view="settings"] .top-nav [data-view="settings"] { color: var(--text); border-bottom-color: var(--gold); }
  /* A day or study keeps its own bar (back link, where you are) and the menu button, whose sheet holds the sections. */
  .top.top-page .top-nav { display: none; }
  .top:not(.top-page) .nav-btn { display: none; }
  .nav-search { width: auto; flex: none; }
  .nav-search-t { display: inline; }
  .top:not(.top-page) .nav-search {
    display: inline-flex; align-items: center; width: 220px; height: 42px; padding: 0 12px; justify-content: flex-start; gap: 8px;
    border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--muted);
    font: 400 14px/1 var(--ui); text-decoration: none;
  }
  .top:not(.top-page) .nav-search:hover { background: var(--raised); }
  .top.top-page .nav-search-t { display: none; }
  /* The menu sheet is a panel under the right edge of the bar, not a full-width sheet. */
  .nav-sheet {
    top: 80px; bottom: auto; left: auto; width: 360px; max-height: calc(100vh - 96px);
    right: max(var(--wide-pad), calc((100% - var(--wide-max)) / 2 + var(--wide-pad)));
    border: 1px solid var(--line); border-radius: 14px; padding-bottom: 8px;
  }
  body.nav-open { overflow: auto; }

  /* ---- the container ------------------------------------------------------------------------------------ */
  body[data-view="home"] .wrap, body[data-view="history"] .wrap { max-width: var(--wide-max); padding: 40px var(--wide-pad) 80px; }
  body[data-view="ask"] .wrap, body[data-view="upnext"] .wrap, body[data-view="verses"] .wrap,
  body[data-view="notes"] .wrap, body[data-view="settings"] .wrap, body[data-view="search"] .wrap {
    max-width: 760px; padding-left: var(--wide-pad); padding-right: var(--wide-pad);
  }
  body[data-view="ask"] .wrap { padding-top: 24px; }

  /* ---- Home: the main column and the aside -------------------------------------------------------------- */
  .hm:not(.hm-first) { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 48px; }
  .hm-main { display: flex; flex-direction: column; gap: 18px; flex: 999 1 560px; min-width: 0; }
  .hm-aside { display: flex; flex-direction: column; gap: 24px; flex: 1 1 340px; min-width: 0; }
  .hm-lately { margin-top: 0; }
  .hm-main .hm-h1 { font-size: 44px; line-height: 1.1; }
  .hm-main .hm-lead { padding: 32px; gap: 14px; }
  .hm-main .hm-title-lead { font-size: 38px; line-height: 1.1; }
  .hm-main .hm-card:not(.hm-lead) { padding: 22px; }
  .hm-main .hm-title { font-size: 26px; }
  /* The first morning and an empty site have no aside: one centered column. */
  .hm-first { max-width: 720px; margin: 0 auto; }

  /* ---- History: the list becomes a table ---------------------------------------------------------------- */
  .history h1 { font-size: 40px; }
  .hi-head, .hi-row {
    display: grid; grid-template-columns: 92px 90px minmax(0, 1fr) 200px 80px; column-gap: 16px; align-items: baseline;
  }
  .hi-head { padding: 10px 0; margin-top: 16px; border-bottom: 1px solid var(--line-strong); font: 500 12px/1.3 var(--ui); color: var(--muted); }
  .hi-row { padding: 11px 0; }
  .hi-date, .hi-range, .hi-opened { display: block; font: 400 12px/1.4 var(--ui); }
  .hi-date { grid-column: 1; color: var(--muted); }
  .hi-tag { grid-column: 2; width: auto; padding-top: 0; }
  .hi-main { grid-column: 3; }
  .hi-meta, .hi-dot { display: none; }
  .hi-detail { display: block; font: 400 12px/1.4 var(--ui); color: var(--muted); }
  .hi-detail:empty { display: none; }
  .hi-range { grid-column: 4; color: var(--gold); }
  .hi-opened { grid-column: 5; color: var(--muted); }
  .hi-opened-new { color: var(--gold); }
  .hi-row:hover { background: var(--panel); }
  .hi-week { padding-top: 28px; }
}
