/* ==========================================================================
   Asherfield — Site Header + Footer
   Plugin-owned navigation chrome for all plugin-rendered virtual pages.

   The homepage ([ash_homepage] shortcode) uses its own left-rail nav and
   does NOT load this file.

   Depends on: ash-tokens.css
   All values reference CSS custom properties — no hardcoded hex.
   ========================================================================== */

:root {
  --admin-bar: var(--wp-admin--admin-bar--height, 0px);
}

/* ── Wordmark ─────────────────────────────────────────────────────────────── */
/* Shared brand mark: ■ asherfield — used in header, footer, and auth pages.
 * The ::before square is the standalone icon mark (7×7px terracotta dot).
 * letter-spacing exception: -0.01em is permitted on the brand mark because
 * this is a named logo, not a content heading (h1–h3). */

.ash-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--ash-near-black);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  line-height: 1;
}

.ash-wordmark::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  background: var(--ash-ring);
  border-radius: 1px;
  flex-shrink: 0;
  margin-bottom: 1px; /* optical baseline alignment */
}

.ash-wordmark:hover {
  color: var(--ash-near-black);
  opacity: 0.82;
  text-decoration: none;
}

/* ── Site header ─────────────────────────────────────────────────────────── */

.ash-site-header {
  position: sticky;
  top: var(--admin-bar);
  z-index: 100;
  width: 100%;
  height: 56px;
  background: var(--ash-ivory);
  border-bottom: 1px solid var(--ash-border-cream);
}

.ash-site-header__inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 24px;
}

/* Primary nav */

.ash-site-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.ash-site-header__nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ash-olive);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
  line-height: 1;
}

.ash-site-header__nav-link:hover {
  color: var(--ash-near-black);
  background: var(--secondary);
}

.ash-site-header__nav-link.is-active {
  color: var(--ash-near-black);
  font-weight: 500;
}

/* Actions (right side) */

.ash-site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ash-site-header__sign-in {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ash-olive);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.12s;
  white-space: nowrap;
}

.ash-site-header__sign-in:hover {
  color: var(--ash-near-black);
}

.ash-site-header__cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: var(--ash-ring);
  color: var(--primary-foreground);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
  line-height: 1;
}

.ash-site-header__cta:hover {
  background: var(--chart-1);
  color: var(--primary-foreground);
}

.ash-site-header__dashboard-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ash-olive);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.ash-site-header__dashboard-link:hover {
  color: var(--ash-near-black);
  background: var(--secondary);
}

/* Mobile hamburger */

.ash-site-header__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ash-near-black);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}

.ash-site-header__hamburger:hover {
  background: var(--secondary);
}

/* ── Mobile drawer ───────────────────────────────────────────────────────── */

.ash-site-header__mobile-drawer {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--ash-ivory);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  z-index: 200;
  padding: 20px 16px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  /* Hidden by default via transform; shown by .is-open */
  visibility: hidden;
}

.ash-site-header__mobile-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.ash-site-header__mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 190;
}

.ash-site-header__mobile-overlay.is-open {
  display: block;
}

.ash-site-header__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.ash-site-header__mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--ash-olive);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.ash-site-header__mobile-close:hover {
  background: var(--secondary);
  color: var(--ash-near-black);
}

