@layer reset, tokens, base, layout, modules, theme, overrides, custom;
@layer tokens {
  :root {
    --ms-gray-50: #f8f9fa;
    --ms-gray-100: #f1f3f5;
    --ms-gray-200: #e9ecef;
    --ms-gray-300: #dee2e6;
    --ms-gray-400: #ced4da;
    --ms-gray-500: #adb5bd;
    --ms-gray-600: #6c757d;
    --ms-gray-700: #495057;
    --ms-gray-800: #343a40;
    --ms-gray-900: #212529;
    --ms-blue-600: #1d4ed8;
    --ms-blue-700: #1e40af;
    --ms-amber-700: #b45309;
    --ms-amber-800: #92400e;
    --ms-white: #ffffff;
    --ms-size-1: clamp(0.25rem, 0.2255rem + 0.1087vw, 0.3125rem);
    --ms-size-2: clamp(0.5rem, 0.4511rem + 0.2174vw, 0.625rem);
    --ms-size-3: clamp(0.75rem, 0.6766rem + 0.3261vw, 0.9375rem);
    --ms-size-4: clamp(1rem, 0.9022rem + 0.4348vw, 1.25rem);
    --ms-size-5: clamp(1.5rem, 1.3533rem + 0.6522vw, 1.875rem);
    --ms-size-6: clamp(2rem, 1.8043rem + 0.8696vw, 2.5rem);
    --ms-size-7: clamp(3rem, 2.7065rem + 1.3043vw, 3.75rem);
    --ms-size-8: clamp(4rem, 3.6087rem + 1.7391vw, 5rem);
    --ms-size-9: clamp(6rem, 5.413rem + 2.6087vw, 7.5rem);
    --ms-size-10: clamp(8rem, 7.2174rem + 3.4783vw, 10rem);
    --ms-font-system-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --ms-font-system-serif: ui-serif, Georgia, Cambria, 'Times New Roman', serif;
    --ms-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ms-font-heading: var(--ms-font-system-sans);
    --ms-font-body: var(--ms-font-system-sans);
    --ms-color-primary: var(--ms-blue-600);
    --ms-color-primary-hover: var(--ms-blue-700);
    --ms-color-on-primary: var(--ms-white);
    --ms-color-accent: var(--ms-amber-700);
    --ms-color-accent-hover: var(--ms-amber-800);
    --ms-color-on-accent: var(--ms-white);
    --ms-color-background: var(--ms-white);
    --ms-color-surface: var(--ms-gray-50);
    --ms-color-text: var(--ms-gray-900);
    --ms-color-text-muted: var(--ms-gray-700);
    --ms-color-border: var(--ms-gray-300);
    --ms-text-0: clamp(1rem, 0.9511rem + 0.2174vw, 1.125rem);
    --ms-text-1: clamp(1.2rem, 1.1193rem + 0.3587vw, 1.4063rem);
    --ms-text-2: clamp(1.44rem, 1.3158rem + 0.5522vw, 1.7575rem);
    --ms-text-3: clamp(1.7281rem, 1.5445rem + 0.8163vw, 2.1975rem);
    --ms-text-4: clamp(2.0737rem, 1.8104rem + 1.1707vw, 2.7469rem);
    --ms-text-5: clamp(2.4881rem, 2.1183rem + 1.6435vw, 3.4331rem);
    --ms-text--2: clamp(0.6944rem, 0.6843rem + 0.0446vw, 0.72rem);
    --ms-text--1: clamp(0.8331rem, 0.807rem + 0.1163vw, 0.9rem);
    --ms-space-density: 1;
    --ms-space-3xs: calc(var(--ms-size-1) * var(--ms-space-density));
    --ms-space-2xs: calc(var(--ms-size-2) * var(--ms-space-density));
    --ms-space-xs: calc(var(--ms-size-3) * var(--ms-space-density));
    --ms-space-s: calc(var(--ms-size-4) * var(--ms-space-density));
    --ms-space-m: calc(var(--ms-size-5) * var(--ms-space-density));
    --ms-space-l: calc(var(--ms-size-6) * var(--ms-space-density));
    --ms-space-xl: calc(var(--ms-size-7) * var(--ms-space-density));
    --ms-space-2xl: calc(var(--ms-size-8) * var(--ms-space-density));
    --ms-space-3xl: calc(var(--ms-size-9) * var(--ms-space-density));
    --ms-space-section: calc(var(--ms-size-10) * var(--ms-space-density));
    --ms-radius: 0.25rem;
    --ms-radius-pill: var(--ms-radius);
    --ms-container-sm: 30rem;
    --ms-container-md: 48rem;
    --ms-container-lg: 64rem;
    --ms-duration-fast: 0.15s;
    --ms-duration-normal: 0.25s;
    --ms-ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --ms-line-height-body: 1.6;
    --ms-line-height-heading: 1.2;
    --ms-font-weight-heading: 600;
    --ms-border-width: 1px;
    --ms-focus-width: 3px;
    --ms-focus-offset: 2px;
    --ms-link-underline-offset: 0.2em;
    --ms-measure: 65ch;
    --ms-scroll-margin: var(--ms-space-m);
    --ms-logo-height: clamp(3rem, 2.6087rem + 1.7391vw, 4rem);
    --ms-logo-max-width: 16rem;
    --ms-header-menu: beside;
    --ms-header-align: start;
    --ms-header-menu-open: push;
    --ms-header-menu-button: label;
    --ms-menu-button-size: 2rem;
    --ms-menu-icon-width: 1.125em;
    --ms-menu-icon-spacing: 0.35em;
    --ms-menu-layer: 2;
    --ms-panel-look: outlined;
    --ms-panel-border-width: var(--ms-border-width);
    --ms-panel-radius: calc(var(--ms-radius) * 2);
    --ms-panel-padding: var(--ms-space-m);
    --ms-panel-shadow: 0 0.25rem 1rem color-mix(in srgb, var(--ms-color-background) 82%, black);
    --ms-background-tint: color-mix(in srgb, var(--ms-color-background) 20%, transparent);
    --ms-background-blur: 0px;
    --ms-background-sheet-width: var(--ms-container-lg);
    --ms-before-header-background: var(--ms-color-surface);
    --ms-before-header-color: var(--ms-color-text);
    --ms-button-radius: var(--ms-radius);
    --ms-button-padding: var(--ms-space-2xs) var(--ms-space-m);
    --ms-button-font-weight: var(--ms-font-weight-heading);
  }
}

/*
 * What every Section shares, whatever its Module (#328, ADR 0012), in the `modules` layer so it
 * holds over each Module's baseline: a full-width Section that opens the Page starts at the top,
 * so it can meet the header. The full-width stretch itself is in theme-base.
 */
@layer modules {
  .p-text__title + [data-width="full"] {
    margin-block-start: 0;
  }
}

/*
 * The Module heading: every Module's own heading (always an h2), in one rule instead of a copy per
 * Module (a shared pattern, docs/CODE_STYLE.md, CSS). It reads the heading tokens, so a Theme's
 * heading font, weight and line height reach every Module. Before each Module's own CSS, so a
 * Module refines its heading there: the Banner's is larger, the Table of contents' smaller and
 * muted. A new Module with a heading joins the one selector list below.
 */
@layer modules {
  :is(
    .m-address__heading,
    .m-banner__heading,
    .m-card-grid__heading,
    .m-contact-form__heading,
    .m-faq__heading,
    .m-food-menu__heading,
    .m-gallery__heading,
    .m-image-text__heading,
    .m-opening-hours__heading,
    .m-price-list__heading,
    .m-pricing-table__heading,
    .m-subpages__heading,
    .m-table-of-contents__heading
  ) {
    margin-block: 0 var(--ms-space-s, 1rem);
    font-family: var(--ms-font-heading, inherit);
    font-size: var(--ms-text-2, 1.44rem);
    font-weight: var(--ms-font-weight-heading, 600);
    line-height: var(--ms-line-height-heading, 1.2);
    color: var(--ms-color-text, CanvasText);
  }

  /*
   * The Member's alignment of the heading (#774), as for a block of rich text (text-align.css):
   * logical values, so `start` is the left and `end` the right in a left-to-right language, and
   * important, as the Banner's ink is, so it beats a Theme that centers headings, Releases older
   * than this rule included (ADR 0010). Every Module with a Section heading but the Banner joins
   * the three lists; a collapsible Table of contents aligns its summary (table-of-contents.css).
   */
  :is(
    .m-address__heading--start,
    .m-card-grid__heading--start,
    .m-contact-form__heading--start,
    .m-faq__heading--start,
    .m-food-menu__heading--start,
    .m-gallery__heading--start,
    .m-image-text__heading--start,
    .m-opening-hours__heading--start,
    .m-price-list__heading--start,
    .m-pricing-table__heading--start,
    .m-subpages__heading--start,
    .m-table-of-contents__heading--start
  ) {
    text-align: start !important;
  }

  :is(
    .m-address__heading--center,
    .m-card-grid__heading--center,
    .m-contact-form__heading--center,
    .m-faq__heading--center,
    .m-food-menu__heading--center,
    .m-gallery__heading--center,
    .m-image-text__heading--center,
    .m-opening-hours__heading--center,
    .m-price-list__heading--center,
    .m-pricing-table__heading--center,
    .m-subpages__heading--center,
    .m-table-of-contents__heading--center
  ) {
    text-align: center !important;
  }

  :is(
    .m-address__heading--end,
    .m-card-grid__heading--end,
    .m-contact-form__heading--end,
    .m-faq__heading--end,
    .m-food-menu__heading--end,
    .m-gallery__heading--end,
    .m-image-text__heading--end,
    .m-opening-hours__heading--end,
    .m-price-list__heading--end,
    .m-pricing-table__heading--end,
    .m-subpages__heading--end,
    .m-table-of-contents__heading--end
  ) {
    text-align: end !important;
  }
}

