/* Mainsail News — header v2 (proposal, Nov 16 2026)
 * Masthead: date "ear" left, logo centre, About / Puzzles / search / moon right.
 * Section bar: its own full-width row, one type style, thin rule above,
 * double rule below. Phones: one swipeable row instead of four wrapped lines.
 * Loads after redesign.css. Uses the existing --m-* colour variables, so dark
 * mode follows automatically.
 * Header text (masthead date, About/Puzzles, section labels, and the slim
 * scroll-down bar on this page) is IvyPresto Headline, same kit as The Helm.
 * Headlines and story links stay Adobe Caslon via redesign.css. */
.mh { background: var(--m-paper); color: var(--m-text); }
.mh-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  column-gap: 20px; padding: 16px 26px 12px;
}
.mh-logo { margin: 0; line-height: 0; grid-column: 2; }
.mh-logo .site-logo { display: block; width: 540px; max-width: 100%; margin: 0 auto; }
.mh-logo .site-logo picture, .mh-logo .site-logo img { max-width: 100%; }
.mh-date {
  grid-column: 1; grid-row: 1; margin: 0; text-align: left;
  font: 400 15px/1.3 "ivypresto-headline", "adobe-caslon-pro", "Adobe Caslon Pro", "Libre Caslon Text", Georgia, serif; color: var(--m-text);
}
.mh-date span { display: block; }
.mh-date .mh-day { font-weight: 600; }
.mh-date .mh-edition { font-style: italic; color: var(--m-src); }
.mh-tools { grid-column: 3; grid-row: 1; justify-self: end; font: 600 16px/1 "ivypresto-headline", "adobe-caslon-pro", "Adobe Caslon Pro", "Libre Caslon Text", Georgia, serif; }
.mh-tools ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.mh-tools a { display: inline-block; padding: 8px 8px; text-decoration: none; white-space: nowrap; }
.mh-tools a:link, .mh-tools a:visited { color: var(--m-link); }
.mh-tools a:hover { color: var(--m-link-hover); text-decoration: underline; text-underline-offset: 4px; }
.mh-tools .mh-icons { display: flex; align-items: center; gap: 8px; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--m-rule); }
.mh-tools .search-toggle, .mh-tools .theme-toggle { width: 32px; height: 32px; margin: 0; }

/* ---- section bar ---- */
.mh-bar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 50;
  background: var(--m-paper);
  border-top: 1px solid var(--m-rule);
  border-bottom: 3px double var(--m-rule-strong);
}
html.slim-active .mh-bar { position: relative; }
.mh-bar .section-bar {
  border: 0; padding: 0 14px; margin: 0 auto; max-width: 1280px;
  display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center;
  font: 600 12.5px/1 "ivypresto-headline", "adobe-caslon-pro", "Adobe Caslon Pro", "Libre Caslon Text", Georgia, serif; letter-spacing: .07em; text-transform: uppercase;
}
.mh-bar .section-bar ul {
  list-style: none; margin: 0 !important; padding: 0; display: contents;
  font-size: inherit; font-weight: inherit;
}
.mh-bar .section-bar a {
  display: block; padding: 12px 6px 11px; white-space: nowrap; text-decoration: none;
  color: var(--m-link); position: relative;
}
.mh-bar .section-bar a::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 5px; height: 2px;
  background: var(--m-link-hover); transform: scaleX(0); transition: transform .15s ease;
}
.mh-bar .section-bar a:hover { color: var(--m-link-hover); text-decoration: none; }
.mh-bar .section-bar a:hover::after, .mh-bar .section-bar a:focus-visible::after { transform: scaleX(1); }
.mh-bar .site-search { border-top: 1px solid var(--m-rule); }
.mh-date span.mh-long, .mh-date span.mh-short { white-space: nowrap; }
.mh-date span.mh-short { display: none; }

/* ---- 700–1279px: two even, centred rows of six ---- */
@media screen and (max-width: 1279px) {
  .mh-bar .section-bar { display: block; padding: 5px 8px; font-size: 13px; letter-spacing: .09em; }
  .mh-bar .section-bar ul { display: flex; flex-wrap: nowrap; justify-content: center; }
  .mh-bar .section-bar a { padding: 8px 13px 7px; }
  .mh-bar .section-bar a::after { left: 13px; right: 13px; bottom: 2px; }
  .mh-logo .site-logo { width: 470px; }
}
@media screen and (max-width: 999px) {
  .mh-bar .section-bar { font-size: 12.5px; letter-spacing: .07em; }
  .mh-bar .section-bar a { padding: 8px 8px 7px; }
  .mh-bar .section-bar a::after { left: 8px; right: 8px; }
}
/* ---- under 1100px: logo on top, date + tools share the line beneath ---- */
@media screen and (max-width: 1099px) {
  .mh-top { grid-template-columns: 1fr auto; row-gap: 8px; padding: 12px 16px 8px; }
  .mh-logo { grid-column: 1 / -1; grid-row: 1; }
  .mh-logo .site-logo { width: 460px; }
  .mh-date { grid-column: 1; grid-row: 2; font-size: 14px; }
  .mh-tools { grid-column: 2; grid-row: 2; font-size: 15px; }
}
/* ---- phones: one swipeable row of sections ---- */
@media screen and (max-width: 819px) {
  .mh-top { padding: 10px 12px 8px; column-gap: 8px; }
  .mh-date { font-size: 13.5px; }
  .mh-tools a { padding: 8px 6px; }
  .mh-tools .mh-icons { margin-left: 4px; padding-left: 10px; gap: 6px; }
  .mh-bar .section-bar {
    display: flex; justify-content: flex-start; max-width: none; padding: 0 30px 0 4px; font-size: 12.5px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  }
  .mh-bar .section-bar::-webkit-scrollbar { display: none; }
  .mh-bar .section-bar ul { display: contents; }
  .mh-bar .section-bar a { padding: 13px 9px 12px; }
  .mh-bar .section-bar a::after { display: none; }
}
@media screen and (max-width: 479px) {
  .mh-date span.mh-long { display: none; }
  .mh-date span.mh-short { display: block; }
  .mh-date .mh-edition { white-space: nowrap; }
}

