:root {
  --bg: #fff7e9;
  --card-bg: #ffeecb;
  --accent: #ffd236;
  --primary: #0099a8;
  --text-dark: #333333;
  --white: #ffffff;
  --radius-lg: 24px;
  --shadow-soft: 0 16px 30px rgba(0, 0, 0, 0.08);
}

/* Base */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { text-decoration: none; color: inherit; }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Header / Nav (wie books.html) */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0 0.5rem;
  position: relative;
}

.logo-wrap { display: flex; align-items: center; gap: 0.75rem; }

.logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  overflow: hidden;
}

.logo-icon img { width: 100%; height: 100%; object-fit: cover; }

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }

.logo-text span:first-child {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  color: var(--primary);
}

.logo-text span:last-child { font-weight: 600; color: #f4a300; }

nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--primary);
}

nav a:hover { text-decoration: underline; }
nav a.active { text-decoration: underline; font-weight: 700; }

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary);
}

/* Titles (wie books.html) */
.page-title { padding: 2rem 0 1rem; }

.pill-label {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 153, 168, 0.08);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.page-title h1 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.page-title p { max-width: 540px; color: var(--text-dark); }

/* Buttons (Primary wie books.html) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background-color: var(--accent);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.12);
}

/* Back link */
.back-link { margin-top: 2rem; font-size: 0.9rem; }
.back-link a { color: var(--primary); text-decoration: underline; font-weight: 500; }

/* Footer */
footer {
  font-size: 0.85rem;
  color: #777;
  text-align: center;
  padding: 2rem 0 0.5rem;
}

/* ---------------------------
   BOOKS PAGE (books.html)
--------------------------- */

.books-controls {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  align-items: end;
}

.sort-controls label,
.search-controls label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.sort-controls select,
.search-controls input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 2px solid rgba(0,153,168,0.25);
  background: #fff;
  outline: none;
  font-family: inherit;
}

.series-controls { grid-column: 1 / -1; margin-top: 0.25rem; }
.series-controls > span {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

#seriesFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-series {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.btn-series.active {
  background: var(--primary);
  color: #fff;
}

.books-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
}

.book-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.book-image {
  height: 190px;
  overflow: hidden;
  background: #ffe28f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem;
  position: relative;
}

.book-image img {
  border-radius: 16px;
  height: 100%;
  object-fit: cover;
}

.book-body {
  padding: 1.2rem 1.2rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.book-meta {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.6rem;
}

.book-desc {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  flex: 1;
}

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

/* ---------------------------
   FREEBIES PAGE (freebie.html)
--------------------------- */

.controls {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  align-items: end;
}

.controls select,
.controls input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 2px solid rgba(0,153,168,0.25);
  background: #fff;
  outline: none;
  font-family: inherit;
}

#typeFilters {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn-filter {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.btn-filter.active { background: var(--primary); color: #fff; }

#grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
}

.card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.card-body {
  padding: 1.2rem 1.2rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h2 {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.meta {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.6rem;
}

.desc {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  flex: 1;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Download */
.btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background-color: var(--accent);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  white-space: nowrap;
}

.btn-main:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.12);
}

/* Etsy */
.btn-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid var(--primary);
  white-space: nowrap;
}

.btn-alt:hover {
  background-color: rgba(0,153,168,0.08);
  transform: translateY(-1px);
}

/* Badge */
.badge-free {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0,0,0,.15);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ---------------------------
   INDEX HERO + SECTION CARDS
--------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 2.5rem;
  padding: 2.5rem 0 3rem;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 1.2rem;
}

.hero-text h1 span { display: block; }

.hero-text p {
  max-width: 420px;
  margin-bottom: 1.6rem;
  color: var(--text-dark);
}

