/* ============================================================
 * johndavidkai – Public Site CSS
 * Mobile-first. Eine Datei, ein Bundle. KEIN inline CSS.
 * Breakpoints: 600px (Tablets), 900px (Desktop)
 * ============================================================ */

/* -------- Tokens (CSS custom properties) ------------------- */
:root {
  --fg:          #1d2230;
  --fg-muted:    #4a5266;
  --bg:          #fafbfc;
  --card:        #ffffff;
  --bd:          #e5e7eb;
  --bd-strong:   #cfd4dc;
  --acc:         #2b5cad;
  --acc-2:       #3a6bc4;
  --error:       #b00020;
  --ok:          #1d7d3b;
  --warn:        #b07e0e;
  --radius:      .5rem;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 14px rgba(0,0,0,.08);

  --gap-xs:      .25rem;
  --gap-s:       .5rem;
  --gap:         1rem;
  --gap-l:       1.5rem;
  --gap-xl:      2rem;
  --gap-2xl:     3rem;
}

/* -------- Reset / Basis-Reset ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--acc-2); outline-offset: 2px; }

/* -------- Skip-Link ---------------------------------------- */
.site-skip {
  position: absolute;
  left: .5rem;
  top: -3rem;
  background: var(--fg);
  color: #fff;
  padding: .6rem .9rem;
  border-radius: var(--radius);
  z-index: 1000;
  transition: top .15s ease-in-out;
}
.site-skip:focus,
.site-skip:focus-visible {
  top: .5rem;
}

/* -------- Header ------------------------------------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--bd);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--gap-s);
  max-width: 60rem;
  margin: 0 auto;
  padding: .75rem 1rem;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--fg);
  font-weight: 500;
}
.site-brand:hover { text-decoration: none; }
.site-brand strong { font-weight: 700; }
.site-brand__mark svg { width: 32px; height: 32px; }
.site-brand__text { font-size: 1.05rem; }

/* Mobile: Hamburger-Toggle */
.nav-toggle__checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.nav-toggle__button {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: .75rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--bd-strong);
  border-radius: var(--radius);
}
.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
}

/* Mobile: Menü ist ein- und ausklappbar */
.site-nav {
  flex-basis: 100%;
  display: none;
  border-top: 1px solid var(--bd);
  margin-top: var(--gap-s);
  padding-top: var(--gap-s);
}
.nav-toggle__checkbox:checked ~ .site-nav { display: block; }

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}
.site-nav__link {
  display: block;
  padding: .8rem .6rem;
  min-height: 44px;
  border-radius: var(--radius);
  color: var(--fg);
}
.site-nav__link:hover { background: var(--bg); text-decoration: none; }
.site-nav__link.is-current {
  font-weight: 600;
  background: var(--bg);
  color: var(--acc);
}

/* -------- Main -------------------------------------------- */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
}

/* -------- Hero -------------------------------------------- */
.hero {
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 1.25rem;
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  color: var(--fg-muted);
  margin: 0 0 .6rem;
}
.hero__title {
  margin: 0 0 .4rem;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
}
.hero__subtitle {
  margin: 0 0 1rem;
  color: var(--fg-muted);
  font-size: 1.05rem;
  max-width: 38rem;
}
.hero__actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

/* -------- Buttons (mobile-friendly ≥44px Höhe) ------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn--primary {
  background: var(--acc);
  color: #fff;
}
.btn--primary:hover { background: var(--acc-2); }
.btn--secondary {
  background: transparent;
  color: var(--acc);
  border-color: var(--acc);
}
.btn--secondary:hover { background: var(--bg); }

/* -------- Intro / Page-Article / Features ----------------- */
.intro { margin-bottom: 1.5rem; }
.intro h2 { font-size: 1.25rem; }

.features {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}
.feature {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.feature__title { margin: 0 0 .4rem; }
.feature__text  { margin: 0 0 .6rem; color: var(--fg-muted); }
.feature__link  { font-weight: 600; }

/* Generisches Page-Article (für längere Seiten) */
.page-article__header { margin-bottom: 1.25rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  color: var(--fg-muted);
  margin: 0 0 .4rem;
}
.page-article__title {
  margin: 0 0 .5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
}
.page-article__intro {
  margin: 0 0 .5rem;
  color: var(--fg-muted);
  font-size: 1.05rem;
}
.page-article--narrow { max-width: 38rem; margin: 0 auto; }

/* -------- Über-John --------------------------------------- */
.facts {
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  padding: .5rem 0;
  margin: 1rem 0;
}
.facts__row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: .5rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--bd);
}
.facts__row:last-child { border-bottom: 0; }
.facts__term { font-weight: 600; }
.facts__def  { margin: 0; color: var(--fg-muted); }

.values {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  gap: var(--gap);
}
.values__item {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: .9rem 1rem;
}
.values__heading { margin: 0 0 .25rem; font-size: 1.05rem; }
.values__text    { margin: 0; color: var(--fg-muted); }

