/* =====================================================================
   Root & Base
   ===================================================================== */
:root{
  --text:#1f2937;           /* slate-800 */
  --muted:#6b7280;          /* gray-500 */
  --brand:#e11d48;          /* Ghana red */
  --brand2:#16a34a;         /* Ghana green */
  --gold:#f59e0b;           /* Ghana gold */
  --card:#f8fafc;
  --border:#e5e7eb;
  --bg:#ffffff;
}
*{ box-sizing:border-box }
html,body{ margin:0; padding:0 }
body{
  font-family: system-ui, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a{ color: var(--brand); text-decoration: none }
a:hover{ text-decoration: underline }
.container{
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;        /* side padding for smaller screens */
}

/* =====================================================================
   Header
   ===================================================================== */
.kente{
  height:6px;
  background: repeating-linear-gradient(
    90deg,
    #e11d48 0 20px, #f59e0b 20px 40px, #16a34a 40px 60px, #111827 60px 80px
  );
}
.site-header{
  position: sticky; top:0; z-index:50;
  background:#fff; border-bottom:1px solid var(--border);
  backdrop-filter: saturate(180%) blur(6px);
}
.header-inner{
  display:flex; gap:1rem; align-items:center; justify-content:space-between;
}
.brand{ font-weight:800 }
.site-header nav a{
  display:inline-block; padding:.35rem .6rem; border-radius:10px;
  margin-right:.5rem; color: var(--text);
}
.site-header nav a:last-child{ margin-right:0 }
.site-header nav a:hover{
  background: rgba(225,29,72,.1);
  color: var(--brand);
  text-decoration: none;
}

/* =====================================================================
   Cards, Tables, Footer
   ===================================================================== */
.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding:1rem; margin:.75rem 0;
}
.table{ width:100%; border-collapse:collapse }
.table th,.table td{
  border:1px solid var(--border);
  padding:.5rem; text-align:left;
}
.site-footer{
  border-top:1px solid var(--border);
  padding:1rem 0; margin-top:2rem;
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn{
  display:inline-block; background:var(--brand); color:#fff;
  font-weight:600; padding:.6rem 1.2rem; border-radius:8px;
  text-decoration:none; cursor:pointer; border:none;
}
.btn:hover{ background:#b91c1c }
.btn-outline{
  display:inline-block; background:transparent; color:var(--brand);
  font-weight:600; padding:.35rem .9rem; border-radius:8px;
  text-decoration:none; cursor:pointer; border:2px solid var(--brand);
}
.btn-outline:hover{ background:var(--brand); color:#fff }
.btn-gold{ background:var(--gold); color:#fff }
.btn-gold:hover{ background:#d97706 }
.btn-outline.logout-button{ padding:.35rem .6rem; border-radius:10px }

/* =====================================================================
   Flash Messages
   ===================================================================== */
.flash-wrap{ margin:1rem 0 }
.flash{
  padding:.75rem 1rem; border-radius:8px; margin-bottom:1rem;
  font-size:.95rem; font-weight:500; border:1px solid var(--border);
}
.flash.success{ background:#ecfdf5; color:#065f46; border-color:#10b981 }
.flash.danger,.flash.error{ background:#fef2f2; color:#991b1b; border-color:#ef4444 }
.flash.info{ background:#eff6ff; color:#1e3a8a; border-color:#3b82f6 }

/* =====================================================================
   Forms
   ===================================================================== */
.form-group{ margin-bottom:1rem }
.form-group label{ display:block; margin-bottom:.35rem; font-weight:600 }
.input{
  width:100%; padding:.5rem .75rem; border:1px solid var(--border);
  border-radius:8px; font-size:1rem;
}
.input:focus{
  outline:none; border-color:var(--brand);
  box-shadow:0 0 0 2px rgba(225,29,72,.2);
}
.form-actions{ text-align:center }

/* =====================================================================
   Login Page
   ===================================================================== */
.login-page{
  background:#f3f4f6; min-height:100vh;
  display:flex; align-items:center; justify-content:center;
}
.login-container{ width:100%; max-width:400px; padding:1rem }
.login-card{
  background:#fff; border:1px solid var(--border);
  border-radius:12px; box-shadow:0 8px 20px rgba(0,0,0,.05); padding:2rem;
}
.login-title{
  margin:0 0 1.5rem; font-size:1.5rem; text-align:center; color:var(--brand);
}

/* =====================================================================
   Gallery & Lightbox
   ===================================================================== */
/* album chips */
.album-filter{
  display:flex; flex-wrap:wrap; gap:.5rem; margin:.5rem 0 1rem;
}
.album-filter a{
  display:inline-block; padding:.35rem .7rem;
  border:1px solid var(--border); border-radius:999px;
  text-decoration:none; color:var(--text); background:#fff;
}
.album-filter a.active,
.album-filter a:hover{ border-color:var(--brand); background:var(--brand); color:#fff }

/* grid of media cards */
.gallery-grid{
  display:grid; gap:.75rem;
  grid-template-columns:repeat(auto-fill, minmax(220px,1fr));
}
.gallery-grid .card{ padding:.5rem }
.gallery-grid a{ position: relative; display:block }
.gallery-grid img{
  width:100%;
  height:auto;             /* no forced height */
  aspect-ratio: 4 / 3;     /* consistent thumb frame */
  object-fit: cover;       /* crop elegantly if needed */
  border-radius:10px;
  border:1px solid var(--border);
}
.gallery-grid figcaption{
  font-size:.95rem; color:var(--text); margin-top:.35rem;
}
.gallery-grid figcaption small{ color:var(--muted); }

/* play badge (single definition) */
.play-badge{
  position:absolute; right:10px; bottom:10px;
  width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center;
  background: rgba(0,0,0,.65); color:#fff; font-weight:700;
}

/* lightbox shell */
.lightbox{
  position:fixed; inset:0; background:rgba(0,0,0,.9);
  display:grid; align-items:center; justify-items:center;
  padding:1.5rem; z-index:1000;
}
.lightbox[hidden]{ display:none !important }
.lightbox img{
  max-width:90vw; max-height:80vh; border-radius:10px;
  box-shadow:0 10px 25px rgba(0,0,0,.4);
}
.lightbox-meta{
  max-width:90vw; margin-top:.75rem; color:#e5e7eb; text-align:center;
}
.lightbox-close{
  position:absolute; top:1rem; right:1rem; width:40px; height:40px;
  border-radius:999px; border:1px solid #334155; background:#111827; color:#fff;
  font-size:1.4rem; line-height:1; cursor:pointer;
}
.lightbox-close:hover{ background:#1f2937 }

/* =====================================================================
   Utilities
   ===================================================================== */
.muted{ color:var(--muted) }
.grid{ display:grid; gap:1rem }
.badge{
  display:inline-block; min-width:1.25em; padding:0 .4em; border-radius:999px;
  background:var(--brand); color:#fff; font-size:.8rem; line-height:1.4;
  text-align:center; vertical-align:middle; margin-left:.35rem;
}
.badge.muted{ background:#e5e7eb; color:#374151 }

@media (max-width:640px){
  .header-inner{ flex-direction:column; align-items:flex-start; gap:.5rem }
}

/* safety net */
[hidden]{ display:none !important }

/* =====================================================================
   Fancy Hero
   ===================================================================== */
.fancy-hero{
  position: relative; min-height: 58vh;
  display:grid; align-items:center; overflow:hidden;
  background: radial-gradient(1000px 400px at 20% 10%, rgba(22,163,74,.10), transparent),
              radial-gradient(800px 360px at 80% 20%, rgba(225,29,72,.10), transparent),
              linear-gradient(180deg, #fff, #fafaf9);
}
.fancy-hero .hero-bg{
  position:absolute; inset:0;
  background-size:cover; background-position:center;
  transform: scale(1.05);
  filter: brightness(.7) contrast(1.05) saturate(1.05);
}
.fancy-hero .hero-overlay{
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.15), rgba(255,255,255,0));
  z-index:1;
}
.fancy-hero .hero-overlay.stronger{
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.35), rgba(0,0,0,.15));
}
.fancy-hero .hero-inner{
  position: relative; z-index: 2; color: #fff;
  padding: 3rem 1rem 4rem;
}
.akwaaba{
  display:inline-block; font-weight:800; letter-spacing:.5px;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  padding: .25rem .6rem; border:1px solid rgba(255,255,255,.5);
  border-radius:999px; background:rgba(255,255,255,.12); color:#fff;
  backdrop-filter: blur(2px);
}
.hero-title{
  margin:.6rem 0 .4rem;
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  font-weight: 900; letter-spacing:.2px; color:#fff;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.fancy-hero .lead{ max-width:60ch; color:#f3f4f6; font-size:1.1rem }
.hero-cta{ margin-top:.6rem }

/* =====================================================================
   Home Cards
   ===================================================================== */
.home-cards{
  display:grid; gap:1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: -2rem; /* pull up under hero a bit */
}
.card-header{
  display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:.5rem;
}
.card-header h2{ margin:0; font-size:1.15rem }
.small-link{ font-size:.9rem; color:var(--brand); text-decoration:none }
.small-link:hover{ text-decoration:underline }
.list-plain{ list-style:none; margin:0; padding:0 }
.list-plain li{ padding:.5rem 0; border-bottom:1px solid var(--border) }
.list-plain li:last-child{ border-bottom:0 }

/* Optional colorful card backgrounds (kept) */
.card-red{  background: linear-gradient(135deg, #fecaca, #fca5a5) }
.card-gold{ background: linear-gradient(135deg, #fde68a, #fbbf24) }
.card-green{background: linear-gradient(135deg, #bbf7d0, #86efac) }
.card-dark{ background: linear-gradient(135deg, #cbd5e1, #94a3b8) }

/* hover effect for home cards */
.home-cards .card{
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.home-cards .card:hover{
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

/* brand text helper */
.text-brand{ color: var(--brand); font-weight: 700 }

/* shared meta label (single definition) */
.list-meta{
  color: #111827;   /* bold black */
  font-weight: 600;
  font-size: .9rem;
}

/* =====================================================================
   Sermons master–detail
   ===================================================================== */
.sermons-layout{
  display:grid; gap:1rem; grid-template-columns:280px 1fr;
}
@media (max-width:900px){
  .sermons-layout{ grid-template-columns:1fr }
  .sermons-sidebar{ order:2 }
  .sermon-detail{ order:1 }
}
.sermons-sidebar .sidebar-inner{ max-height:70vh; overflow:auto; padding-right:.25rem }
.sermon-link{
  display:block; padding:.6rem .5rem; border-radius:8px;
  text-decoration:none; color:var(--text); border:1px solid transparent;
}
.sermon-link:hover{ background:var(--card); border-color:var(--border); text-decoration:none }
.sermon-link.active{ background:#fff7ed; border-color:#fdba74 }
.sermon-link-title{ color: var(--brand); font-weight:700 }
.sermon-link-meta{ color:#111827; font-weight:600; font-size:.9rem }
.sermon-detail header{ border-bottom:1px solid var(--border); padding-bottom:.35rem; margin-bottom:.5rem }
.sermon-body.clamp{ max-height:18rem; overflow:hidden; position:relative }
.sermon-body.clamp::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:3.2rem;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff);
}

/* =====================================================================
   Map
   ===================================================================== */
.map-embed{
  position:relative; width:100%; aspect-ratio:16/9;
  background:#e5e7eb; border-radius:12px; overflow:hidden; border:1px solid var(--border);
}
.map-embed iframe{ position:absolute; inset:0; width:100%; height:100%; border:0 }

/* =====================================================================
   Social Media
   ===================================================================== */
.social-list{
  list-style:none; padding:0; margin:.5rem 0 0 0;
  display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:.5rem .75rem;
}
.social-list li{ margin:0 }
.social-link{
  display:inline-flex; align-items:center; gap:.4rem;
  text-decoration:none; color:var(--text);
  padding:.4rem .6rem; border:1px solid var(--border);
  border-radius:10px; background:#fff;
}
.social-link:hover{ text-decoration:none; border-color:var(--brand); background:#fff1f2 }
.social-link .icon{ font-size:1.1rem; line-height:1 }

/* footer round icon variant */
.site-footer .social-list a{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:50%;
  background:#f8fafc; transition: background .2s ease, transform .2s ease;
}
.site-footer .social-list a:hover{ background:#e5e7eb; transform: scale(1.1) }

/* =====================================================================
   Media tiles (videos/posters)
   ===================================================================== */
.media-tile{ position: relative; display:block }
.media-tile img{
  width:100%;
  height:220px;                /* keep consistent with gallery thumbs */
  object-fit:cover;
  border-radius:10px;
  border:1px solid var(--border);
}

/* =====================================================================
   Admin media grids (photos + videos)
   ===================================================================== */
.admin-media-grid{
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.admin-media-item{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-media-thumb{
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  overflow: hidden;
}
.admin-media-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-media-badge{
  position: absolute;
  left: 8px; bottom: 8px;
  background: rgba(0,0,0,.65);
  color:#fff; font-size:.8rem; font-weight:700;
  padding: .2rem .45rem;
  border-radius: 999px;
}
.admin-media-body{
  padding: .5rem .6rem;
  display: grid;
  gap: .25rem;
}
.admin-media-title{
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.3;
}
.admin-media-meta{
  color: var(--muted);
  font-size: .85rem;
}
.admin-media-actions{
  display: flex;
  gap: .4rem;
  padding: .5rem .6rem .6rem;
}
.admin-media-actions .btn,
.admin-media-actions a{
  font-size: .85rem;
  padding: .35rem .55rem;
  border-radius: 8px;
}

/* =====================================================================
   Clamp helpers (truncate)
   ===================================================================== */
.truncate-1{
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
}
.truncate-2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Lightbox next/prev buttons */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #111827;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.9;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: #1f2937; }

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }