/* ================================================================
   KB TRAINING & SECURITY SERVICES — SHARED STYLESHEET v1.1
   Fixes: logo size, body/nav spacing, container width, performance
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,600&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 76px; }

/* FIX #2: NO body padding-top — page templates use .kb-page-start div for offset */
body { font-family: 'Outfit', sans-serif; overflow-x: hidden; -webkit-font-smoothing: antialiased; }

img { max-width: 100%; display: block; }
a { text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── DESIGN TOKENS ── */
:root {
  --gold:        #B8963E;
  --gold-light:  #D4AF6A;
  --gold-pale:   #F0E4C8;
  --gold-faint:  rgba(184,150,62,0.1);
  --bg-primary:   #F7F5F0;
  --bg-card:      #FFFFFF;
  --bg-subtle:    #EFEFEB;
  --text-primary: #1A1A1A;
  --text-body:    #3D3D3D;
  --text-muted:   #7A7A7A;
  --border:       rgba(0,0,0,0.1);
  --border-gold:  rgba(184,150,62,0.25);
  --shadow:       0 2px 20px rgba(0,0,0,0.07);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.12);
  --dk-bg:        #0C0C0C;
  --dk-surface:   #161616;
  --dk-border:    rgba(184,150,62,0.2);
  --dk-text:      rgba(255,255,255,0.85);
  --dk-muted:     rgba(255,255,255,0.45);
  --container:   1200px;
  --nav-h:       76px;
  --radius:      3px;
  --radius-lg:   6px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── TYPOGRAPHY ── */
.t-display { font-family: 'Cormorant Garamond', serif; font-weight: 300; line-height: 1.1; letter-spacing: -0.01em; }
.t-heading  { font-family: 'Cormorant Garamond', serif; font-weight: 400; line-height: 1.2; }
.t-eyebrow  { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }
.t-body     { font-size: 0.95rem; line-height: 1.8; color: var(--text-body); }
.t-small    { font-size: 0.78rem; line-height: 1.7; color: var(--text-muted); }

/* ── NAV ── */
/* ── NAV ── */
.kb-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h);
  background: rgba(247,245,240,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center;
  padding: 0 3rem;
  gap: 2rem;
  transition: box-shadow 0.3s var(--ease);
}
.kb-nav.elevated { box-shadow: var(--shadow); }

/* FIX #1: Logo — hard-clamp ALL images including WP custom_logo output */
.kb-nav-logo {
  display: flex; align-items: center; gap: 0.85rem;
  flex-shrink: 0; text-decoration: none;
  overflow: hidden;
  max-height: calc(var(--nav-h) - 16px);
}
.kb-nav-logo img,
.kb-nav-logo a img,
.kb-nav-logo .custom-logo-link img,
.kb-nav-logo .custom-logo {
  height: 44px !important;
  width:  44px !important;
  min-width: 44px;
  max-width: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
  display: block;
}
.kb-nav-logo .custom-logo-link {
  display: flex; align-items: center; line-height: 0; flex-shrink: 0;
}

.kb-nav-logo-text { display: flex; flex-direction: column; gap: 1px; }
.kb-nav-logo-text strong { font-family: 'Cormorant Garamond', serif; font-size: 0.95rem; font-weight: 600; color: #1A1A1A; letter-spacing: 0.03em; line-height: 1.1; }
.kb-nav-logo-text span   { font-size: 0.52rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); font-weight: 500; }

.kb-nav-menu { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.kb-nav-item { position: relative; }

.kb-nav-link {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-body); transition: color 0.2s; white-space: nowrap;
}
.kb-nav-link:hover, .kb-nav-link.active { color: var(--gold); }

.kb-nav-cta-link {
  display: inline-block; padding: 0.55rem 1.5rem; flex-shrink: 0;
  background: var(--gold); color: #fff !important;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  transition: background 0.2s;
}
.kb-nav-cta-link:hover { background: var(--gold-light); color: #fff !important; }

/* Hamburger */
.kb-hamburger { display: none; flex-direction: column; gap: 5px; padding: 6px; background: none; border: none; margin-left: auto; }
.kb-hamburger span { display: block; width: 22px; height: 1.5px; background: var(--text-primary); transition: all 0.3s; }
.kb-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.kb-hamburger.open span:nth-child(2) { opacity: 0; }
.kb-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

/* Mobile menu */
.kb-mobile-nav {
  position: fixed; inset: 0; z-index: 800; background: var(--bg-primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: all 0.3s var(--ease); padding-top: var(--nav-h);
}
.kb-mobile-nav.open { opacity: 1; visibility: visible; pointer-events: all; }
.kb-mobile-nav a {
  display: block; width: 100%; padding: 1rem 2rem;
  font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 300;
  color: var(--text-primary); border-bottom: 1px solid var(--border);
  text-align: center; letter-spacing: 0.03em; transition: color 0.2s;
}
.kb-mobile-nav a:hover { color: var(--gold); }

/* FIX #2: Single-source page offset spacer */
.kb-page-start { display: block; height: var(--nav-h); }

/* FIX #3: Container always max-width */
.kb-container {
  max-width: var(--container);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

/* ── HERO ── */
.kb-hero { height: 52vh; min-height: 400px; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.kb-hero-img { position: absolute; inset: 0; background: var(--dk-bg); overflow: hidden; }
.kb-hero-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.kb-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 60%); }
.kb-hero-content { position: relative; z-index: 2; max-width: var(--container); width: 100%; margin: 0 auto; padding: 3rem 2.5rem; }
.kb-hero-eyebrow { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.35em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.8rem; }
.kb-hero-eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--gold); }
.kb-hero h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 300; color: #fff; line-height: 1.1; letter-spacing: 0.01em; }
.kb-hero h1 em { font-style: italic; color: var(--gold-light); }

