/*
 * Gestaltung der öffentlichen Seiten und des Adminbereichs.
 * Die Hauptbereiche stehen in der Reihenfolge unten; spätere Regeln können
 * frühere Regeln gezielt für Karten, Formulare oder kleinere Bildschirme anpassen.
 */
/* Zentrale Farben, Schriften und Seitenabstände; var(--name) nutzt sie weiter unten. */
/* --- FARBVARIABLEN --- */
:root {
  --color-accent: #ff2400;       /* Scharlachrot (Hauptakzent) */
  --color-dark: #07163d;         /* Dunkelblau */
  --color-slate: #354363;        /* Slate / Nebengrau-Blau */
  --color-cyan: #01739e;         /* Akzent-Blau */
  --color-bg-main: #ffffff;      /* Grundfarbe */
  --color-bg-subtle: #f2f3f5;    /* Soft-Grau */
  --color-bg-dark: #81848a;    /* Dark-Grau */
  --color-text: #07163d;
  --color-border: #d5d8df;
  --color-input: #f8f9fa;
  --font-body: "Avenir Next", Avenir, Verdana, sans-serif;
  --font-brand: "Abadi", "Abadi MT", Verdana, sans-serif;
  --content-width: 900px;
  --page-gutter: clamp(18px, 4vw, 30px);
}

.mini-book-card .book-details {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

/* --- RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  html,
  .scroll-area {
    scroll-behavior: auto;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-main);
  color: var(--color-text);
  overflow-x: hidden;
}

h1,
h2,
h3 {
  color: var(--color-dark);
  font-family: inherit;
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.5rem, 2.0vw, 1.7rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
}

h3 {
  font-size: 1.1rem;
}

/* --- SCHWEBENDER / FIXIERTER HEADER --- */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-dark);
}

.brand-logo {
  height: 38px;
  width: auto;
}