/* -------- Projekte ---------------------------------------- */
.project-list {
  display: grid;
  gap: var(--gap);
}
.project-card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.project-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.project-card__title { margin: 0; font-size: 1.15rem; }
.project-card__status {
  font-size: .8rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--bd-strong);
  background: var(--bg);
}
.project-card__status[data-status="in arbeit"] { border-color: var(--warn); color: var(--warn); }
.project-card__status[data-status="geplant"]   { border-color: var(--bd-strong); color: var(--fg-muted); }
.project-card__status[data-status="laufend"]   { border-color: var(--ok);    color: var(--ok); }
.project-card__status[data-status="fertig"]    { border-color: var(--acc);   color: var(--acc); }
.project-card__summary { margin: .4rem 0 .6rem; color: var(--fg-muted); }
.project-card__tag {
  margin: 0;
  font-size: .85rem;
  color: var(--fg-muted);
}

/* -------- Kontakt ----------------------------------------- */
.contact-block { padding: 1rem 0; }
.contact-email {
  font-size: 1.1rem;
  font-weight: 600;
  display: inline-block;
  min-height: 44px;
  padding: .8rem 0;
}
.contact-note {
  color: var(--fg-muted);
  font-size: .9rem;
  margin-top: 1rem;
}

/* -------- 404 --------------------------------------------- */
.notfound {
  padding: 2rem 1rem;
  text-align: center;
  max-width: 36rem;
  margin: 1rem auto;
}
.notfound__code {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0;
  color: var(--acc);
  letter-spacing: .04em;
}
.notfound__title {
  margin: .25rem 0 .6rem;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
}
.notfound__text {
  margin: 0 0 1.25rem;
  color: var(--fg-muted);
}
.notfound__actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* -------- Footer ------------------------------------------ */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--bd);
  margin-top: 2rem;
}
.site-footer__inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  gap: .5rem;
}
.site-footer__line {
  margin: 0;
  color: var(--fg-muted);
  font-size: .9rem;
}
.site-footer__legal {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.site-footer__legal a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ============================================================
 * Breakpoints (mobile-first; nach oben erweitert)
 * ============================================================ */
@media (min-width: 600px) {
  .site-header__inner { padding: 1rem 1.25rem; }
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .facts__row { grid-template-columns: 1fr 3fr; }
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 900px) {
  .site-main { padding: 1.5rem 1.25rem; }
  .hero { padding: 2rem 0 2.25rem; margin-bottom: 2rem; }
  .nav-toggle__button { display: none; }
  .site-nav {
    display: flex !important;
    flex-basis: auto;
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
  }
  .site-nav__list {
    flex-direction: row;
    gap: .25rem;
  }
  .site-nav__link { padding: .6rem .9rem; }
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
  .project-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* -------- Admin-Bar (Phase P040) -------------------------------- */
.admin-bar {
  background: #1d2230;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #2b5cad;
}
.admin-bar__inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: .5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.admin-bar__toggle {
  background: #2b5cad;
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: .55rem 1rem;
  min-height: 44px;
  font: inherit;
  cursor: pointer;
}
.admin-bar__toggle[aria-pressed="true"] {
  background: #1d7d3b;
  outline: 3px solid #fff;
}
.admin-bar__toggle[aria-pressed="true"] span::before {
  content: "EIN";
  color: #fff;
  font-weight: 700;
}
.admin-bar__toggle[aria-pressed="false"] span::before {
  content: "aus";
  color: #c0c4d0;
}
.admin-bar__toggle span::before { font-weight: 700; }
.admin-bar__toggle span { display:none; } /* show ::before via attr */
.admin-bar__link {
  color: #fff;
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.admin-bar__user {
  margin-left: auto;
  color: #c0c4d0;
  font-size: .9rem;
}

/* Editor-Shell Styles */
.editor-shell { display: grid; gap: 1rem; }
.editor-fields textarea { width: 100%; max-width: 100%; box-sizing: border-box; font: inherit; }
.editor-tags,
.editor-images,
.editor-actions,
.editor-fields {
  display: grid; gap: .8rem;
}
.editor-tag-list,
.editor-image-list {
  list-style: none;
  padding: 0; margin: 0;
  display: grid; gap: .4rem;
}
.editor-image-list img { vertical-align: middle; }
.editor-tag-input { display: flex; gap: .5rem; flex-wrap: wrap; }
.editor-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.editor-actions [data-kind="ok"]  { color: var(--ok);   font-weight: 600; }
.editor-actions [data-kind="err"] { color: var(--error); font-weight: 600; }
.editor-actions [data-kind="warn"]{ color: var(--warn); font-weight: 600; }

/* -------- Druckbarkeit */
@media print {
  .site-header, .site-footer, .hero__actions, .notfound__actions, .site-skip { display: none; }
  a { color: inherit; text-decoration: underline; }
  body { background: #fff; color: #000; }
}
