/*
Theme Name: On Duty CH
Description: New layout for the On Duty AG site. Content and photography come from onduty.ch.
Version: 1.1.0
Text Domain: onduty-ch
*/

:root {
  --ink: #141414;
  --muted: #5c584f;
  --paper: #f7f4ee;
  --white: #ffffff;
  --card: #ffffff;
  --line: #e4ddd2;
  --gold: #e2a100;
  --gold-deep: #b78100;
  --header-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 18px 50px rgba(20, 20, 20, 0.08);
  --wrap: 1120px;
  --header: 76px;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
}

html.onduty-theme-dark {
  --ink: #f6f3ec;
  --muted: #c8c0b4;
  --paper: #1c1b19;
  --white: #141311;
  --card: #221f1c;
  --line: rgba(255, 255, 255, 0.12);
  --gold-deep: #f0b31a;
  --header-bg: rgba(20, 19, 17, 0.92);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
html.onduty-theme-light { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.od-i18n[data-lang="en"],
.od-i18n[data-lang="fr"] { display: none; }
html[data-onduty-lang="en"] .od-i18n[data-lang="de"],
html[data-onduty-lang="en"] .od-i18n[data-lang="fr"] { display: none; }
html[data-onduty-lang="en"] .od-i18n[data-lang="en"] { display: inline; }
html[data-onduty-lang="fr"] .od-i18n[data-lang="de"],
html[data-onduty-lang="fr"] .od-i18n[data-lang="en"] { display: none; }
html[data-onduty-lang="fr"] .od-i18n[data-lang="fr"] { display: inline; }
select[data-topic][data-lang="en"],
select[data-topic][data-lang="fr"] { display: none; }
html[data-onduty-lang="en"] select[data-topic][data-lang="de"],
html[data-onduty-lang="en"] select[data-topic][data-lang="fr"] { display: none; }
html[data-onduty-lang="en"] select[data-topic][data-lang="en"] { display: block; }
html[data-onduty-lang="fr"] select[data-topic][data-lang="de"],
html[data-onduty-lang="fr"] select[data-topic][data-lang="en"] { display: none; }
html[data-onduty-lang="fr"] select[data-topic][data-lang="fr"] { display: block; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--white);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), calc(100% - 40px)); margin: 0 auto; }
.wrap-l { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap-l {
  display: flex;
  align-items: center;
  gap: 22px;
  width: min(1240px, calc(100% - 32px));
}
.logo {
  display: inline-flex;
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
}
.logo img { height: 34px; width: auto; }
.nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-deep); }

.header-end { display: flex; align-items: center; gap: 10px; flex: none; }

.header-lang-switcher { position: relative; z-index: 60; }
.header-lang-toggle,
.header-lang-option {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}
.header-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 4px;
  letter-spacing: 0.04em;
}
.header-lang-label { text-transform: uppercase; font-size: 15px; }
.nation {
  width: 20px;
  height: 14px;
  display: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex: none;
}
.nation.is-static { display: block; }
html[data-onduty-lang="de"] .header-lang-toggle .nation[data-lang="de"],
html[data-onduty-lang="en"] .header-lang-toggle .nation[data-lang="en"],
html[data-onduty-lang="fr"] .header-lang-toggle .nation[data-lang="fr"],
html:not([data-onduty-lang]) .header-lang-toggle .nation[data-lang="de"] { display: block; }
.header-lang-arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s ease;
}
.header-lang-switcher.is-open .header-lang-arrow { transform: rotate(180deg); }
.header-lang-dropdown {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.header-lang-switcher.is-open .header-lang-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.header-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.header-lang-option:hover { color: var(--gold-deep); }
html[data-onduty-lang="de"] .header-lang-option[data-set-lang="de"],
html[data-onduty-lang="en"] .header-lang-option[data-set-lang="en"],
html[data-onduty-lang="fr"] .header-lang-option[data-set-lang="fr"],
html:not([data-onduty-lang]) .header-lang-option[data-set-lang="de"] { display: none; }

.header-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--gold);
  box-shadow: 0 2px 10px rgba(226, 161, 0, 0.28);
  color: #141414;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.header-theme-toggle:hover { transform: translateY(-1px); }
