/* ==========================================================================
   CDA Business Services — main stylesheet
   ========================================================================== */

:root {
  --color-primary: #0063a8;
  --color-primary-dark: #004d82;
  --color-primary-light: #eaf3fa;
  --color-accent: #f2a71b;
  --color-text: #1f2937;
  --color-text-light: #5b6472;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-border: #e2e8f0;
  --font-body: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1180px;
  --max-width-header: 1360px;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 17px;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

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

.btn {
  display: inline-block;
  padding: 0.75em 1.6em;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  border: 2px solid var(--color-primary);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-white { background: #fff; color: var(--color-primary); border-color: #fff; }
.btn-white:hover { background: transparent; color: #fff; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ---- Top bar ---- */
.top-bar {
  background: var(--color-primary-dark);
  color: #fff;
  font-size: 0.78rem;
}
.top-bar .container {
  max-width: var(--max-width-header);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
  padding-bottom: 4px;
  flex-wrap: wrap;
  gap: 6px;
}
.top-bar a { color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.top-bar svg { width: 13px; height: 13px; flex: none; }
.top-bar-contact { display: flex; gap: 18px; flex-wrap: wrap; }
.top-bar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top-bar-address { font-size: 0.8rem; }

.remote-support-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 3px 13px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  border: 1px solid rgba(255,255,255,0.45);
  white-space: nowrap;
}
.remote-support-btn:hover { background: #fff; color: var(--color-primary-dark); }

@media (max-width: 700px) {
  .top-bar-address { display: none; }
}

/* ---- Site header ---- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  max-width: var(--max-width-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.site-branding img { max-height: 46px; width: auto; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--color-text);
  font-weight: 600;
  padding: 8px 10px;
  display: block;
  border-radius: var(--radius);
  font-size: 0.88rem;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.menu-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 1.3rem;
  color: var(--color-primary);
  cursor: pointer;
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .site-header .container { flex-wrap: wrap; }
  .top-bar-contact { justify-content: center; width: 100%; }
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 70px 0;
}
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { color: #fff; }
.hero p.lead { font-size: 1.15rem; color: #eaf3fa; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 1.5em; flex-wrap: wrap; }
.hero-art { background: rgba(255,255,255,0.08); border-radius: var(--radius); padding: 20px; }
.hero-art a:hover, .hero-art a:focus-visible { background: rgba(255,255,255,0.14); }

@media (max-width: 800px) {
  .hero .container { grid-template-columns: 1fr; }
}

/* ---- Section helpers ---- */
.section { padding: 70px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 3em; }
.section-header p { color: var(--color-text-light); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* ---- Service cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 1000px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card .icon { width: 48px; height: 48px; margin-bottom: 16px; color: var(--color-primary); }
.card .icon img,
.hero-art img { width: 100%; height: 100%; object-fit: contain; }
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--color-text-light); margin-bottom: 0.8em; }
.card a.more { font-weight: 600; }

/* ---- Feature row (service page blocks) ---- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px 0;
  border-bottom: 1px solid var(--color-border);
}
.feature-row:last-child { border-bottom: none; }
.feature-row.reverse .feature-media { order: 2; }
.feature-media {
  background: var(--color-primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 220px;
}
.feature-media svg { width: 100%; max-width: 220px; color: var(--color-primary); }
.feature-media.has-photo {
  background: none;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  min-height: 0;
  display: block;
  max-width: 75%;
  margin: 0 auto;
}
.feature-media.has-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}
.feature-list { list-style: none; margin: 1em 0 0; padding: 0; }
.feature-list li {
  padding-left: 28px;
  position: relative;
  margin-bottom: 0.6em;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 16px;
  height: 16px;
  background: var(--color-primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='black' stroke-width='3'/%3E%3C/svg%3E") center/contain no-repeat;
}

@media (max-width: 800px) {
  .feature-row, .feature-row.reverse { grid-template-columns: 1fr; }
  .feature-row.reverse .feature-media { order: 0; }
}

/* ---- Callout / CTA band ---- */
.cta-band {
  background: var(--color-primary);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #eaf3fa; }

/* ---- Contact page ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3em;
  margin-top: 1em;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form .hp-field { display: none; }

.form-notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 1.5em;
  font-weight: 600;
}
.form-notice.success { background: #e6f7ee; color: #1b7a43; }
.form-notice.error { background: #fdeceb; color: #b3261e; }

.map-wrap iframe { width: 100%; height: 340px; border: 0; border-radius: var(--radius); }
.address-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

/* ---- Downloads toolbar (search + category filter) ---- */
.downloads-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 2.5em;
}
#cda-download-search {
  flex: 1 1 240px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}
#cda-download-os-filter,
#cda-download-driver-filter,
#cda-download-manufacturer-filter {
  flex: 0 1 200px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--color-text);
}
.download-filters { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.download-filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
}
.download-filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.download-filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ---- Downloads (Support page) ---- */
.download-group { margin-bottom: 2.5em; }
.download-group h3 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary-light);
  padding-bottom: 0.4em;
}
.download-list { list-style: none; margin: 0; padding: 0; }
.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.download-item .file-meta { color: var(--color-text-light); font-size: 0.9rem; }

/* ---- Blog ---- */
.post-list { display: grid; gap: 32px; }
.post-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-card .post-thumb { aspect-ratio: 16/9; background: var(--color-primary-light); overflow: hidden; }
.post-card .post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 20px 24px; }
.post-meta { color: var(--color-text-light); font-size: 0.9rem; margin-bottom: 0.5em; }

.single-post .entry-content { max-width: 760px; margin: 0 auto; }
.single-post .entry-header { max-width: 760px; margin: 0 auto 2em; }

/* ---- About / generic content page ---- */
.content-narrow { max-width: 760px; margin: 0 auto; }
.content-narrow h1,
.content-narrow h2,
.content-narrow h3,
.content-narrow h4 {
  text-align: center;
  margin-top: 1.6em;
  margin-bottom: 0.7em;
}
.content-narrow h1:first-child,
.content-narrow h2:first-child,
.content-narrow h3:first-child,
.content-narrow h4:first-child {
  margin-top: 0;
}
.content-narrow p { margin-bottom: 1.4em; }
.placeholder-box {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  color: var(--color-text-light);
  background: var(--color-bg-alt);
}

/* ---- Sister company panel ---- */
.partner-panel {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 36px;
  flex-wrap: wrap;
}
.partner-panel .partner-text { flex: 1 1 380px; }

/* ---- Footer ---- */
.site-footer {
  background: var(--color-text);
  color: #cbd5e1;
  padding: 50px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1em; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 0.6em; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
