/*
  02-header-footer.css
  Styling for the Astra header, the theme toggle button that sits in
  the primary menu, and the custom footer printed after the Astra
  footer by inc/footer-social.php.
  The header markup belongs to Astra and is only styled here. The
  footer markup is the theme's own, printed by tm_site_footer().
  Edit here for header shadow, menu link colours or footer colours.
*/

/* Header */
.site-header {
  background: var(--tm-surface);
  border-bottom: 1px solid var(--tm-border);
  box-shadow: 0 1px 0 rgba(12, 36, 50, 0.02), 0 8px 24px rgba(12, 36, 50, 0.04);
}
/* Astra paints the actual header bar white from its own global colour
   (--ast-global-color-4) and does not flip it in dark mode, while the
   title and menu colours below do flip. Without this rule the dark mode
   header was light text on a white bar. The .site-header prefix gives
   these rules enough specificity to win over Astra's generated CSS. */
.site-header .ast-primary-header-bar,
.site-header .ast-below-header-bar,
.ast-mobile-header-wrap .ast-primary-header-bar {
  background-color: var(--tm-surface);
  border-bottom-color: var(--tm-border);
}
.site-title a,
.site-branding .site-title a,
.site-header .ast-site-identity .site-title a {
  color: var(--tm-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.site-description { color: var(--tm-muted); }

.main-header-menu .menu-link,
.ast-header-break-point .main-header-menu .menu-link,
.site-header .ast-builder-menu-1 .menu-item > .menu-link {
  color: var(--tm-ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
}
.main-header-menu .menu-item:hover > .menu-link,
.main-header-menu .current-menu-item > .menu-link,
.site-header .ast-builder-menu-1 .menu-item:hover > .menu-link,
.site-header .ast-builder-menu-1 .menu-item.current-menu-item > .menu-link {
  color: var(--tm-primary);
}

/* Theme toggle, appended to the primary menu by inc/customizer.php */
.tm-menu-toggle-item {
  display: flex;
  align-items: center;
  margin-left: 10px;
}
.tm-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--tm-border-strong);
  background: var(--tm-bg-soft);
  color: var(--tm-ink);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.tm-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--tm-primary);
  color: var(--tm-primary);
}
.tm-toggle-icon { display: inline-flex; }
.tm-toggle-icon svg { display: block; }
/* Light mode shows the moon (tap for dark). Dark mode shows the sun. */
.tm-toggle-sun { display: none; }
[data-theme="dark"] .tm-toggle-sun { display: inline-flex; }
[data-theme="dark"] .tm-toggle-moon { display: none; }

/* Site logo image (set in Customizer > Site Identity). The logo art
   sits on white, which blends into the light header; in dark mode
   the same white becomes a neat rounded chip on the navy bar. */
.custom-logo { max-height: 44px; object-fit: contain; }
[data-theme="dark"] .custom-logo { border-radius: 9px; }
@media (max-width: 921px) {
  .custom-logo { max-height: 36px; }
}

/* Footer: a light band that follows the page tokens. The old deep
   navy band was removed on 2026-11-22 at the user's request. */
.site-footer {
  background: var(--tm-footer-bg);
  color: var(--tm-footer-ink);
}
.site-footer a { color: var(--tm-footer-ink); }
.site-footer a:hover { color: var(--tm-primary); }
.site-footer .widget-title,
.site-footer h2, .site-footer h3, .site-footer h4 { color: var(--tm-footer-ink); }
.ast-footer-copyright, .site-footer .ast-small-footer-section { color: var(--tm-footer-muted); }

/* Astra's own below footer bar only prints the theme credit line
   ("Powered by Astra WordPress Theme"). The custom footer below has
   its own bottom bar, so Astra's bar is hidden. Nothing else in the
   Astra footer is touched. The attribute selector plus !important
   is deliberate: Astra's generated builder CSS sets a display value
   on this wrap with a more specific selector, which beat the plain
   class rule in the first live check on 2026-11-20. The copyright
   element is also removed in the Customizer, so this rule is only
   a safety net. */
.site-below-footer-wrap[data-section="section-below-footer-builder"] { display: none !important; }

/* Custom footer, printed by the astra_footer_after hook.
   A light band that follows the page tokens, with a gradient accent
   strip along the top edge. */
.tm-site-footer {
  position: relative;
  background: var(--tm-footer-bg);
  border-top: 1px solid var(--tm-border);
  color: var(--tm-footer-ink);
  padding: 54px 0 0;
}
.tm-site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tm-primary-dark), var(--tm-primary-bright) 55%, var(--tm-amber));
}
.tm-footer-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr 0.95fr 1.25fr;
  gap: 36px;
  padding-bottom: 42px;
}
.tm-footer-grid-no-recent { grid-template-columns: 1.7fr 1fr 1fr; }

/* Brand column */
.tm-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--tm-footer-ink);
}
.tm-footer-logo:hover { color: var(--tm-primary); }
.tm-footer-logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--tm-primary-bright), var(--tm-primary-dark));
  box-shadow: var(--tm-shadow-tile);
}
.tm-footer-logo-tile svg { display: block; color: #ffffff; }
.tm-footer-logo-name {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tm-footer-blurb {
  color: var(--tm-footer-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 18px 0 22px;
  max-width: 340px;
}

/* Link columns */
.tm-footer-title {
  color: var(--tm-footer-ink);
  font-size: 0.98rem;
  font-weight: 700;
  margin: 6px 0 16px;
}
.tm-footer-list { list-style: none; margin: 0; padding: 0; }
.tm-footer-list li { margin-bottom: 11px; }
.tm-footer-list a {
  color: var(--tm-footer-ink);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.tm-footer-list a:hover { color: var(--tm-primary); }
.tm-footer-posts a { font-weight: 600; line-height: 1.4; }
.tm-footer-post-date {
  display: block;
  color: var(--tm-footer-muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

/* Bottom bar */
.tm-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  flex-wrap: wrap;
  border-top: 1px solid var(--tm-border);
  padding: 20px 0 24px;
  font-size: 0.9rem;
  color: var(--tm-footer-muted);
}

/* Social icon row, inside the footer brand column */
.tm-social-links { display: flex; gap: 10px; }
.tm-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--tm-primary-dark);
  background: linear-gradient(145deg, #ffffff, var(--tm-bg-soft));
  border: 1px solid var(--tm-border-strong);
  box-shadow: var(--tm-shadow-card);
  transition: transform 0.2s ease, background 0.2s ease;
}
html[data-theme="dark"] .tm-social-btn {
  color: var(--tm-footer-ink);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: var(--tm-border);
  box-shadow: none;
}
.tm-social-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(145deg, var(--tm-primary-bright), var(--tm-primary-dark));
  color: #ffffff;
}
.tm-social-btn svg { display: block; }
