/* Overrides: loaded last on every page, after the Fable pages' own styles */

/* Text: no single word left alone on the last line */
li, dd, dt, figcaption, .lead, .pill { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }

/* Page titles use the width they have */
.svc-hero h1 { max-width: 22ch; }
.svc-hero .lead { max-width: 50rem; margin-inline: auto; }
.page-hero h1 { max-width: 24ch; }
.page-hero .lead { max-width: 48rem; }
.split-head h2 { max-width: 18ch; }
.split-head .lead { max-width: 34rem; }
.section-head { max-width: 52rem; }

/* Footer: one short block on phones */
.footer-base { margin-top: 12px; color: var(--ink); }
.footer-compact { display: none; }
@media (max-width: 640px) {
  .site-footer { padding-block: 40px 24px; }
  .footer-grid { gap: 0; }
  .footer-col { display: none; }
  .footer-brand img { height: 30px; margin-bottom: 12px; }
  .footer-brand p:not(.footer-base) { display: none; }
  .footer-base { margin-top: 0; color: var(--muted); }
  .footer-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 20px; }
  .footer-compact a { padding-block: 7px; color: var(--ink); text-decoration: none; }
  .footer-legal { gap: 4px 20px; margin-top: 20px; padding-top: 16px; }
}

/* FAQ: a contact card under the heading, held in view while the answers scroll */
.faq-aside { margin-top: 32px; padding: 24px; border-radius: var(--r-panel); background: var(--paper); }
.section-paper .faq-aside { background: var(--white); }
.faq-aside .faces { margin-bottom: 16px; }
.faq-aside h3 { font-size: 1.125rem; line-height: 1.35; }
.faq-aside p { margin-top: 6px; color: var(--muted); }
.faq-aside .btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.faq-aside .faq-mail { margin-top: 16px; font-size: .9375rem; }
.faq-mail a { color: var(--blue); }
@media (min-width: 1001px) {
  .faq-grid > div:first-child { position: sticky; top: calc(var(--header-h) + 32px); }
}
@media (max-width: 1000px) {
  .faq-grid { gap: 0; }
  .faq-grid > div:first-child { display: contents; }
  .faq-grid .faq { order: 1; margin-top: 32px; }
  .faq-aside { order: 2; }
}

/* Where we work: in person on the Coast, by video call everywhere else */
.area-groups { display: grid; gap: 32px; }
.area-groups h3 { font-size: 1rem; line-height: 1.4; }
.area-groups .area { margin-top: 12px; }
.area-remote .pill { border-style: dashed; background: var(--paper); }

/* Trusted by: one line, turning into a slow carousel when the logos don't fit */
.logo-viewport { flex: 1; min-width: 0; display: flex; }
.logos.is-measuring .logo-row { flex: none; flex-wrap: nowrap; justify-content: flex-start; width: max-content; }
.logos.is-marquee .logo-viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.logos.is-marquee .logo-row { flex: none; flex-wrap: nowrap; justify-content: flex-start; width: max-content; padding-right: var(--logo-gap, 48px); gap: var(--logo-gap, 48px); animation: logo-scroll var(--dur, 30s) linear infinite; }
.logos.is-marquee .logo-viewport:hover .logo-row { animation-play-state: paused; }
.logos.is-scroll .logo-viewport { overflow-x: auto; scrollbar-width: none; }
.logos.is-scroll .logo-row { flex: none; flex-wrap: nowrap; width: max-content; }
@keyframes logo-scroll { to { transform: translateX(-100%); } }
@media (max-width: 1099px) {
  .logo-viewport { width: 100%; }
  .logo-row { flex-wrap: nowrap; }
}

/* Photos */
.ind-block .ind-photo { margin: 24px 0 0; max-width: 420px; aspect-ratio: 4 / 3; border-radius: var(--r-card); overflow: hidden; background: var(--raised); }
.ind-block .ind-photo img { width: 100%; height: 100%; object-fit: cover; }
.wide-photo { margin: clamp(40px, 4vw + 16px, 72px) 0 0; aspect-ratio: 21 / 9; border-radius: var(--r-panel); overflow: hidden; background: var(--raised); }
.wide-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) {
  .wide-photo { aspect-ratio: 4 / 3; }
}

/* Links on navy */
.section-navy p a:not(.btn) { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.section-navy p a:not(.btn):hover { color: var(--on-navy); }
@media (max-width: 640px) {
  .footer-legal { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 4px 24px; }
}

/* Even rows: lists sized to divide by 2, 3 and 4 */
.preset-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.preset label { justify-content: center; text-align: center; padding-block: 6px; }
.area-groups .area { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.area-groups .pill { justify-content: center; text-align: center; padding-block: 6px; }
@media (min-width: 641px) and (max-width: 960px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .preset-opts, .area-groups .area { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pills.jump { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .pills.jump::-webkit-scrollbar { display: none; }
  .pills.jump .pill { flex: none; }
  .ind-block .pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ind-block .pills .pill { justify-content: center; text-align: center; padding-block: 6px; }
}

/* Homepage: the repetitive tasks and the sum */
#hours .duo-body > .task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 32px; margin-top: 0; }
#hours .example { max-width: none; margin-top: 28px; padding: 16px 20px; border-radius: var(--r-card); background: var(--white); color: var(--ink); font-size: 1rem; }
@media (max-width: 640px) {
  #hours .duo-body > .task-list { grid-template-columns: minmax(0, 1fr); }
}
#hours .lead { margin-top: 16px; }

/* How it works: a photo beside the steps */
.how-split { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(40px, 5vw, 72px); align-items: stretch; }
.how-photo { position: relative; min-height: 460px; margin: 0; overflow: hidden; border-radius: var(--r-panel); background: var(--raised); }
.how-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; }
#how .section-head { margin-bottom: 32px; }
#how .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 0; }
@media (max-width: 860px) {
  .how-split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .how-photo { min-height: 0; aspect-ratio: 3 / 2; order: 2; }
  .how-body { order: 1; }
}