.brand-name {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.main-nav ul {
  display: flex;
  list-style: none;
}

.menu-toggle {
  display: none;
}

.main-nav a {
  text-decoration: none;
  color: var(--color-slate);
  font-size: 0.95rem;
  font-weight: 500;

  transition: color 0.2s ease;
  padding: 0 15px;
}

.main-nav a:hover {
  color: var(--color-accent);
}

.main-nav a.active {
  display: none;
  padding: 0;
}

/* Unter 900 px wird die Hauptnavigation zum aufklappbaren Menü. */
@media (max-width: 1150px) {
  .fixed-header {
    height: 60px;
    padding: 0 20px;
    gap: 16px;
  }

  .brand {
    min-width: 0;
  }

  .brand-name {
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-content: center;
    gap: 5px;
    margin-left: auto;
    padding: 8px;
    border: 0;
    background: transparent;
    color: var(--color-dark);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, width 0.2s ease;
  }

  .menu-toggle:hover span:last-child {
    width: 16px;
    background: var(--color-accent);
  }

  .menu-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .main-nav {
    position: absolute;
    top: 100%;
    right: 12px;
    width: min(320px, calc(100vw - 24px));
    max-height: 0;
    overflow: hidden;
    border-top: 2px solid var(--color-accent);
    background: #fff;
    box-shadow: 0 12px 28px rgba(7, 22, 61, 0.12);
    opacity: 0;
    visibility: hidden;
  }

  .main-nav.is-open {
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .main-nav ul {
    display: grid;
    gap: 0;
    padding: 8px 0;
  }

  .main-nav a {
    display: block;
    padding: 12px 18px;
  }

  .main-nav a:hover,
  .main-nav a.active {
    background: #fafafa;
  }

  .main-content {
    margin-top: 60px;
  }
}

/* --- SCHWEBENDER FOOTER (UNTEN RECHTS) --- */
.fixed-footer {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
}

.floating-impressum {
  display: block;
  padding: 10px 14px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  text-decoration: none;
  color: var(--color-slate);
  font-size: 0.95rem;
  font-weight: 500;

  transition: background-color 0.2s ease;
}

.floating-impressum:hover {
  background: rgba(255, 255, 255, 0.96);
}

/* --- MAIN CONTENT AREA --- */
.main-content {
  margin-top: 60px;
  max-width: 100dvw;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 760px) {
  .main-content {
    margin-top: 60px;
  }
}

.page-title-container {
  position: sticky;
  top: 0;
  z-index: 101;
  /* Der Titel liegt vor dem Header, soll aber keine Navigationselemente abfangen. */
  pointer-events: none;
  padding: 14px 18px;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 4dvh;
  margin-bottom: 4dvh;
  background: transparent;
  text-align: center;
}

/* Der Seitentitel fährt beim Scrollen bewusst über den Header. Nur während das
   Mobilmenü offen ist, wird er hinter dessen eigener Ebene abgelegt, damit die
   Navigation vollständig lesbar und bedienbar bleibt. Beim Schließen lebt der
   Slide-Effekt unverändert wieder auf. */
@media (max-width: 1150px) {
  body.mobile-menu-open .page-title-container {
    z-index: 99;
  }
}

/* Die Startseite begrenzt Suchfeld und Buchlisten auf eine lesbare Breite. */
.homepage-publications {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 30px 80px;
}

.publication-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-input {
  padding: 12px 16px;
  border: 1px solid var(--color-bg-subtle);
  background: var(--color-input);
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  outline: none;
  flex: 1;
  min-width: 250px;
}

.filter-input:focus {
  border-color: var(--color-slate);
}

.results-status {
  margin-bottom: 12px;
  color: var(--color-slate);
  font-size: 0.8rem;
}

.results-status:empty {
  display: none;
}

.publications-list-page {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.publication-tabs {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 22px;
}

.publication-tab {
  padding: 0;
  border: 0;
  background: transparent;

  color: var(--color-slate);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;

  cursor: pointer;
  transition: color 0.18s ease;
}

.publication-tab[aria-selected="false"]:hover {
  color: var(--color-accent);
}

.publication-tab[aria-selected="true"] {
  color: var(--color-cyan);
}

.publication-tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 5px;
}

.publication-tab-panel[hidden] {
  display: none;
}

html,
.scroll-area {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

html::-webkit-scrollbar,
.scroll-area::-webkit-scrollbar {
  width: 7px;
}

html::-webkit-scrollbar-track,
.scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb,
.scroll-area::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--color-border);
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

html::-webkit-scrollbar-thumb:hover,
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
  background-clip: padding-box;
}

.scroll-area {
  max-height: min(72vh, 760px);
  overflow-y: auto;
  overscroll-behavior-y: auto;
  scroll-behavior: smooth;
  padding: 8px 18px 20px 0;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 12px;
  min-width: 0;
}

.category-tag {
  padding: 0;
  color: var(--color-slate);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.18s ease;
}

.category-tag:hover {
  color: var(--color-cyan);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Kleine Displays: kompakter Such- und Reiterbereich. */
@media (max-width: 650px) {
  .homepage-publications {
    padding: 0 16px 70px;
  }

  .publication-tabs {
    gap: 16px;
  }

  .scroll-area {
    max-height: 65vh;
    padding-right: 10px;
  }

  .publication-filters {
    flex-direction: column;
  }

  .filter-input {
    min-width: 0;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .brand-prefix {
    display: none;
  }

  .brand-logo {
    height: 32px;
    width: auto;
  }
}

@media (max-width: 430px) {
  .publication-tabs {
    flex-direction: column;
    align-items: flex-end;
  }

  .publication-tab[aria-selected="true"] {
    display: none;
  }

  .publication-tab[aria-selected="false"] {
    align-self: flex-end;
  }
}



/*
 * Gemeinsame Buchkarten für Listen- und Detailansichten.
 * Das linke Grid-Feld nimmt das Cover auf, rechts stehen Titel, Angaben und Kaufbereich.
 */
.book-cover-link {
  width: 100%;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.book-cover-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Ein fehlendes Cover bleibt sichtbar als bewusste Vorab-Ausgabe, nicht als
   kaputtes Bildsymbol. Das ist besonders für frühe Ankündigungen hilfreich. */
.book-cover-fallback {
  display: flex;
  aspect-ratio: 2 / 3;
  width: min(100%, 330px);
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--color-dark);
  color: #fff;
  box-shadow: 0 12px 28px rgba(7, 22, 61, 0.14);
}

.book-cover-fallback span {
  color: #c8d2e7;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.book-cover-fallback strong {
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  line-height: 1.02;
}

.book-details {
  display: grid;
  min-height: 100%;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  align-content: stretch;
  min-width: 0;
}

.book-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 14px;
}

.book-author-keywords {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.book-author-keywords:empty {
  display: none;
}

.book-author-keywords .author {
  flex: 0 0 auto;
}

.book-author-keywords .category-tags {
  flex: 1 1 auto;
  margin: 0;
}

.entry-type {
  align-self: flex-start;
  margin-bottom: 5px;

  color: var(--color-cyan);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.entry-type:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.book-details .author {
  font-size: 0.90rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-slate);
  font-weight: 500;
  transition: color 0.18s ease;
}

.book-subtitle {
  color: var(--color-slate);
  font-size: 1rem;
}

.book-details h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.book-details h2 a:hover {
  color: var(--color-accent);
}

.book-details .summary {
  margin: 24px 0;
  color: var(--color-slate);
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-line;
}

.book-info {
  margin-top: 4px;
  color: var(--color-slate);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.55;
}

.book-section-purchase,
.book-section-editorial {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.book-section-purchase {
  align-self: center;
  width: 100%;
  padding: 16px 0;
  /* border-top: 1px solid var(--color-bg-subtle); */
}

.book-section-editorial {
  padding-top: 8px;
}

.book-action-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 9px 14px;
  background: var(--color-dark);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.book-action-link:hover {
  background: var(--color-accent);
}

.book-detail-link {
  padding: 0;
  background: transparent;
  color: var(--color-slate);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.book-detail-link:hover {
  background: transparent;
  color: var(--color-accent);
}

.meta-info {
  font-size: 0.8rem;
  color: var(--color-slate);
  margin-top: 0;
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.price-block .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
}

.price-block .shipping-info {
  font-size: 0.75rem;
  color: var(--color-slate);
}

.author-filter-link {
  align-self: flex-start;
  text-decoration: none;
}

.author-filter-link:hover {
  color: var(--color-cyan);
}

.quote {
  margin: 0;
  padding: 18px 22px;
  border: 1px solid #e5e7eb;
  background: #f7f7f8;
  color: var(--color-slate);
}

.quote p {
  margin: 0;
  font-family: inherit;
  font-size: 1.0rem;
  font-style: italic;
  line-height: 1.6;
}

.quote-block {
  align-self: end;
  margin: 0;
  padding-top: 0px;
}

.quote-author {
  display: block;
  margin-top: 8px;
  color: var(--color-dark);
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 500;
  text-align: right;
}

.book-card {
  display: grid;
  grid-template-columns: fit-content(450px) minmax(0, 1fr);
  grid-template-rows: minmax(min(450px, 70vw), auto);
  gap: clamp(22px, 3vw, 40px);
  align-items: stretch;
  padding: 0 0;
  background: transparent;
}

/*
 * Auf der Startseite dient die Coverhöhe als Mindesthöhe für die Textspalte.
 * main.js misst die drei Textbereiche; wenn sie nicht mehr hineinpassen,
 * ergänzt es die Klasse quote-full-row für das Zitat unterhalb der Karte.
 */
.book-card > .book-cover-link {
  grid-column: 1;
  grid-row: 1;
  width: fit-content;
  max-width: 100%;
  align-items: flex-start;
}

.book-card .book-cover-img {
  width: auto;
  height: min(450px, 70vw);
  max-width: 100%;
  object-fit: contain;
}

.book-card > .book-details {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) auto minmax(min-content, 1fr);
  min-height: min(450px, 70vw);
  align-self: stretch;
}

.book-card > .book-details .book-heading {
  grid-row: 1;
  align-self: start;
}

.book-card > .book-details .book-section-purchase {
  grid-row: 2;
  align-self: center;
}

.book-card > .book-details > .quote-block {
  grid-row: 3;
  align-self: end;
}

.book-card.quote-full-row {
  grid-template-rows: minmax(min(450px, 70vw), auto) auto;
}

.book-card.quote-full-row > .book-details {
  grid-row: 1;
  grid-template-rows: minmax(min-content, 1fr) auto;
}

.book-card.quote-full-row > .book-details .book-section-purchase {
  grid-row: 2;
  align-self: end;
}

.book-card.quote-full-row > .quote-block {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: start;
}

.mini-book-card {
  display: grid;
  grid-template-columns: minmax(84px, 140px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 18px 0;
  border-top: 2px solid var(--color-dark);
  background: transparent;
}

.mini-book-card.has-no-cover {
  grid-template-columns: minmax(0, 1fr);
  padding-left: clamp(16px, 3vw, 30px);
  border-left: 4px solid var(--color-accent);
}

.mini-book-card .book-cover-link {
  width: 100%;
}

.mini-book-card .book-cover-img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.mini-book-card .book-heading {
  gap: 4px;
}

.mini-book-card-label {
  margin: 0 0 6px;
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mini-book-card-summary {
  max-width: 56ch;
  margin: 7px 0 2px;
  color: var(--color-slate);
  line-height: 1.55;
}

.mini-book-card .book-author-keywords {
  gap: 8px;
  margin-bottom: 4px;
}

.mini-book-card .category-tags {
  gap: 2px 6px;
}

/* Die Einzelansicht ist eine Leseseite: Sie übernimmt Typografie und Farben der
   Karten, gibt Text und bibliografischen Angaben aber einen eigenen Rhythmus. */
.detail-container {
  max-width: 1080px;
  margin: 0 auto 80px;
  padding: clamp(24px, 5vw, 56px) var(--page-gutter) 80px;
}

.detail-back-link {
  display: inline-block;
  margin-bottom: clamp(32px, 6vw, 68px);
  color: var(--color-slate);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.detail-back-link:hover { color: var(--color-accent); }

.book-detail-header {
  max-width: 780px;
  margin-bottom: clamp(30px, 5vw, 56px);
}

.book-detail-header h1 {
  max-width: 16ch;
  margin: 0;
  color: var(--color-dark);
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 0.98;
}

.book-detail-subtitle {
  margin: 14px 0 0;
  color: var(--color-slate);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.book-detail-layout {
  display: grid;
  grid-template-columns: minmax(180px, 330px) minmax(0, 1fr);
  gap: clamp(26px, 6vw, 74px);
  align-items: start;
}

.book-detail-cover { position: sticky; top: 110px; }

.book-detail-cover .book-cover-img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  object-position: top center;
  box-shadow: 0 12px 28px rgba(7, 22, 61, 0.1);
}

.book-detail-reading { min-width: 0; }

.book-detail-facts {
  margin: 0 0 25px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-slate);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.book-detail-intro {
  margin: 0 0 22px;
  color: var(--color-dark);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-style: italic;
  line-height: 1.5;
}

.book-detail-summary {
  color: var(--color-slate);
  font-size: 1.04rem;
  line-height: 1.8;
  white-space: pre-line;
}

.book-detail-quote { margin-top: 34px; }

.book-detail-order {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 2px solid var(--color-dark);
}

.book-detail-order p { margin: 0; }
.book-detail-order .shipping-info { display: block; margin-top: 4px; }

.book-additional-text {
  max-width: 66ch;
  margin: clamp(44px, 8vw, 92px) 0 0 auto;
  padding: clamp(24px, 4vw, 40px) 0 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  line-height: 1.75;
}

.book-additional-text[hidden] {
  display: none;
}

.book-additional-text > :first-child {
  margin-top: 0;
}

.book-additional-text > :last-child {
  margin-bottom: 0;
}

/* Die Buchdetailansicht wechselt auf schmalen Geräten zu einer Spalte. */
@media (max-width: 850px) {
  .book-detail-layout {
    grid-template-columns: 1fr;
  }
  .book-detail-cover { position: static; width: min(300px, 80%); }
  .book-detail-order { grid-column: 1; }
}

@media (max-width: 650px) {
  .detail-container { padding-bottom: 70px; }
  .book-detail-order { align-items: flex-start; flex-direction: column; }

  .mini-book-card {
    grid-template-columns: minmax(76px, 26vw) minmax(0, 1fr);
    gap: 14px;
  }
}

/*
 * ADMIN: Hauptbereiche, Unterreiter und Formulare.
 * Die Klassen für Eingabefelder bestimmen ihre Breite im Raster;
 * HTML-Reihenfolge und Formularinhalte stehen in admin/index.html.
 */
.admin-container {
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  padding: 76px 24px 50px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.admin-main-tabs {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: clamp(4px, 1vw, 14px);
  margin: 0;
  border-bottom: 2px solid var(--color-bg-subtle);
}
.admin-main-tab-btn {
  flex: 0 1 auto;
  padding: 10px 4px;
  border: none;
  background: none;
  font-size: clamp(0.7rem, 1.1vw, 1rem);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--color-slate);
}

.admin-main-tab-btn.active {
  color: var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  margin-bottom: -2px;
}

.content-panel {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: visible;
}

.admin-subtab-row[hidden],
.admin-section-panel[hidden],
.admin-subtabs[hidden],
.content-form[hidden],
.content-field[hidden],
.content-fields-grid[hidden],
.content-list-view[hidden],
.entries-list-view[hidden] {
  display: none;
}

.admin-subtab-row {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 10px 10px;
  background: var(--color-bg-subtle);
}

.admin-subtab-row .admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
}

.admin-subtab-row .admin-subtabs[hidden] {
  display: none;
}

.admin-subtab-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

/* --- ADMIN BUTTONS: Einheitliches System --- */
/* Basis: leicht abgerundete Ecken (border-radius 4px), konsistente Größe */
.admin-btn {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  font-size: inherit;
  font-family: inherit;
}

.admin-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.admin-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.admin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Variante: primär (Speichern, Verwalten, Warenkorb, Kaufen) – Cyan-Hovereffekt */
.admin-btn--primary {
  background: var(--color-dark);
  color: #fff;
}

.admin-btn--primary:hover,
.admin-btn--primary:focus-visible {
  background: var(--color-cyan);
  color: #fff;
}

.admin-btn--primary:disabled {
  background: #e6e8ec;
  color: #9298a3;
  border-color: transparent;
}

/* Variante: danger (Löschen) – transparenter BG, scharlachroter Rand + Schrift */
.admin-btn--danger {
  background: transparent;
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
}

.admin-btn--danger:hover,
.admin-btn--danger:focus-visible {
  background: var(--color-accent);
  color: #fff;
}

.admin-btn--danger:disabled {
  background: transparent;
  border-color: #e6e8ec;
  color: #9298a3;
}

/* Kleine Variante: nur dort, wo wirklich kleiner nötig */
.admin-btn--small {
  width: 32px;
  height: 32px;
  padding: 6px;
}

.admin-btn--small svg {
  width: 18px;
  height: 18px;
}

.admin-btn[hidden] {
  display: none;
}

/* Tooltip für Admin-Buttons (gleich wie bisher) */
.admin-btn[data-tooltip]::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 50%;
  padding: 4px 7px;
  border-radius: 2px;
  background: var(--color-dark);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.admin-btn[data-tooltip]:hover::after,
.admin-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Abwärtskompatibilität: alte Klasse bleibt funktionslos, aber nicht ausgeblendet */
/* (wird im HTML nicht mehr verwendet) */
.admin-icon-button {
  /* keine eigenen Styles mehr – ersetzt durch .admin-btn */
}

.admin-icon-button[data-tooltip]::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 50%;
  padding: 4px 7px;
  border-radius: 2px;
  background: var(--color-dark);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.admin-icon-button[data-tooltip]:hover::after,
.admin-icon-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.admin-section-panel {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: visible;
  padding: 10px 20px;
  background: var(--color-bg-subtle);
}

.content-form {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 50px;
  overflow: visible;
  padding: 0 4px 8px 0;
}

.content-fields-grid {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.content-field-group {
  display: grid;
  min-width: 0;
  align-self: stretch;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.content-field-groups {
  display: flex;
  grid-column: 1 / -1;
  min-height: 100%;
  flex: 1 1 auto;
  flex-direction: column;
}

.content-field-group--top {
  margin-block-end: auto;
}

.content-field-group--middle {
  margin-block: auto;
}

.content-field-group--bottom {
  margin-block-start: auto;
}

.content-field-group--fill {
  flex: 1 1 auto;
}

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}

.rich-text-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-right: 10px;
  border-right: 1px solid var(--color-border);
}

.rich-text-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-slate);
  font-size: 0.85rem;
}

.rich-text-toolbar .btn {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 500;
}

.rich-text-toolbar .btn:hover,
.rich-text-toolbar .btn:focus-visible {
  border-color: var(--color-border);
  background: #fff;
  color: var(--color-accent);
  outline: none;
}

.rich-text-toolbar .btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.rich-text-toolbar select,
.rich-text-toolbar input[type="number"] {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font: inherit;
}

.rich-text-toolbar input[type="number"] {
  width: 76px;
}

.rich-text-toolbar input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.rich-text-toolbar input[type="color"],
.rich-text-toolbar input[type="number"],
.rich-text-toolbar select {
  border-radius: 2px;
}

.rich-text-editor {
  min-height: max(420px, calc(100dvh - 340px));
  overflow: visible;
  padding: 20px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  line-height: 1.65;
  text-align: left;
}

.rich-text-editor:focus {
  border-color: var(--color-accent);
  outline: 2px solid rgba(255, 36, 0, 0.12);
}

.rich-text-editor .notice-box {
  margin: 16px 0;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-tab-btn {
  padding: 0 10px;
  border: none;
  background: none;
  color: var(--color-bg-dark);
  font-weight: 600;
  cursor: pointer;
}

.admin-tab-btn.active {
  color: var(--color-accent);
}

.admin-main-tab-btn,
.admin-tab-btn {
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
}

.admin-subtabs {
  gap: 10px;
  margin: 0;
}

.form-container {
  display: flex;
  width: 100%;
  max-width: 1000px;
  min-width: 0;
  flex: 1 0 auto;
  flex-direction: column;
  margin: 0 auto;
  padding: 0;
}

.content-field {
  display: flex;
  min-width: 0;
  grid-column: span 6;
  flex-direction: column;
  gap: 5px;
}

.content-field.full {
  grid-column: 1 / -1;
}

.content-field.third {
  grid-column: span 4;
}

.content-field.two-thirds {
  grid-column: span 8;
}

.content-field.quarter {
  grid-column: span 3;
}

.content-field.three-quarters {
  grid-column: span 9;
}

.content-field label,
.form-field-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: var(--color-slate); }


.content-field input,
.content-field textarea,
.content-field select,
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-width: 0;
  color: var(--color-text);
  background: var(--color-input);
}

.content-field input:not([type="hidden"]),
.content-field textarea,
.content-field select {
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--color-bg-subtle);
  border-bottom: 1.5px solid var(--color-slate);
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.content-field textarea {
  min-height: 120px;
  resize: vertical;
  max-width: 100%;
  background: var(--color-input);
}

.content-field.small textarea {
  min-height: 88px;
}

.content-field.medium textarea {
  min-height: 150px;
}

.content-field.large textarea {
  min-height: clamp(220px, 32vh, 480px);
}

.content-field input:focus,
.content-field textarea:focus,
.content-field select:focus,
.cart-quantity-label input:focus {
  border-bottom: 1.5px solid var(--color-accent);
  outline: none;
}

.content-field input:required:not([type="hidden"]):not([type="checkbox"]),
.content-field textarea:required,
.content-field select:required {
  border: 1px solid rgba(255, 36, 0, 0.38);
  border-bottom: 1.5px solid var(--color-accent);
}

.content-field input:required:not([type="hidden"]):not([type="checkbox"]):focus,
.content-field textarea:required:focus,
.content-field select:required:focus {
  border-color: var(--color-accent);
  border-bottom-width: 1.5px;
}

.content-field input[type="checkbox"],
.content-field input[type="color"] {
  width: auto;
  accent-color: var(--color-accent);
}

.content-field input[type="color"] {
  width: 54px;
  height: 54px;
  padding: 4px;
  border: 1px solid #e1e3e8;
  background: #fff;
  cursor: pointer;
}

.content-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.content-field input[type="color"]::-webkit-color-swatch,
.content-field input[type="color"]::-moz-color-swatch {
  border: 0;
}

/*
 * Formularfelder teilen sich ein 12-Spalten-Raster. Ohne Zusatzklasse belegt
 * ein Feld 6 Spalten (die Hälfte); "full", "third" und "two-thirds" ändern das.
 * Diese Klassen helfen, Felder anzuordnen, ohne jedes Feld einzeln zu positionieren.
 */
.admin-color-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(100px, 130px);
  gap: 8px;
  align-items: center;
}

.admin-color-control select,
.admin-color-control input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font: inherit;
}

.admin-color-control input[type="color"] {
  width: 54px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
}

.rich-text-toolbar [data-rich-block-format],
.rich-text-toolbar [data-rich-spacing-block],
.rich-text-toolbar input[type="number"] {
  width: auto;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
}

.rich-text-toolbar input[type="number"] {
  width: 76px;
}

.rich-text-toolbar .admin-color-control select,
.rich-text-toolbar .admin-color-control input[type="text"] {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.rich-text-toolbar input[type="color"],
.rich-text-toolbar .admin-color-control input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.keyword-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.keyword-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.keyword-controls > .new-keywords-field {
  grid-column: 1;
}

.keyword-options {
  display: block;
  grid-column: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: justify;
}

.keyword-option {
  display: inline-block;
  margin: 0 1.25em 0.6em 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.keyword-option:hover,
.keyword-option:focus-visible {
  color: var(--color-accent);
}

.keyword-option:focus-visible {
  color: var(--color-cyan);
  text-decoration: none;
  text-underline-offset: 3px;
}

.keyword-option[aria-pressed="true"] {
  color: var(--color-cyan);
  -webkit-text-stroke: 0.35px currentColor;
}

.keyword-empty-state {
  color: var(--color-slate);
  font-size: 0.9rem;
  text-align: left;
}

#keyword-status {
  grid-column: 1;
  color: var(--color-slate);
}

.new-keywords-field {
  gap: 0;
}

.new-keywords-field input {
  border-right: 0 !important;
  border-left: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
}

.book-fields-grid {
  row-gap: 16px;
}

.post-details-spacer {
  grid-column: 1 / -1;
  height: 8px;
}

.site-page-actions {
  align-items: center;
}

#site-page-status {
  margin-left: auto;
  color: var(--color-accent);
  font-weight: 600;
}

.content-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.image-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 8px 0 4px;
}

