/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.head {
  text-align: center;
  position: relative;
  margin-bottom: 8px;
  padding-top: 18px;
}

.theme-toggle {
  position: absolute;
  top: 14px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle:hover { color: var(--brass); border-color: var(--brass); }

.main-logo-link { text-decoration: none; color: var(--ink); }

/* Masthead — an <h1> on the homepage, a <p> on inner pages; margins zeroed
   to override both UA defaults. Fallback face is metric-tuned (base.css). */
.masthead {
  font-family: "Permanent Marker", "Masthead Fallback", cursive;
  font-weight: 400;
  font-size: clamp(2.5rem, 1.5rem + 5vw, 5rem); /* 40–80px */
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
  margin: 0;
  color: var(--ink);
}

/* Signature: the daily quote as a centered band between hairlines. */
.quote-band {
  max-width: 720px;
  margin: 14px auto 0;
  padding: 8px 16px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-style: italic;
  font-size: 0.875rem; /* 14px */
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-author {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-left: 8px;
}

.subhead {
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  border-top: 2px solid var(--ink);
  margin-top: 14px;
  padding: 0;
  font-family: var(--sans);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.subhead a {
  color: var(--ink);
  padding: 14px 1.5vw;
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.subhead a:hover { color: var(--brass); text-decoration: underline; }

.subhead b {
  color: var(--brass);
  padding: 0 3vw;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.main-footer {
  margin-top: 80px;
  margin-bottom: 40px;
  padding: 0 20px;
}

.footer-nav {
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  border-top: 2px solid var(--ink);
  padding: 6px 0;
  font-family: var(--sans);
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.footer-link {
  color: var(--ink);
  padding: 12px 2vw;
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  text-decoration: none;
  letter-spacing: 0.08em;
}

.footer-link:hover { color: var(--brass); text-decoration: underline; }

.footer-nav b {
  color: var(--muted);
  padding: 0 4vw;
  font-size: 0.8125rem;
}

.bookshop-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 40px;
}

.bookshop-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 12px;
}

/* ==========================================================================
   BACK TO TOP — in layout.css because the button renders on every page,
   including static pages that don't load components.css.
   ========================================================================== */

#backToTop {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  padding: 10px 15px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 4px;
  font-family: var(--sans);
  font-weight: 700;
}

#backToTop:hover { background: var(--ink); color: var(--paper); }

@media (prefers-reduced-motion: no-preference) {
  #backToTop { transition: background 0.15s ease, color 0.15s ease; }
}
