/*
 * bosch_styles.css — Canonical Bosch Corporate Design stylesheet
 * Brand tokens, base reset, typography, and reusable component classes.
 * Page-specific styles belong in styles.css only.
 *
 * Color tokens sourced from Bosch Brand Guide.
 * Known values:
 *   --bosch-blue-50: #005691   (primary UI accent)
 *   --bosch-gray-35: #4E5256   (secondary text / borders)
 * Bosch Red (#E20015) is reserved for the logotype ONLY — never use as UI color.
 */

/* ─── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  /* Brand colors */
  --color-accent:        #005691;   /* --bosch-blue-50 */
  --color-accent-dark:   #003f6b;   /* hover/active state */
  --color-accent-light:  #e6f0f8;   /* subtle tint for backgrounds */
  --color-secondary:     #4E5256;   /* --bosch-gray-35 */
  --color-link:          #005691;   /* Bosch-compliant link color */
  --color-link-hover:    #003f6b;
  --color-logotype:      #E20015;   /* Bosch Red — logotype ONLY */

  /* Neutrals */
  --color-bg:            #ffffff;
  --color-surface:       #f7f7f7;
  --color-border:        #d9dadb;
  --color-text:          #1a1a1a;
  --color-text-muted:    #6b6d70;
  --color-text-on-dark:  #ffffff;

  /* Feedback */
  --color-success:       #2e7d32;
  --color-error:         #c62828;
  --color-warning:       #e65100;

  /* Spacing scale (4-base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;
  --s-7: 64px;
  --s-8: 96px;

  /* Typography */
  --font-family:         'Bosch Sans', Arial, sans-serif;
  --font-size-sm:        0.875rem;   /* 14px */
  --font-size-base:      1rem;       /* 16px */
  --font-size-md:        1.125rem;   /* 18px */
  --font-size-lg:        1.25rem;    /* 20px */
  --font-size-xl:        1.5rem;     /* 24px */
  --font-size-2xl:       2rem;       /* 32px */
  --font-size-3xl:       2.5rem;     /* 40px */
  --line-height:         1.6;
  --line-height-heading: 1.2;
  --font-weight-normal:  400;
  --font-weight-medium:  500;
  --font-weight-bold:    700;

  /* Radius */
  --radius-sm:           2px;
  --radius-md:           4px;
  --radius-lg:           8px;

  /* Transitions */
  --transition-fast:     150ms ease;
  --transition-base:     250ms ease;

  /* Layout */
  --max-width:           1200px;
  --header-height:       64px;
}

/* ─── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  transition: color var(--transition-fast);
}
a:hover  { color: var(--color-link-hover); }
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul, ol { list-style: none; }

/* ─── LAYOUT ──────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--s-4);
}

.section {
  padding-block: var(--s-7);
}

/* ─── TYPOGRAPHY ──────────────────────────────────────────────────────────── */
.h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  color: var(--color-text);
}
.h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  color: var(--color-text);
}
.h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  color: var(--color-text);
}
.h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-heading);
  color: var(--color-text);
}
.lead {
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
  line-height: var(--line-height);
}
.text-muted { color: var(--color-text-muted); }
.text-sm    { font-size: var(--font-size-sm); }

/* ─── SITE HEADER ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden; /* clip supergraphic stripe */
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  position: relative;
  z-index: 1; /* sit above the supergraphic */
}

/* Bosch Supergraphic — decorative stripe at top of header */
.site-supergraphic {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Brand / logotype */
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
}
.brand__logo {
  height: 32px;
  width: auto;
}
.brand__name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.brand__tagline {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-left: var(--s-1);
}

/* Primary nav */
.nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.nav__link {
  padding: var(--s-2) var(--s-3);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.nav__link:hover {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
}
.nav__link[aria-current="page"] {
  color: var(--color-accent);
  background-color: var(--color-accent-light);
  font-weight: var(--font-weight-bold);
}
.nav__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Mobile nav toggle (hidden by default — shown only on narrow screens) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--s-2);
  color: var(--color-text);
}

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Primary */
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-text-on-dark);
  border-color: var(--color-accent);
}
.btn--primary:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-text-on-dark);
}

/* Secondary / outline */
.btn--secondary {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn--secondary:hover {
  background-color: var(--color-accent-light);
}

/* Ghost */
.btn--ghost {
  background-color: transparent;
  color: var(--color-secondary);
  border-color: var(--color-border);
}
.btn--ghost:hover {
  background-color: var(--color-surface);
}

/* Small variant */
.btn--sm {
  padding: var(--s-1) var(--s-3);
  font-size: var(--font-size-sm);
}

/* Disabled */
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── CARDS ───────────────────────────────────────────────────────────────── */
.card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-base);
}
.card:hover { border-color: var(--color-accent); }

.card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background-color: var(--color-accent-light);
}
.card__image--placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}
.card__body {
  padding: var(--s-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.card__footer {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}

/* ─── BADGES / TAGS ───────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px var(--s-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  background-color: var(--color-accent-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── GRID ────────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

/* ─── FORM ELEMENTS ───────────────────────────────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
}
.label--required::after {
  content: ' *';
  color: var(--color-error);
}
.input,
.textarea,
.select {
  width: 100%;
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 86, 145, 0.15);
}
.textarea {
  resize: vertical;
  min-height: 120px;
}

/* ─── SITE FOOTER ─────────────────────────────────────────────────────────── */
.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: var(--s-5);
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: center;
  text-align: center;
}
.footer-links {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--color-accent); text-decoration: underline; }
.footer-copy {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ─── SIDEBAR ─────────────────────────────────────────────────────────────── */
.widget {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.widget__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--color-accent);
}
.widget__list { display: flex; flex-direction: column; gap: var(--s-2); }
.widget__list li a {
  font-size: var(--font-size-sm);
  color: var(--color-secondary);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.widget__list li a:hover { color: var(--color-accent); }
.widget__count {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  background-color: var(--color-surface);
  padding: 1px var(--s-2);
  border-radius: 10px;
}

/* ─── UTILITY ─────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.visually-hidden { composes: sr-only; }
.mt-auto { margin-top: auto; }
.text-center { text-align: center; }
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--s-4);
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .h1 { font-size: var(--font-size-2xl); }
  .h2 { font-size: var(--font-size-xl); }
}

@media (max-width: 640px) {
  :root { --s-7: 48px; }
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav.is-open { display: flex; flex-direction: column; }
  .nav-toggle { display: flex; }
  .brand__tagline { display: none; }
  .h1 { font-size: var(--font-size-xl); }
}