.image-editor-grid > .content-field {
  grid-column: 1 / -1;
  min-width: 0;
}

.content-list-view,
.entries-list-view {
  flex: 1 1 auto;
  overflow: visible;
}

.content-list-view {
  display: flex;
  flex-direction: column;
}

.entries-list-view {
  display: flex;
  flex-direction: column;
}

.page-content-form {
  overflow: visible;
}

.page-content-form > [data-page-fields]:not([hidden]) {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  gap: 18px;
}

.page-content-form > [data-page-fields="legal"]:not([hidden]) {
  grid-template-rows: auto minmax(0, 1fr);
}

.page-content-form > [data-page-fields="legal"] > .rich-text-toolbar,
.page-content-form > [data-page-fields="legal"] > #legal-editor {
  grid-column: 1 / -1;
}

.page-content-form #legal-editor {
  min-height: max(360px, calc(100dvh - 350px));
}

.drop-zone-group .drop-zone[role="button"] {
  min-height: 190px;
  padding: 22px;
}

/*
 * Bildzuschnitt: Vorschau, Auswahlrahmen und abgedunkelter Außenbereich liegen übereinander.
 * Die Geometrie des Ausschnitts wird durch admin.js gesetzt; CSS stellt die Ebenen dar.
 */
.image-crop-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: visible;
  border: 1px solid var(--color-border);
  background-color: #f1f2f4;
  background-image: linear-gradient(45deg, #e6e8ec 25%, transparent 25%), linear-gradient(-45deg, #e6e8ec 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e8ec 75%), linear-gradient(-45deg, transparent 75%, #e6e8ec 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  user-select: none;
}