/*
 * The button: every link or form button in a Module that looks like a button, in one rule instead
 * of a copy per Module (a shared pattern, docs/CODE_STYLE.md, CSS). Filled in the primary colour,
 * at least 44 px tall (WCAG 2.2, 2.5.8). Each has the same 2 px border, so an outlined button is
 * the same height beside it. The outlined ones (rich text's secondary, the Banner's second button,
 * a Price list row's) are the second list below. Before rich text's and each Module's own CSS, so
 * they refine it there: the Banner's hover, a full-width button. A new button joins the lists.
 */
@layer modules {
  :is(
    .m-rich-text__button,
    .m-banner__button,
    .m-card-grid__button,
    .m-contact-form__submit,
    .m-price-list__button,
    .m-pricing-table__button
  ) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 44px;
    padding: var(--ms-button-padding, 0.5rem 1.5rem);
    font: inherit;
    font-weight: var(--ms-button-font-weight, bolder);
    line-height: 1.2;
    color: var(--ms-color-on-primary, Canvas);
    text-align: center;
    text-decoration: none;
    background: var(--ms-color-primary, LinkText);
    border: 2px solid var(--ms-color-primary, LinkText);
    border-radius: var(--ms-button-radius, 0.25rem);
    cursor: pointer;

    &:hover {
      background: var(--ms-color-primary-hover, LinkText);
      border-color: var(--ms-color-primary-hover, LinkText);
    }
  }

  /*
   * Outlined in the primary colour: rich text's secondary button (#425), the Banner's second
   * button (#512) and a Price list row's (#730, so a button on every row isn't a column of filled
   * buttons). They differ from a filled button by shape as well as colour (WCAG 1.4.1). The
   * surface colour on hover rather than an underline, so it reads as a button too.
   */
  :is(.m-rich-text__button--secondary, .m-banner__button--secondary, .m-price-list__button) {
    color: var(--ms-color-primary, LinkText);
    background: transparent;

    &:hover {
      background: var(--ms-color-surface, transparent);
    }
  }
}

/*
 * Panels (GLOSSARY.md, #506): the boxed parts of Modules, a pricing table's columns and the cards
 * of a Grid of cards and of a Subpages (#540). A Theme picks one look with `--ms-panel-look`, read with a container style query
 * (ADR 0014), and tunes it with the other `--ms-panel-` tokens; a browser without style queries
 * shows the default, `outlined`. Each Module keeps its own layout inside its Panels. A new Panel
 * joins the one selector list below.
 *   flat      no fill and no edge: only spacing sets the Panel apart.
 *   outlined  the background color and a border.
 *   filled    the surface color.
 *   elevated  the surface color and a shadow.
 * Filled and elevated Panels keep a faint border, so on a dark background, where a shadow hardly
 * shows, their edges still do.
 */
@layer modules {
  :is(.m-pricing-table__column, .m-card-grid__card, .m-subpages__card) {
    padding: var(--ms-panel-padding, 1.5rem);
    background: var(--ms-color-background, Canvas);
    border: var(--ms-panel-border-width, 1px) solid var(--ms-color-border, currentColor);
    border-radius: var(--ms-panel-radius, 0.5rem);

    @container style(--ms-panel-look: flat) {
      background: transparent;
      border-color: transparent;
    }

    @container style(--ms-panel-look: filled) or style(--ms-panel-look: elevated) {
      background: var(--ms-color-surface, Canvas);
      border-color: color-mix(in srgb, var(--ms-color-border, currentColor) 50%, transparent);
    }

    @container style(--ms-panel-look: elevated) {
      box-shadow: var(--ms-panel-shadow, none);
    }
  }
}

/*
 * Cards in columns (a shared pattern, docs/CODE_STYLE.md, CSS): the Grid of cards (#426) and the
 * Subpages Module (#540) lay out their cards alike, so Themes style both the same way (owner
 * decision 2026-11-17). Each block keeps its own BEM names; this lists them once. The cards keep
 * their order in exactly the columns the Member picked where there's room: one on phones, two from
 * 30rem (tablets), and 2, 3 or 4 from 48rem; one column stacks its cards at every width (owner
 * decision 2026-11-13). The container queries ask the Layout's Region, not the block: in the
 * reading column it's never 48rem wide, so asking it would cap every block at two columns. Before
 * each Module's own CSS, which sets its images' shape and its own parts. No JavaScript and no
 * sideways scrolling. A new Module with cards in columns joins the selector lists below.
 */
