/* =============================================
   CMI Ostafrikanische Region – Mission Website
   Modern CSS rewrite (replacing frame/table layout)
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:      #1a3a5c;
  --navy-dark: #122841;
  --navy-mid:  #2c5f8a;
  --orange:    #e87722;
  --orange-dark:#b85e0a;
  --sidebar-bg:#f0f4f8;
  --border:    #d0dce8;
  --text:      #2d2d2d;
  --text-light:#555;
  --white:     #ffffff;
  --font:      'Segoe UI', Arial, Helvetica, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: #e8edf2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ───────────────────────────────── */

header {
  background: var(--navy);
  color: var(--white);
  padding: 28px 36px 22px;
  border-bottom: 4px solid var(--orange);
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-inner { display: block; }

header .subtitle {
  font-size: 0.92rem;
  color: #a8c4df;
  margin-top: 5px;
  font-style: italic;
}

/* ── Page layout ──────────────────────────── */

.layout {
  display: flex;
  flex: 1;
  align-items: stretch;
}

/* ── Sidebar nav ──────────────────────────── */

.sidebar {
  width: 210px;
  min-width: 210px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 0;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li a {
  display: block;
  padding: 8px 18px;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar ul li a:hover {
  background: #dce6f0;
  border-left-color: var(--navy-mid);
  color: var(--navy-dark);
}

.sidebar ul li a.active {
  background: var(--white);
  border-left-color: var(--orange);
  color: var(--navy-dark);
  font-weight: 700;
}

.nav-section {
  display: block;
  padding: 10px 18px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--orange);
  margin-top: 6px;
  pointer-events: none;
}

/* ── Main content ─────────────────────────── */

main {
  flex: 1;
  background: var(--white);
  padding: 36px 44px;
  max-width: 860px;
  line-height: 1.5;
}

main h2 {
  font-size: 1.2rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 8px;
  margin: 36px 0 10px;
}

.rb-section h2 {
  border-bottom: none;
  padding-bottom: 0;
}

h2.heading-bar, h3.heading-bar {
  border-bottom: 2px solid var(--orange);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

main h3 {
  font-size: 1rem;
  color: var(--navy-mid);
  margin: 40px 0 8px;
  font-weight: 600;
}

main p {
  margin: 0 0 16px;
  color: var(--text);
}

main ul {
  margin: 0 0 16px 24px;
  font-size: 0.95rem;
}

main ul li {
  margin-bottom: 4px;
}

p.page-link {
  margin-top: 32px;
}

/* ── Section block ────────────────────────── */

.section-block {
  background: var(--sidebar-bg);
  border-left: 4px solid var(--orange);
  border-radius: 0 6px 6px 0;
  padding: 6px 0 6px 18px;
  margin-bottom: 28px;
}

.section-block h3 {
  margin-top: 0;
  color: var(--navy);
}

.section-block p, .section-block ul {
  margin-bottom: 0;
  font-size: 0.94rem;
}

/* ── Gallery index list ───────────────────── */

.gallery-list {
  list-style: none;
  margin: 0;
}

.gallery-list li {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.gallery-list li:last-child {
  border-bottom: none;
}

.gallery-list li a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-mid);
  text-decoration: none;
}

.gallery-list li a:hover {
  text-decoration: underline;
  color: var(--navy-dark);
}

.gallery-list li p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-light);
}

/* ── Gallery card grid ───────────────────────────────────────────────────── */
.gallery-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.gallery-card {
  display: block;
  background: #f0f4f8;
  border: 1px solid #d0dce8;
  border-radius: 6px;
  overflow: hidden;
  color: #1a3a5c;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: box-shadow .15s;
}

.gallery-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.gallery-card-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery-card-nothumb { width: 100%; aspect-ratio: 4/3; background: #d0dce8; }
.gallery-card-caption { padding: 10px 14px; font-size: .88rem; }

/* ── Plan links grid ──────────────────────── */

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.plan-grid a {
  display: block;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px 16px;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.plan-grid a:hover {
  background: #dce6f0;
  border-color: var(--navy-mid);
}

/* ── Contact / donation cards ─────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}

.contact-card {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
}

.contact-card h3 {
  margin-top: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy);
  margin-bottom: 10px;
}

.contact-card p,
.contact-card a {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text);
  text-decoration: none;
}

.contact-card a {
  color: var(--navy-mid);
}

.contact-card a:hover {
  text-decoration: underline;
}

.donation-block {
  background: #fff8f0;
  border: 1px solid #f0d0a0;
  border-left: 4px solid var(--orange);
  border-radius: 0 6px 6px 0;
  padding: 18px 22px;
  margin-bottom: 20px;
}

.donation-block h3 {
  color: var(--orange-dark);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.donation-block p {
  font-size: 0.93rem;
  margin-bottom: 6px;
  line-height: 1.6;
}
button.copy-iban {
  display: inline-block;
  padding: 2px 7px;
  font-size: 1.2rem;
  color: #c45e00;
  background: none;
  border: 1px solid #c45e00;
  border-radius: 3px;
  cursor: pointer;
  vertical-align: middle;
  transition: color .15s, border-color .15s;
}
button.copy-iban:hover { color: #a34e00; border-color: #a34e00; }
button.copy-iban.copied { color: #3a7a50; border-color: #3a7a50; }

/* ── Book nav tabs ────────────────────────── */

.book-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.book-tabs a {
  display: inline-block;
  padding: 7px 14px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--navy);
  font-size: 0.84rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.book-tabs a:hover {
  background: #dce6f0;
  border-color: var(--navy-mid);
}

/* ── Photo centered images ────────────────── */

.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 24px;
}

.photo-row img {
  max-width: 320px;
  width: 100%;
  border: 3px solid var(--border);
  border-radius: 4px;
}

/* ── Links ────────────────────────────────── */

a {
  color: var(--navy-mid);
}

a:hover {
  color: var(--navy-dark);
}

/* ── Note ─────────────────────────────────── */

.note {
  font-size: 0.82rem;
  color: #888;
  font-style: italic;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ── Footer ───────────────────────────────── */

footer {
  background: var(--navy-dark);
  color: #7a9ab8;
  text-align: center;
  padding: 14px 20px;
  font-size: 0.82rem;
}

footer a {
  color: #a8c4df;
}

/* ── Rundbrief (newsletter) ───────────────── */

.rb-sender {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.rb-sender-img {
  max-width: 160px;
  width: 100%;
  flex-shrink: 0;
  border: none;
}

.rb-sender-info {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
}

.rb-sender-info p { margin-bottom: 2px; }

.rb-sender-name {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px !important;
}

.rb-quote {
  margin: 24px 0;
  padding: 14px 22px;
  font-style: italic;
}

.rb-quote.rb-quote--sidebar {
  border-left: 4px solid var(--orange);
  background: #fff8f0;
  border-radius: 0 6px 6px 0;
}

.rb-quote p {
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--navy-dark);
}

.rb-quote cite {
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: normal;
}

.rb-closing-quote {
  margin-top: 32px;
}

.rb-section {
  margin-bottom: 28px;
}

.rb-section h2 {
  font-size: 1.1rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.rb-highlight {
  border-left: 4px solid var(--orange);
  border-radius: 0 6px 6px 0;
  padding: 6px 0 6px 18px;
}

.rb-highlight h2 {
  border-bottom-color: transparent;
}

.rb-image-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.rb-grid-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid var(--border);
  display: block;
}

.rb-image-grid figure {
  margin: 0;
}

.rb-image-grid figcaption {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
  text-align: center;
}

.rb-support {
  background: #fff8f0;
  border: 1px solid #f0d0a0;
  border-left: 4px solid var(--orange);
  border-radius: 0 6px 6px 0;
  padding: 18px 22px;
  margin-top: 32px;
  margin-bottom: 20px;
}

.rb-support h3 {
  color: var(--orange-dark);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rb-support p {
  font-size: 0.93rem;
  margin-bottom: 6px;
  line-height: 1.6;
}

/* ── Hamburger button (hidden on desktop) ─── */

.nav-toggle { display: none; }

/* ── Responsive ───────────────────────────── */

@media (max-width: 720px) {
  header { padding: 14px 18px; }
  header h1 { font-size: 1.2rem; }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
  }

  /* Hamburger button */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .nav-toggle span {
    display: block;
    height: 2.5px;
    background: var(--white);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  /* Animate to × when open */
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(8.75px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-8.75px) rotate(-45deg); }

  /* Sidebar becomes a floating dropdown panel */
  .layout { flex-direction: column; position: relative; }

  .sidebar {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 220px;
    min-width: unset;
    border-right: none;
    border-top: 3px solid var(--orange);
    border-radius: 0 0 6px 0;
    padding: 6px 0;
    background: var(--sidebar-bg);
    box-shadow: 6px 6px 20px rgba(0,0,0,.22), 2px 0 8px rgba(0,0,0,.15);
    z-index: 200;
  }
  .sidebar.nav-open { display: block; }

  .sidebar ul {
    flex-direction: column;
  }

  .sidebar ul li a {
    border-left: 3px solid transparent;
    padding: 9px 18px;
    font-size: 0.92rem;
  }

  .sidebar ul li a.active {
    border-left-color: var(--orange);
    background: #e0e8f0;
  }

  .nav-section {
    padding: 8px 18px 2px;
  }

  main {
    padding: 24px 20px;
    max-width: 100%;
  }

  .contact-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Print ─────────────────────────────────── */

@media print {
  @page {
    size: A4;
    margin: 2.5cm 2.5cm 2cm 2.5cm;
  }

  /* Hide chrome */
  header, .sidebar, footer { display: none !important; }

  /* Full-width main */
  .layout { display: block; }
  main {
    padding: 0;
    max-width: 100%;
  }

  /* Typography */
  body { font-size: 10.5pt; color: #000; background: #fff; }
  h2   { font-size: 11.5pt; color: #1a3a5c; }
  h3   { font-size: 11pt;   color: #1a3a5c; }

  /* Keep sections together where possible */
  .rb-section, .rb-quote, .rb-support,
  .rb-image-grid figure { break-inside: avoid; }

  /* Sender block */
  .rb-sender-info { font-size: 9pt; }

  /* Tighten image grid for print */
  .rb-image-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .rb-grid-img   { border: 1px solid #ccc; }

  /* Don't print link URLs */
  a::after { content: none !important; }
}