.image-crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.crop-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: rgba(6, 12, 28, 0.58);
  pointer-events: none;
}

.crop-selection {
  position: absolute;
  z-index: 2;
  border: 2px solid #fff;
  cursor: move;
  touch-action: none;
}

.crop-selection::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(7, 22, 61, 0.42);
  content: "";
  pointer-events: none;
}

.crop-handle {
  position: absolute;
  z-index: 2;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-accent);
  border-radius: 2px;
  background: #fff;
  touch-action: none;
}

.crop-handle[data-crop-handle="n"] { top: -8px; left: 50%; cursor: ns-resize; transform: translateX(-50%); }
.crop-handle[data-crop-handle="ne"] { top: -8px; right: -8px; cursor: nesw-resize; }
.crop-handle[data-crop-handle="e"] { top: 50%; right: -8px; cursor: ew-resize; transform: translateY(-50%); }
.crop-handle[data-crop-handle="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-handle[data-crop-handle="s"] { bottom: -8px; left: 50%; cursor: ns-resize; transform: translateX(-50%); }
.crop-handle[data-crop-handle="sw"] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.crop-handle[data-crop-handle="w"] { top: 50%; left: -8px; cursor: ew-resize; transform: translateY(-50%); }
.crop-handle[data-crop-handle="nw"] { top: -8px; left: -8px; cursor: nwse-resize; }

.crop-selection:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.crop-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--color-slate);
  font-size: 0.9rem;
  text-align: center;
}

