/*
Theme Name: KS Autoteknikk
Theme URI: https://ksautotek.no
Author: KS Autoteknikk
Description: Custom theme for KS Autoteknikk, a local car body/paint/key/electronics workshop on Senja. Dark, high-contrast layout with green brand accents, built around the paint-order and contact workflows from ksautotek.no.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: ksautotek
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #0a0c0b;
  --bg-raised: #141712;
  --bg-card: #171a17;
  --bg-card-border: #262b25;
  --text: #f3f5f2;
  --text-muted: #a9b0a7;
  --text-faint: #6f766d;

  --green-100: #b7e6a0;
  --green-300: #7ed957;
  --green-500: #4caf3d;
  --green-600: #3a8f2f;
  --green-700: #256b23;
  --green-900: #123312;

  --accent: var(--green-500);
  --accent-light: var(--green-300);
  --accent-dark: var(--green-700);

  --font-display: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius: 6px;
  --container: 1180px;
  --gap: 24px;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0 0 16px;
}
p { margin: 0 0 16px; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--green-300), var(--green-600));
  color: #06110a;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--green-100), var(--green-500)); }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.35);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent-light); color: var(--accent-light); }
.btn-block { width: 100%; justify-content: center; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 11, 10, 0.97);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
}
.site-logo img { height: 40px; width: auto; }
.site-logo { display: flex; align-items: center; }

.primary-nav ul { display: flex; gap: 30px; }
.primary-nav a {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--text);
  border-color: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 90px 0 70px;
  background: radial-gradient(ellipse at 75% 30%, rgba(76,175,61,0.16), transparent 55%), var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.hero--photo {
  background-image: linear-gradient(100deg, rgba(6,8,7,0.94) 0%, rgba(6,8,7,0.72) 40%, rgba(6,8,7,0.35) 100%), var(--hero-image, none);
  background-size: cover;
  background-position: center;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 620px);
  gap: 40px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  color: var(--accent-light);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 2px;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--accent-light); }
.hero p.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin-bottom: 30px;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 46px; }

.hero__facts {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
}
.hero__fact {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.hero__fact .icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  flex: none;
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */
.section { padding: 84px 0; }
.section--tight { padding: 60px 0; }
.section-head { max-width: 640px; margin-bottom: 46px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 12px; }
.section-head p { color: var(--text-muted); margin-bottom: 0; }

/* ==========================================================================
   Services grid
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.service-card:hover { border-color: var(--green-700); transform: translateY(-3px); }
.service-card__media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, var(--green-900), #0c0e0c 70%);
  background-image: var(--card-image, none);
  background-size: cover;
  background-position: center;
  position: relative;
}
.service-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
}
.service-card__body { padding: 22px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.service-card__icon {
  width: 30px; height: 30px;
  color: var(--accent-light);
  margin-bottom: 12px;
}
.service-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.service-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 14px; flex: 1; }
.service-card__link {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-light);
}
.service-card__link:hover { color: var(--green-100); }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  position: relative;
  padding: 76px 0;
  background: linear-gradient(100deg, rgba(6,8,7,0.95) 10%, rgba(6,8,7,0.55) 60%, rgba(6,8,7,0.25) 100%), var(--cta-image, linear-gradient(135deg, #0e150f, #060706));
  background-size: cover;
  background-position: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cta-band__inner { max-width: 560px; }
.cta-band h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.cta-band p { color: var(--text-muted); margin-bottom: 26px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: #060706; border-top: 1px solid rgba(255,255,255,0.06); padding: 56px 0 26px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer-logo img { height: 34px; margin-bottom: 14px; }
.footer-tagline { color: var(--text-faint); font-style: italic; font-size: 0.9rem; }
.footer-col h4 {
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col a, .footer-col address { color: var(--text-muted); font-style: normal; font-size: 0.92rem; }
.footer-col a:hover { color: var(--accent-light); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 24px;
  font-size: 0.82rem;
  color: var(--text-faint);
}
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--accent-light); }

/* ==========================================================================
   Generic page/content
   ========================================================================== */
.page-header {
  padding: 60px 0 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: radial-gradient(ellipse at 20% 0%, rgba(76,175,61,0.12), transparent 60%);
}
.page-header h1 { margin-bottom: 8px; }
.page-header p { color: var(--text-muted); margin-bottom: 0; }
.entry-content { max-width: 760px; }
.entry-content h2 { margin-top: 40px; font-size: 1.5rem; }
.entry-content a { color: var(--accent-light); text-decoration: underline; }
.entry-content ul { list-style: disc; padding-left: 22px; margin-bottom: 16px; }
.entry-content ul li { margin-bottom: 6px; }

/* Two-column content layout (About page etc.) */
.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: start;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 28px;
}
.info-card h3 { font-size: 1rem; margin-bottom: 18px; }
.info-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.92rem;
}
.info-list li:last-child { border-bottom: none; }
.info-list .label { color: var(--text-faint); min-width: 130px; flex: none; }
.info-list a { color: var(--text); }
.info-list a:hover { color: var(--accent-light); }

/* Services list (Tjenester page) */
.services-list { display: flex; flex-direction: column; gap: 20px; }
.services-list .service-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 26px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.services-list .service-row__media {
  min-height: 160px;
  background: linear-gradient(150deg, var(--green-900), #0c0e0c 70%);
  background-image: var(--card-image, none);
  background-size: cover;
  background-position: center;
}
.services-list .service-row__body { padding: 22px 24px 22px 0; }
.services-list h3 { margin-bottom: 8px; font-size: 1.15rem; }
.services-list p { color: var(--text-muted); margin-bottom: 10px; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 32px;
}
.form-row { margin-bottom: 20px; }
.form-row--split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
label .req { color: var(--accent-light); }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: #0e100e;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 120px; }
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0e100e;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.92rem;
}
.radio-option input { width: auto; accent-color: var(--accent); }
.radio-option .price { margin-left: auto; color: var(--accent-light); font-family: var(--font-display); }
.form-hint { color: var(--text-faint); font-size: 0.82rem; margin-top: 6px; }
.form-honeypot { position: absolute; left: -9999px; }

.form-notice {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 26px;
  font-size: 0.92rem;
}
.form-notice--success { background: rgba(76,175,61,0.12); border: 1px solid var(--green-700); color: var(--green-100); }
.form-notice--error { background: rgba(220,80,60,0.1); border: 1px solid #7a3a30; color: #f0b8ac; }

/* ==========================================================================
   404
   ========================================================================== */
.not-found { padding: 120px 0; text-align: center; }
.not-found h1 { font-size: 6rem; color: var(--accent); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .services-list .service-row { grid-template-columns: 1fr; }
  .services-list .service-row__media { min-height: 140px; }
  .services-list .service-row__body { padding: 20px 22px; }
}

@media (max-width: 720px) {
  .primary-nav { position: fixed; inset: 66px 0 0 0; background: var(--bg); padding: 20px 24px; transform: translateY(-110%); transition: transform 0.2s ease; overflow-y: auto; }
  .primary-nav.is-open { transform: translateY(0); }
  .primary-nav ul { flex-direction: column; gap: 4px; }
  .primary-nav a { display: block; padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-toggle { display: inline-flex; align-items: center; }
  .header-actions .btn-primary.header-cta { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row--split { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 46px; }
}
