/**
 * Overview & Purpose
 * Keeps the Vital Pancakes brand and primary navigation visually
 * and behaviorally consistent across the public site, workspace, and tools.
 *
 * Architectural Relationships
 * Called by: Every user-facing HTML page.
 * Calls: Design tokens supplied by style.css or workspace.css.
 *
 * External Resources
 * None.
 *
 * Notes
 * The header stays visible while page content scrolls. A shared script inserts
 * the compact page path and browser-history controls immediately beneath it.
 */

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--navy, #1b1a17);
  border-radius: 0;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0.5rem;
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  width: min(calc(100% - 2rem), var(--max-width, 1180px));
  margin: 0.5rem auto 0;
  padding: 0.35rem 0.55rem;
  background: rgb(251 250 246 / 94%);
  border: 1px solid var(--ink, #171613);
  border-radius: 0;
  box-shadow: 5px 5px 0 rgb(23 22 19 / 10%);
  backdrop-filter: blur(14px);
}

.path-navigation {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: min(calc(100% - 2rem), var(--max-width, 1180px));
  min-height: 3.65rem;
  align-items: stretch;
  gap: 0.08rem;
  margin: 0.12rem auto 0.25rem;
  padding: 0 0.1rem;
  color: #928f88;
  font-size: 0.66rem;
  line-height: 1;
}

.path-navigation-trail {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
  white-space: nowrap;
}

.path-navigation-trail::-webkit-scrollbar {
  display: none;
}

.path-navigation-trail li {
  display: inline-flex;
  align-items: center;
}

.path-navigation-trail li + li::before {
  margin: 0 0.12rem;
  color: #b3b0aa;
  content: "/";
}

.path-navigation-trail a,
.path-navigation-trail span {
  color: inherit;
  text-decoration: none;
}

.path-navigation-trail a:hover {
  color: #5f5c56;
  text-decoration: underline;
  text-underline-offset: 0.12rem;
}

.path-navigation-trail [aria-current="page"] {
  color: #77746e;
}

.path-history-controls {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.path-history-button {
  display: inline-grid;
  width: 2.5rem;
  height: 2.15rem;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: #4e4b45;
  font-size: 1.55rem;
  line-height: 1;
}

.path-history-button:hover,
.path-history-button:focus-visible {
  background: rgb(23 22 19 / 6%);
  color: #171613;
  outline: 0;
}

.has-path-navigation .breadcrumb {
  display: none;
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink, #171613);
  font-family: var(--font-blackletter, "Old English Text MT", Georgia, serif);
  font-weight: 750;
  text-decoration: none;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.site-header .brand-mark {
  display: block;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  overflow: hidden;
  color: transparent;
  background: transparent url("assets/vital-pancakes-logo-transparent-black.png?v=1") center / contain no-repeat;
  border: 0;
  border-radius: 0;
  font-size: 0;
}

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.global-glossary-dialog {
  width: min(980px, calc(100vw - 2rem));
  max-height: min(780px, calc(100dvh - 2rem));
  border: 1px solid #625d53;
  border-radius: 6px;
  background: #f8f5ed;
  color: #1b1a17;
  padding: 0;
}

.global-glossary-dialog::backdrop {
  background: rgb(27 26 23 / 56%);
}

.global-glossary-shell {
  display: grid;
  max-height: calc(100dvh - 2rem);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.global-glossary-heading,
.global-glossary-form-actions,
.global-glossary-entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.global-glossary-heading {
  border-bottom: 1px solid #c9c2b4;
  padding: 1rem 1.15rem;
}

.global-glossary-heading p,
.global-glossary-heading h2,
.global-glossary-form h3,
.global-glossary-entry p,
.global-glossary-status {
  margin: 0;
}

.global-glossary-heading p {
  color: #81251f;
  font-size: 0.72rem;
  font-weight: 800;
}

.global-glossary-heading h2 {
  font-size: 1.45rem;
}

.global-glossary-close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #aaa193;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.45rem;
}

.global-glossary-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #c9c2b4;
  padding: 0.75rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.global-glossary-search input,
.global-glossary-form input,
.global-glossary-form textarea {
  width: 100%;
  border: 1px solid #aaa193;
  border-radius: 0;
  background: #fff;
  color: #1b1a17;
  font: inherit;
  letter-spacing: 0;
  padding: 0.65rem;
}

.global-glossary-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.global-glossary-layout > section {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid #c9c2b4;
  padding: 1rem 1.15rem;
}

.global-glossary-list {
  display: grid;
}

.global-glossary-entry {
  border-bottom: 1px solid #d8d1c4;
  padding: 0.85rem 0;
}

.global-glossary-entry:first-child {
  padding-top: 0;
}

.global-glossary-entry > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.global-glossary-entry span {
  color: #746e65;
  font-size: 0.78rem;
}

.global-glossary-entry p {
  margin: 0.45rem 0 0.7rem;
  line-height: 1.5;
}

.global-glossary-entry-actions {
  justify-content: flex-start;
}

.global-glossary-entry-actions button,
.global-glossary-entry-actions a,
.global-glossary-form-actions button {
  border: 1px solid #8d8578;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.45rem 0.65rem;
}

.global-glossary-entry-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.global-glossary-entry-actions .is-danger {
  color: #81251f;
}

.global-glossary-form {
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem;
}

.global-glossary-form label {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.global-glossary-form textarea {
  resize: vertical;
}

.global-glossary-form-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

.global-glossary-form-actions .global-glossary-save {
  border-color: #1b1a17;
  background: #1b1a17;
  color: #fff;
}

.global-glossary-status {
  min-height: 2.5rem;
  border-top: 1px solid #c9c2b4;
  color: #575148;
  padding: 0.7rem 1.15rem;
}

.global-glossary-status.is-error {
  color: #81251f;
}

@media (max-width: 760px) {
  .global-glossary-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .global-glossary-layout > section {
    max-height: 42dvh;
    border-right: 0;
    border-bottom: 1px solid #c9c2b4;
  }

  .global-glossary-form {
    overflow: visible;
  }

  .global-glossary-entry > div:first-child {
    display: grid;
    gap: 0.2rem;
  }
}

.site-header nav a {
  padding: 0.3rem 0.42rem;
  color: var(--ink-soft, #5a554c);
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--navy, #1b1a17);
  background: var(--surface-soft, #e8e3d8);
  border-bottom-color: var(--teal, #7b211a);
}

@media (max-width: 640px) {
  .site-header {
    top: 0.35rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0.35rem auto 0;
    padding: 0.45rem;
  }

  .path-navigation {
    width: min(calc(100% - 1rem), var(--max-width, 1180px));
    margin-top: 0.12rem;
    font-size: 0.62rem;
  }

  .site-header nav {
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.2rem;
    overflow-x: auto;
  }

  .site-header nav a {
    flex: 1 0 auto;
    padding: 0.32rem 0.42rem;
    text-align: center;
    font-size: 0.72rem;
  }
}