.crop-placeholder[hidden] {
  display: none;
}

.image-upload-status {
  min-height: 1.2em;
  color: var(--color-slate);
}

.crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.section-spacer {
  grid-column: 1 / -1;
  height: 15px;
}

/* Dateiablage per Maus oder Tastatur */
.drop-zone-group {
  display: flex;
  flex-direction: column;
}

.drop-zone-group .drop-zone {
  display: flex;
  min-height: 170px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1px dashed var(--color-border);
  text-align: center;
  background: var(--color-input);
  color: var(--color-slate);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.admin-image-upload-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.drop-zone-group .drop-zone.dragover,
.drop-zone-group .drop-zone:hover,
.drop-zone-group .drop-zone:focus-visible {
  border-color: var(--color-accent);
  background: #fffafa;
  color: var(--color-dark);
  outline: none;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn {
  padding: 10px 0;
  border: none;
  background: var(--color-bg-subtle);
  color: var(--color-dark);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  color: var(--color-accent);
}

.btn-secondary {
  color: var(--color-slate);
  background: #fff;
}

.btn-secondary:hover {
  color: var(--color-cyan);
}

/* Verwaltungslisten für Bücher, Posts und Termine */
.entry-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 12px;
  border-bottom: 1px solid #ccc;
  background: #fff;
}

.entry-list-item:nth-child(even) {
  background: #f9f9f9;
}

.entry-list-details {
  min-width: 0;
}

.entry-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.cart-icon-button.entry-action-button {
  width: 40px;
  height: 40px;
}

.cart-icon-button.entry-action-button svg {
  width: 20px;
  height: 20px;
}
.cart-icon-button.entry-action-button:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
}
.cart-icon-button.entry-action-button.delete-action {
  border-color: #e1e3e8;
  background: #fff;
  color: var(--color-accent);
}
.cart-icon-button.entry-action-button.delete-action:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
}

