/* Shared editorial grid. Load after the locale and branch presentation styles. */
:root {
  --layout-max: 1232px;
  --layout-gutter: clamp(6vw, calc(10vw - 36px), 7.5vw);
  --layout-inset: max(var(--layout-gutter), calc((100% - var(--layout-max)) / 2));
  --layout-bleed: max(var(--layout-gutter), calc((100vw - var(--layout-max)) / 2));
  --layout-rail: min(var(--layout-max), calc(100% - 2 * var(--layout-gutter)));
  --layout-columns: 12;
  --layout-gap: clamp(16px, 1.8vw, 28px);
  --layout-fifth-column: calc((100% + var(--layout-gap)) * 5 / 12 - var(--layout-gap));
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(var(--layout-columns), minmax(0, 1fr));
  gap: var(--layout-gap);
}

/* Use on the innermost full-width parent, once per section. */
.layout-rail,
html body .site-header .header-inner,
html body .branch-landing > .architecture-caption,
html body .ms-page .ms-arrival-grid,
html body .page-sections .ms-arrival-grid,
html body .page-sections .ms-statement-inner,
html body .page-sections .ms-cooking-spread,
html body .page-sections .ms-concerns-inner,
html body .page-sections .ms-gallery .ms-gallery-track,
html body .page-sections .ms-visit-rows,
html body .page-sections .ms-location > .ms-wrap,
html body .page-sections .ms-booking > .ms-wrap,
html body .site-footer > .footer-top,
html body .site-footer > .footer-bottom,
html body.ms-subpage #main > :is(.ms-bv-page, .blog-index, .ms-qa-page, .breadcrumbs, .detail-layout),
html body.ms-subpage #main > .blog-post-page,
html body.ms-subpage #main > :is(.ms-dish-intro, .ms-menu-picker, .ms-dish-gallery, .branch-menu-prices) {
  box-sizing: border-box;
  width: var(--layout-rail);
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}

html body .site-footer,
html body.ms-subpage .site-footer,
html body .page-sections :is(.ms-crowd, .ms-statement, .ms-cooking, .ms-concerns, .ms-album, .ms-reviews, .ms-location, .ms-booking) {
  padding-inline: 0;
}

html body .site-header .mobile-nav {
  padding-inline: var(--layout-inset);
}

html body.ms-subpage #main > .ms-menu-cover h1 {
  width: var(--layout-rail);
  justify-self: center;
  text-align: start;
}

html body.ms-subpage #main > #menu-intro.ms-dish-intro,
html body.ms-subpage #main > .ms-bv-page > .ms-menu-intro {
  padding-inline: 0;
  text-align: start;
}

html body.ms-subpage #main > .ms-bv-page > :is(.ms-sub-crumbs, .ms-menu-intro, .ms-visit-arrival, .ms-visit-route, .ms-visit-prepare, .ms-visit-book),
html body.ms-subpage #main > .ms-qa-page > :is(.ms-qa-breadcrumb, .ms-qa-heading, .ms-qa-layout, .ms-qa-contact),
html body.ms-subpage #main > .ms-menu-picker > :is(.ms-category-switch, .ms-signatures) {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  margin-inline: 0;
}

html body.ms-subpage #main > .ms-bv-page > .ms-sub-crumbs,
html body.ms-subpage #main > .ms-qa-page > .ms-qa-breadcrumb {
  inset-inline-start: 0;
  width: auto;
}

html body.ms-subpage #main .ms-menu-picker .ms-signatures .menu-carousel {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

/* The cover, breadcrumb, introduction and body share a reading edge. A
   line-length cap still applies to long copy; it must not recenter that copy. */
html body.ms-subpage #main > .ms-dish-opening {
  padding-inline: 0;
}

html body.ms-subpage #main > .ms-dish-opening > div {
  box-sizing: border-box;
  width: var(--layout-rail);
  min-width: 0;
  justify-self: center;
  text-align: start;
}

html body.ms-subpage #main > .ms-dish-opening h1 {
  margin-inline: 0;
  text-align: start;
}

html body.ms-subpage:has(.detail-layout) #main > nav.breadcrumbs {
  width: var(--layout-rail);
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}

html body.ms-subpage #main :is(.ms-menu-intro, .story-prologue, .ms-qa-heading),
html body.ms-subpage #main :is(.ms-menu-intro, .story-prologue, .ms-qa-heading) :is(h2, p) {
  text-align: start;
}

html body.ms-subpage #main :is(.ms-menu-intro, .story-prologue, .ms-qa-heading) p,
html body.ms-subpage #main .ms-qa-heading > div,
html body.ms-subpage #main .ms-qa-topics nav {
  margin-inline: 0;
}