.header-theme-toggle .theme-icon { display: none; width: 20px; height: 20px; }
.header-theme-toggle svg { width: 20px; height: 20px; display: block; fill: currentColor; }
html.onduty-theme-light .header-theme-toggle .theme-icon-sun,
html:not(.onduty-theme-dark) .header-theme-toggle .theme-icon-sun { display: inline-flex; }
html.onduty-theme-dark .header-theme-toggle {
  background: #221f1c;
  color: #f6f3ec;
  border-color: var(--gold);
}
html.onduty-theme-dark .header-theme-toggle .theme-icon-sun { display: none; }
html.onduty-theme-dark .header-theme-toggle .theme-icon-moon { display: inline-flex; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: #1a1400; }
.btn-gold:hover { background: #f0b31a; }
.btn-dark { background: var(--ink); color: var(--white); }
html.onduty-theme-dark .btn-dark { background: #f6f3ec; color: #141414; }
.btn-line { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
}

.hero {
  position: relative;
  min-height: 640px;
  display: grid;
  align-items: end;
  color: #fff;
  background: #1b1b1b center/cover no-repeat;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -4%;
  background: inherit;
  transform: scale(1.04);
}
html.od-motion .hero::before {
  animation: odch-hero 18s ease-out both;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,10,10,.78) 0%, rgba(10,10,10,.28) 70%);
}
.hero .wrap { position: relative; z-index: 1; padding: 88px 0 72px; }
.kicker {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 14px;
}
.hero h1, .page-hero h1, h1, h2, h3 { line-height: 1.15; letter-spacing: -0.03em; color: var(--ink); }
.hero h1, .hero .lede, .hero .kicker { color: #fff; }
.hero .kicker { color: var(--gold); }
.hero h1 { font-size: clamp(40px, 5vw, 68px); max-width: 14ch; margin: 0 0 16px; }
.lede { font-size: 20px; max-width: 46ch; margin: 0 0 28px; color: var(--muted); }
.hero .lede { color: #f3f0ea; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.clients {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.clients span:first-child { color: var(--ink); letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }

.section { padding: 84px 0; }
.section-paper { background: var(--paper); }
.section h2, .page-hero h1 { font-size: clamp(32px, 4vw, 48px); margin: 0 0 12px; }
.page-hero h1 { font-size: clamp(36px, 5vw, 60px); max-width: 18ch; }
.intro { max-width: 62ch; color: var(--muted); margin: 0 0 32px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.card img { height: 210px; width: 100%; object-fit: cover; }
.card div { padding: 20px 20px 24px; }
.card h3 { margin: 0 0 8px; font-size: 24px; }
.card p { margin: 0; color: var(--muted); }
.card:hover { transform: translateY(-6px); }
.card:hover h3 { color: var(--gold-deep); }

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.split img { width: 100%; height: 520px; object-fit: cover; }
.points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.point { background: var(--card); border: 1px solid var(--line); padding: 16px; }
.point strong { display: block; margin-bottom: 4px; }
.point span { color: var(--muted); font-size: 15px; }

.page-hero { padding: 72px 0 28px; background: var(--paper); }
.prose { max-width: 72ch; }
.prose h2 { font-size: 32px; margin: 36px 0 10px; }
.prose p { color: var(--muted); }
.prose a { color: var(--gold-deep); }
.list { padding: 0; margin: 16px 0 0; list-style: none; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); }
.media-row { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; margin-top: 28px; }
.media-row img { width: 100%; height: 420px; object-fit: cover; }
.media-row .jobs { grid-template-columns: 1fr; }

.jobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.job { border-top: 3px solid var(--gold); background: var(--card); padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.job h3 { margin: 0 0 8px; }
.job p { color: var(--muted); }

.form {
  display: grid;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: var(--shadow);
}
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.form input, .form select, .form textarea {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 8px;
  width: 100%;
}
.form .hp { position: absolute; left: -9999px; }
.note { background: #eef8e8; border: 1px solid #b7dfb0; color: #17310f; padding: 12px 14px; }
.note-error { background: #fff4f4; border: 1px solid #e7b4b4; color: #6b1d1d; }
html.onduty-theme-dark .note { background: #1e2a1c; border-color: #3d6b38; color: #e7f5e2; }
html.onduty-theme-dark .note-error { background: #3a2222; border-color: #8a4545; color: #ffd9d9; }
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 36px; align-items: start; }
.address { font-style: normal; }
.address a { color: var(--gold-deep); }

.site-footer { background: #111; color: #f3f0ea; padding: 48px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer-brand { font-weight: 800; letter-spacing: .08em; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer p, .site-footer li { color: #d9d3c8; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid #2c2c2c; font-size: 14px; color: #bdb6ab; }

@keyframes odch-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes odch-hero {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
html.od-motion .hero .wrap > * { animation: odch-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
html.od-motion .hero .wrap > *:nth-child(2) { animation-delay: 0.08s; }
html.od-motion .hero .wrap > *:nth-child(3) { animation-delay: 0.16s; }
html.od-motion .hero .wrap > *:nth-child(4) { animation-delay: 0.24s; }
html.od-motion .page-hero .wrap > * { animation: odch-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
html.od-motion .page-hero .wrap > *:nth-child(2) { animation-delay: 0.08s; }
html.od-motion .page-hero .wrap > *:nth-child(3) { animation-delay: 0.16s; }
html.od-motion .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
html.od-motion .reveal.is-visible { opacity: 1; transform: none; }
html.od-motion .cards .reveal:nth-child(2) { transition-delay: 0.08s; }
html.od-motion .cards .reveal:nth-child(3) { transition-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn, .header-theme-toggle, .nav a::after, .header-lang-dropdown { transition: none; }
}

@media (max-width: 1040px) {
  .nav { display: none; }
  .site-header.is-open .nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 16px 20px 20px;
    gap: 14px;
  }
  .header-end { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .cards, .jobs, .split, .media-row, .contact-grid, .footer-grid, .points { grid-template-columns: 1fr; }
  .hero { min-height: 560px; }
  .split img, .media-row img { height: 280px; }
}