/* ── SECTIONS ── */
.kb-section    { padding: 6rem 0; }
.kb-section-sm { padding: 4rem 0; }
.kb-section-dark   { background: var(--dk-bg); }
.kb-section-subtle { background: var(--bg-subtle); }
.kb-section-white  { background: #fff; }

.kb-section-header { margin-bottom: 3.5rem; }
.kb-section-header.centered { text-align: center; }
.kb-section-header.centered .kb-eyebrow { justify-content: center; }
.kb-eyebrow { display: flex; align-items: center; gap: 0.75rem; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.35em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.9rem; }
.kb-eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--gold); flex-shrink: 0; }
.kb-section-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 300; line-height: 1.15; color: var(--text-primary); margin-bottom: 1rem; }
.kb-section-title em { font-style: italic; color: var(--gold); }
.kb-section-title.light { color: #fff; }
.kb-section-sub { font-size: 0.9rem; line-height: 1.85; color: var(--text-muted); max-width: 520px; }
.kb-section-sub.wide { max-width: 700px; }
.kb-section-sub.light { color: var(--dk-muted); }

/* Date tabs */
.kb-dates-tabs { display:flex; border-bottom:1px solid var(--border); margin-bottom:0; }
.kb-dates-tab { padding:0.65rem 1.5rem; font-size:0.65rem; font-weight:600; letter-spacing:0.15em; text-transform:uppercase; cursor:pointer; border:none; background:none; color:var(--text-muted); border-bottom:2px solid transparent; margin-bottom:-1px; transition:all 0.2s; font-family:'Outfit',sans-serif; }
.kb-dates-tab.active { color:var(--gold); border-bottom-color:var(--gold); }
.kb-dates-panel { display:none; }
.kb-dates-panel.active { display:block; }
.kb-date-row { display:flex; justify-content:space-between; align-items:center; padding:0.85rem 0; border-bottom:1px solid var(--border); }
.kb-date-row:last-child { border-bottom:none; }
.kb-date-loc { font-size:0.6rem; letter-spacing:0.15em; text-transform:uppercase; color:var(--text-muted); margin-bottom:0.15rem; }
.kb-date-range { font-size:0.85rem; font-weight:500; color:var(--text-primary); }
.kb-date-price-inline { font-family:'Cormorant Garamond',serif; font-size:1.1rem; color:var(--gold); }

/* ── BUTTONS ── */
.kb-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 2.2rem; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; transition: all 0.25s var(--ease); font-family: 'Outfit', sans-serif; border: none; cursor: pointer; }
.kb-btn-primary { background: var(--gold); color: #fff; }
.kb-btn-primary:hover { background: var(--gold-light); }
.kb-btn-outline { background: transparent; color: var(--text-primary); border: 1.5px solid var(--border); }
.kb-btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.kb-btn-outline-gold { background: transparent; color: var(--gold); border: 1.5px solid var(--border-gold); }
.kb-btn-outline-gold:hover { background: var(--gold); color: #fff; }
.kb-btn-outline-white { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.kb-btn-outline-white:hover { border-color: #fff; }
.kb-btn-sm { padding: 0.55rem 1.4rem; font-size: 0.6rem; }

/* ── CARDS ── */
.kb-card { background: var(--bg-card); border: 1px solid var(--border); padding: 2rem 1.8rem; width: 100%; transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s; }
.kb-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--border-gold); }
.kb-card-dark { background: var(--dk-surface); border: 1px solid var(--dk-border); }
.kb-card-dark:hover { border-color: var(--gold); }

/* ── REVEAL ANIMATIONS ── */
.kb-reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.kb-reveal.visible { opacity: 1; transform: none; }
.kb-reveal-delay-1 { transition-delay: 0.1s; }
.kb-reveal-delay-2 { transition-delay: 0.2s; }
.kb-reveal-delay-3 { transition-delay: 0.3s; }
.kb-reveal-delay-4 { transition-delay: 0.4s; }

/* ── FOOTER ── */
.kb-footer { background: #0C0C0C; border-top: 1px solid rgba(184,150,62,0.2); padding: 5rem 0 2.5rem; }
.kb-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 4rem; }
.kb-footer-brand h4 { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; color: var(--gold); margin-bottom: 0.25rem; }
.kb-footer-brand .motto { font-size: 0.55rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(184,150,62,0.68); margin-bottom: 1.2rem; display: block; }
.kb-footer-brand p { font-size: 0.78rem; color: rgba(255,255,255,0.35); line-height: 1.85; }
.kb-footer-col h5 { font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.2rem; }
.kb-footer-col a { display: block; font-size: 0.78rem; color: rgba(255,255,255,0.38); margin-bottom: 0.55rem; transition: color 0.2s; }
.kb-footer-col a:hover { color: #fff; }
.kb-footer-bottom { padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.06); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.kb-footer-bottom p { font-size: 0.66rem; color: rgba(255,255,255,0.55); }
.kb-footer-tagline { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 0.95rem; color: rgba(184,150,62,0.68); }

/* ── OFFICES GRID ── */
.kb-offices-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.kb-office-card { padding: 2rem; border: 1px solid var(--border-gold); background: var(--bg-card); }
.kb-office-card h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 400; color: var(--text-primary); margin-bottom: 0.3rem; }
.kb-office-hq { font-size: 0.55rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; display: block; }
.kb-office-card address { font-style: normal; font-size: 0.82rem; color: var(--text-muted); line-height: 1.8; }

/* ── WP ADMIN BAR OFFSET ── */
.admin-bar .kb-nav { top: 32px; }
.admin-bar .kb-page-start { height: calc(var(--nav-h) + 32px); }
@media (max-width: 782px) {
  .admin-bar .kb-nav { top: 46px; }
  .admin-bar .kb-page-start { height: calc(var(--nav-h) + 46px); }
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .kb-nav { padding: 0 1.5rem; }
  .kb-nav-menu { display: none; }
  .kb-hamburger { display: none; }
  .kb-hamburger { display: flex; }
  .kb-nav-cta-link { display: none; }
  .kb-footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .kb-offices-grid { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .kb-container { padding-left: 1.25rem; padding-right: 1.25rem; }
  .kb-section { padding: 4rem 0; }
  .kb-hero { height: 44vh; min-height: 300px; }
  .kb-hero-content { padding: 2rem 1.25rem; }
  .kb-footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}