.content-stream {
  display: grid;
  gap: 24px;
}

/* Karten für Posts und Termine sowie der dazugehörige Kalender */
.content-detail-stream {
  padding-top: 8px;
}

.content-back-link {
  color: var(--color-cyan);
  font-weight: 600;
  text-decoration: none;
}

.content-back-link:hover {
  color: var(--color-accent);
}

.content-card {
  overflow: hidden;
  background: var(--post-background, var(--color-bg-subtle));
  color: var(--post-text);
}

.content-card[data-text-mode="light"] {
  --post-text: #fff;
  --post-muted: #e8eaf0;
}

.content-card[data-text-mode="dark"] {
  --post-text: #07163d;
  --post-muted: #354363;
}

.content-card[data-text-mode="custom"] {
  --post-text: var(--post-custom-text);
  --post-muted: var(--post-custom-text);
}

.content-card-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.content-card-body {
  padding: clamp(20px, 4vw, 36px);
}

.content-card-date,
.content-card-meta {
  margin-bottom: 10px;
  color: var(--post-muted);
  font-size: 0.9rem;
}

.content-card h2 {
  margin-bottom: 12px;
  color: var(--post-text);
}

.content-card h2 a {
  color: inherit;
  text-decoration-color: transparent;
  text-underline-offset: 0.15em;
  transition: text-decoration-color 0.2s ease;
}

.content-card h2 a:hover {
  text-decoration-color: currentColor;
}

.content-card-subtitle {
  margin-bottom: 12px;
  color: var(--post-muted, var(--color-slate));
  font-size: 1.05rem;
}

.content-card-text {
  color: var(--post-text);
  line-height: 1.75;
  white-space: pre-line;
}

.content-card-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--post-text);
  font-weight: 600;
}

.content-card-read-more {
  display: inline-block;
  margin: 14px 18px 0 0;
  color: var(--post-text);
  font-weight: 600;
  text-underline-offset: 0.15em;
}

.calendar-floating-button {
  position: fixed;
  z-index: 110;
  right: 20px;
  bottom: 76px;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 8px 24px rgba(7, 22, 61, 0.24);
  color: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.calendar-floating-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(7, 22, 61, 0.28);
}

.calendar-floating-button:focus-visible,
.calendar-close:focus-visible,
.calendar-nav:focus-visible,
.calendar-all:focus-visible,
.calendar-day:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.calendar-floating-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.event-calendar-dialog {
  position: fixed;
  inset: auto 20px 144px auto;
  width: min(390px, calc(100vw - 32px));
  max-width: none;
  max-height: min(82vh, 600px);
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(7, 22, 61, 0.1);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(7, 22, 61, 0.24);
  color: var(--color-dark);
}

.event-calendar-dialog[open] {
  animation: calendar-pop-in 0.18s ease-out;
}

.event-calendar-dialog::backdrop {
  background: rgba(7, 22, 61, 0.25);
  backdrop-filter: blur(2px);
}

