/* Festival Gazette — mobile text scale + Aa control
   Evan CLEAR 2026-09-30: Aa mounts in .fg-ask-bar-end (right of About icon) when bar exists;
   else action utility column. Never a row above Ask.
   Keep phone chrome bumps + mute-strong + rem hygiene from deploy 0e893a54.
   Load LAST so phone bumps beat inline C2c. Never text-size-adjust:none. */

html {
  --fs: 1;
}
html[data-text-scale="default"] { --fs: 1; }
html[data-text-scale="larger"],
html[data-text-scale="a-plus"] { --fs: 1.12; }
html[data-text-scale="largest"],
html[data-text-scale="a-plus-plus"] { --fs: 1.25; }

/* ——— Aa action utility ——— */
/* When in .fg-ask-bar, mount must stay STATIC so pop uses bar as containing
   block (Evan 2026-09-30). Relative mount + left/right insets collapsed the
   pop to ~30px → sideways "Text size" + clipped labels. */
[data-aa-mount] {
  position: relative;
  display: inline-flex;
}
.fg-ask-bar [data-aa-mount].fg-ask-bar-aa,
.fg-ask-bar .fg-ask-bar-aa {
  position: static !important;
  display: inline-flex;
}
/* Non-bar fallbacks still need a relative anchor */
body.hub-a1 .a1-mark-actions [data-aa-mount] {
  position: relative;
  display: inline-flex;
}
/* Aa uses same .a1-util box as About/Share; glyph is ink-circle SVG */
.a1-util.util-aa {
  /* inherit hub-chrome .a1-util size */
}
.a1-util.util-aa svg {
  display: block;
}
.a1-util.util-aa[aria-expanded="true"] { background: rgba(26, 21, 16, 0.06); }
.a1-util.util-aa:hover { background: rgba(26, 21, 16, 0.05); }
.a1-util.util-aa:focus-visible {
  outline: 2px solid var(--rust, #9C341F);
  outline-offset: 2px;
}
body.trial-paper .aa-paper-util-col {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}
body.trial-paper .aa-paper-util-col [data-aa-mount] { position: relative; }

/* Text size pop — cream/ink, share socials-pop family.
   Bar pop geometry lives in hub-chrome (.fg-ask-bar-aa-pop). */
.aa-text-pop {
  left: auto;
  right: 0;
  transform: none;
  box-sizing: border-box;
  min-width: 220px;
  width: min(280px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 14px 14px 16px;
  background: #fffdf8;
  z-index: 50;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  overflow: visible;
}
.aa-text-pop::before {
  left: auto;
  right: 14px;
  margin-left: 0;
}
.aa-text-pop .sp-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  writing-mode: horizontal-tb;
}
.aa-text-pop .sp-title {
  writing-mode: horizontal-tb;
  white-space: nowrap;
  margin: 0;
}
/* Non-bar: anchored to util under Share / paper tools */
body.hub-a1 .a1-mark-actions [data-aa-mount] .aa-text-pop,
body.trial-paper .aa-paper-util-col .aa-text-pop {
  top: calc(100% + 8px);
  bottom: auto;
  z-index: 50;
}
.aa-size-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  writing-mode: horizontal-tb;
}
.aa-size-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.35px solid var(--ink, #1A1510);
  border-radius: 10px;
  background: var(--cream, #FBF7EE);
  cursor: pointer;
  text-align: left;
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  color: var(--ink, #1A1510);
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}
.aa-size-btn .aa-glyph {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.aa-size-btn[aria-pressed="true"] {
  border-color: var(--rust, #9C341F);
  border-width: 2px;
  box-shadow: inset 0 -3px 0 var(--rust, #9C341F);
  background: #fff;
}
.aa-size-btn:focus-visible {
  outline: 2px solid var(--rust, #9C341F);
  outline-offset: 2px;
}

/* ——— First-visit soft sheet (Mock 2) ——— */
.aa-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(26, 21, 16, 0.18);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px 96px;
  box-sizing: border-box;
  pointer-events: auto;
}
.aa-scrim[hidden] {
  display: none !important;
}
.aa-sheet {
  width: 100%;
  max-width: 340px;
  background: #fffdf8;
  border: 1.15px solid var(--ink, #1A1510);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(26, 21, 16, 0.18);
  padding: 18px 16px 16px;
  animation: aa-rise 0.28s ease-out;
}
@keyframes aa-rise {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.aa-sheet h2 {
  margin: 0 0 6px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 20px;
  line-height: 1.15;
  color: var(--ink, #1A1510);
}
.aa-sheet-lead {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--mute-strong, #4A443C);
  font-family: "Newsreader", Georgia, serif;
}
.aa-sheet-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}
.aa-choice {
  min-height: 52px;
  width: 100%;
  padding: 12px 14px;
  border: 1.35px solid var(--ink, #1A1510);
  border-radius: 10px;
  background: var(--cream, #FBF7EE);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: "Newsreader", Georgia, serif;
  color: var(--ink, #1A1510);
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}
.aa-choice strong {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 16px;
}
.aa-choice span {
  font-size: 13px;
  color: var(--mute, #5C554C);
}
.aa-choice:focus-visible,
.aa-choice[aria-pressed="true"] {
  border-color: var(--rust, #9C341F);
  border-width: 2px;
  box-shadow: inset 0 -3px 0 var(--rust, #9C341F);
  background: #fff;
}
.aa-default-link {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: "Barlow", system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--mute-strong, #4A443C);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin: 0 0 10px;
  text-transform: none;
  letter-spacing: normal;
  padding: 8px 0;
}
.aa-dont-ask {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
  color: var(--mute-strong, #4A443C);
  cursor: pointer;
  font-family: "Newsreader", Georgia, serif;
}
.aa-dont-ask input {
  width: 18px;
  height: 18px;
  accent-color: var(--rust, #9C341F);
}
.aa-sheet-foot {
  margin: 12px 0 0;
  text-align: right;
}
.aa-dismiss {
  font-family: "Barlow", system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--mute, #5C554C);
  border: 0;
  background: transparent;
  cursor: pointer;
  min-height: 40px;
  padding: 8px 4px;
  text-transform: none;
  letter-spacing: normal;
}

/* Legacy Text · A/A+/A++ strip — hide if any remnant markup remains */
.text-size-row,
.text-size {
  display: none !important;
}

/* Desktop: denser bases stay; --fs still multiplies reading roles */
@media (min-width: 721px) {
  body.trial-paper { font-size: calc(17px * var(--fs)); }
  body.trial-paper .who,
  body.trial-paper .who-chip {
    font-size: min(15.5px, calc(11px * var(--fs)));
  }
  body.trial-paper .type,
  body.trial-paper .card-type {
    font-size: calc(12px * var(--fs));
  }
  body.trial-paper .meta,
  body.trial-paper .card > .meta {
    font-size: calc(15.5px * var(--fs));
    line-height: 1.45;
  }
  body.trial-paper .meta .row:not(.when) .v {
    font-size: calc(15.5px * var(--fs));
    line-height: 1.45;
  }
  body.trial-paper .meta .row .k,
  body.trial-paper .meta .k,
  body.trial-paper .k {
    font-size: min(15px, calc(11px * var(--fs)));
  }
  body.trial-paper .why,
  body.trial-paper .card > .why {
    font-size: calc(17px * var(--fs));
    line-height: 1.5;
  }
  body.trial-paper .ink-kicker,
  body.trial-paper .card > .ink-kicker {
    font-size: calc(16px * var(--fs));
  }
}

/* Phone ≤720px — locked default chrome bump + --fs multipliers */
@media (max-width: 720px) {
  :root {
    --mute-strong: #4A443C;
  }

  body.trial-paper {
    font-size: calc(18px * var(--fs));
    line-height: 1.5;
  }

  body.trial-paper .who,
  body.trial-paper .who .chip,
  body.trial-paper .legend .who,
  body.trial-paper .legend .who .chip,
  body.trial-paper .who-chip {
    font-size: min(15.5px, calc(12.5px * var(--fs)));
  }

  body.trial-paper .type,
  body.trial-paper .card-type {
    font-size: calc(13.5px * var(--fs));
    color: var(--mute-strong);
    font-weight: 500;
  }
  body.trial-paper .lab,
  body.trial-paper .must-flag {
    font-size: min(15.5px, calc(12.5px * var(--fs)));
  }

  body.trial-paper .meta,
  body.trial-paper .card > .meta {
    font-size: calc(16.5px * var(--fs));
    line-height: 1.5;
  }
  body.trial-paper .meta .row:not(.when) .v {
    font-size: calc(16.5px * var(--fs));
    font-weight: 500;
    line-height: 1.5;
    color: var(--mute-strong);
  }

  body.trial-paper .meta .row .k,
  body.trial-paper .meta .k,
  body.trial-paper .k {
    font-size: min(15px, calc(12px * var(--fs)));
  }

  body.trial-paper .why,
  body.trial-paper .card > .why {
    font-size: calc(17.5px * var(--fs));
    line-height: 1.5;
  }

  body.trial-paper .ink-kicker,
  body.trial-paper .card > .ink-kicker {
    font-size: calc(16.5px * var(--fs));
    line-height: 1.45;
  }

  body.trial-paper .ask-filter-btn,
  body.trial-paper .paper-hub-ask .ask-suggest [data-ask-try],
  body.hub-a1 .ask-filter-btn,
  body.hub-a1 .ask-suggest [data-ask-try] {
    font-size: calc(14px * var(--fs));
  }
  body.trial-paper .paper-hub-ask .ask-go,
  body.hub-a1 .ask-pill .ask-go {
    font-size: calc(14px * var(--fs));
  }

  body.hub-a1 .ask-place-line,
  body.hub-a1 .ask-summary {
    font-size: calc(14px * var(--fs));
  }

  /* H3: leave alone at default/larger; ≤+6% at largest only */
  html[data-text-scale="largest"] body.trial-paper .card > h3,
  html[data-text-scale="largest"] body.trial-paper h3,
  html[data-text-scale="a-plus-plus"] body.trial-paper .card > h3,
  html[data-text-scale="a-plus-plus"] body.trial-paper h3 {
    font-size: clamp(calc(22px * 1.06), calc(4.6vw * 1.06), calc(28px * 1.06));
  }
}

/* ——— Ask search results honor --fs (hub R1 + paper ask-hit) ———
   Was missing from first text-scale ship; Evan 2026-09-21. */
.r1-title {
  font-size: clamp(calc(18px * var(--fs)), calc(4.5vw * var(--fs)), calc(22px * var(--fs)));
  line-height: 1.2;
}
.r1-whenwhere {
  font-size: calc(14px * var(--fs));
  line-height: 1.45;
}
.r1-meta,
.r1-cost,
body.hub-a1 .r1-cost {
  font-size: calc(13px * var(--fs));
  line-height: 1.45;
}
.r1-open,
body.hub-a1 .r1-open,
.r1-paper {
  font-size: calc(14px * var(--fs));
}
.r1-footer,
.r1-more {
  font-size: calc(13px * var(--fs));
}
body.hub-a1 .ask-miss,
body.hub-a1 .ask-wait {
  font-size: calc(16px * var(--fs));
  line-height: 1.45;
}
body.hub-a1 .ask-summary,
body.hub-a1 .ask-summary-row .ask-summary {
  font-size: calc(15px * var(--fs));
}
body.hub-a1 .ask-place-line,
body.hub-a1 .ask-place-line.ask-place-under-filter {
  font-size: calc(13px * var(--fs));
}

body.trial-paper .ask-panel .ask-hit h4 {
  font-size: calc(16px * var(--fs));
  line-height: 1.25;
}
body.trial-paper .ask-panel .ask-hit p {
  font-size: calc(14px * var(--fs));
  line-height: 1.45;
}
body.trial-paper .ask-panel .ask-hit .k {
  font-size: min(15px, calc(11px * var(--fs)));
}
body.trial-paper .ask-panel .ask-miss,
body.trial-paper .ask-panel .ask-empty,
body.trial-paper .ask-panel .ask-wait {
  font-size: calc(15px * var(--fs));
  line-height: 1.45;
}
