/*
Theme Name: Macbach - Just Kids Dental
Theme URI: https://macbach.com
Author: Macbach Healthcare Solutions
Author URI: https://macbach.com
Description: Custom Macbach theme for Just Kids Dental — Pediatric Dentist in Dallas, TX.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: macbach-jkd
Tags: pediatric, dental, healthcare, macbach
Tested up to: 6.9
Requires PHP: 7.4
*/

/* === Macbach JKD Base === */
:root {
  --macbach-brand: #1E5A8C;
  --macbach-accent: #F58220;
  --macbach-mint: #3BB9A8;
  --macbach-ink: #1F2937;
  --macbach-paper: #FFFFFF;
  --macbach-mist: #F3F4F6;
  --macbach-border: #e5e7eb;
  --macbach-radius: 14px;
  --macbach-radius-lg: 20px;
  --macbach-shadow: 0 8px 24px rgba(0,0,0,.08);
  --macbach-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--macbach-font);
  color: var(--macbach-ink);
  background: var(--macbach-paper);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* === Top Bar === */
.macbach-topbar {
  background: var(--macbach-brand);
  color: #fff;
  font-size: .85rem;
  padding: 8px 0;
  text-align: center;
  font-weight: 600;
}
.macbach-topbar a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.macbach-topbar a:hover { opacity: .85; }
.macbach-topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* === Site Header === */
.macbach-header {
  background: #fff;
  border-bottom: 1px solid var(--macbach-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.macbach-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.macbach-logo img { height: 48px; width: auto; }

/* === Navigation === */
.macbach-nav { display: flex; align-items: center; gap: 4px; }
.macbach-nav ul { display: flex; align-items: center; gap: 2px; }
.macbach-nav > ul > li { position: relative; }
.macbach-nav a {
  display: block;
  padding: 10px 14px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--macbach-ink);
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.macbach-nav a:hover,
.macbach-nav .current-menu-item > a,
.macbach-nav .current-menu-ancestor > a {
  color: var(--macbach-brand);
  background: rgba(30, 90, 140, .06);
}

/* Dropdowns */
.macbach-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--macbach-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
  padding: 8px;
  min-width: 220px;
  z-index: 200;
  flex-direction: column;
}
.macbach-nav li:hover > .sub-menu { display: flex; }
.macbach-nav .sub-menu a { padding: 8px 12px; font-size: .88rem; border-radius: 6px; }
.macbach-nav .sub-menu .sub-menu { left: 100%; top: -8px; }

/* Header CTA */
.macbach-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--macbach-accent);
  color: #fff;
  font-weight: 700;
  font-size: .92rem;
  border-radius: 9999px;
  transition: filter .15s;
  white-space: nowrap;
}
.macbach-header__cta:hover { filter: brightness(.92); color: #fff; }

/* Mobile Toggle */
.macbach-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.macbach-menu-toggle span {
  display: block; width: 24px; height: 2.5px;
  background: var(--macbach-ink); border-radius: 2px; transition: .2s;
}
.macbach-menu-close {
  display: none;
}

/* === Footer === */
.macbach-footer { background: var(--macbach-ink); color: #D1D5DB; padding: 48px 0 0; }
.macbach-footer__inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px;
}
.macbach-footer__brand img {
  height: 44px; width: auto; margin-bottom: 16px;
  filter: brightness(0) invert(1);
}
.macbach-footer__brand p { font-size: .92rem; line-height: 1.7; margin: 4px 0; }
.macbach-footer__brand a { color: #93C5FD; }
.macbach-footer__brand a:hover { color: #fff; }
.macbach-footer__col h4 {
  color: #fff; font-size: .95rem; font-weight: 700;
  margin-bottom: 14px; letter-spacing: .02em;
}
.macbach-footer__col ul li { margin: 8px 0; }
.macbach-footer__col a { font-size: .9rem; color: #9CA3AF; transition: color .15s; }
.macbach-footer__col a:hover { color: #fff; }
.macbach-footer__bottom {
  max-width: 1200px; margin: 36px auto 0; padding: 18px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; color: #6B7280; flex-wrap: wrap; gap: 8px;
}
.macbach-footer__bottom a { color: #9CA3AF; }
.macbach-footer__bottom a:hover { color: #fff; }
.macbach-footer__actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.macbach-footer__actions a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 9999px; font-size: .85rem; font-weight: 600;
  color: #D1D5DB; transition: .15s;
}
.macbach-footer__actions a:hover {
  border-color: var(--macbach-brand); color: #fff;
  background: rgba(30,90,140,.2);
}

/* === Page Content === */
.macbach-content { min-height: 60vh; }

/* === 404 === */
.macbach-404 { text-align: center; padding: 80px 20px; max-width: 640px; margin: 0 auto; }
.macbach-404 h1 { font-size: clamp(32px, 5vw, 52px); color: var(--macbach-brand); margin-bottom: .3em; }
.macbach-404 p { font-size: 1.1rem; color: #6B7280; margin-bottom: 24px; }
.macbach-404 .btn {
  display: inline-block; padding: 12px 24px;
  background: var(--macbach-brand); color: #fff;
  border-radius: 9999px; font-weight: 700; transition: filter .15s;
}
.macbach-404 .btn:hover { filter: brightness(.9); }

/* === Mobile Responsive === */
@media (max-width: 960px) {
  .macbach-nav {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff; z-index: 300;
    flex-direction: column; padding: 80px 24px 24px;
    overflow-y: auto;
  }
  .macbach-nav.is-open { display: flex; }
  .macbach-nav.is-open .macbach-menu-close {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--macbach-ink);
    z-index: 301;
  }
  .macbach-nav ul { flex-direction: column; width: 100%; gap: 0; }
  .macbach-nav a {
    padding: 14px 16px; font-size: 1rem;
    border-bottom: 1px solid var(--macbach-border); border-radius: 0;
  }
  .macbach-nav .sub-menu {
    position: static; box-shadow: none; border: none;
    border-radius: 0; padding: 0 0 0 16px;
    display: flex; flex-direction: column; min-width: auto;
  }
  .macbach-nav .sub-menu .sub-menu { left: 0; top: 0; }
  .macbach-menu-toggle { display: flex; }
  .macbach-header__cta--desktop { display: none; }
  .macbach-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .macbach-footer__inner { grid-template-columns: 1fr; }
  .macbach-topbar__inner { font-size: .78rem; }
}

/* === Mobile Sticky CTA === */
.macbach-mobile-cta { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90; }
.macbach-mobile-cta a {
  flex: 1; text-align: center; padding: 14px 10px;
  font-weight: 800; font-size: .85rem; color: #fff; text-decoration: none;
}
.macbach-mobile-cta a:nth-child(1) { background: var(--macbach-brand); }
.macbach-mobile-cta a:nth-child(2) { background: var(--macbach-accent); }
.macbach-mobile-cta a:nth-child(3) { background: var(--macbach-mint); }

@media (max-width: 768px) {
  .macbach-mobile-cta { display: flex; }
  .macbach-footer { padding-bottom: 56px; }
}

/* === Skip Link (A11y) === */
.macbach-skip-link {
  position: absolute; top: -100px; left: 10px;
  background: var(--macbach-brand); color: #fff;
  padding: 10px 18px; border-radius: 0 0 8px 8px;
  font-weight: 700; z-index: 9999; transition: top .2s;
}
.macbach-skip-link:focus { top: 0; }

/* === WP Core Overrides === */
.wp-block-image img { border-radius: 16px; }
.wp-block-heading { color: var(--macbach-ink); }
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }
