/* ============================================================
   Children of Hope — Phase 2 Shared Stylesheet (style2.css)
   ============================================================ */

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

/* ── VARIABLES ── */
:root {
  --accent:    #CB0F33;
  --blue:      #1a6bbf;
  --teal:      #0DC4C2;
  --dark-text: #030524;
  --mid-text:  #4D5656;
  --hfont:     'BioRhyme', serif;
  --bfont:     'Cabin', sans-serif;
  --card-bg:   #ffffff;
  --outer-bg:  #b0b0b0;
  --shadow:    0 8px 48px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
  --left-w:    280px;
  --topbar-h:  56px;
  --footer-h:  52px;
}

/* ── OUTER BACKGROUND ── */
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--outer-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bfont);
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 2px,
    rgba(255,255,255,0.015) 2px, rgba(255,255,255,0.015) 4px
  );
  pointer-events: none;
}

/* ── RAISED FRAME ── */
.frame {
  position: relative;
  width: 95vw;
  height: 95vh;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: var(--left-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr var(--footer-h);
  grid-template-areas:
    "topbar topbar"
    "left   right"
    "footer footer";
  overflow: hidden;
}

/* ── TOP BAR ── */
.topbar {
  grid-area: topbar;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 50;
}

.hamburger {
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px; border-radius: 4px;
  transition: background .15s; background: none; border: none; flex-shrink: 0;
}
.hamburger:hover { background: #f0f0f0; }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: #333; border-radius: 2px; transition: all .3s;
}
.frame.menu-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.frame.menu-open .hamburger span:nth-child(2) { opacity: 0; }
.frame.menu-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topbar-title {
  font-family: var(--hfont);
  font-size: 18px; font-weight: 700; color: var(--blue);
  letter-spacing: 0.01em; white-space: nowrap; text-decoration: none;
}
.topbar-title:hover { text-decoration: underline; }

.topbar-subtitle {
  font-family: var(--hfont);
  font-size: 15px; font-weight: 400; color: var(--accent);
  letter-spacing: 0.01em; white-space: nowrap; margin-left: 8px;
}

/* ── SLIDE-OUT NAV ── */
.nav-overlay {
  position: absolute;
  top: var(--topbar-h); left: 0;
  width: 260px;
  height: calc(100% - var(--topbar-h) - var(--footer-h));
  background: #fff; border-right: 1px solid #e8e8e8;
  z-index: 40; transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  padding: 16px 0; box-shadow: 4px 0 20px rgba(0,0,0,0.08);
  overflow-y: auto;
}
.frame.menu-open .nav-overlay { transform: translateX(0); }

.nav-overlay a {
  display: block; padding: 13px 24px;
  font-family: var(--bfont); font-size: 15px; font-weight: 600;
  color: var(--mid-text); text-decoration: none;
  border-left: 3px solid transparent; transition: all .15s;
}
.nav-overlay a:hover,
.nav-overlay a.current { color: var(--blue); border-left-color: var(--blue); background: #f5f9ff; }

.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #bbb; padding: 16px 24px 6px;
}
.nav-indent { padding-left: 36px !important; font-size: 13px !important; font-weight: 400 !important; }

/* ── LEFT PANEL ── */
.left-panel {
  grid-area: left;
  border-right: 1px solid #e8e8e8;
  background: #fafafa;
  position: relative;
  overflow: hidden;
}

/* ── ZELLE NUDGE ── */
.zelle-nudge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 14px;
  background: rgba(255,255,255,0.95);
  border-top: 1px solid #e8e8e8;
  font-family: var(--bfont); font-size: 11px;
  color: var(--mid-text); line-height: 1.5; text-align: center;
}
.zelle-nudge strong { color: var(--blue); display: block; margin-bottom: 3px; }
.zelle-nudge a { color: var(--accent); font-weight: 700; text-decoration: none; word-break: break-all; }
.zelle-nudge a:hover { text-decoration: underline; }

/* ── RIGHT PANEL ── */
.right-panel {
  grid-area: right;
  overflow-y: auto;
  background: #fff;
}

/* ── FOOTER ── */
.frame-footer {
  grid-area: footer;
  background: #1a3fbc;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px; gap: 16px;
}
.footer-copy {
  font-family: var(--bfont); font-size: 10px;
  color: rgba(255,255,255,0.65); white-space: nowrap;
}
.social-links { display: flex; align-items: center; gap: 6px; justify-self: center; }
.social-links a {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 700;
  font-family: var(--bfont); transition: background .15s;
}
.social-links a:hover { background: rgba(255,255,255,0.35); }

/* ── COMMON PAGE ELEMENTS ── */
.page-title {
  font-family: var(--hfont);
  font-size: 26px; font-weight: 700;
  color: var(--accent); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 2px solid #f0f0f0;
}

.section-title {
  font-family: var(--hfont);
  font-size: 22px; font-weight: 700; color: var(--blue);
  margin-bottom: 20px; padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

/* ── VIDEO WRAP ── */
.video-wrap {
  position: relative; width: 100%;
  aspect-ratio: 16/9; background: #111;
  border-radius: 4px; overflow: hidden; margin-bottom: 8px;
}
.video-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: none;
}
.video-caption {
  font-family: var(--bfont); font-size: 12px;
  color: #888; font-style: italic; line-height: 1.4;
}