.ash-site-header__mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.ash-site-header__mobile-link {
  display: block;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.ash-site-header__mobile-link:hover {
  background: var(--secondary);
}

.ash-site-header__mobile-actions {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.ash-site-header__mobile-cta {
  display: block;
  padding: 10px 16px;
  background: var(--ash-ring);
  color: var(--primary-foreground);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}

.ash-site-header__mobile-cta:hover {
  background: var(--chart-1);
  color: var(--primary-foreground);
}

.ash-site-header__mobile-sign-in {
  display: block;
  padding: 9px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ash-olive);
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.ash-site-header__mobile-sign-in:hover {
  background: var(--secondary);
  color: var(--ash-near-black);
}

/* ── Theme header suppression ────────────────────────────────────────────── */
/* Hides Blocksy's own header on plugin-rendered pages. These selectors cover
 * Blocksy's class structure (ct-header, ct-header-row). If the theme changes,
 * audit these selectors against the theme's actual header markup. */

body.ash-uses-plugin-nav .site-header,
body.ash-uses-plugin-nav header.site-header,
body.ash-uses-plugin-nav .ct-header,
body.ash-uses-plugin-nav .ct-header-row,
body.ash-uses-plugin-nav header[class*="header"],
body.ash-uses-plugin-nav #masthead {
  display: none !important;
}

/* ── Site footer ─────────────────────────────────────────────────────────── */

.ash-site-footer {
  background: var(--ash-near-black);
  color: var(--ash-ivory);
}

.ash-site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

/* Brand column */

.ash-site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ash-site-footer__logo.ash-wordmark {
  color: var(--ash-ivory);
}

.ash-site-footer__logo.ash-wordmark::before {
  background: var(--ash-ring);
}

.ash-site-footer__logo.ash-wordmark:hover {
  color: var(--ash-ivory);
  opacity: 0.75;
}

.ash-site-footer__tagline {
  font-size: 0.875rem;
  color: var(--ash-silver);
  line-height: var(--lh-editorial);
  margin: 0;
  max-width: 22ch;
}

.ash-site-footer__social {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.ash-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--ash-silver);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.ash-social-link:hover {
  background: var(--ash-dark-surface);
}

/* Intentional brand exceptions — do not generalize */
.ash-social-link--instagram:hover { color: #e1306c; }
.ash-social-link--facebook:hover  { color: #1877f2; }
.ash-social-link--youtube:hover   { color: #ff0000; }

/* Navigation columns */

.ash-site-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.ash-site-footer__col-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ash-stone);
  margin: 0 0 14px;
}

.ash-site-footer__col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ash-site-footer__col-list a {
  font-size: 0.875rem;
  color: var(--ash-silver);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.12s;
}

.ash-site-footer__col-list a:hover {
  color: var(--ash-ivory);
}

/* Legal bar */

.ash-site-footer__legal {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid var(--ash-dark-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ash-site-footer__copyright {
  font-size: 0.8125rem;
  color: var(--ash-stone);
  margin: 0;
}

.ash-site-footer__legal-links {
  display: flex;
  gap: 20px;
}

.ash-site-footer__legal-links a {
  font-size: 0.8125rem;
  color: var(--ash-stone);
  text-decoration: none;
  transition: color 0.12s;
}

.ash-site-footer__legal-links a:hover {
  color: var(--ash-ivory);
}

/* ── Theme footer suppression ────────────────────────────────────────────── */
/* Same Blocksy-targeting pattern as header suppression above. */

body.ash-uses-plugin-nav .site-footer,
body.ash-uses-plugin-nav footer.site-footer,
body.ash-uses-plugin-nav .ct-footer,
body.ash-uses-plugin-nav footer[class*="footer"],
body.ash-uses-plugin-nav #colophon {
  display: none !important;
}

/* ── Auth card in-card brand: hidden when plugin header is active ─────────── */
/* The plugin header already shows the wordmark at the top of the page.
 * The auth card's own brand element is redundant when .ash-uses-plugin-nav
 * is set. If the plugin header fails to inject, the brand stays visible. */

body.ash-uses-plugin-nav .ash-auth-brand {
  display: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* 768px: hide desktop nav, show hamburger */
@media (max-width: 768px) {
  .ash-site-header__nav,
  .ash-site-header__actions {
    display: none;
  }

  .ash-site-header__hamburger {
    display: flex;
    margin-left: auto;
  }
}

/* 900px: collapse footer to 2-column grid */
@media (max-width: 900px) {
  .ash-site-footer__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 24px 40px;
  }

  .ash-site-footer__cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .ash-site-footer__brand {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
  }

  .ash-site-footer__tagline {
    max-width: 40ch;
  }
}

/* 480px: tight footer */
@media (max-width: 480px) {
  .ash-site-footer__inner {
    padding: 40px 16px 32px;
  }

  .ash-site-footer__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 16px;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ash-site-header__mobile-drawer,
  .ash-site-header__cta,
  .ash-site-header__nav-link,
  .ash-site-header__dashboard-link,
  .ash-site-header__sign-in,
  .ash-social-link {
    transition: none;
  }
}
