/*
 * Kundan Base — Base styles
 * Reset, typography, layout utilities, buttons, shared components.
 */

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
img, video { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; }

/* ─── Body ───────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ─────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem);  font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.35; }
h4 { font-size: 1rem;    font-weight: 600; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
em { font-style: italic; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ─── Layout ─────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

section { padding: var(--section-py) 0; }

.section-label {
  display: inline-block;
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-header { max-width: 680px; margin-bottom: 60px; }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-header h2 { margin-bottom: 16px; }
.section-intro { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.6);
  color: var(--white);
}

.btn-ghost-dark {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost-dark:hover {
  background: var(--accent);
  color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.btn-white:hover {
  background: #f0f4ff;
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-lg { padding: 18px 36px; font-size: 1.05rem; }

/* ─── Card ───────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-icon {
  width: 48px;
  height: 48px;
  background: #dbeafe;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── Site header ────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* height: 64px; */
  height: auto;
  min-width: 0;
  padding: 10px 0;
}

.site-logo {
  flex-shrink: 1;
  min-width: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--white); }
.site-logo .logo-mark {
  color: var(--accent);
  font-size: 1.4em;
  line-height: 1;
  vertical-align: middle;
}

.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0 24px;
}

.header-nav__list {
  display: flex;
  align-items: center;
  gap: 8px 28px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav__list > .menu-item {
  position: relative;
}

/* Invisible hover bridge — top-level only (below primary nav link). */
.header-nav__list > .menu-item-has-children::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 16px;
  z-index: 199;
}

.header-nav__list > .menu-item > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition);
  padding: 8px 4px;
  border-radius: var(--radius);
}

.header-nav__list > .menu-item > a:hover,
.header-nav__list > .menu-item > a:focus-visible {
  color: var(--white);
  outline: none;
}

/* Dropdown panels — shared look; position differs for first vs nested level */
.header-nav .sub-menu {
  position: absolute;
  min-width: 220px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: var(--navy-mid);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 200;
}

/* First-level: below top nav item, centered */
.header-nav__list > .menu-item > .sub-menu {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
}

/* Nested: fly-out to the right of the parent row */
.header-nav .sub-menu .menu-item-has-children {
  position: relative;
}

/* Hover bridge between nested parent link and fly-out (horizontal gap) */
.header-nav .sub-menu .menu-item-has-children::after {
  content: '';
  position: absolute;
  top: 0;
  left: 100%;
  width: 12px;
  height: 100%;
  z-index: 199;
}

.header-nav .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  right: auto;
  transform: none;
  margin-left: 4px;
  margin-top: 0;
  z-index: 210;
}

.header-nav .menu-item-has-children:hover > .sub-menu,
.header-nav .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.header-nav .sub-menu .menu-item > a {
  display: block;
  padding: 10px 18px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-nav .sub-menu .menu-item > a:hover,
.header-nav .sub-menu .menu-item > a:focus-visible {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  outline: none;
}

.header-nav__list > .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.65;
  vertical-align: middle;
}

/* Nested items: point chevron right (fly-out) */
.header-nav .sub-menu .menu-item-has-children > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-nav .sub-menu .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  border-right: none;
  opacity: 0.65;
  flex-shrink: 0;
  transform: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}
.header-phone:hover,
.header-phone:focus-visible {
  color: var(--white);
}

.header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.1);
}

/* Login control: colors from Customizer (Content → Button outline) via .wp-block-button.is-style-outline */
.site-header .kb-header-login-wrap.wp-block-button {
  display: inline-block;
}
.btn-login {
  display: inline-block;
  background: transparent;
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1.2;
  box-sizing: border-box;
}
.btn-login:focus-visible {
  outline: none;
}

.header-cta {
  padding: 10px 20px;
  font-size: 0.9rem;
  flex-shrink: 1;
  min-width: 0;
  text-align: center;
}

/* Hamburger — hidden on desktop */
.header-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: 0 -8px 0 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--white);
}

.header-menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header-menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-menu-toggle.is-active .header-menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-menu-toggle.is-active .header-menu-toggle__bar:nth-child(2) {
  opacity: 0;
}
.header-menu-toggle.is-active .header-menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile panel — never shown as raw list on desktop */
.mobile-nav-panel {
  display: none;
}

/* ─── Site footer (homepage-reference-v2 .site-footer) ─ */
.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 64px 0 32px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
  align-items: start;
}
.footer-brand .footer-brand__tagline {
  color: rgba(255,255,255,0.45);
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 14px 0 0 0;
}
.footer-address {
  margin-top: 20px;
  color: rgba(255,255,255,0.35);
  font-size: 0.83rem;
  line-height: 1.7;
  font-style: normal;
}
.footer-address a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
}
.footer-address a:hover { color: var(--white); }
.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.footer-social__link {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.footer-social__link:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}
.footer-col h4 {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0 0 16px 0;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.footer-col li { margin: 0; }
.footer-col a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.footer-bottom p {
  color: rgba(255,255,255,0.3);
  font-size: 0.83rem;
  margin: 0;
}
/* Brand logo (text or custom logo) */
.footer-brand .footer-logo,
.footer-brand .logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.footer-brand .footer-logo:hover,
.footer-brand .logo:hover { color: var(--white); }
.footer-brand .footer-logo .logo-mark,
.footer-brand .logo .logo-mark {
  color: var(--accent);
  font-size: 1.4em;
  line-height: 1;
  vertical-align: middle;
}
.footer-brand .custom-logo-link {
  display: inline-block;
  line-height: 0;
}
.footer-brand .custom-logo-link img {
  max-height: 40px;
  width: auto;
}

/* ─── Post / page content ────────────────────────── */
/*
 * .entry-content is used inside the post content div (.kb-post-content).
 * It styles the typography of rendered blocks. Width constraints are handled
 * by gutenberg.css (.kb-page-content / .kb-post-content) so wide/full blocks
 * can escape without extra negative-margin hacks.
 */
.entry-content h2, .entry-content h3 { margin: 1.8em 0 0.6em; }
.entry-content ul, .entry-content ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 1.5em 0;
  color: var(--muted);
  font-style: italic;
  background: var(--grey-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ─── Utilities ──────────────────────────────────── */
.text-muted  { color: var(--muted); }
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.custom-logo-link img {
  object-fit: scale-down;
  width: 30px;
  height: auto;
}