/* ── NAV CARDS (index2 left panel) ── */
.book-cover { flex-shrink: 0; padding: 20px 20px 12px; }
.book-cover img {
  width: 100%; max-height: 200px;
  object-fit: contain; display: block;
  border-radius: 3px; box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.nav-cards {
  flex: 1; display: flex; flex-direction: column;
  padding: 8px 12px; gap: 6px; overflow-y: auto;
}
.nav-card {
  display: block; text-decoration: none;
  padding: 10px 14px; border-radius: 4px;
  border: 1px solid #e4e4e4; background: #fff;
  transition: all .2s; cursor: pointer;
}
.nav-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(26,107,191,0.12);
  transform: translateX(2px);
}
.nav-card-title {
  font-family: var(--hfont); font-size: 13px; font-weight: 700;
  color: var(--blue); margin-bottom: 3px;
}
.nav-card-desc { font-family: var(--bfont); font-size: 11px; color: #888; line-height: 1.4; }

/* ── PHOTO VIEWER (events2) ── */
.photo-viewer { position: relative; background: #111; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.photo-viewer-main { width: 100%; height: 280px; object-fit: contain; display: block; background: #111; cursor: pointer; }
.pv-prev, .pv-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.5); color: #fff; border: none; cursor: pointer;
  font-size: 22px; padding: 10px 16px; transition: background .15s;
  line-height: 1; border-radius: 3px;
}
.pv-prev:hover, .pv-next:hover { background: rgba(0,0,0,0.8); }
.pv-prev { left: 8px; }
.pv-next { right: 8px; }
.pv-counter {
  position: absolute; bottom: 8px; right: 12px;
  font-family: var(--bfont); font-size: 11px;
  color: rgba(255,255,255,0.7); background: rgba(0,0,0,0.4);
  padding: 2px 8px; border-radius: 10px;
}
.pv-thumbs {
  display: flex; gap: 4px; overflow-x: auto; padding: 6px 0;
  scrollbar-width: thin;
}
.pv-thumbs::-webkit-scrollbar { height: 4px; }
.pv-thumbs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.pv-thumb {
  flex-shrink: 0; width: 56px; height: 42px;
  object-fit: cover; border-radius: 2px; cursor: pointer;
  opacity: 0.6; transition: opacity .15s; border: 2px solid transparent;
}
.pv-thumb:hover { opacity: 1; }
.pv-thumb.active { opacity: 1; border-color: var(--teal); }

/* ── LIGHTBOX ── */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.95); z-index: 1000;
  align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 2px; }
.lb-close {
  position: absolute; top: 20px; right: 28px;
  color: #fff; font-size: 36px; cursor: pointer;
  background: none; border: none; line-height: 1;
}
.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 48px; cursor: pointer;
  background: none; border: none; padding: 0 20px; line-height: 1;
}
.lb-prev { left: 0; }
.lb-next { right: 0; }


/* ============================================================
   MOBILE BREAKPOINTS
   ============================================================ */

/* ── TABLET & MOBILE (≤ 768px) ── */
@media (max-width: 768px) {

  /* Remove the floating card — fill the full screen */
  html, body {
    align-items: flex-start;
    justify-content: flex-start;
    background: #fff;
    overflow: auto;
    height: auto;
    min-height: 100%;
  }
  body::before { display: none; }

  /* Frame becomes a normal full-width document flow */
  .frame {
    width: 100%;
    height: auto;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  /* Topbar stays fixed at top */
  .topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    z-index: 100;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  }

  /* Nav overlay fills most of screen width */
  .nav-overlay {
    position: fixed;
    top: var(--topbar-h);
    height: calc(100% - var(--topbar-h));
    width: 80vw;
    max-width: 300px;
    z-index: 99;
  }

  /* Hide left panel — hamburger replaces it */
  .left-panel { display: none; }

  /* Right panel is the main content — scrollable, padded for topbar */
  .right-panel {
    display: block !important;
    overflow: visible !important;
    width: 100% !important;
    padding: 80px 16px 24px !important;
    flex: 1;
  }

  /* Footer sits at the bottom naturally */
  .frame-footer {
    flex-shrink: 0;
    padding: 0 16px;
  }

  .footer-copy { font-size: 9px; }

  /* Subtitle hidden */
  .topbar-subtitle { display: none; }

  /* Photo viewer shorter */
  .photo-viewer-main { height: 220px; }

  /* Index2 specific — family photo becomes fixed height banner */
  .family-photo { height: 220px; flex-shrink: 0; }
  .story-text { overflow: visible; }

  /* Cards grid — 2 columns on tablet */
  .cards-grid { grid-template-columns: 1fr 1fr !important; gap: 12px; }
  .xuan-grid { grid-template-columns: 1fr !important; gap: 24px; }
  .cards-section { padding: 24px 16px !important; }
}

/* ── PHONE (≤ 480px) ── */
@media (max-width: 480px) {

  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-title { font-size: 15px; }

  /* Social icons fill footer */
  .social-links a { width: 28px; height: 28px; font-size: 10px; }
  .footer-copy { display: none; }

  /* Titles scale down */
  .page-title { font-size: 20px; }
  .section-title { font-size: 17px; }

  /* All 2-column grids go single column */
  .videos-grid,
  .partners-grid,
  .persons-grid,
  .bio-grid {
    grid-template-columns: 1fr !important;
  }

  /* Bio grid image centered when stacked */
  .bio-grid img { max-width: 240px; margin: 0 auto 16px; }

  /* Cards single column */
  .cards-grid { grid-template-columns: 1fr !important; }

  /* Photo viewer compact */
  .photo-viewer-main { height: 180px; }

  /* Bigger touch targets on arrows */
  .pv-prev, .pv-next { padding: 14px 20px; font-size: 28px; }

  /* Impact hero inner padding tighter */
  .impact-hero { padding: 16px !important; }
  .impact-hero-inner { padding: 16px !important; }
  .content-area { padding: 16px !important; }

  /* Family photo shorter on phone */
  .family-photo { height: 160px; }

  /* About photo full width */
  .about-photo { width: 100% !important; height: 180px !important; }
}
