/* =========================================================
   SMALL TOWN MAHJ — FINAL FRAME / HEADER PLACEMENT
   Keeps the floral mat locked to the viewport and gives mobile
   a compact three-piece header: booking tile, crest, menu tile.
   Loaded after mat-reference-pass.css.
   ========================================================= */

/* Keep the decorative mat physically pinned to the browser viewport. */
.mat-edge-frame {
  position: fixed !important;
  z-index: 500 !important;
  inset: 0 !important;
  width: 100dvw;
  height: 100dvh;
  max-width: none !important;
  max-height: none !important;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
}

.mat-edge,
.mat-corner {
  position: fixed !important;
}

/* Straight runs stop at the dedicated corners. */
.mat-edge--top {
  top: 0 !important;
  right: var(--mat-edge-side) !important;
  left: var(--mat-edge-side) !important;
}

.mat-edge--bottom {
  right: var(--mat-edge-side) !important;
  bottom: 0 !important;
  left: var(--mat-edge-side) !important;
}

.mat-edge--left {
  top: var(--mat-edge-top) !important;
  bottom: var(--mat-edge-bottom) !important;
  left: 0 !important;
}

.mat-edge--right {
  top: var(--mat-edge-top) !important;
  right: 0 !important;
  bottom: var(--mat-edge-bottom) !important;
}

.mat-corner--top-left { top: 0 !important; left: 0 !important; }
.mat-corner--top-right { top: 0 !important; right: 0 !important; }
.mat-corner--bottom-right { right: 0 !important; bottom: 0 !important; }
.mat-corner--bottom-left { bottom: 0 !important; left: 0 !important; }

/* Booking action reads as a small physical ivory Mahjong tile. */
.header-book-tile {
  position: absolute;
  z-index: 18;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  min-height: 48px;
  border: 1px solid #4c6f9f;
  border-radius: 7px 7px 9px 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(255,252,244,.82) 52%, rgba(236,227,210,.96) 100%),
    #fff9ee;
  box-shadow:
    0 3px 0 #c9bca7,
    0 5px 0 rgba(7,39,84,.16),
    0 9px 15px rgba(3,28,65,.16),
    inset 0 0 0 2px rgba(255,255,255,.72),
    inset 0 0 0 3px rgba(23,75,143,.10);
  color: #123f78;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1;
  padding: 0 1rem;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255,255,255,.8);
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.header-book-tile::before {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(23,75,143,.24);
  border-radius: 4px 4px 6px 5px;
  content: '';
  pointer-events: none;
}

.header-book-tile::after {
  content: '◆';
  margin-left: .48rem;
  color: #174b8f;
  font-size: .48rem;
  opacity: .82;
}

.header-book-tile:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 0 #c9bca7,
    0 6px 0 rgba(7,39,84,.16),
    0 11px 17px rgba(3,28,65,.18),
    inset 0 0 0 2px rgba(255,255,255,.72),
    inset 0 0 0 3px rgba(23,75,143,.10);
}

.header-book-tile:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 #c9bca7,
    0 3px 7px rgba(3,28,65,.14),
    inset 0 0 0 2px rgba(255,255,255,.72),
    inset 0 0 0 3px rgba(23,75,143,.10);
}