html body.ms-subpage #main .ms-qa-topics nav {
  width: 100%;
  column-gap: var(--layout-gap);
}

html body.ms-subpage #main .ms-menu-picker .ms-category-switch,
html body.ms-subpage #main .ms-visit-page > .ms-visit-arrival {
  padding-inline: 0;
}

/* Continue the coloured sections into the gutter. Heading letters sit on
   the content edge while the dark surface still has space to their left. */
html body.ms-subpage #main > .ms-story-feature {
  overflow: visible;
}

html body.ms-subpage #main .ms-story-feature > .story-kitchen,
html body.ms-subpage #main .blog-post-page .blog-post-opening {
  width: auto;
  margin-inline: calc(0px - var(--layout-bleed));
  padding-inline: var(--layout-bleed);
  border-radius: var(--section-turn);
}

html body.ms-subpage #main .blog-post-page .blog-post-opening .blog-post-header {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  padding-inline: 0;
}

html body.ms-subpage #main .blog-post-page .blog-post-opening .blog-cover {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}

html body.ms-subpage #main .blog-post-page :is(.blog-post, .blog-related, .blog-post-bottom, .blog-reading-layout) {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  padding-inline: 0;
  margin-inline: 0;
}

html body.ms-subpage #main .blog-reading-layout {
  justify-content: start;
}

html body.ms-subpage #main .blog-reading-layout > .blog-body {
  width: 100%;
  min-width: 0;
  max-width: 70ch;
  margin-inline: 0;
}

html body .page-sections .ms-location .ms-location-photo {
  margin-inline: 0;
  transform: none;
}

html body .page-sections .ms-statement-inner {
  text-align: start;
}

html body .page-sections .ms-statement-inner h2,
html body .page-sections .ms-statement-body {
  text-align: start;
}

html body .page-sections .ms-statement-dots {
  align-items: flex-start;
}

html body .page-sections .ms-quote-open {
  left: 0;
  top: auto;
  bottom: 100%;
  font-size: clamp(32px, 4vw, 64px);
}

html body .page-sections .ms-quote-close {
  right: 0;
}

@media (min-width: 901px) {
  html body.ms-subpage #main .ms-story-feature :is(.story-origin, .story-table, .story-grill > header,
      .story-kitchen > header, .story-kitchen-layout),
  html body.ms-subpage #main .ms-visit-page :is(.ms-route-heading, .ms-visit-prepare, .ms-visit-book),
  html body.ms-subpage #main .ms-qa-page .ms-qa-contact,
  html body.ms-subpage #main .blog-post-page .blog-post-opening,
  html body .page-sections .ms-location .ms-visit-spread {
    grid-template-columns: minmax(0, var(--layout-fifth-column)) minmax(0, 1fr);
    column-gap: var(--layout-gap);
  }

  html body.ms-subpage #main .ms-story-feature .story-kitchen-photos {
    max-width: none;
  }

  html body.ms-subpage #main .ms-visit-page .ms-visit-arrival {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--layout-gap);
  }

  html body.ms-subpage #main .blog-post-page .blog-reading-layout {
    grid-template-columns: minmax(0, calc((100% + var(--layout-gap)) / 4 - var(--layout-gap))) minmax(0, 1fr);
    gap: var(--layout-gap);
  }

  html body.ms-subpage #main :is(.blog-grid, .blog-related-grid, .ms-dish-gallery > div) {
    column-gap: var(--layout-gap);
  }

  html body.ms-subpage #main .ms-qa-group {
    column-gap: var(--layout-gap);
    grid-template-columns: minmax(0, calc((100% + var(--layout-gap)) / 4 - var(--layout-gap))) minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  :root {
    --layout-gutter: 24px;
    --layout-columns: 4;
    --layout-gap: 12px;
  }
}

@media (max-width: 374px) {
  :root {
    --layout-gutter: 16px;
  }
}

/* Only the pair of overlapping photographs immediately below the street scene.
   The mask reveals the real paper below each fibre, including at the overlap. */
.page-sections > .ms-crowd > .ms-arrival-grid {
  --arrival-paper-edge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cfilter id='f' x='-5%25' y='-5%25' width='110%25' height='110%25'%3E%3CfeGaussianBlur in='SourceGraphic' stdDeviation='2.35' result='soft'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.061 .115' numOctaves='3' seed='8' result='grain'/%3E%3CfeDisplacementMap in='soft' in2='grain' scale='19' xChannelSelector='R' yChannelSelector='G'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='5.5' y='5.5' width='789' height='589' rx='3' fill='white' filter='url(%23f)'/%3E%3C/svg%3E");
}