@keyframes calendar-pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.calendar-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-dialog-heading p {
  margin-bottom: 4px;
  color: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.calendar-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  color: var(--color-slate);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.calendar-close:hover {
  color: var(--color-accent);
}

.calendar-controls {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.calendar-controls h3 {
  min-width: 0;
  color: var(--color-dark);
  text-align: center;
  text-transform: capitalize;
}

.calendar-nav,
.calendar-all {
  min-height: 40px;
  border: 1px solid #dfe2e8;
  border-radius: 4px;
  padding: 7px 12px;
  background: #fff;
  color: var(--color-dark);
  cursor: pointer;
  font: inherit;
}

.calendar-nav {
  width: 40px;
  padding: 0;
  font-size: 1.4rem;
}

.calendar-all {
  grid-column: 1 / -1;
  min-height: 36px;
  margin-top: 2px;
  background: var(--color-bg-subtle);
}

.calendar-nav:hover,
.calendar-all:hover,
.calendar-all.active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.event-calendar {
  overflow: hidden;
  border: 1px solid #eceef2;
  border-radius: 5px;
  background: #fff;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-bottom: 1px solid #eceef2;
  background: #f8f8fa;
}

.calendar-weekdays span {
  padding: 10px 4px;
  color: var(--color-slate);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.calendar-day,
.calendar-day-empty {
  min-height: 44px;
  border: 0;
  border-right: 1px solid #f0f1f4;
  border-bottom: 1px solid #f0f1f4;
  background: #fff;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--color-dark);
  cursor: pointer;
  font: inherit;
}

.calendar-day:disabled {
  color: #a7acb7;
  cursor: default;
}

.calendar-day.has-events {
  font-weight: 700;
}

.calendar-day.has-events:hover,
.calendar-day.selected {
  border-radius: 50%;
  background: #fff0ed;
  color: var(--color-accent);
}

.calendar-day.today > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #d9dce4;
  border-radius: 50%;
}

.calendar-day.selected.today > span {
  border-color: var(--color-accent);
}

.calendar-day i {
  position: absolute;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
}

.calendar-hint {
  margin-top: 12px;
  color: var(--color-slate);
  font-size: 0.78rem;
  text-align: center;
}

.content-empty {
  color: var(--color-slate);
  text-align: center;
  padding: 24px;
}

/* Öffentliche Inhaltsseiten, Idee-Seite und Seitenformulare */
.content-stream,
.content-page,
.idea-layout {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-right: var(--page-gutter);
  padding-left: var(--page-gutter);
}

.content-stream,
.content-page {
  padding-bottom: 100px;
}

.content-page h2 {
  margin: 32px 0 12px;
}

.content-page p,
.content-page li {
  color: var(--color-slate);
  font-size: 1rem;
  line-height: 1.75;
}

.content-page p + p {
  margin-top: 14px;
}

.content-page a {
  color: var(--color-cyan);
}

.content-page .lead {
  font-family: inherit;
  font-size: 1.12rem;
}

.content-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 75vh;
  margin: 32px auto 18px;
  object-fit: contain;
  background: transparent;
}

.content-image[hidden] {
  display: none;
}

.idea-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.0fr) minmax(0, 0.7fr);
  align-items: start;
  gap: clamp(24px, 4vw, 40px);
}

.idea-figure {
  min-width: 0;
}

.idea-figure .content-image {
  margin: 0;
}

.idea-copy {
  min-width: 0;
}

.idea-layout .idea-copy .idea-text {
  max-width: none;
  margin: 0;
}

.idea-layout .idea-copy .idea-credit {
  margin-top: 1.75em;
  color: var(--color-slate);
  font-size: 0.9rem;
}

/* Bild und Text der Idee-Seite stehen auf schmalen Geräten untereinander. */
@media (max-width: 880px) {
  .idea-layout {
    grid-template-columns: 1fr;
    padding: 0 10dvw;
    padding-bottom: 6dvh;
  }

  .idea-figure,
  .idea-copy {
    width: 100%;
  }

  .idea-figure .content-image {
    width: 100%;
    max-height: none;
  }
}

.form-card {
  display: grid;
  gap: 22px;
  margin: 32px 0 0;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field[hidden] {
  display: none;
}

.form-field label {
  color: var(--color-accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-field input,
.form-field textarea,
.form-field select {
  min-height: 46px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1.5px solid var(--color-accent);
  background: var(--color-bg-main);
  text-align: left;
  transition: border-color 0.18s ease;
}

.contact-intro {
  white-space: pre-line;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #858b99;
}

.form-field input:hover,
.form-field textarea:hover,
.form-field select:hover {
  border-color: #c8cbd2;
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--color-slate);
  outline: none;
  transition: border-color 0.5s ease;
}

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--color-slate);
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-consent a {
  color: var(--color-dark);
  text-decoration-color: var(--color-accent);
  text-underline-offset: 3px;
}

.form-consent input {
  margin-top: 4px;
  accent-color: var(--color-accent);
}

.form-submit {
  justify-self: start;
  padding:13px 0;
  border: 0;
  border-radius: 2px;
  background: #fff;
  color: var(--color-accent);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
}

.form-submit:hover {
  color: var(--color-dark);
}

.form-submit:active {
  transform: translateY(1px);
}

.form-submit:focus-visible {
  outline: 3px solid rgba(255, 36, 0, 0.25);
  outline-offset: 3px;
}

.form-submit:disabled {
  background: #fff;
  color: #858b99;
  cursor: not-allowed;
}

.form-status {
  min-height: 1.5em;
  color: var(--color-slate);
}

.form-status[data-state="error"] {
  color: var(--color-accent);
  font-weight: 600;
}

.form-status[data-state="success"] {
  color: #27633d;
}

.order-items {
  display: grid;
  gap: 12px;
}

.form-row-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cart-section h2 {
  margin-bottom: 14px;
}

.cart-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 48px;
  gap: 14px;
  align-items: end;
}

.cart-icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  align-self: start;
  place-items: center;
  border: 1px solid var(--color-dark);
  background: var(--color-dark);
  color: #fff;
  cursor: pointer;
}

.cart-icon-button:hover {
  border-color: var(--color-cyan);
  background: var(--color-cyan);
}

.cart-icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cart-icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px auto 44px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--color-bg-subtle);
}

