/* ==========================================================================
   Sterling & Vance — professional advisory theme
   ========================================================================== */

:root {
  --bg: #f7f7f5;
  --bg-alt: #eeece5;
  --bg-dark: #0f1b2d;
  --border: #e1ddd1;
  --text: #14202f;
  --text-dim: #566378;
  --text-dimmer: #8b93a3;
  --accent: #b8912f;
  --accent-bright: #d1ab4d;
  --accent-2: #0f1b2d;
  --accent-text: #ffffff;

  --container-width: 1120px;
  --radius: 2px;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
em { font-style: italic; color: var(--accent); }

.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }

.section { padding: 110px 0; }
.section-dark { background: var(--bg-dark); color: #fff; }
.section-dark .eyebrow { color: var(--accent-bright); }
.section-dark p { color: rgba(255, 255, 255, 0.72); }
.section-dark h2 { color: #fff; }

.section-head { text-align: center; max-width: 600px; margin: 0 auto 60px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 38px); margin-top: 10px; }

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lead { font-size: 18px; color: var(--text-dim); }

/* Buttons — sweep-fill hover
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s ease, border-color 0.2s ease;
}

.btn span { position: relative; z-index: 1; }

.btn-primary { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 0;
}
.btn-primary:hover::before { transform: scaleX(1); }
.btn-primary:hover { color: var(--accent-2); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }

.section-dark .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.section-dark .btn-ghost:hover { background: #fff; color: var(--bg-dark); }

.btn-lg { padding: 17px 34px; font-size: 15px; }

/* Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 24px 0;
  background: rgba(247, 247, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--text); }

.main-nav ul { display: flex; gap: 36px; }
.main-nav a { font-size: 14px; font-weight: 600; color: var(--text-dim); transition: color 0.15s ease; }
.main-nav a:hover { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span { display: block; width: 16px; height: 2px; margin: 0 auto; background: var(--text); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero
   ========================================================================== */

.hero { padding: 140px 0 100px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero .eyebrow { margin-bottom: 24px; display: inline-block; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 24px; }
.hero p.lead { font-size: 19px; max-width: 580px; margin: 0 auto 38px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-photo {
  max-width: 480px;
  width: 100%;
  margin: 40px auto 0;
  border-radius: var(--radius-lg, 8px);
  border: 1px solid var(--border);
}

/* Services
   ========================================================================== */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }

.service-card { border-top: 2px solid var(--accent); padding-top: 24px; }
.service-index { display: block; font-family: var(--font-heading); font-size: 15px; color: var(--text-dimmer); margin-bottom: 14px; }
.service-card h3 { font-size: 20px; margin-bottom: 12px; }
.service-card p { font-size: 15px; color: var(--text-dim); }

/* Approach
   ========================================================================== */

.approach-inner { text-align: center; }
.approach-inner > h2 { max-width: 600px; margin: 12px auto 56px; }
.approach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: left; }
.approach-item h3 { font-size: 18px; margin-bottom: 10px; color: var(--accent-bright); }
.approach-item p { font-size: 14px; }

/* Stats
   ========================================================================== */

.stats-band { padding: 72px 0; background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-value { display: block; font-family: var(--font-heading); font-size: 42px; font-weight: 700; color: var(--accent-2); }
.stat-label { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* Testimonial
   ========================================================================== */

.testimonial { max-width: 720px; margin: 0 auto; text-align: center; }
.testimonial p { font-family: var(--font-heading); font-size: 24px; line-height: 1.5; font-style: italic; color: var(--text); margin-bottom: 22px; }
.testimonial-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  border: 1px solid var(--border);
}
.testimonial-author { font-size: 14px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

.firm-video { max-width: 720px; margin: 48px auto 0; border-radius: var(--radius-lg, 8px); overflow: hidden; border: 1px solid var(--border); }

/* CTA
   ========================================================================== */

.cta-banner { text-align: center; max-width: 620px; margin: 0 auto; }
.cta-banner h2 { font-size: clamp(28px, 4vw, 36px); margin: 10px 0 14px; }
.cta-banner p { margin-bottom: 30px; }

/* Footer
   ========================================================================== */

.site-footer { border-top: 1px solid var(--border); padding: 32px 0; text-align: center; }
.footer-bottom p { color: var(--text-dimmer); font-size: 13px; }
.footer-admin-link { margin-top: 4px; }
.footer-admin-link a { text-decoration: underline; opacity: 0.7; }
.footer-admin-link a:hover { opacity: 1; }

/* Scroll reveal
   ========================================================================== */

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Responsive video/embed utility — used anywhere a cms_video() field renders */

.media-embed-16x9 { position: relative; padding-top: 56.25%; background: #000; }
.media-embed-16x9 iframe,
.media-embed-16x9 video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .grid-3, .approach-grid { grid-template-columns: 1fr; gap: 32px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .main-nav.is-open { max-height: 320px; }
  .main-nav ul { flex-direction: column; padding: 8px 24px 20px; gap: 4px; }
  .main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .header-actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ==========================================================================
   Admin / install / auth — shared across every Deadmojo CMS-driven template.
   Uses var() fallbacks so it works whether or not the theme above defines
   --bg-card / --radius-lg.
   ========================================================================== */

.flash {
  margin: 16px auto 0;
  padding: 12px 18px;
  border-radius: var(--radius, 8px);
  font-size: 14px;
}
.flash-success { background: rgba(80, 200, 120, 0.12); border: 1px solid rgba(80, 200, 120, 0.35); color: #4fbd7a; }
.flash-error { background: rgba(220, 80, 70, 0.12); border: 1px solid rgba(220, 80, 70, 0.35); color: #e2685c; }

.demo-banner {
  background: var(--accent);
  color: var(--accent-text, #fff);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  position: relative;
  z-index: 200;
}
.demo-banner a { text-decoration: underline; }

.auth-section { padding: 64px 0 80px; display: flex; justify-content: center; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card, var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, var(--radius, 12px));
  padding: 36px 32px;
}

.auth-card h1 { font-size: 24px; margin-bottom: 6px; text-align: center; }
.auth-subtext { color: var(--text-dim); font-size: 13px; text-align: center; margin-bottom: 24px; }
.demo-login-hint { font-size: 13px; color: var(--text-dim); background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius, 8px); padding: 10px 14px; margin-bottom: 20px; }

.form-errors { background: rgba(220, 80, 70, 0.1); border: 1px solid rgba(220, 80, 70, 0.3); border-radius: var(--radius, 8px); padding: 14px 18px; margin-bottom: 20px; font-size: 14px; color: #e2685c; }
.form-errors ul { list-style: disc; padding-left: 18px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text-dim); }
.field-help { font-size: 12px; color: var(--text-dimmer); margin: -2px 0 8px; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.form-group textarea { resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--accent); }

.admin-video-url { margin-top: 8px; }

.admin-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); margin: 8px 0; }
.admin-checkbox input { width: auto; }

.admin-media-preview { margin-bottom: 10px; }
.admin-media-preview img { max-width: 220px; max-height: 140px; object-fit: cover; border-radius: var(--radius, 8px); border: 1px solid var(--border); }
.admin-media-preview video { max-width: 320px; border-radius: var(--radius, 8px); border: 1px solid var(--border); }

.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; align-items: flex-start; }

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--bg-card, var(--bg-alt));
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
}
.admin-sidebar .logo { margin-bottom: 28px; font-size: 18px; display: block; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  padding: 10px 12px;
  border-radius: var(--radius, 8px);
  font-size: 14px;
  color: var(--text-dim);
}
.admin-nav a:hover { background: var(--bg-alt); text-decoration: none; }
.admin-nav a.is-active { background: rgba(255, 255, 255, 0.06); color: var(--accent); }

.admin-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.admin-sidebar-footer a { color: var(--text-dim); }
.admin-sidebar-footer a:hover { color: var(--accent); }

.admin-main { flex: 1; padding: 40px; max-width: 900px; }
.admin-main h1 { font-size: 26px; margin-bottom: 6px; }
.admin-subtext { color: var(--text-dim); margin-bottom: 28px; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.admin-stat { background: var(--bg-card, var(--bg-alt)); border: 1px solid var(--border); border-radius: var(--radius-lg, var(--radius, 12px)); padding: 20px; }
.admin-stat-value { display: block; font-size: 28px; font-weight: 800; margin-bottom: 4px; color: var(--accent); }
.admin-stat-label { font-size: 12px; color: var(--text-dim); }

.admin-quicklinks { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-form { max-width: 640px; }
.admin-form-wide { max-width: 720px; }

.admin-fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg, var(--radius, 12px)); padding: 24px; margin-bottom: 24px; }
.admin-fieldset legend { padding: 0 8px; font-size: 15px; font-weight: 700; color: var(--accent); }

.install-body { display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; background: var(--bg); }
.install-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card, var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, var(--radius, 12px));
  padding: 36px 32px;
}
.install-card h1 { font-size: 24px; margin-bottom: 24px; }
.install-card h2 { font-size: 16px; margin: 24px 0 12px; }
.install-card p { margin-bottom: 12px; font-size: 14px; color: var(--text-dim); }

.install-checklist { list-style: none; font-size: 14px; }
.install-checklist li { padding: 6px 0; }
.install-checklist .is-ok { color: #4fbd7a; }
.install-checklist .is-fail { color: #e2685c; font-weight: 600; }

.install-error { background: rgba(220, 80, 70, 0.1); border: 1px solid rgba(220, 80, 70, 0.3); border-radius: var(--radius, 8px); padding: 14px 18px; margin: 14px 0; font-size: 14px; }
.install-error ul { list-style: disc; padding-left: 18px; margin: 0; }
.install-success { color: #4fbd7a; font-weight: 600; font-size: 15px; }
.install-hint { font-size: 12px; color: var(--text-dimmer); }

@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; min-height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-footer { flex-direction: row; border-top: none; padding-top: 0; margin-left: auto; }
  .admin-main { padding: 24px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}
