/*
 * mobile.css — phone-only refinements for The Hour Brief.
 *
 * Loaded as <link rel="stylesheet" href="/mobile.css" media="(max-width: 640px)">,
 * so every rule here already applies only at <=640px. Desktop and tablet render
 * from the page's own inline <style>, untouched.
 *
 * The premium skin (fonts, palette, app bar, tab bar, cards) is /app.css; only phone layout lives here.
 * Companion behaviour (clamped summaries, the About/lane "More" toggles) lives in
 * /mobile.js. Shared reader components live in /reader.css (imported below). App-only
 * native touches live in /capacitor-bridge.js.
 */
@import url("/reader.css");
@import url("/app.css");

/* ---- Platform polish ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
a, button, summary, .vote-btn, .nav a, .about-toggle {
  -webkit-tap-highlight-color: transparent;
}

/* ---- Masthead is the app bar (see app.css); the tagline never changes day to day ---- */
.tagline { display: none; }

/* ---- About: evergreen boilerplate, clamped with a toggle ---- */
.about {
  padding: 12px 0;
  margin-bottom: 0;
  border-bottom: none;
}
.about p {
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.about.is-expanded p {
  -webkit-line-clamp: unset;
  overflow: visible;
}
.about .free-line { display: none; }
.about-toggle {
  margin-top: 6px;
  font: inherit;
  font-size: 0.8rem;
  background: none;
  border: 0;
  color: var(--brand);
  padding: 6px 0;
  min-height: 40px;
  cursor: pointer;
}

/* ---- Page gutters ---- */
.page {
  padding-left: 16px;
  padding-right: 16px;
  gap: 0;
}

/* ---- Lane nav: one scrolling row, clears the status bar in-app ---- */
.nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  top: env(safe-area-inset-top, 0px);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

/* ---- Sections: headers clear the sticky nav ---- */
section.lane { scroll-margin-top: 64px; }
.lane-head h2 {
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.4;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.lane-head.is-expanded h2 { -webkit-line-clamp: unset; overflow: visible; }
.lane-more {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  background: none;
  border: 0;
  color: var(--brand);
  margin: 2px 0 0 17px;
  padding: 6px 0;
  min-height: 40px;
  cursor: pointer;
}
.lane-more[hidden] { display: none; }

/* ---- Items: reclaim the dot gutter, scannable headlines ---- */
.item {
  grid-template-columns: 1fr;
  gap: 0;
}
.item .dot { display: none; }
.item p { max-width: none; }
.item .takeaway { max-width: none; }

/* ---- Story layout: natural reading order (wired in /mobile.js) ----
   headline -> summary -> [Read more] -> takeaway, then the source and the vote
   buttons share one row. Collapsed, only the summary is clamped to 4 lines;
   the takeaway always stays visible and always follows the facts it comments on. */
.item > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
}
.item > div > :not(.src):not(.vote-row) { grid-column: 1 / -1; }
.item > div > .src { grid-column: 1; }
.item > div > .vote-row { grid-column: 2; margin-top: 8px; }

.item .story-body > p:first-child { margin-top: 6px; }
.item .story-body > p + p { margin-top: 8px; }

/* ---- Touch targets ---- */
.vote-row { gap: 10px; margin-top: 14px; }
.vote-btn {
  padding: 10px 16px;
  font-size: 0.85rem;
  min-height: 44px;
  border-radius: 22px;
}
.item .src { font-size: 0.82rem; }
.item .src a { display: inline-block; padding: 8px 0; }

/* ---- Inputs: no iOS focus-zoom (needs >=16px), full-width actions ---- */
.subscribe-form { flex-direction: column; gap: 10px; }
.subscribe-form input[type="email"] { flex: 1 1 auto; font-size: 16px; padding: 12px; }
.subscribe-form button { width: 100%; padding: 13px; font-size: 16px; }
.comment-form input, .comment-form textarea { font-size: 16px; padding: 12px; }
.comment-form button { align-self: stretch; width: 100%; padding: 13px; font-size: 16px; }

/* ---- Density ---- */
.subscribe-box { margin-top: 24px; padding: 16px; }
.comments-section { margin-top: 36px; }
.ticker { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.ticker > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---- Archive list + about page (their own layouts) ---- */
.archive-banner { padding: 10px 16px; font-size: 0.8rem; }
.edition-card { padding: 14px 16px; }
.page > h1 { font-size: 1.5rem; }
.lede { font-size: 1rem; }