@layer modules {
  :is(.m-card-grid, .m-subpages) {
    margin-block: var(--ms-space-l, 2rem);
  }

  /* Full width (ADR 0012): the heading and the cards keep a gutter from the edges. */
  :is(.m-card-grid, .m-subpages)[data-width="full"] {
    padding-inline: var(--ms-space-m, 1.5rem);
  }

  /* Opening the Page at full width, the block meets the header; its heading keeps some air. */
  .m-card-grid[data-width="full"] .m-card-grid__heading,
  .m-subpages[data-width="full"] .m-subpages__heading {
    margin-block-start: var(--ms-space-s, 1rem);
  }

  :is(.m-card-grid__cards, .m-subpages__cards) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ms-space-s, 1rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* One column stays one; the others go to two on tablets. `:where()` keeps this rule's
     specificity at the 3 and 4 columns' below, which follow it and so win from 48rem. */
  @container (inline-size >= 30rem) {
    .m-card-grid:where(:not(.m-card-grid--columns-1)) .m-card-grid__cards,
    .m-subpages:where(:not(.m-subpages--columns-1)) .m-subpages__cards {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @container (inline-size >= 48rem) {
    .m-card-grid--columns-3 .m-card-grid__cards,
    .m-subpages--columns-3 .m-subpages__cards {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .m-card-grid--columns-4 .m-card-grid__cards,
    .m-subpages--columns-4 .m-subpages__cards {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  /* A Panel (panels.css): its fill, edge, corners and padding follow the Theme's Panel look. */
  :is(.m-card-grid__card, .m-subpages__card) {
    display: flex;
    flex-direction: column;
    gap: var(--ms-space-2xs, 0.5rem);
    min-inline-size: 0;
    /* A long word breaks only when it can't fit, hyphenated in the Site's language. */
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* The image runs to the card's edges at the top, in its rounded corners. */
  :is(.m-card-grid__media, .m-subpages__media) {
    display: block;
    margin: calc(var(--ms-panel-padding, 1.5rem) * -1) calc(var(--ms-panel-padding, 1.5rem) * -1) 0;
  }

  :is(.m-card-grid__image, .m-subpages__image) {
    display: block;
    block-size: auto;
    --_corner: calc(var(--ms-panel-radius, 0.5rem) - var(--ms-panel-border-width, 1px));
    border-start-start-radius: var(--_corner);
    border-start-end-radius: var(--_corner);
  }

  :is(.m-card-grid__title, .m-subpages__title) {
    margin: 0;
    font-family: var(--ms-font-heading, inherit);
    font-size: var(--ms-text-1, 1.2rem);
    font-weight: var(--ms-font-weight-heading, 600);
    line-height: var(--ms-line-height-heading, 1.2);
  }

  :is(.m-card-grid__text, .m-subpages__description) {
    color: var(--ms-color-text-muted, CanvasText);
  }
}

/*
 * Rows of names with their prices (a shared pattern, docs/CODE_STYLE.md, CSS): the Food menu
 * (#626) and the Price list (#729) lay out their rows alike, so Themes style both the same way.
 * Each block keeps its own BEM names; this lists them once. Readable under any Theme, including
 * Theme Releases older than these Modules (ADR 0010). Each row has its name and price on one line,
 * the price at the end, and its description below both, as wide as the line allows, so it isn't
 * squeezed on phones. Price headings ("Small / Large", "30 min / 60 min") sit above the prices. No
 * JavaScript and no sideways scrolling; a long name or price wraps. Themes refine it, such as
 * dotted lines leading to the price. Before each Module's own CSS, so a Module refines it there.
 */
@layer modules {
  :is(.m-food-menu__intro, .m-price-list__intro) {
    max-inline-size: var(--ms-measure, 65ch);
    margin-block-end: var(--ms-space-m, 1.5rem);

    & > :first-child {
      margin-block-start: 0;
    }

    & a {
      color: var(--ms-color-primary, LinkText);
    }
  }

  :is(.m-food-menu__price-headings, .m-price-list__price-headings) {
    margin: 0 0 var(--ms-space-2xs, 0.5rem);
    font-size: var(--ms-text--1, 0.83rem);
    font-weight: bolder;
    color: var(--ms-color-text-muted, CanvasText);
    text-align: end;
  }

  :is(.m-food-menu__dishes, .m-price-list__rows) {
    display: flex;
    flex-direction: column;
    gap: var(--ms-space-s, 1rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* The name takes the space it needs and the price the rest of the line, at its end; a name too
     long for the line wraps rather than pushing the price off it. */
  :is(.m-food-menu__dish, .m-price-list__row) {
    display: grid;
    /* The price takes what it needs, up to 12rem and never more than 40% of the line, so a long
       price ("Glass 95 / Bottle 450") wraps instead of squeezing the name on phones. */
    grid-template-columns: minmax(0, 1fr) fit-content(min(12rem, 40%));
    column-gap: var(--ms-space-s, 1rem);
    align-items: baseline;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  :is(.m-food-menu__name, .m-price-list__name) {
    grid-column: 1;
    margin: 0;
    font-family: var(--ms-font-heading, inherit);
    font-size: var(--ms-text-1, 1.2rem);
    font-weight: var(--ms-font-weight-heading, 600);
    line-height: var(--ms-line-height-heading, 1.2);
  }

  :is(.m-food-menu__price, .m-price-list__price) {
    grid-column: 2;
    margin: 0;
    font-weight: bolder;
    text-align: end;
  }

  :is(.m-food-menu__description, .m-price-list__description) {
    grid-column: 1 / -1;
    max-inline-size: var(--ms-measure, 65ch);
    margin: var(--ms-space-3xs, 0.25rem) 0 0;
    color: var(--ms-color-text-muted, CanvasText);
  }
}

/*
 * Rich text, in any Module that has it: its subheadings, and its button links (#425). The buttons'
 * look is the shared button's (buttons.css): primary is filled, the default, and secondary
 * outlined, so the two differ by shape as well as colour (WCAG 1.4.1). Buttons next to each other
 * share a line, which wraps on phones. Icons in the text (#664) are one line of text tall.
 */
@layer modules {
  /*
   * Subheadings in rich text (h2–h4; a Module may print them a level down, renderer/rich-text.ts)
   * read the heading tokens like the Module heading (headings.css), so the heading font Override
   * and the Theme's weight and type scale reach them. One step below the Module heading, so the
   * Section's own heading stays the largest. A Module with rich text joins the selector list.
   */
  :is(
      .m-address__text,
      .m-card-grid__text,
      .m-faq__answer,
      .m-food-menu__intro,
      .m-image-text__text,
      .m-opening-hours__text,
      .m-price-list__intro,
      .m-pricing-table__intro,
      .m-text
    )
    :is(h2, h3, h4) {
    font-family: var(--ms-font-heading, inherit);
    font-size: var(--ms-text-0, 1rem);
    font-weight: var(--ms-font-weight-heading, 600);
    line-height: var(--ms-line-height-heading, 1.2);
    color: var(--ms-color-text, CanvasText);

    &:is(h2) {
      font-size: var(--ms-text-1, 1.2rem);
    }
  }

  /* A list reads as one block: its items' paragraphs keep no space of their own, only a little
     between items. */
  :is(
      .m-address__text,
      .m-card-grid__text,
      .m-faq__answer,
      .m-food-menu__intro,
      .m-image-text__text,
      .m-opening-hours__text,
      .m-price-list__intro,
      .m-pricing-table__intro,
      .m-text
    )
    li {
    & > p {
      margin-block: 0;
    }

    & + li {
      margin-block-start: var(--ms-space-3xs, 0.25rem);
    }
  }

  /* A block's alignment (#771) is in text-align.css, which the admin's editor shares. */

  .m-rich-text__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ms-space-xs, 0.75rem);
    margin-block: var(--ms-space-m, 1.5rem);
  }

  /*
   * An icon in the text (#664): as tall as the letters, sitting on the line like one, so it never
   * changes the line height. A single-colour icon draws with `currentColor`, so it takes the text
   * colour, in a link or a heading too; a Twemoji icon keeps its own colours.
   */
  .m-rich-text__icon {
    display: inline-block;
    inline-size: 1em;
    block-size: 1em;
    vertical-align: -0.125em;

    & > svg {
      display: block;
      inline-size: 100%;
      block-size: 100%;
    }
  }
}

/*
 * A paragraph, heading or list the Member aligned in rich text (#771), by the modifier
 * @minisite/renderer prints on it. The admin's editor prints the same modifier and keeps an exact
 * copy of this file, apps/admin/src/editing/text-align.css, so it shows what visitors will see;
 * packages are imported only through their index (docs/CODE_STYLE.md), and a test in the admin
 * fails when the two differ. It reads no tokens, so it means the same in both.
 *
 * Logical values, so `start` is the left and `end` the right in a left-to-right language. The
 * Member's choice beats the Theme's: set on the block itself, it wins over text centered around
 * it, and important, as the Banner's ink is, it wins over a Theme that centers the block, Releases
 * older than this rule included (ADR 0010): an important declaration in an earlier layer wins over
 * normal ones in later layers. A centered or end-aligned list aligns as a whole: its markers sit
 * beside the text they belong to, inside the box, rather than in the start margin.
 */
@layer modules {
  .m-rich-text__block--start {
    text-align: start !important;
  }

  .m-rich-text__block--center {
    text-align: center !important;
  }

  .m-rich-text__block--end {
    text-align: end !important;
  }

  :is(ul, ol):is(.m-rich-text__block--center, .m-rich-text__block--end) {
    list-style-position: inside;
    padding-inline-start: 0;

    /* The item's paragraph sits on the marker's line, not below it. */
    & > li > p {
      display: inline;
    }
  }

  /*
   * A Text (#661) goes only in a Region. Outside the band above the header it keeps each block to
   * a readable line length (text.css), so an aligned block also moves within the Region: centered
   * in its middle, end-aligned at its end, not just aligned inside a narrow box at the start.
   * Important, as the alignment is, so a Theme's margins can't pin it back to the start.
   */
  [data-region]:not([data-region="before-header"]) .m-text > .m-rich-text__block--center {
    margin-inline: auto !important;
  }

  [data-region]:not([data-region="before-header"]) .m-text > .m-rich-text__block--end {
    margin-inline-start: auto !important;
  }

  /*
   * A Text's buttons follow its text, and so does the band's row of lines and buttons (#662), as
   * the owner decided (2026-11-27): to the middle when any block is centered, else to the end when
   * any is end-aligned, else to the start when one is set there. Without `:has()` they stay at the
   * start, and each line is still aligned on its own.
   */
  @supports selector(:has(a)) {
    [data-region]:not([data-region="before-header"])
      .m-text:has(> .m-rich-text__block--start)
      > .m-rich-text__buttons {
      justify-content: flex-start !important;
    }

    [data-region]:not([data-region="before-header"])
      .m-text:has(> .m-rich-text__block--end)
      > .m-rich-text__buttons {
      justify-content: flex-end !important;
      margin-inline-start: auto !important;
    }

    [data-region]:not([data-region="before-header"])
      .m-text:has(> .m-rich-text__block--center)
      > .m-rich-text__buttons {
      justify-content: center !important;
      margin-inline: auto !important;
    }

    [data-region="before-header"] .m-text:has(> .m-rich-text__block--start) {
      justify-content: flex-start !important;
    }

    [data-region="before-header"] .m-text:has(> .m-rich-text__block--end) {
      justify-content: flex-end !important;
    }

    [data-region="before-header"] .m-text:has(> .m-rich-text__block--center) {
      justify-content: center !important;
    }
  }
}

/*
 * Where a cropped image is placed (#458): a Module that crops an image (the Banner, the Gallery,
 * the Grid of cards and the Subpages) prints its Focal Point as data-focus-x and data-focus-y, in 5% steps
 * (FOCAL_POINT_STEP), and reads --_focus-x and --_focus-y in its object-position. The Site CSP is
 * style-src 'self', so an inline object-position couldn't apply; one rule per step costs about
 * 0.2 KB gzipped. An image without them, or a browser without custom properties, crops around the
 * centre, as before.
 */
@layer modules {
  /* Each cropped image fills its box around its Focal Point. A new one joins this selector list. */
  :is(.m-banner__image, .m-card-grid__image, .m-gallery__image, .m-subpages__image) {
    inline-size: 100%;
    object-fit: cover;
    object-position: var(--_focus-x, 50%) var(--_focus-y, 50%);
  }

  [data-focus-x="0"] {
    --_focus-x: 0%;
  }
  [data-focus-x="5"] {
    --_focus-x: 5%;
  }
  [data-focus-x="10"] {
    --_focus-x: 10%;
  }
  [data-focus-x="15"] {
    --_focus-x: 15%;
  }
  [data-focus-x="20"] {
    --_focus-x: 20%;
  }
  [data-focus-x="25"] {
    --_focus-x: 25%;
  }
  [data-focus-x="30"] {
    --_focus-x: 30%;
  }
  [data-focus-x="35"] {
    --_focus-x: 35%;
  }
  [data-focus-x="40"] {
    --_focus-x: 40%;
  }
  [data-focus-x="45"] {
    --_focus-x: 45%;
  }
  [data-focus-x="50"] {
    --_focus-x: 50%;
  }
  [data-focus-x="55"] {
    --_focus-x: 55%;
  }
  [data-focus-x="60"] {
    --_focus-x: 60%;
  }
  [data-focus-x="65"] {
    --_focus-x: 65%;
  }
  [data-focus-x="70"] {
    --_focus-x: 70%;
  }
  [data-focus-x="75"] {
    --_focus-x: 75%;
  }
  [data-focus-x="80"] {
    --_focus-x: 80%;
  }
  [data-focus-x="85"] {
    --_focus-x: 85%;
  }
  [data-focus-x="90"] {
    --_focus-x: 90%;
  }
  [data-focus-x="95"] {
    --_focus-x: 95%;
  }
  [data-focus-x="100"] {
    --_focus-x: 100%;
  }
  [data-focus-y="0"] {
    --_focus-y: 0%;
  }
  [data-focus-y="5"] {
    --_focus-y: 5%;
  }
  [data-focus-y="10"] {
    --_focus-y: 10%;
  }
  [data-focus-y="15"] {
    --_focus-y: 15%;
  }
  [data-focus-y="20"] {
    --_focus-y: 20%;
  }
  [data-focus-y="25"] {
    --_focus-y: 25%;
  }
  [data-focus-y="30"] {
    --_focus-y: 30%;
  }
  [data-focus-y="35"] {
    --_focus-y: 35%;
  }
  [data-focus-y="40"] {
    --_focus-y: 40%;
  }
  [data-focus-y="45"] {
    --_focus-y: 45%;
  }
  [data-focus-y="50"] {
    --_focus-y: 50%;
  }
  [data-focus-y="55"] {
    --_focus-y: 55%;
  }
  [data-focus-y="60"] {
    --_focus-y: 60%;
  }
  [data-focus-y="65"] {
    --_focus-y: 65%;
  }
  [data-focus-y="70"] {
    --_focus-y: 70%;
  }
  [data-focus-y="75"] {
    --_focus-y: 75%;
  }
  [data-focus-y="80"] {
    --_focus-y: 80%;
  }
  [data-focus-y="85"] {
    --_focus-y: 85%;
  }
  [data-focus-y="90"] {
    --_focus-y: 90%;
  }
  [data-focus-y="95"] {
    --_focus-y: 95%;
  }
  [data-focus-y="100"] {
    --_focus-y: 100%;
  }
}

/*
 * Image + text's baseline (ADR 0010): readable under any Theme, including Theme Releases older
 * than this Module. Themes refine it in their `theme` layer. The image, when there is one, comes
 * first and fills the column; Themes place it beside the text if they like (#199).
 */
@layer modules {
  .m-image-text {
    container-type: inline-size;
    margin-block: var(--ms-space-l, 2rem);
  }

  .m-image-text__media {
    display: block;
    margin-block-end: var(--ms-space-s, 1rem);
  }

  .m-image-text__image {
    display: block;
    inline-size: 100%;
    block-size: auto;
  }

  .m-image-text__text {
    max-inline-size: var(--ms-measure, 65ch);

    & > :first-child {
      margin-block-start: 0;
    }

    & > :last-child {
      margin-block-end: 0;
    }

    & a {
      color: var(--ms-color-primary, LinkText);
    }
  }

  /* The text keeps a comfortable line length; wide containers get more room around it. 48rem is
     the md container (--ms-container-md): custom properties can't be used in a container query. */
  @container (inline-size >= 48rem) {
    .m-image-text__body {
      padding-inline: var(--ms-space-m, 1.5rem);
    }
  }

  .m-image-text__text {
    & a {
      color: var(--ms-color-primary, LinkText);
      text-underline-offset: var(--ms-link-underline-offset, 0.2em);

      &:hover {
        color: var(--ms-color-primary-hover, LinkText);
      }
    }

    & :is(h2, h3) {
      margin-block: var(--ms-space-m, 1.5rem) var(--ms-space-2xs, 0.5rem);
    }
  }
}

/*
 * Opening hours' baseline (ADR 0010): readable under any Theme, including Theme Releases older
 * than this Module. Themes refine it in their `theme` layer. The table keeps days and hours
 * side by side even at 320 px; a long run of days wraps within its cell.
 */
@layer modules {
  .m-opening-hours {
    container-type: inline-size;
    margin-block: var(--ms-space-l, 2rem);
  }

  .m-opening-hours__text {
    max-inline-size: var(--ms-measure, 65ch);

    & > :first-child {
      margin-block-start: 0;
    }

    & > :last-child {
      margin-block-end: var(--ms-space-s, 1rem);
    }

    & a {
      color: var(--ms-color-primary, LinkText);
    }
  }

  /* Both tables, the week's and Special Days', are as wide and give the days the same share, so
     their hours line up. The hours never wrap; the days take what is left. */
  .m-opening-hours__table {
    inline-size: 100%;
    max-inline-size: 32rem;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
  }

  .m-opening-hours__days,
  .m-opening-hours__hours {
    padding-block: var(--ms-space-2xs, 0.25rem);
    text-align: start;
    vertical-align: baseline;
  }

  .m-opening-hours__days {
    inline-size: 60%;
    padding-inline-end: var(--ms-space-m, 1.5rem);
    font-weight: inherit;
  }

  .m-opening-hours__hours {
    white-space: nowrap;
  }

  /* Special Days (#259): their subheading, and the label above the dates. */
  .m-opening-hours__subheading {
    margin-block: var(--ms-space-m, 1.5rem) var(--ms-space-xs, 0.5rem);
    font-family: var(--ms-font-heading, inherit);
    font-size: var(--ms-text-1, 1.2rem);
    line-height: var(--ms-line-height-heading, 1.2);
  }

  .m-opening-hours__label,
  .m-opening-hours__dates,
  .m-opening-hours__range {
    display: block;
  }

  .m-opening-hours__label {
    font-weight: bolder;
  }
}

/*
 * Table of contents' baseline (ADR 0010, #284): readable under any Theme, including Theme
 * Releases older than this Module. A plain numbered list of links; Themes may restyle it, make
 * it sticky, and add smooth scrolling and `scroll-margin-top` to Section headings. When the
 * Member ticks "collapsible", the list sits in a closed `<details>` and its summary opens it.
 */
@layer modules {
  .m-table-of-contents {
    container-type: inline-size;
    margin-block: var(--ms-space-l, 2rem);
  }

  /* Smaller and muted than the shared Module heading: it introduces the list, not a Section. */
  .m-table-of-contents__heading {
    font-size: var(--ms-text-1, 1.2rem);
    color: var(--ms-color-text-muted, CanvasText);
  }

  /* On a box of the surface color, its list or, collapsible, the whole of it. */
  .m-table-of-contents__list,
  .m-table-of-contents__details {
    max-inline-size: var(--ms-measure, 65ch);
    margin: 0;
    padding: var(--ms-space-xs, 0.75rem) var(--ms-space-s, 1rem) var(--ms-space-xs, 0.75rem)
      var(--ms-space-l, 2rem);
    background: var(--ms-color-surface, Canvas);
    border-radius: var(--ms-radius, 0.25rem);
  }

  .m-table-of-contents__details {
    padding-inline-start: var(--ms-space-s, 1rem);

    & .m-table-of-contents__list {
      padding: 0 0 0 var(--ms-space-m, 1.5rem);
      background: none;
    }
  }

  .m-table-of-contents__item + .m-table-of-contents__item {
    margin-block-start: var(--ms-space-2xs, 0.25rem);
  }

  /* 24 px minimum target height (WCAG 2.2, 2.5.8) on touch screens. */
  .m-table-of-contents__link {
    display: inline-block;
    min-block-size: 24px;
    padding-block: var(--ms-space-3xs, 0.125rem);
    color: var(--ms-color-primary, LinkText);
    text-underline-offset: var(--ms-link-underline-offset, 0.2em);

    &:hover {
      color: var(--ms-color-primary-hover, LinkText);
    }
  }

  /* Collapsible: the summary reads like the heading and is a comfortable tap target. */
  .m-table-of-contents__summary {
    display: list-item;
    min-block-size: 24px;
    cursor: pointer;

    & .m-table-of-contents__heading {
      display: inline;
      font-weight: bolder;
    }
  }

  /* The heading's alignment (#774), on the summary that shows it, with its marker; important, as
     the other Module headings' are, so it beats a Theme's. */
  .m-table-of-contents__summary--start {
    text-align: start !important;
  }

  .m-table-of-contents__summary--center {
    text-align: center !important;
  }

  .m-table-of-contents__summary--end {
    text-align: end !important;
  }

  .m-table-of-contents__details[open] > .m-table-of-contents__summary {
    margin-block-end: var(--ms-space-xs, 0.5rem);
  }
}

/*
 * FAQ's baseline (ADR 0010, #272): readable under any Theme, including Theme Releases older than
 * this Module. Each question is a native <details>, so it opens without JavaScript; the browser's
 * own marker shows open and closed by its shape, not by colour. Themes refine it.
 */
@layer modules {
  .m-faq {
    container-type: inline-size;
    margin-block: var(--ms-space-l, 2rem);
  }

  .m-faq__item {
    max-inline-size: var(--ms-measure, 65ch);
    border-block-end: var(--ms-border-width, 1px) solid var(--ms-color-border, currentColor);
  }

  /* A whole-row target of at least 44 px (WCAG 2.2, 2.5.8 and the admin's own rule). */
  .m-faq__question {
    display: list-item;
    min-block-size: 44px;
    padding-block: var(--ms-space-xs, 0.75rem);
    font-weight: bolder;
    cursor: pointer;
  }

  .m-faq__answer {
    padding-block-end: var(--ms-space-s, 1rem);

    & > :first-child {
      margin-block-start: 0;
    }

    & > :last-child {
      margin-block-end: 0;
    }

    & a {
      color: var(--ms-color-primary, LinkText);
    }
  }

  .m-faq__item {
    border-block-end-color: var(--ms-color-border, currentColor);

    &:first-of-type {
      border-block-start: var(--ms-border-width, 1px) solid var(--ms-color-border, currentColor);
    }
  }

  .m-faq__question {
    display: flex;
    gap: var(--ms-space-s, 1rem);
    align-items: center;
    justify-content: space-between;
    list-style: none;
    color: var(--ms-color-text, CanvasText);

    &::-webkit-details-marker {
      display: none;
    }

    &::after {
      flex: none;
      content: "+";
      /* biome-ignore lint/suspicious/noDuplicateProperties: the plain one is the fallback where alt text is unsupported. */
      content: "+" / "";
      font-size: 1.25em;
      line-height: 1;
      color: var(--ms-color-primary, LinkText);
    }

    &:hover {
      color: var(--ms-color-primary-hover, LinkText);
    }
  }

  .m-faq__item[open] > .m-faq__question::after {
    content: "\2212";
    /* biome-ignore lint/suspicious/noDuplicateProperties: the plain one is the fallback where alt text is unsupported. */
    content: "\2212" / "";
  }

  .m-faq__answer a {
    color: var(--ms-color-primary, LinkText);
    text-underline-offset: var(--ms-link-underline-offset, 0.2em);
  }
}

/*
 * Banner's baseline (ADR 0010, #328): readable under any Theme. A band in the surface colour with
 * a large heading, an optional line of text and up to two buttons, its height following its
 * content above a minimum. Its width is the shared `data-width` (ADR 0012, #635), stretched by
 * theme-base: `full` to the edges, with square corners, and `breakout` as wide as the large
 * container, keeping its corners. The body keeps the reading width inside it. Themes refine it.
 */
@layer modules {
  .m-banner {
    display: grid;
    align-items: center;
    min-block-size: 16rem;
    margin-block: var(--ms-space-l, 2rem);
    color: var(--ms-color-text, CanvasText);
    background: var(--ms-color-surface, Canvas);
    border-radius: var(--ms-radius, 0);

    &[data-width="full"] {
      border-radius: 0;
    }
  }

  /*
   * With a background image (#329): the image covers the Banner, a dark overlay sits on it, and
   * the text is white. The default overlay is 60% black, so white text has at least 5.7:1 even
   * on a white photo (WCAG AA). Themes may tint it with `--ms-banner-overlay`, never weaken it.
   */
  .m-banner--with-image {
    position: relative;
    isolation: isolate;
    overflow: clip;

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      background: var(--ms-banner-overlay, rgb(0 0 0 / 0.6));
    }
  }

  /*
   * The light overlay, chosen per Banner: 60% white, so the near-black text has at least 6.6:1
   * even on a black photo (WCAG AA). Fixed, not a token, as the dark text needs it light.
   */
  .m-banner--light::after {
    background: rgb(255 255 255 / 0.6);
  }

  .m-banner__media {
    position: absolute;
    inset: 0;
    z-index: -2;
  }

  /* Fills the Banner; the shared focus rules crop it around its Focal Point (#458). */
  .m-banner__image {
    block-size: 100%;
  }

  .m-banner__body {
    inline-size: 100%;
    max-inline-size: var(--ms-container-md, 48rem);
    margin-inline: auto;
    padding: var(--ms-space-xl, 3rem) var(--ms-space-m, 1.5rem);
  }

  .m-banner__heading {
    margin: 0;
    font-size: var(--ms-text-4, 2.07rem);
    text-wrap: balance;
  }

  .m-banner__text {
    max-inline-size: var(--ms-measure, 65ch);
    margin: var(--ms-space-s, 1rem) 0 0;
    font-size: var(--ms-text-1, 1.2rem);
  }

  /* The main button first, then the secondary (#512): side by side, wrapping onto rows on phones. */
  .m-banner__action {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ms-space-xs, 0.75rem);
    margin: var(--ms-space-m, 1.5rem) 0 0;
  }

  /*
   * The second button (#512) is outlined, as the shared outlined button (the buttons pattern). It hovers to
   * the background rather than the surface colour, which is the Banner's own.
   */
  .m-banner__button--secondary:hover {
    background: var(--ms-color-background, transparent);
  }

  /* The heading weight, muted text and details every Theme shares (#506). */
  .m-banner__heading {
    font-size: var(--ms-text-5, 2.49rem);
  }

  .m-banner__text {
    color: var(--ms-color-text-muted, CanvasText);
  }

  /*
   * The ink on a photo: white on the dark overlay, near-black on the light one. Fixed, not tokens,
   * because each overlay is fixed to suit it. The shade is the second button's hover, which moves
   * away from the ink so the text keeps its contrast.
   */
  .m-banner--with-image {
    --_banner-ink: #fff;
    --_banner-shade: rgb(0 0 0 / 0.3);
  }

  .m-banner--light {
    --_banner-ink: #111;
    --_banner-shade: rgb(255 255 255 / 0.5);
  }

  /*
   * The ink on the heading and text, important so it beats every Theme's text colour, including
   * Theme Releases older than this rule (ADR 0010): an important declaration in an earlier layer
   * wins over normal ones in later layers. After the plain rules, for noDescendingSpecificity.
   */
  .m-banner--with-image :is(.m-banner__heading, .m-banner__text) {
    color: var(--_banner-ink) !important;
  }

  /*
   * The second button on a photo (#512): outlined and written in the ink, which has at least
   * 5.7:1 on either overlay (WCAG AA). Important, as the heading's is, so it beats any Theme's
   * button colours.
   */
  .m-banner--with-image .m-banner__button--secondary {
    color: var(--_banner-ink) !important;
    border-color: var(--_banner-ink) !important;

    &:hover {
      background: var(--_banner-shade);
    }
  }

  /* The focus ring in the ink too: a Theme's primary colour may be faint on either overlay. */
  .m-banner--with-image :focus-visible {
    outline-color: var(--_banner-ink);
  }
}

/*
 * Pricing table's baseline (ADR 0010, #340): readable under any Theme, including Theme Releases
 * older than this Module. The columns keep the Member's order: side by side as many as fit at
 * 12rem or more, the rest wrapping onto a new row, and stacked on phones; no JavaScript and no
 * sideways scrolling. The highlighted
 * column has a thicker border and its badge text, so it never relies on colour. Themes refine it.
 */
@layer modules {
  .m-pricing-table {
    margin-block: var(--ms-space-l, 2rem);
  }

  /* Full width (ADR 0012, #617): the heading and the columns keep a gutter from the edges, as a
     full-width Gallery's or Grid of cards' do (#633). */
  .m-pricing-table[data-width="full"] {
    padding-inline: var(--ms-space-m, 1.5rem);
  }

  .m-pricing-table__intro {
    max-inline-size: var(--ms-measure, 65ch);
    margin-block-end: var(--ms-space-m, 1.5rem);

    & > :first-child {
      margin-block-start: 0;
    }

    & a {
      color: var(--ms-color-primary, LinkText);
    }
  }

  .m-pricing-table__columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: var(--ms-space-s, 1rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* A Panel (the shared Panel styles): its fill, edge, corners and padding follow the Theme's Panel look. */
  .m-pricing-table__column {
    display: flex;
    flex-direction: column;
    gap: var(--ms-space-2xs, 0.5rem);
    min-inline-size: 0;
    /* A long word breaks only when it can't fit, hyphenated in the Site's language. */
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* The thicker border comes out of the padding, so the column's content and button stay in line
     with the other columns'. */
  .m-pricing-table__column--highlighted {
    padding: calc(
      var(--ms-panel-padding, 1.5rem) +
      var(--ms-panel-border-width, 1px) -
      var(--ms-border-width, 1px) *
      3
    );
    border-width: calc(var(--ms-border-width, 1px) * 3);
    border-color: var(--ms-color-primary, currentColor);
  }

  .m-pricing-table__badge {
    align-self: flex-start;
    margin: 0;
    padding: 0.125em 0.625em;
    font-size: var(--ms-text--1, 0.83rem);
    font-weight: bolder;
    color: var(--ms-color-on-primary, Canvas);
    background: var(--ms-color-primary, CanvasText);
    border-radius: var(--ms-radius-pill, 999px);
  }

  .m-pricing-table__name {
    margin: 0;
    font-family: var(--ms-font-heading, inherit);
    font-size: var(--ms-text-1, 1.2rem);
    font-weight: var(--ms-font-weight-heading, 600);
    line-height: var(--ms-line-height-heading, 1.2);
  }

  .m-pricing-table__price {
    margin: 0;
  }

  .m-pricing-table__amount {
    font-size: var(--ms-text-3, 1.73rem);
    font-weight: bolder;
    line-height: 1.1;
  }

  .m-pricing-table__description,
  .m-pricing-table__features {
    margin: 0;
  }

  .m-pricing-table__period,
  .m-pricing-table__description {
    color: var(--ms-color-text-muted, CanvasText);
  }

  .m-pricing-table__features {
    padding-inline-start: 0;
    list-style: none;
  }

  /* A check before each feature, drawn in text so it needs no image, and silent to screen readers:
     the list already says these are features. It hangs in the feature's padding, so a feature that
     wraps lines up under its own text. */
  .m-pricing-table__feature {
    padding-inline-start: 1.25em;
  }

  .m-pricing-table__feature::before {
    content: "\2713";
    /* biome-ignore lint/suspicious/noDuplicateProperties: the plain one is the fallback where alt text is unsupported. */
    content: "\2713" / "";
    display: inline-block;
    inline-size: 1.25em;
    margin-inline-start: -1.25em;
    font-weight: bolder;
    color: var(--ms-color-primary, LinkText);
  }

  /* At the foot of the column, so the buttons line up; at least 44 px tall, the target size the
     admin and every Site keep to (WCAG 2.2 asks for 24 px, 2.5.8). */
  .m-pricing-table__action {
    margin: auto 0 0;
    padding-block-start: var(--ms-space-xs, 0.75rem);
  }

  /* Across the whole column, so every column's button lines up. */
  .m-pricing-table__button {
    display: flex;
  }
}

/*
 * Gallery's baseline (ADR 0010, #349): readable under any Theme, including Theme Releases older
 * than this Module. A grid of thumbnails in the Member's order, as many side by side as fit at
 * 9rem or more, and never fewer than two, so phones show two columns (owner decision). Every
 * thumbnail is cropped to the gallery's one shape in CSS, around its Focal Point (#458), so moving
 * the point needs no new image sizes. No JavaScript and no sideways scrolling. Themes refine it.
 *
 * Each thumbnail links to its image, large and uncropped (#350). With the Runtime's gallery
 * script, the link opens the lightbox below instead: a modal `<dialog>` over the whole Page, so it
 * is styled here, in every Theme alike, with the Theme's tokens. Text and icons are the Theme's
 * text colour on its background, the pair every Theme keeps above WCAG AA.
 */
@layer modules {
  .m-gallery {
    margin-block: var(--ms-space-l, 2rem);
  }

  /* Full width (ADR 0012): the heading and the grid keep a gutter from the edges. */
  .m-gallery[data-width="full"] {
    padding-inline: var(--ms-space-m, 1.5rem);
  }

  /* Opening the Page at full width, a gallery meets the header; its heading keeps some air. */
  .m-gallery[data-width="full"] .m-gallery__heading {
    margin-block-start: var(--ms-space-s, 1rem);
  }

  .m-gallery__list {
    display: grid;
    /* Half the width less half the gap is the most a column may ask for: always two or more. */
    grid-template-columns: repeat(
        auto-fill,
        minmax(min(calc(50% - var(--ms-space-2xs, 0.5rem) / 2), 9rem), 1fr)
      );
    gap: var(--ms-space-2xs, 0.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .m-gallery__item {
    min-inline-size: 0;
  }

  .m-gallery__figure {
    margin: 0;
  }

  .m-gallery__link {
    display: block;
    border-radius: var(--ms-radius, 0);
  }

  .m-gallery__media {
    display: block;
  }

  .m-gallery__image {
    display: block;
    block-size: auto;
    aspect-ratio: 1;
    background: var(--ms-color-surface, Canvas);
    border-radius: var(--ms-radius, 0);
  }

  .m-gallery--landscape .m-gallery__image {
    aspect-ratio: 4 / 3;
  }

  .m-gallery--portrait .m-gallery__image {
    aspect-ratio: 3 / 4;
  }

  /* One row under the thumbnail, cut with an ellipsis, so every row of the grid lines up
     (owner decision 2026-11-10). The whole caption is in the HTML, for screen readers and for
     the larger view (#350). */
  .m-gallery__caption {
    padding-block-start: var(--ms-space-3xs, 0.25rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--ms-text--1, 0.83rem);
    color: var(--ms-color-text-muted, inherit);
  }

  /* The page behind an open lightbox doesn't scroll. */
  html:has(.m-gallery-lightbox[open]) {
    overflow: hidden;
  }

  /*
   * The lightbox (#350), mobile first: the position and Close on top, the image and its caption,
   * then Previous and Next. From 48rem, Previous and Next sit beside the image. `display` only
   * while open, so a closed dialog stays hidden. Media queries, not container queries: the dialog
   * fills the screen, and an element can't query its own size.
   */
  .m-gallery-lightbox {
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    max-inline-size: none;
    max-block-size: none;
    margin: 0;
    padding: var(--ms-space-2xs, 0.5rem);
    border: 0;
    color: var(--ms-color-text, CanvasText);
    background: var(--ms-color-background, Canvas);
    /* Sideways swipes step through the images; pinching still zooms. */
    touch-action: pan-y pinch-zoom;
  }

  .m-gallery-lightbox[open] {
    display: grid;
    grid-template:
      "position close" auto
      "figure figure" minmax(0, 1fr)
      "previous next" auto
      / 1fr 1fr;
    gap: var(--ms-space-2xs, 0.5rem);
  }

  .m-gallery-lightbox::backdrop {
    background: var(--ms-color-background, Canvas);
  }

  @media (min-width: 48rem) {
    .m-gallery-lightbox[open] {
      grid-template:
        "position position close" auto
        "previous figure next" minmax(0, 1fr)
        / auto 1fr auto;
      padding: var(--ms-space-s, 1rem);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .m-gallery-lightbox[open] {
      animation: m-gallery-lightbox-in var(--ms-duration-fast, 150ms)
        var(--ms-ease-standard, ease-out);
    }
  }

  @keyframes m-gallery-lightbox-in {
    from {
      opacity: 0;
    }
  }

  .m-gallery-lightbox__position {
    grid-area: position;
    align-self: center;
    margin: 0;
    font-size: var(--ms-text--1, 0.83rem);
  }

  .m-gallery-lightbox__figure {
    grid-area: figure;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ms-space-2xs, 0.5rem);
    min-block-size: 0;
    margin: 0;
  }

  .m-gallery-lightbox__media {
    display: contents;
  }

  /* Whole, in its own proportions: it shrinks to fit and is never cropped or enlarged. */
  .m-gallery-lightbox__image {
    flex: 0 1 auto;
    min-block-size: 0;
    max-inline-size: 100%;
    max-block-size: 100%;
    inline-size: auto;
    block-size: auto;
    object-fit: contain;
  }

  .m-gallery-lightbox__caption {
    max-inline-size: var(--ms-container-md, 48rem);
    text-align: center;
  }

  .m-gallery-lightbox__caption:empty {
    display: none;
  }

  /* At least 44 px each way (WCAG 2.2, 2.5.8). */
  .m-gallery-lightbox__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ms-space-3xs, 0.25rem);
    min-inline-size: 44px;
    min-block-size: 44px;
    padding: var(--ms-space-3xs, 0.25rem) var(--ms-space-xs, 0.75rem);
    font: inherit;
    color: inherit;
    background: var(--ms-color-background, Canvas);
    border: var(--ms-border-width, 1px) solid currentColor;
    border-radius: var(--ms-radius, 0.25rem);
    cursor: pointer;

    &:hover {
      text-decoration: underline;
    }
  }

  /* A gallery of one image has no Previous or Next. */
  .m-gallery-lightbox__button[hidden] {
    display: none;
  }

  .m-gallery-lightbox__button--close {
    grid-area: close;
    justify-self: end;
  }

  .m-gallery-lightbox__button--previous {
    grid-area: previous;
    justify-self: start;
  }

  .m-gallery-lightbox__button--next {
    grid-area: next;
    justify-self: end;
  }

  @media (min-width: 48rem) {
    .m-gallery-lightbox__button--previous,
    .m-gallery-lightbox__button--next {
      align-self: center;
    }
  }

  .m-gallery-lightbox__icon {
    inline-size: 1.25em;
    block-size: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/*
 * The contact form's baseline (ADR 0010, #423): readable and usable under any Theme, including
 * Theme Releases older than this Module. One column of labelled fields at the reading width;
 * every control at least 44 px tall (WCAG 2.2, 2.5.8). The notes `api` sends a visitor back to
 * show with `:target`, so the form works without JavaScript. Themes refine it.
 */
@layer modules {
  .m-contact-form {
    container-type: inline-size;
    margin-block: var(--ms-space-l, 2rem);
  }

  .m-contact-form__form {
    display: grid;
    gap: var(--ms-space-s, 1rem);
    max-inline-size: var(--ms-measure, 65ch);
  }

  .m-contact-form__field {
    display: grid;
    gap: var(--ms-space-3xs, 0.25rem);
  }

  .m-contact-form__label {
    font-weight: bolder;
  }

  .m-contact-form__hint,
  .m-contact-form__privacy,
  .m-contact-form__preview {
    margin: 0;
    font-size: var(--ms-text--1, 0.875rem);
  }

  .m-contact-form__input {
    box-sizing: border-box;
    inline-size: 100%;
    min-block-size: 44px;
    padding: var(--ms-space-2xs, 0.5rem);
    font: inherit;
    color: var(--ms-color-text, FieldText);
    background: var(--ms-color-background, Field);
    /* Muted text, not the border token: a field's edge needs 3:1 (WCAG 2.2, 1.4.11). */
    border: var(--ms-border-width, 1px) solid var(--ms-color-text-muted, currentColor);
    border-radius: var(--ms-radius, 0.25rem);
  }

  .m-contact-form__input--message {
    resize: vertical;
  }

  .m-contact-form__submit {
    justify-self: start;

    &:disabled {
      cursor: not-allowed;
      opacity: 0.6;
    }
  }

  /*
   * Shown only when `api` sends the visitor back to it (`#sent-…`, or a refusal's, #443), or when
   * the Runtime's contact form script shows it in place (`data-shown`, #448).
   */
  .m-contact-form__status {
    display: none;
    max-inline-size: var(--ms-measure, 65ch);
    margin-block: 0 var(--ms-space-s, 1rem);
    padding: var(--ms-space-s, 1rem);
    font-weight: bolder;
    border: var(--ms-border-width, 1px) solid currentColor;
    border-inline-start-width: 0.25rem;
    border-radius: var(--ms-radius, 0.25rem);

    &:target,
    &[data-shown] {
      display: block;
    }
  }

  .m-contact-form__heading {
    text-wrap: balance;
  }

  .m-contact-form__input {
    color: var(--ms-color-text, CanvasText);
    background: var(--ms-color-background, Canvas);
    border-color: var(--ms-color-text-muted, CanvasText);
    border-radius: var(--ms-radius, 0.25rem);

    &:focus-visible {
      border-color: var(--ms-color-primary, LinkText);
    }
  }

  .m-contact-form__hint,
  .m-contact-form__privacy,
  .m-contact-form__preview {
    color: var(--ms-color-text-muted, CanvasText);
  }

  .m-contact-form__status {
    color: var(--ms-color-text, CanvasText);
    background: var(--ms-color-surface, Canvas);
    border-color: var(--ms-color-primary, LinkText);
  }
}

/*
 * Grid of cards' baseline (ADR 0010, #426): readable under any Theme, including Theme Releases
 * older than this Module. The cards' columns, Panels, images, titles and text are the card pattern
 * it shares with the Subpages Module. This adds what only a grid has: every card's image
 * cropped to the grid's one shape around its Focal Point, in CSS, as in the Gallery; an icon, the
 * emoji's SVG inline; a short rich-text body; and the button at the card's foot, so buttons line
 * up. Themes refine it.
 */
@layer modules {
  .m-card-grid__image {
    aspect-ratio: 1;
  }

  .m-card-grid--landscape .m-card-grid__image {
    aspect-ratio: 4 / 3;
  }

  .m-card-grid--portrait .m-card-grid__image {
    aspect-ratio: 3 / 4;
  }

  .m-card-grid__icon {
    display: block;
    inline-size: 2.5rem;
    block-size: 2.5rem;

    & svg {
      display: block;
      inline-size: 100%;
      block-size: 100%;
    }
  }

  .m-card-grid__text {
    & > * {
      margin-block: 0 var(--ms-space-2xs, 0.5rem);
    }

    & > :last-child {
      margin-block-end: 0;
    }

    & ul,
    & ol {
      padding-inline-start: 1.25em;
    }

    & a {
      color: var(--ms-color-primary, LinkText);
    }
  }

  /* At the foot of the card, so the buttons of a row line up; at least 44 px tall, the target
     size the admin and every Site keep to (WCAG 2.2 asks for 24 px, 2.5.8). */
  .m-card-grid__action {
    margin: auto 0 0;
    padding-block-start: var(--ms-space-2xs, 0.5rem);
  }

  /* A label too long for a narrow card wraps at its spaces, never inside a word. */
  .m-card-grid__button {
    max-inline-size: 100%;
    hyphens: manual;
  }
}

/*
 * The Address's baseline (ADR 0010): readable under any Theme, including Theme Releases older
 * than this Module. Themes refine it in their `theme` layer.
 */
@layer modules {
  .m-address {
    container-type: inline-size;
    margin-block: var(--ms-space-l, 2rem);
  }

  .m-address__text {
    max-inline-size: var(--ms-measure, 65ch);

    & > :first-child {
      margin-block-start: 0;
    }

    & > :last-child {
      margin-block-end: var(--ms-space-s, 1rem);
    }

    & a {
      color: var(--ms-color-primary, LinkText);
    }
  }

  .m-address__address {
    font-style: normal;
  }

  /* The map (#525): under the address on phones, beside it where there's room. */
  /* Resets the browser's figure margin (1em 40px), which shrinks the map. */
  .m-address__map {
    margin: var(--ms-space-s, 1rem) 0 0;
  }

  .m-address__map-link {
    display: block;
  }

  .m-address__map-image {
    display: block;
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--ms-radius, 0);
  }

  .m-address__credit {
    margin-block-start: var(--ms-space-3xs, 0.25rem);
    font-size: var(--ms-text--1, 0.83rem);
    color: var(--ms-color-text-muted, inherit);

    & a {
      color: inherit;
    }
  }

  @container (inline-size >= 40rem) {
    .m-address--with-map {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
      column-gap: var(--ms-space-m, 1.5rem);
      align-items: start;
    }

    .m-address--with-map > :not(.m-address__address, .m-address__map) {
      grid-column: 1 / -1;
    }

    .m-address--with-map .m-address__map {
      margin-block-start: 0;
    }
  }

  .m-address__text {
    & a {
      text-underline-offset: var(--ms-link-underline-offset, 0.2em);

      &:hover {
        color: var(--ms-color-primary-hover, LinkText);
      }
    }

    & :is(h2, h3) {
      margin-block: var(--ms-space-m, 1.5rem) var(--ms-space-2xs, 0.5rem);
    }
  }
}

/*
 * Columns' baseline (ADR 0010, #441): readable under any Theme, including Theme Releases older
 * than this Module. Its Sections fill the cells in the Member's order, one per cell, in at most the
 * columns the Member picked: each cell is at least `--_min` wide, half the small container
 * (the design system's Containers), so they wrap onto more rows when
 * there's no room and stack on phones. Fewer Sections than columns share the width. The tracks are
 * sized by the Columns' own width, so at full width four fit where the reading column takes two. No
 * sideways scrolling. Each cell is a query container, so a Section lays itself out for its cell,
 * not the Page: Opening hours and Address keep no side padding in a narrow cell. It has no heading:
 * its Sections keep theirs. Themes refine it.
 */
@layer modules {
  .m-columns {
    --_count: 2;
    --_gap: var(--ms-space-m, 1.5rem);
    --_min: calc(var(--ms-container-sm, 30rem) / 2);
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(
          min(100%, max(var(--_min), (100% - (var(--_count) - 1) * var(--_gap)) / var(--_count))),
          1fr
        )
      );
    gap: var(--ms-space-l, 2rem) var(--_gap);
    margin-block: var(--ms-space-l, 2rem);
  }

  .m-columns--columns-3 {
    --_count: 3;
  }

  .m-columns--columns-4 {
    --_count: 4;
  }

  /* Full width (ADR 0012): the Sections keep a gutter from the edges, and, with no background to
     meet the header with, the usual space above even when the Columns opens the Page. */
  .m-columns[data-width="full"] {
    margin-block-start: var(--ms-space-l, 2rem);
    padding-inline: var(--ms-space-m, 1.5rem);
  }

  .m-columns__cell {
    container-type: inline-size;
    min-inline-size: 0;

    /* The Columns keeps the space around the row; a Section in a cell starts at its top. */
    & > * {
      margin-block: 0;
    }
  }
}

/*
 * Subpages' baseline (ADR 0010, #540): readable under any Theme, including Theme Releases older
 * than this Module. Its columns, Panels, images, titles and descriptions are the shared card
 * pattern, as for the Grid of cards, so Themes style both alike. This adds every image's landscape
 * 4:3 crop around its Focal Point, and the one link per card: the card's heading, stretched over the
 * whole card, so a tap anywhere opens the subpage and a screen reader hears only its title. The
 * focus ring and the hover underline move to the card the link covers. No JavaScript.
 */
@layer modules {
  .m-subpages__card {
    position: relative;
  }

  .m-subpages__image {
    aspect-ratio: 4 / 3;
  }

  .m-subpages__description {
    margin: 0;
  }

  .m-subpages__link {
    color: inherit;
    text-decoration: none;
  }

  /* Rounded as the card's Panel is, so the focus ring follows its corners. */
  .m-subpages__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--ms-panel-radius, 0.5rem);
  }

  .m-subpages__card:hover .m-subpages__link {
    text-decoration: underline;
  }

  .m-subpages__link:focus-visible {
    outline: none;
  }

  .m-subpages__link:focus-visible::after {
    outline: var(--ms-focus-width, 3px) solid var(--ms-color-primary, Highlight);
    outline-offset: var(--ms-focus-offset, 2px);
  }
}

/*
 * Food menu's baseline (ADR 0010, #626): readable under any Theme, including Theme Releases older
 * than this Module. Its dishes are laid out like the Price list's rows, in the shared price-rows
 * pattern: the name and price on one line, the price at the end, and the description
 * below. This holds what is the Food menu's own: numbers (#627), menu marks and their key (#628)
 * and allergens (#629).
 */
@layer modules {
  .m-food-menu {
    margin-block: var(--ms-space-l, 2rem);
  }

  /* The number (#627) starts the name, part of its heading, so a screen reader reads "31 Pad
     thai". At least three figures wide, of one width each, so numbered names line up for numbers
     up to "999" or "31a"; a longer one pushes its own name on, and a dish with none starts flush. */
  .m-food-menu__number {
    display: inline-block;
    min-inline-size: 3ch;
    font-variant-numeric: tabular-nums;
  }

  /* A dish's allergens and allergen note (#629), under its description, smaller. */
  .m-food-menu__allergens {
    grid-column: 1 / -1;
    max-inline-size: var(--ms-measure, 65ch);
    margin: var(--ms-space-3xs, 0.25rem) 0 0;
    font-size: var(--ms-text--1, 0.83rem);
    color: var(--ms-color-text-muted, CanvasText);
  }

  /* Menu marks (#628) follow the name, inside its heading, as icons the size of its text; their
     names are read out, and shown in place of an icon the render doesn't have. */
  .m-food-menu__marks {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25em;
    vertical-align: -0.125em;
    font-family: var(--ms-font-body, inherit);
    font-size: 0.8em;
    font-weight: normal;
  }

  .m-food-menu__mark {
    display: inline-flex;
    gap: 0.0625em;
  }

  :is(.m-food-menu__mark, .m-food-menu__key-item) svg {
    inline-size: 1.25em;
    block-size: 1.25em;
    flex: none;
  }

  .m-food-menu__mark-name {
    font-size: var(--ms-text--1, 0.83rem);
    color: var(--ms-color-text-muted, CanvasText);
  }

  /* The key: one entry per mark the menu uses, on one line where they fit. */
  .m-food-menu__key {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ms-space-2xs, 0.5rem) var(--ms-space-s, 1rem);
    margin: var(--ms-space-m, 1.5rem) 0 0;
    padding: 0;
    font-size: var(--ms-text--1, 0.83rem);
    color: var(--ms-color-text-muted, CanvasText);
    list-style: none;
  }

  .m-food-menu__key-item {
    display: inline-flex;
    gap: 0.375em;
    align-items: center;
  }
}

/*
 * Price list's baseline (ADR 0010, #729). Its rows are laid out like the Food menu's, in the shared
 * price-rows pattern; this holds only what is the Price list's own.
 */
@layer modules {
  .m-price-list {
    margin-block: var(--ms-space-l, 2rem);
  }

  /*
   * A row's button (#730). Outlined, as the shared outlined button (the buttons pattern), so a
   * button on every row isn't a column of filled buttons (owner decision 2026-11-24). On phones
   * it sits under the description, across the whole row.
   */
  .m-price-list__action {
    grid-column: 1 / -1;
    margin-block: var(--ms-space-2xs, 0.5rem) 0;
  }

  /*
   * From 30rem, a list with buttons gives them a column of their own after the prices, on the
   * name's line (owner decision 2026-11-24). The list is one grid that every row takes its columns
   * from (subgrid), so the price headings, prices and buttons line up down the list, and a row
   * without a button keeps its price in line with the others. The Region is the container, as for
   * cards in columns. Where subgrid isn't supported, the buttons stay under the descriptions.
   */
  @supports (grid-template-columns: subgrid) {
    @container (inline-size >= 30rem) {
      .m-price-list--with-buttons {
        display: grid;
        grid-template-columns:
          minmax(0, 1fr)
          fit-content(min(12rem, 30%))
          fit-content(min(14rem, 30%));
        column-gap: var(--ms-space-s, 1rem);

        & > * {
          grid-column: 1 / -1;
        }

        & > .m-price-list__price-headings {
          grid-column: 2;
        }

        & .m-price-list__rows {
          display: grid;
          grid-template-columns: subgrid;
          row-gap: var(--ms-space-s, 1rem);
        }

        & .m-price-list__row {
          grid-column: 1 / -1;
          grid-template-columns: subgrid;
        }

        & .m-price-list__action {
          grid-row: 1;
          grid-column: 3;
          margin-block: 0;
        }
      }
    }
  }
}

/*
 * The Text's baseline (#661, ADR 0010): a short line or two of rich text with no heading, such as
 * a phone number or a "Book now" button, readable under any Theme, Theme Releases older than this
 * Module included. Its buttons are rich text's. The Region it's in sets its width
 * and spacing around it; Themes refine it in their `theme` layer.
 */
@layer modules {
  .m-text {
    margin-block: var(--ms-space-m, 1.5rem);

    /* Each block keeps to a readable line length, and starts at the Region's start unless the
       Member aligned it (#771): the shared alignment rules move a centered or end-aligned one. */
    & > * {
      max-inline-size: var(--ms-measure, 65ch);
    }

    & > :first-child {
      margin-block-start: 0;
    }

    & > :last-child {
      margin-block-end: 0;
    }

    /* Links in the text, not its buttons, which keep the shared button's colours. */
    & a:not([class]) {
      color: var(--ms-color-primary, LinkText);
    }
  }

  /*
   * In the band above the header (#662): no space around it, so the band stays thin, and its lines
   * and buttons share one row where there's room, wrapping onto more on phones. Here and not in
   * theme-base, as the band's look is: theme-base's `layout` layer comes before `modules`, so it
   * can't undo the Text's own margins. `data-region` is part of every Layout's HTML; on a Layout
   * Release from before the band, this never matches.
   */
  [data-region="before-header"] .m-text {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ms-space-2xs, 0.5rem) var(--ms-space-m, 1.5rem);
    max-inline-size: none;
    margin-block: 0;

    /* One row, so its items keep their own width and no space of their own: the row as a whole
       follows the text's alignment (#771, in the shared alignment rules), not each item. */
    & > * {
      max-inline-size: none;
      margin-block: 0;
    }
  }
}