.hero-image {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-image img {
  border-radius: 20px;
  width: 100%;
  height: auto;
  object-fit: cover;
}

section { margin-bottom: 3.5rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 2.8rem;
  align-items: center;
}

.section-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.section-heading {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.section-text { font-size: 1rem; color: var(--text-dark); }

/* ---------------------------
   Responsive (wie books.html + index.html)
--------------------------- */

@media (max-width: 860px) {
  header { padding-top: 0.75rem; }

  nav {
    position: absolute;
    top: 64px;
    right: 1.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-soft);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    display: none;
    z-index: 15;
  }

  nav.open { display: flex; }
  .nav-toggle { display: block; }

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

  .books-controls { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr; }

  .hero { grid-template-columns: 1fr; padding-top: 1.8rem; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page { padding: 0 1rem 2.5rem; }

  .books-grid { grid-template-columns: 1fr; }
  #grid { grid-template-columns: 1fr; }

  .book-image { height: 180px; }
  .card img { height: 180px; }
}

/* ===== MODAL / OVERLAY ===== */
#modalOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
}

#modalOverlay.open { display: flex; }

/* Modal Container: scroll rechts, nicht gesamt */
#modalOverlay .modal {
  width: min(980px, 100%);
  max-height: min(86vh, 900px);
  overflow: hidden;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  position: relative;
}

/* Top right icon buttons (Share + Close) */
.modal-top-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 0.4rem;
  z-index: 20;
}

.modal-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-btn:hover { background: var(--accent); }

/* 2 Columns + fixed height */
#modalOverlay .modal-content {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  height: min(86vh, 900px);
}

/* LEFT sticky column */
#modalOverlay .modal-left {
  background: #ffe28f;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  align-self: start;
}

/* Image */
#modalOverlay .modal-image img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 18px;
}

/* Buttons under image */
#modalOverlay .modal-left-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* RIGHT scroll area */
#modalOverlay .modal-right {
  padding: 1.4rem 1.4rem 1.2rem;
  overflow: auto;
}

#modalOverlay .modal-title {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

#modalOverlay .modal-meta {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0.9rem;
}

#modalOverlay .modal-desc {
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.65;
  margin-bottom: 1.1rem;
  white-space: pre-line;
}

/* Mobile: stack */
@media (max-width: 860px) {
  #modalOverlay .modal { overflow: auto; }
  #modalOverlay .modal-content { grid-template-columns: 1fr; height: auto; }
  #modalOverlay .modal-left { position: relative; top: auto; }
  #modalOverlay .modal-right { overflow: visible; }
  #modalOverlay .modal-image img { height: 260px; }
}


/* =========================
   INTRO SECTION (neu)
   Synchron: Bildhöhe gleich, Textstart gleich, Button unten
========================= */

.split.intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.8rem;
  align-items: stretch;
}

.split.intro.reverse { direction: rtl; }
.split.intro.reverse > * { direction: ltr; }

.section-intro-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);

  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 🔑 Fixe Bild-Zone: sorgt für gleichen Textstart */
.section-intro-card .intro-media {
  height: 220px;              /* <-- kannst du anpassen (z.B. 200–280) */
  border-radius: 18px;
  overflow: hidden;
  background: #ffe28f;        /* optional: hübscher Rahmen wie bei Cards */
  margin-bottom: 1.2rem;

  display: flex;              /* Zentrieren */
  align-items: center;
  justify-content: center;
}

/* Bild zentriert + gleichmäßig beschnitten */
.section-intro-card .intro-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* gleich hohe Bilder, schön zugeschnitten */
  object-position: center;    /* zentriert */
}

/* Textblock wächst */
.section-intro-card .section-text {
  flex: 1 1 auto;
  margin-bottom: 1.25rem;
}

/* Button immer ganz unten mittig */
.section-intro-card .intro-action {
  margin-top: auto;
  display: flex;
  justify-content: center;
}

/* Responsive */
@media (max-width: 860px) {
  .split.intro { grid-template-columns: 1fr; }
  .section-intro-card .intro-media { height: 200px; }
}