.cart-item-title {
  min-width: 0;
}

.cart-quantity-label input {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.cart-line-total {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Bestellformular und die Zusammenfassung des gespeicherten Warenkorbs */
.cart-remove {
  justify-self: end;
}

.order-summary {
  padding: 18px;
  background: var(--color-bg-subtle);
  line-height: 1.7;
}

.order-summary[hidden] {
  display: none;
}

.order-summary strong {
  color: var(--color-dark);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice-box {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg-subtle);
  color: var(--color-slate);
  line-height: 1.6;
}

@media (max-width: 650px) {
  .content-page {
    padding: 0 18px 90px;
  }

  .calendar-floating-button {
    right: 16px;
    bottom: 76px;
    width: 52px;
    height: 52px;
  }

  .event-calendar-dialog {
    inset: auto 12px 138px;
    width: auto;
    max-height: min(78vh, 560px);
    padding: 18px 14px;
  }

  .calendar-controls {
    gap: 6px;
  }

  .calendar-day,
  .calendar-day-empty {
    min-height: 44px;
  }

  .form-row-two {
    grid-template-columns: 1fr;
  }

  .idea-figure .content-image {
    margin: 0 auto;
  }

  .cart-add-row {
    grid-template-columns: minmax(0, 1fr) 100px 44px;
  }

  .cart-item {
    grid-template-columns: minmax(0, 1fr) 76px 44px;
    gap: 8px;
  }

  .cart-line-total {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .admin-container {
    height: 100dvh;
    min-height: 0;
    padding: 72px 10px 22px;
  }

  .form-container {
    width: 100%;
    min-width: 0;
    padding: 0;
  }

  .admin-main-tabs {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 12px;
    margin: 0;
    overflow: visible;
  }

  .admin-main-tab-btn {
    min-width: 0;
    width: auto;
    min-height: 46px;
    padding: 8px 4px;
    font-size: clamp(0.68rem, 2.4vw, 0.84rem);
    line-height: 1.15;
    white-space: nowrap;
  }

  .admin-section-panel {
    min-width: 0;
    padding: 10px 12px 14px;
  }

  .admin-subtab-row {
    gap: 8px;
  }

  .admin-subtab-actions {
    gap: 5px;
  }

  .admin-icon-button {
    width: 36px;
    height: 36px;
    padding: 7px;
  }

  .rich-text-toolbar {
    gap: 6px;
    padding: 8px;
  }

  .rich-text-toolbar-group {
    padding-right: 6px;
  }

  .rich-text-toolbar .btn {
    min-height: 42px;
  }

  .rich-text-editor {
    min-height: 55vh;
    padding: 14px;
    font-size: 16px;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
    margin: 10px 12px 16px;
  }

  .admin-tab-btn {
    min-width: 0;
    min-height: 48px;
    padding: 8px 4px;
    font-size: 0.82rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .content-fields-grid {
    gap: 14px;
    min-width: 0;
  }

  .content-fields-grid > .content-field:not(.full) {
    grid-column: 1 / -1;
  }

  .content-fields-grid > *,
  .content-field,
  .image-editor-grid {
    min-width: 0;
  }

  .book-fields-grid {
    row-gap: 12px;
  }

  #books-subtabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-spacer {
    grid-column: 1 / -1;
    height: 4px;
  }

  .content-field input:not([type="hidden"]),
  .content-field textarea,
  .content-field select {
    min-height: 46px;
    padding: 12px;
    font-size: 16px;
  }

  .content-field textarea {
    min-height: 120px;
  }

  .content-field input[type="checkbox"] {
    min-height: 20px;
    min-width: 20px;
  }

  .admin-color-control {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .admin-color-control input[type="color"] {
    width: 48px;
  }

  .admin-color-control input[type="text"] {
    grid-column: 1 / -1;
  }

  .drop-zone-group .drop-zone[role="button"] {
    min-height: 140px;
    padding: 18px 14px;
  }

  .image-crop-viewport {
    max-width: 100%;
  }

  .crop-handle {
    width: 18px;
    height: 18px;
  }

  .crop-handle[data-crop-handle="n"] { top: -10px; }
  .crop-handle[data-crop-handle="ne"] { top: -10px; right: -10px; }
  .crop-handle[data-crop-handle="e"] { right: -10px; }
  .crop-handle[data-crop-handle="se"] { right: -10px; bottom: -10px; }
  .crop-handle[data-crop-handle="s"] { bottom: -10px; }
  .crop-handle[data-crop-handle="sw"] { bottom: -10px; left: -10px; }
  .crop-handle[data-crop-handle="w"] { left: -10px; }
  .crop-handle[data-crop-handle="nw"] { top: -10px; left: -10px; }

  .btn-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .btn-group .btn {
    width: 100%;
    min-height: 46px;
    padding: 12px 16px;
  }

  .content-list-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .content-list-heading .btn {
    min-height: 44px;
  }

  .entry-list-item {
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 8px;
  }

  .entry-list-details {
    overflow-wrap: anywhere;
    font-size: 0.92rem;
  }

  .entry-actions {
    gap: 4px;
  }

  .cart-icon-button.entry-action-button {
    width: 40px;
    height: 40px;
  }

  .book-card {
    grid-template-columns: fit-content(450px) minmax(0, 1fr);
    grid-template-rows: minmax(min(450px, 70vw), auto);
    gap: 16px;
  }

  .book-card > .book-cover-link {
    width: fit-content;
    max-width: 100%;
  }

  .book-card.quote-full-row {
    grid-template-rows: minmax(min(450px, 70vw), auto) auto;
  }

  .book-card .book-author-keywords {
    align-items: baseline;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .book-card .book-author-keywords .category-tags {
    flex: 1 1 100px;
    justify-content: flex-end;
  }

  .content-stream {
    padding: 0 18px 90px;
  }

  .quote {
    padding: 16px 18px;
  }
}