/* ---- bolder icons: solid crescent moon, heavier ring ---- */
.mh-tools .search-toggle, .mh-tools .theme-toggle,
.slim-tools .search-toggle, .slim-tools .theme-toggle { border-width: 1.5px; border-color: currentColor; }
.theme-toggle .theme-icon-moon svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.theme-toggle .theme-icon-sun svg { width: 19px; height: 19px; stroke-width: 2.2; }

/* Slim scroll-down bar (built by mainsail.js) should match the new header type
   on pages that load this file. Other pages keep Caslon from redesign.css. */
.slim-bar,
.slim-menu {
  font-family: "ivypresto-headline", "adobe-caslon-pro", "Adobe Caslon Pro", "Libre Caslon Text", Georgia, serif;
}
.slim-menu-btn {
  font-family: "ivypresto-headline", "adobe-caslon-pro", "Adobe Caslon Pro", "Libre Caslon Text", Georgia, serif;
}
.slim-wordmark {
  font-family: "ivypresto-headline", "adobe-caslon-pro", "Adobe Caslon Pro", "Libre Caslon Text", Georgia, serif;
}

/* ---- current page (About / Puzzles) ---- */
.mh-tools a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
/* ---- pages with no date in the masthead (Puzzles): tools centre under the logo on narrow screens ---- */
@media screen and (max-width: 1099px) {
  .mh-nodate .mh-top { grid-template-columns: minmax(0, 1fr); }
  .mh-nodate .mh-tools { grid-column: 1; justify-self: center; }
}

/* ---------- Puzzles pill (Nov 18, 2026) ----------
 * Filled flag-stripe red #BC0830, white text, A2 mini crossword icon:
 * 2x2 with thin frame and gridlines, top-left cell filled flush
 * (edge to edge, no inset gap).
 * Desktop: [Puzzles pill] | About | search | moon
 *   (pill before About so it does not read as "About Puzzles";
 *   thin divider between them.)
 * Mobile (<=1099px): pill on the date row with search and moon;
 *   About moves into the section bar (.sb-about).
 * Contrast: white on #BC0830 is 6.53:1 (WCAG AA).
 * Icon size: 16px desktop, 15px at <=1099px.
 * Apply on top of live v136 (6 PM evening edition); do not deploy until approved.
 */
a.puzzles-pill,
.mh-tools a.puzzles-pill,
.mh-tools a.puzzles-pill:link,
.mh-tools a.puzzles-pill:visited,
.mh-tools a.puzzles-pill:hover {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 13px !important;
  border-radius: 999px;
  font: 600 15px/1 "ivypresto-headline", "adobe-caslon-pro", "Adobe Caslon Pro", "Libre Caslon Text", Georgia, serif;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  background: #BC0830 !important;
  background-color: #BC0830 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  border: 1.5px solid #BC0830;
  box-sizing: border-box;
}
.puzzles-pill .xw-icon,
.puzzles-pill svg { width: 16px; height: 16px; flex: 0 0 16px; display: block; overflow: visible; }
.mh-tools .puzzles-pill:hover { filter: brightness(1.08); }
.mh-tools .mh-about {
  margin-left: 2px;
  padding-left: 14px;
  border-left: 1px solid var(--m-rule);
}
.sb-about { display: none; }
@media screen and (max-width: 1099px) {
  .mh-about { display: none; }
  .sb-about { display: list-item; }
  a.puzzles-pill,
  .mh-tools a.puzzles-pill {
    padding: 5px 11px !important;
    font-size: 14px;
    gap: 5px;
  }
  .puzzles-pill .xw-icon,
  .puzzles-pill svg { width: 15px; height: 15px; flex-basis: 15px; }
}
@media screen and (max-width: 479px) {
  a.puzzles-pill,
  .mh-tools a.puzzles-pill { padding: 5px 10px !important; font-size: 13.5px; }
}

.mh-tools a.puzzles-pill[aria-current="page"] {
  text-decoration: none !important;
  filter: brightness(1.08);
}


/* ---------- Nav fix (Nov 19, 2026) ----------
 * Desktop section bar typography and layout are the pre-v141 styles
 * (12.5px IvyPresto, letter-spacing .07em, space-between gaps).
 * These rules only keep Puzzles/About alignment in the dropdown and
 * hide .mh-about there on smaller screens. About last after Florida,
 * the "About Mainsail News" dropdown label, and no "More sections"
 * live in the HTML and mainsail.js.
 */
@media screen and (min-width: 1280px) {
  /* Desktop only (Nov 19, 2026): slightly larger labels, same
     .07em tracking, uppercase, and space-between gaps. */
  .mh-bar .section-bar { font-size: 14.5px; }
}
@media screen and (min-width: 801px) {
  .slim-menu .slim-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .slim-menu .slim-main li {
    display: flex;
    align-items: center;
  }
  .slim-menu .slim-main a:not(.puzzles-pill) {
    display: inline-flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    min-height: 31px;
    line-height: 1;
  }
  .slim-menu .sb-primary,
  .slim-menu .sb-secondary {
    font-size: 18px;
  }
}

@media screen and (max-width: 1099px) {
  .slim-menu li.mh-about { display: none; }
}