.header-book-tile:focus-visible,
.site-header.mat-header .nav-toggle:focus-visible {
  outline: 3px solid rgba(233,163,45,.78);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .header-book-tile {
    display: inline-flex;
    top: 10px;
    left: 0;
  }

  /* Header controls stay fully in the cobalt header area. */
  .site-header.mat-header .nav-toggle,
  .site-header.mat-header[data-scrolled] .nav-toggle {
    top: 10px !important;
    right: 0 !important;
    display: inline-grid !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 46px !important;
    min-height: 46px !important;
    place-items: center;
    border: 1px solid rgba(23,75,143,.46) !important;
    border-radius: 8px 8px 10px 7px !important;
    background:
      linear-gradient(180deg, rgba(255,255,255,.74), rgba(255,249,238,.08)),
      #fff9ee !important;
    box-shadow:
      0 3px 0 #cabaa3,
      0 7px 14px rgba(3,28,65,.16),
      inset 0 0 0 2px rgba(120,163,208,.08) !important;
    padding: 0 !important;
  }

  .site-header.mat-header .nav-toggle__face {
    width: 24px !important;
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .site-header.mat-header .nav-toggle__face i {
    width: 24px !important;
    height: 2px !important;
    background: #174b8f !important;
  }

  .site-header.mat-header .nav-toggle__label {
    display: none !important;
  }

  /* The crest is intentionally mounted into the top floral binding. */
  .mat-crest,
  .site-header.mat-header[data-scrolled] .mat-crest {
    top: -28px !important;
  }
}

@media (max-width: 680px) {
  .site-header.mat-header {
    height: 78px !important;
  }

  .site-header.mat-header .site-header__inner {
    min-height: 78px !important;
  }

  .header-book-tile {
    top: 12px;
    left: 0;
    min-width: 84px;
    min-height: 44px;
    font-size: .62rem;
    letter-spacing: .105em;
    padding-inline: .7rem;
  }

  .header-book-tile::before {
    inset: 3px;
  }

  .site-header.mat-header .nav-toggle,
  .site-header.mat-header[data-scrolled] .nav-toggle {
    top: 12px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .mat-crest,
  .site-header.mat-header[data-scrolled] .mat-crest {
    top: -30px !important;
    width: 132px !important;
  }

  /* Keep the open menu below the complete header cluster. */
  .site-header.mat-header .site-nav,
  .site-header.mat-header[data-scrolled] .site-nav {
    top: 84px !important;
  }
}

/* =========================================================
   MAT FRAME STRUCTURE — ARTWORK-AGNOSTIC
   The physical mat frame is now independent from its future artwork.
   Drop the chosen repeatable border texture into --mat-frame-art.
   ========================================================= */
:root {
  --mat-frame-side: 38px;
  --mat-frame-top: 42px;
  --mat-frame-bottom: 38px;
  --mat-frame-surface: #fff9ee;
  --mat-frame-pipe: #153c75;
  --mat-frame-pipe-soft: #7ea6d5;
  --mat-frame-art: none;
  --mat-frame-art-size: 220px 220px;

  --mat-edge-side: var(--mat-frame-side);
  --mat-edge-top: var(--mat-frame-top);
  --mat-edge-bottom: var(--mat-frame-bottom);
}

body {
  padding: var(--mat-frame-top) var(--mat-frame-side) var(--mat-frame-bottom) !important;
}

.mat-edge,
.mat-corner {
  background-color: var(--mat-frame-surface) !important;
  background-image: var(--mat-frame-art) !important;
  background-repeat: repeat !important;
  background-size: var(--mat-frame-art-size) !important;
  filter: none !important;
}

.mat-edge--top,
.mat-edge--bottom {
  height: auto !important;
}

.mat-edge--top {
  height: var(--mat-frame-top) !important;
  box-shadow:
    inset 0 -2px 0 var(--mat-frame-pipe),
    inset 0 -4px 0 rgba(255,249,238,.92),
    0 3px 8px rgba(0,18,51,.10);
}

.mat-edge--bottom {
  height: var(--mat-frame-bottom) !important;
  transform: none !important;
  box-shadow:
    inset 0 2px 0 var(--mat-frame-pipe),
    inset 0 4px 0 rgba(255,249,238,.92),
    0 -3px 8px rgba(0,18,51,.08);
}

.mat-edge--left {
  width: var(--mat-frame-side) !important;
  box-shadow:
    inset -2px 0 0 var(--mat-frame-pipe),
    inset -4px 0 0 rgba(255,249,238,.92),
    3px 0 8px rgba(0,18,51,.08);
}

.mat-edge--right {
  width: var(--mat-frame-side) !important;
  transform: none !important;
  box-shadow:
    inset 2px 0 0 var(--mat-frame-pipe),
    inset 4px 0 0 rgba(255,249,238,.92),
    -3px 0 8px rgba(0,18,51,.08);
}

.mat-corner {
  width: var(--mat-frame-side) !important;
  box-shadow: none !important;
}

.mat-corner--top-left,
.mat-corner--top-right {
  height: var(--mat-frame-top) !important;
}

.mat-corner--bottom-left,
.mat-corner--bottom-right {
  height: var(--mat-frame-bottom) !important;
}

/* Rounded inner piping makes the frame read as one sewn mat binding. */
.mat-corner::after {
  position: absolute;
  width: 14px;
  height: 14px;
  content: '';
  pointer-events: none;
}

.mat-corner--top-left::after {
  right: 0;
  bottom: 0;
  border-right: 2px solid var(--mat-frame-pipe);
  border-bottom: 2px solid var(--mat-frame-pipe);
  border-bottom-right-radius: 14px;
}

.mat-corner--top-right::after {
  left: 0;
  bottom: 0;
  border-left: 2px solid var(--mat-frame-pipe);
  border-bottom: 2px solid var(--mat-frame-pipe);
  border-bottom-left-radius: 14px;
}

.mat-corner--bottom-left::after {
  right: 0;
  top: 0;
  border-right: 2px solid var(--mat-frame-pipe);
  border-top: 2px solid var(--mat-frame-pipe);
  border-top-right-radius: 14px;
}

.mat-corner--bottom-right::after {
  left: 0;
  top: 0;
  border-left: 2px solid var(--mat-frame-pipe);
  border-top: 2px solid var(--mat-frame-pipe);
  border-top-left-radius: 14px;
}

/* Quiet stitched seam just inside the frame, independent of the artwork. */
.mat-edge--top::after,
.mat-edge--bottom::after,
.mat-edge--left::after,
.mat-edge--right::after {
  position: absolute;
  content: '';
  pointer-events: none;
  opacity: .6;
}

.mat-edge--top::after,
.mat-edge--bottom::after {
  right: 8px;
  left: 8px;
  border-top: 1px dashed rgba(23,75,143,.32);
}

.mat-edge--top::after { bottom: 7px; }
.mat-edge--bottom::after { top: 7px; }

.mat-edge--left::after,
.mat-edge--right::after {
  top: 8px;
  bottom: 8px;
  border-left: 1px dashed rgba(23,75,143,.32);
}

.mat-edge--left::after { right: 7px; }
.mat-edge--right::after { left: 7px; }

@media (max-width: 980px) {
  :root {
    --mat-frame-side: 30px;
    --mat-frame-top: 34px;
    --mat-frame-bottom: 30px;
    --mat-frame-art-size: 180px 180px;
  }
}

@media (max-width: 680px) {
  :root {
    --mat-frame-side: 24px;
    --mat-frame-top: 28px;
    --mat-frame-bottom: 24px;
    --mat-frame-art-size: 150px 150px;
  }

  .mat-corner::after {
    width: 11px;
    height: 11px;
  }

  .mat-edge--top::after { bottom: 5px; }
  .mat-edge--bottom::after { top: 5px; }
  .mat-edge--left::after { right: 5px; }
  .mat-edge--right::after { left: 5px; }
}