.page-sections > .ms-crowd > .ms-arrival-grid > :is(.ms-crowd-photo, .ms-crowd-detail),
.page-sections > .ms-crowd > .ms-arrival-grid > .ms-crowd-detail > img {
  -webkit-mask: var(--arrival-paper-edge) center / 100% 100% no-repeat;
  mask: var(--arrival-paper-edge) center / 100% 100% no-repeat;
}

.page-sections > .ms-crowd > .ms-arrival-grid > .ms-crowd-detail {
  border-color: transparent;
  background: #f8f8f3 url('/2026-11-27_질감_밝은종이.jpg') center / 960px auto;
}

/* The original full-width sheets ended in a 50px turn. Keep the photographs,
   grid, scrollers and their focus outlines independent of that outer edge. */
:root {
  --section-turn: clamp(24px, 3.7vw, 50px);
  --paper-surface: #f8f8f3 url('/2026-11-27_질감_밝은종이.jpg') center top / 1920px auto repeat;
  --charcoal-surface: #25211e url('/2026-11-27_질감_무쇠차콜.jpg') center / cover;
  --turn-mask:
    radial-gradient(circle var(--section-turn) at 100% 0, transparent calc(100% - .8px), #000 100%) left / var(--section-turn) 100% no-repeat,
    radial-gradient(circle var(--section-turn) at 0 0, transparent calc(100% - .8px), #000 100%) right / var(--section-turn) 100% no-repeat;
}

/* These sections start on transparent paper. Paint just the two cutouts with
   the following material, leaving the original overlapping photos in place. */
.page-sections > :is(.ms-statement,.ms-cooking,.ms-album,.ms-booking),
body:has(> .site-footer) > main#main {
  position: relative;
}
.page-sections > :is(.ms-statement,.ms-cooking,.ms-album,.ms-booking)::before,
body:has(> .site-footer) > main#main::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  block-size: var(--section-turn);
  pointer-events: none;
  -webkit-mask: var(--turn-mask);
  mask: var(--turn-mask);
}
.page-sections > :is(.ms-statement,.ms-cooking,.ms-album,.ms-booking)::before {
  bottom: calc(100% - .5px);
  background: var(--charcoal-surface);
}
.page-sections > :is(.ms-cooking,.ms-booking)::before {
  background: inherit;
}
/* Paint containment would cut off the corners just outside these three bands. */
#main .page-sections > :is(.ms-statement,.ms-cooking,.ms-booking) {
  content-visibility: visible;
}
body:has(> .site-footer) > main#main::after {
  bottom: 0;
  background: var(--section-footer, #c10230);
}
body.ms-subpage { --section-footer: #211c1a; }
body .page-sections > .ms-cooking,
body .page-sections .ms-album > .ms-gallery {
  border-end-start-radius: var(--section-turn);
  border-end-end-radius: var(--section-turn);
}

/* The small lid remains a working link through the center of the join.
   Round the image below it without clipping the link's hit area. */
html body.ms-subpage #main > :is(.ms-menu-cover,.ms-dish-opening),
html body.ms-subpage #main > .ms-menu-cover > img,
html body.ms-subpage #main > .ms-menu-cover::before,
html body.ms-subpage #main > .ms-dish-opening > img,
html body.ms-subpage #main > .ms-dish-opening::before {
  border-end-start-radius: var(--section-turn);
  border-end-end-radius: var(--section-turn);
}
body .district-hero .district-utility,
body .district-hero + .smoothBtn-wrap,
body .district-hero + .smoothBtn-wrap::after {
  background: var(--paper-surface);
  border-bottom: 0;
}
body .district-hero .district-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  block-size: var(--section-turn);
  background: var(--paper-surface);
  -webkit-mask: var(--turn-mask);
  mask: var(--turn-mask);
  pointer-events: none;
}

/* Carry the existing sand-coloured arrival band to the edge. Its three
   columns stay aligned with the route instructions and map below. */
html body.ms-subpage #main > .ms-visit-page {
  overflow: visible;
}
html body.ms-subpage #main > .ms-visit-page > .ms-visit-arrival {
  width: auto;
  margin-inline: calc(0px - var(--layout-bleed));
  padding-inline: var(--layout-bleed);
  border-radius: var(--section-turn);
}

/* The gallery, contact and related-reading blocks share the same reading
   rail. Extend only the section background into the page gutters. */
html body.ms-subpage #main :is(.ms-dish-gallery,.ms-qa-contact,.blog-related) {
  position: relative;
  isolation: isolate;
}
html body.ms-subpage #main :is(.ms-dish-gallery,.ms-qa-contact,.blog-related)::before {
  content: "";
  position: absolute;
  inset: 0 calc(0px - var(--layout-bleed));
  z-index: -1;
  background: #f3eee5;
  border-radius: var(--section-turn);
  pointer-events: none;
}
