/*
  The sections Mena adds to customer pages (src/features/site-layout/public-views.tsx).
  Layout and colour only: type comes from base.css (h2 Heading, p Body, .t-lead, .t-small).
  They sit on the same full-width bands as the page's own parts (site.css .band, .band--light,
  .band--cocoa), so they look like the rest of the page with any amount of text, and a missing
  photo just leaves the words. Phone first; no sideways scroll at 375px.
*/

/* A soft band (the page's alternate colour). */
.site-section--oat { background: var(--mm-oat); }
.site-section--oat + .band--light, .band--light + .site-section--oat { border-top: 0; }

/* Long words and links she pastes wrap instead of pushing the page wider. */
.site-section, .site-notice { overflow-wrap: anywhere; }

/* ---- Text: one comfortable column ---- */
.site-text { display: grid; gap: var(--mm-space-4); max-width: var(--mm-reading-max); }

/* ---- Photo: one wide photo, a heading above and a caption under it ---- */
.site-photo { display: grid; gap: var(--mm-space-4); margin: 0; }
.site-photo__frame { aspect-ratio: 3 / 2; }
.site-photo__caption { color: var(--mm-ink-soft); }
.band--cocoa .site-photo__caption { color: var(--mm-cream-soft); }
@media (min-width: 900px) { .site-photo__frame { aspect-ratio: 16 / 7; } }

/* ---- Photo beside text: the story band's grid, the photo on either side ---- */
.site-split--no-photo { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .site-split--right .site-split__photo { order: 2; }
  .site-split--right { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .site-split--no-photo, .site-split--no-photo.site-split--right { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Questions and answers: hairline rows that open ---- */
.site-faq { display: grid; gap: var(--mm-space-4); max-width: 46rem; }
.site-faq__list { border-top: var(--mm-rule); margin-top: var(--mm-space-2); }
.band--cocoa .site-faq__list, .band--cocoa .site-faq__item { border-color: var(--mm-cocoa-line); }
.site-faq__item { border-bottom: var(--mm-rule); }
.site-faq__question {
  display: flex; align-items: center; justify-content: space-between; gap: var(--mm-space-4);
  min-height: 56px; padding: var(--mm-space-3) 0; cursor: pointer; list-style: none;
}
.site-faq__question::-webkit-details-marker { display: none; }
/* The plus that turns into a minus: two hairlines drawn with backgrounds, no icon font. */
.site-faq__question::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(currentColor, currentColor) center / 14px 1.5px no-repeat,
              linear-gradient(currentColor, currentColor) center / 1.5px 14px no-repeat;
}
.site-faq__item[open] > .site-faq__question::after { background: linear-gradient(currentColor, currentColor) center / 14px 1.5px no-repeat; }
.site-faq__answer { display: grid; gap: var(--mm-space-3); padding: 0 0 var(--mm-space-4); max-width: var(--mm-reading-max); }

/* ---- Quote: the words large, the name small under them ---- */
.site-quote { display: grid; gap: var(--mm-space-4); max-width: 44rem; margin: 0 auto; text-align: center; justify-items: center; }
.site-quote__text { display: grid; gap: var(--mm-space-3); margin: 0; }
.site-quote__by { color: var(--mm-ink-soft); }
.band--cocoa .site-quote__by { color: var(--mm-cream-soft); }

/* ---- Notice: a calm band across the page (sage tint), the words in the page width ---- */
.site-notice { background: var(--mm-sage-tint); color: var(--mm-ink); border-bottom: 1px solid var(--mm-line); }
.site-notice__inner { display: grid; gap: var(--mm-space-1); padding-top: var(--mm-space-4); padding-bottom: var(--mm-space-4); }
.site-notice__inner > p { max-width: 48rem; }

/* ---- Blocks inside a section, and section colours (src/features/site-layout/blocks.ts) ----
   A section with blocks, a colour or an alignment sits in a .site-frame: her blocks before and
   after the section's own content, on the same band colour (or her colour). A section without
   any prints exactly as before, with no frame. */
.site-frame { overflow-wrap: anywhere; }
.site-frame--notice { background: var(--mm-sage-tint); color: var(--mm-ink); }
.site-blocks--before { padding-top: var(--mm-band-pad); }
.site-blocks--after { padding-bottom: var(--mm-band-pad); }
.site-blocks--empty { display: none; }
/* Blocks and the content beside them share one band, so the gap between them is the usual one. */
.site-frame > .site-blocks--before:not(.site-blocks--empty) + :is(.band, section, div) { padding-top: var(--mm-space-6); }
.site-frame > :is(.band, section, div):has(+ .site-blocks--after:not(.site-blocks--empty)) { padding-bottom: var(--mm-space-6); }
.site-frame > .site-notice + .site-blocks--after:not(.site-blocks--empty), .site-frame--notice > .site-blocks { padding-top: var(--mm-space-4); padding-bottom: var(--mm-space-4); }
.site-blocks__list { display: grid; gap: var(--mm-space-4); }

.site-block { margin: 0; min-width: 0; }
.site-block--text { display: grid; gap: var(--mm-space-3); max-width: var(--mm-reading-max); }
.site-block--center { margin-inline: auto; }
.site-block--right { margin-left: auto; }
.site-block--image { width: 100%; }
.site-block--image.site-block--small { max-width: 18rem; }
.site-block--image.site-block--medium { max-width: 34rem; }
.site-block--image.site-block--center { margin-inline: auto; }
.site-block--image.site-block--right { margin-left: auto; margin-right: 0; }
.site-block__photo img { width: 100%; height: auto; }

/* Her background colour: the frame paints it (looks.css sets the colour and its words' colour),
   and the bands inside let it show through. */
.site-bg { background-color: var(--mm-section-bg); color: var(--mm-section-fg); }
.site-bg > :is(.band, section, .site-notice, .page-band, div) { background-color: transparent; color: inherit; border-top: 0; }
.site-bg :is(h1, h2, h3, h4, p, li, figcaption, blockquote, summary, .t-small, .lead, .site-photo__caption, .site-quote__by) { color: inherit; }
.site-bg a:not(.btn) { color: inherit; text-decoration: underline; }
.site-bg :is(input, select, textarea) { color: var(--mm-ink); }
.site-bg .btn { background: var(--mm-section-btn); color: var(--mm-section-btn-text); }
.site-bg .btn:hover { background: var(--mm-section-btn-hover); color: var(--mm-section-btn-text); }
.site-bg :focus-visible { outline-color: var(--mm-section-fg); }
.site-bg .site-faq__list, .site-bg .site-faq__item { border-color: currentColor; }

/* Where the section's words sit. */
.site-align--left :is(h1, h2, h3, p, figcaption, blockquote) { text-align: left; }
.site-align--left .site-quote { text-align: left; justify-items: start; margin-inline: 0; }
.site-align--center :is(h1, h2, h3, p, figcaption, blockquote) { text-align: center; }
.site-align--center :is(.site-text, .site-faq, .site-faq__answer, .site-notice__inner > p, .page-intro, .how__inner > p) { margin-inline: auto; justify-items: center; }
.site-align--right :is(h1, h2, h3, p, figcaption, blockquote) { text-align: right; }
.site-align--right :is(.site-text, .site-faq, .site-faq__answer, .site-notice__inner > p, .page-intro, .how__inner > p, .site-quote) { margin-left: auto; margin-right: 0; justify-items: end; }

/* A block's own alignment wins over the section's (these come after it). */
.site-block.site-block--left, .site-block--left p { text-align: left; }
.site-block.site-block--center, .site-block--center p { text-align: center; }
.site-block.site-block--right, .site-block--right p { text-align: right; }
