/*
 * File: assets/css/header.css, the site frame of every Mammoth page.
 * Purpose: draws the frame around the bands: the sticky red bar with its tabs and icon buttons, the masthead over its
 * rays and skyline from devices.css, the search row, the phone drawer and the ink footer.
 * Defines: nothing; rules for .site-bar, .masthead, .site-search, .drawer and .site-footer
 * Doc: docs/notes/mammothcomics.com/assets/themes/mammoth/assets/css/header.css.md
 */

/* Bar: the rays are drawn from its foot at its own height; the search row is placed below it. */
.site-bar {
  position: sticky;
  top: 0;
  z-index: var(--layer-bar);
}

.site-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(from 0deg at 50% 100%, var(--color-ground-ray) 0deg 7.5deg, transparent 7.5deg 15deg);
  -webkit-mask-image: radial-gradient(farthest-side at 50% 100%, var(--color-ink-950) 15%, transparent 100%);
  mask-image: radial-gradient(farthest-side at 50% 100%, var(--color-ink-950) 15%, transparent 100%);
  pointer-events: none;
}

.bar-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--s-1);
  max-width: calc(var(--container) + 2 * var(--gutter));
  height: var(--nav-h);
  margin-inline: auto;
  padding-inline: calc(var(--gutter) - var(--s-2));
}

.btn-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: var(--target-min);
  height: var(--target-min);
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: var(--r-sm);
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-standard);
}

.ground-red .btn-icon:hover { background: var(--color-ground-ray); }
.ground-ink .btn-icon:hover { background: var(--color-ink-700); }

.bar-emblem {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  margin-right: auto;
  border-radius: var(--r-full);
}

.bar-emblem img {
  width: var(--emblem-size);
  height: var(--emblem-size);
}

.bar-tabs { display: none; }

.bar-actions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.bar-toggle,
.bar-action { display: none; }

.bar-cart { position: relative; }

.count-badge {
  position: absolute;
  top: 2px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--btn-light);
  color: var(--on-btn-light);
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: var(--fs-1);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .bar-menu { order: 10; }
  .bar-toggle,
  .bar-action { display: inline-flex; }
}

@media (min-width: 1024px) {
  .bar-menu { display: none; }
  .bar-emblem { margin-right: var(--s-3); }

  .bar-tabs {
    display: flex;
    align-self: stretch;
    margin-right: auto;
  }

  .bar-tab-list {
    display: flex;
    align-items: flex-end;
    gap: 2px;
  }

  .bar-tab {
    display: inline-flex;
    align-items: center;
    min-height: calc(var(--nav-h) - var(--s-3));
    padding: var(--s-2) var(--s-3) var(--s-1);
    color: var(--color-text-on-ground);
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: var(--tracking-display);
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color var(--dur) var(--ease-standard);
  }

  .bar-tab:hover { background: var(--color-ground-ray); }

  .bar-tab[aria-current] {
    background: var(--current-background-default);
    color: var(--current-text-default);
  }

  .bar-tab:focus-visible { outline-offset: -3px; }
}

@media (min-width: 1280px) {
  .bar-tab { font-size: 22px; padding-inline: var(--s-4); }
}

/* Search row under the bar, and the page variant of the not found page. */
.search-row {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  padding: var(--s-3) 0 var(--s-4);
  box-shadow: var(--shadow-1);
}

.search-inner {
  position: relative;
  max-width: calc(var(--container-narrow) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.search-page .search-inner { padding-inline: 0; margin: var(--s-4) 0 0; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.search-icon {
  position: absolute;
  left: var(--s-4);
  color: var(--text-3-panel);
  pointer-events: none;
}

.search-field {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--control-height);
  padding: 0 var(--s-6) 0 calc(var(--s-4) + 24px);
  background: var(--panel);
  color: var(--text-panel);
  border: var(--border-field) solid var(--field-border-default);
  border-radius: var(--r-sm);
  font-size: var(--fs-3);
}

.search-field::placeholder { color: var(--text-3-panel); opacity: 1; }
.search-field:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.search-spin {
  position: absolute;
  right: calc(var(--target-min) + var(--s-4));
  color: var(--text-3-panel);
}

.search-page .search-spin { right: var(--s-4); }

.search-list {
  position: absolute;
  top: calc(100% + var(--s-2));
  right: var(--gutter);
  left: var(--gutter);
  z-index: 2;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: var(--s-1);
  background: var(--panel);
  color: var(--text-panel);
  border: var(--border-panel) solid var(--card-border-default);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
}

.search-page .search-list { right: 0; left: 0; }

.search-hit {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  min-height: 56px;
  padding: var(--s-2) var(--s-3);
  color: var(--text-panel);
  border-radius: var(--r-sm);
  text-decoration: none;
  cursor: pointer;
}

.search-hit img {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
}

.search-hit-title { font-weight: 700; line-height: var(--lh-tight); }
.search-hit-price { color: var(--text-2-panel); font-size: var(--fs-2); font-weight: 700; }

.search-hit:hover,
.search-hit[aria-selected="true"] {
  background: var(--current-background-default);
  color: var(--current-text-default);
}

.search-hit[aria-selected="true"] .search-hit-price,
.search-hit:hover .search-hit-price { color: var(--current-text-default); }

.search-status {
  margin-top: var(--s-2);
  color: var(--text-2);
  font-size: var(--fs-2);
}

.search-status:empty { display: none; }

/* Masthead */
.masthead {
  --ray-origin-x: 50%;
  --ray-origin-y: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--masthead-page-height);
  padding: var(--s-4) var(--gutter) calc(var(--skyline-height) + var(--s-3));
  text-align: center;
}

.masthead-home {
  --ray-origin-x: var(--ray-origin-home-x);
  --ray-origin-y: var(--ray-origin-home-y);
  min-height: var(--masthead-home-height);
  padding-bottom: calc(var(--skyline-height) * 0.7);
}

.masthead-portal { min-height: var(--masthead-portal-height); }

.masthead-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

.masthead-logo { line-height: 0; }

.masthead-logo img {
  width: min(var(--lockup-width), calc(100vw - 2 * var(--gutter)));
  height: auto;
  filter: drop-shadow(3px 3px 0 var(--color-ink-950));
}

.masthead-tagline {
  color: var(--color-text-on-ground);
  font-size: var(--fs-3);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 2px 2px 0 var(--color-ink-950);
}

.masthead-title {
  max-width: 24ch;
  font-size: var(--fs-h1);
  line-height: var(--lh-display);
}

.masthead-title.is-long { font-size: var(--fs-h2); }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-1) var(--s-2);
  color: var(--text-2);
  font-size: var(--fs-2);
  font-weight: 500;
}

.breadcrumb-list li + li::before {
  content: '/';
  margin-right: var(--s-2);
  color: var(--text-2);
}

.breadcrumb-list a {
  display: inline-flex;
  align-items: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  color: var(--text-2);
}

.breadcrumb-list [aria-current] { color: var(--text-2); }

.masthead-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-2) var(--s-4);
}

.masthead-signed { color: var(--text-2); font-size: var(--fs-2); }
.masthead-signed strong { color: var(--text); font-weight: 700; }
.masthead-logout { margin: 0; }

/* Drawer under 1024px: the scrim, then the ink panel at the left. */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--layer-scrim);
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-enter);
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: var(--layer-drawer);
  display: flex;
  flex-direction: column;
  width: min(320px, 86vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-3) var(--s-4) var(--s-6);
  box-shadow: var(--shadow-2);
  transform: translateX(-100%);
  transition: transform var(--dur-2) var(--ease-enter);
  touch-action: pan-y;
}

.drawer.is-open { transform: translateX(0); }
.drawer-scrim.is-open { opacity: 1; }

.drawer.is-closing {
  transition-duration: calc(var(--dur-2) * 0.8);
  transition-timing-function: var(--ease-exit);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}

.drawer-emblem { width: 44px; height: 44px; }

.drawer-links { display: grid; gap: 2px; }

.drawer-link {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--s-3);
  color: var(--text);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: var(--tracking-display);
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.drawer-link:hover { background: var(--color-ink-700); }

.drawer-link[aria-current] {
  background: var(--current-background-default);
  color: var(--current-text-default);
}

.drawer-extra {
  display: grid;
  gap: 2px;
  margin-top: var(--s-5);
}

.drawer-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: var(--target-min);
  padding: var(--s-2) var(--s-3);
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: var(--r-sm);
  font-size: var(--fs-3);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.drawer-row i { width: 20px; text-align: center; }
a.drawer-row:hover,
button.drawer-row:hover { background: var(--color-ink-700); }
.drawer-hours { color: var(--text-2); cursor: default; }

body.is-drawer-open { overflow: hidden; }

@media (min-width: 1024px) {
  .drawer,
  .drawer-scrim { display: none !important; }
}

/* Footer */
.site-footer { padding-bottom: var(--s-6); }

.footer-grid {
  display: grid;
  gap: var(--s-6);
}

.footer-brand {
  display: grid;
  gap: var(--s-3);
  align-content: start;
  justify-items: start;
}

.footer-emblem { width: 72px; height: 72px; }

.footer-blurb,
.footer-address,
.footer-hours { color: var(--text-2); font-size: var(--fs-2); line-height: var(--lh-body); }

.footer-head {
  margin-bottom: var(--s-3);
  font-size: var(--fs-h3);
}

.footer-store { display: grid; gap: var(--s-2); align-content: start; }
.footer-hours .is-today { color: var(--text); font-weight: 700; }

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--target-min);
  color: var(--text);
  font-weight: 500;
}

.footer-links { display: grid; }

.footer-row {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.footer-row:hover { text-decoration: underline; }

.social-list { display: flex; gap: var(--s-2); }
.social-link { font-size: 22px; }

.footer-legal {
  margin-top: var(--s-6);
  color: var(--text-2);
  font-size: var(--fs-2);
}

/* 768: the emblem, blurb and social in the first column, the store details and the menu in the second. */
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row dense;
  }

  .footer-brand,
  .footer-social { grid-column: 1; }

  .footer-store,
  .footer-menu { grid-column: 2; }
}

@media (min-width: 1280px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; }

  .footer-brand,
  .footer-store,
  .footer-menu,
  .footer-social { grid-column: auto; }
}
