/* ====== Base layout for sticky footer ====== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
.page { min-height: 100%; display: flex; flex-direction: column; }
.page-content { flex: 1; }

/* ====== Theme tokens ====== */
:root{
  --text:#f5f7fb; --muted:#aab4c3;
  --brand:#1f7aec; --brand-ink:#0d3f84;
  --card:rgba(20,26,33,.85); --border:#2a3441; --chip:#1a2330;
  --radius:16px; --shadow:0 12px 28px rgba(0,0,0,.35);
}

/* ====== Global background + overlay ====== */
body{
  color: var(--text);
  background: url('/assets/adult-backlit-beach-1000445-1024x682.jpg') center 20% / cover no-repeat fixed;
  position: relative;
}
body::before{
  content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(1200px 800px at 70% 20%, rgba(24,32,40,.35), transparent 60%),
    linear-gradient(to bottom, rgba(11,14,18,.35), rgba(11,14,18,.65));
}
/* ensure content sits above overlay */
.page, .site-header, .site-footer { position: relative; z-index:1 }

/* ====== Container ====== */
.wrap{ max-width:1040px; margin:0 auto; padding:24px; }

/* ====== Sticky, translucent header ====== */
.site-header{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(15,20,26,.45);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-wrap{
  max-width: 1040px; margin: 0 auto; padding: 12px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
}
.nav-brand{font-weight:800; color:#f5f7fb; text-decoration:none;}
.nav-list{display:flex; gap:14px; align-items:center; margin:0; padding:0; list-style:none;}
.nav-list a{color:#aab4c3; text-decoration:none; padding:8px 10px; border-radius:999px; border:1px solid transparent;}
.nav-list a:hover{ color:#f5f7fb; border-color:rgba(255,255,255,.08); }
.nav-list a.active{ color:#fff; background:#1f7aec; border-color:#1f7aec; }
.nav-cta{ background:#1f7aec; color:#fff !important; border-color:#1f7aec !important; }
.nav-cta:hover{ background:#0d3f84 !important; }

/* ====== Footer (sticks to bottom on short pages) ====== */
.site-footer{
  border-top:1px solid rgba(255,255,255,.06);
  background: linear-gradient( to bottom, rgba(11,14,18,.35), rgba(11,14,18,.65) );
}
.footer-wrap{
  max-width:1040px; margin:0 auto; padding:24px;
  display:grid; gap:18px;
}
@media(min-width:860px){ .footer-wrap{ grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand{font-weight:800; color:#f5f7fb; text-decoration:none;}
.footer-muted{color:#aab4c3; font-size:.95rem; margin:.35rem 0 0}
.footer-col h4{margin:.2rem 0 .6rem; font-size:1rem; font-weight:700}
.footer-col a{color:#aab4c3; text-decoration:none; display:block; padding:.25rem 0; border-radius:8px;}
.footer-col a:hover{ color:#f5f7fb; background: rgba(255,255,255,.06); }
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.06);
  padding:14px 24px; color:#aab4c3; font-size:.92rem;
  display:flex; align-items:center; justify-content:center; gap:8px;
  max-width:1040px; margin:0 auto;
}

/* ====== Common UI bits ====== */
.btn{ padding:.6rem .9rem; border:1px solid var(--border); border-radius:999px; background:var(--chip); color:var(--text); cursor:pointer; }
.btn.primary{ background:var(--brand); border-color:var(--brand); color:#fff }
.btn.primary:hover{ background:var(--brand-ink) }
.card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:20px; display:flex; flex-direction:column; gap:12px; }

/* ====== Welcome page helpers ====== */
.hero{ margin:34px 0 8px }
.hero h1{ margin:0 0 .4rem 0; font-size:clamp(28px,4vw,44px); line-height:1.1 }
.hero p{ margin:0; color:var(--muted); font-size:1.05rem }
.cards{ display:grid; gap:18px; margin-top:20px }
@media(min-width:860px){ .cards{ grid-template-columns:1fr 1fr } }
.welcome-offset{ margin-top: clamp(24vh, 32vh, 40vh) }
@media (max-width:600px){ .welcome-offset{ margin-top: 22vh } }

/* ===== Search page (filters) ===== */
.filters{
  margin: .8rem auto 0;
  max-width: 720px;
  display: grid;
  gap: .6rem;
}
@media (min-width: 720px){
  .filters{ grid-template-columns: 3fr 4fr; align-items: center; }
}
.filters-left{
  display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center;
}
#agePref, #statePref{
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  min-width: 150px;
}
#agePref{ max-width: 160px; }
#statePref{ max-width: 240px; }

/* Search panel inside a card */
.search-panel { max-width: 860px; margin: 18px auto 8px; }

/* Search page layout */
.search-section { margin: 4vh auto 0; text-align: center; }
.search-row { display:flex; gap:.6rem; justify-content:center; flex-wrap:wrap; }
.search-row input[type="search"]{
  flex:1; min-width:260px; max-width:500px;
  padding:.7rem .9rem; border:1px solid var(--border);
  border-radius:999px; background:var(--chip); color:var(--text); font-size:1rem;
}
.search-section .meta { font-size:.9rem; color:var(--muted); margin-top:.6rem; min-height:1.2rem; }

/* Filters row */
.filters{ margin:.8rem auto 0; max-width:860px; display:grid; gap:.6rem; }
@media (min-width: 860px){ .filters{ grid-template-columns: 3fr 4fr; align-items:center; } }
.filters-left{ display:flex; gap:.6rem; flex-wrap:wrap; justify-content:center; }
#agePref, #statePref{
  padding:.55rem .8rem; border:1px solid var(--border);
  border-radius:10px; background:var(--chip); color:var(--text);
  min-width:150px;
}
#agePref{ max-width:160px; }
#statePref{ max-width:260px; }

/* Results grid */
.results{ display:grid; gap:18px; margin-top:1.2rem; }

/* Author banner + avatar size */
.author-banner{
  margin-top:.8rem; padding:.6rem .75rem;
  background: rgba(31,122,236,.14); border:1px solid var(--border);
  border-radius:12px; display:flex; align-items:center; gap:.6rem; justify-content:flex-end;
}
.author-banner img{
  width:40px; height:40px; border-radius:50%; object-fit:cover; border:1px solid var(--border);
}
.author-banner .text{ text-align:right; }
.author-banner .name{ font-weight:600; }
.author-banner .sub{ color:var(--muted); font-size:.9rem; }

/* Server-provided highlight (<mark>) */
mark{ background: rgba(255,230,130,.5); color:inherit; padding:0 2px; border-radius:3px; }

/* --- Filters: make inputs same smaller width + align the note to the left --- */
.filters { 
  grid-template-columns: auto 1fr;   /* inputs block + note beside it */
  align-items: center;
}
.filters-left { gap: .5rem; }
#agePref, #statePref{
  width: 140px;           /* same width for both */
  min-width: 140px;
  max-width: 140px;
  padding: .5rem .7rem;
}
.filters-right{ text-align: left; }  /* note sits to the right of inputs */
.filters-right .hint{ display: block; }

/* Mobile: stack nicely */
@media (max-width: 720px){
  .filters{ grid-template-columns: 1fr; }
  .filters-right{ text-align: center; }
}

/* --- Differentiate cards: bluer tone for RESULT cards, keep search card as-is --- */
:root{
  --search-card: rgba(20,26,33,.85);
  --result-card: rgba(22, 38, 64, .82);   /* bluer */
  --result-border:#1f3a5f;
}

.search-panel{ background: var(--search-card); }

.result-card{
  background: var(--result-card);
  border-color: var(--result-border);
}

/* optional: a touch more separation on result cards */
.result-card .when{ color: #91a6c4; }

/* Keyword chips */
.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.keywords .chip {
  background: #2c6ebd;
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}
/* Make the author name look like a link, not a button */
.author-banner .name button.author-link{
  all: unset;                /* strip native button styles (the white box) */
  display: inline;
  cursor: pointer;
  color: #cfe2ff;
  text-decoration: underline;
}
.author-banner .name button.author-link:hover{
  color: #ffffff;
}
.author-banner .name button.author-link:focus{
  outline: 2px solid #1f7aec;
  outline-offset: 2px;
  border-radius: 4px;
}
/* Continue reading link */
.continue-link {
  margin-top: 0.4rem;
  font-size: 0.85rem;     /* same as .when */
  color: #666;            /* neutral gray, like your meta line */
}

.continue-link a {
  color: inherit;         /* use same gray instead of purple */
  text-decoration: none;  /* remove default underline */
}

.continue-link a:hover {
  text-decoration: underline;
  color: #333;            /* slightly darker on hover */
}

/* --- Chips ---------------------------------------------------- */
.chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:.6rem; }
.chip{ font-size:.78rem; padding:.18rem .6rem; border-radius:999px; border:1px solid var(--border); background:var(--chip); color:var(--text); }
.chip.match{ background:#2c6ebd; border-color:#2c6ebd; color:#fff; }

/* Preserve newlines in author bio */
#profilePopover .pp-bio { white-space: pre-wrap; }

/* Author popover - larger, higher visual weight */
#profilePopover{
  position: absolute;
  z-index: 2000;                 /* above cards */
  display: none;
  min-width: 320px;
  max-width: 420px;
  padding: 16px;
  background: rgba(18,24,32,.98);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(0,0,0,.55);
}

/* Bigger avatar + roomy layout */
#profilePopover .pp-body{
  display: grid;
  grid-template-columns: 100px 1fr; /* bigger avatar column */
  gap: 14px;
  align-items: center;
}
#profilePopover .pp-avatar{
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.14);
}
#profilePopover .pp-name{ margin:0; font-weight: 800; font-size: 1.15rem; }
#profilePopover .pp-meta{ color: var(--muted); font-size: .95rem; margin: .25rem 0 .2rem; }
#profilePopover .pp-bio { margin: .4rem 0 0; color: #e9eef7; font-size: .98rem; line-height: 1.4; }

/* Keep author name looking like a link (no white box) */
.author-banner .name button.author-link{
  all: unset; cursor: pointer; color: #cfe2ff; text-decoration: underline;
}
.author-banner .name button.author-link:hover{ color:#fff; }
.author-banner .name button.author-link:focus{ outline:2px solid #1f7aec; outline-offset:2px; border-radius:4px; }

/* Layout skeleton: header | main (grows) | footer */
.page{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-content{
  flex: 1;                   /* main fills leftover height */
  display: block;
}
.site-footer{
  margin-top: 0;             /* let footer sit right after main */
}

/* HERO section on index only */
.hero{
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(32px, 6vh, 72px) 24px 0;
}
.hero h1{ margin: 0 0 .4rem; }
.hero p.lead{ margin: 0 0 1.2rem; color: var(--muted); }

/* Card row under the hero text */
.hero-cards{
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: clamp(20px, 8vh, 60px);   /* << moves cards UP/DOWN; tweak middle value */
  margin-bottom: 28px;
}
@media (min-width: 900px){
  .hero-cards{ grid-template-columns: 1fr 1fr; }
}

/* Cards themselves (reuse your existing .card styles) */
.hero-cards .card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
/* ====== Footer refinements ====== */
.site-footer {
  padding-top: 32px;         /* breathing room above footer */
}

.footer-wrap {
  padding: 20px;             /* slightly tighter inside */
}

.footer-muted {
  font-size: 0.85rem;        /* smaller tagline */
  line-height: 1.4;
}

.footer-col h4 {
  font-size: 0.9rem;         /* smaller headings */
}

.footer-col a {
  font-size: 0.85rem;        /* smaller links */
}

.footer-bottom {
  font-size: 0.8rem;         /* smaller copyright line */
  padding: 10px 20px;
}

/* Mobile-friendly footer layout */
@media (max-width: 600px) {
  .footer-wrap {
    text-align: center;      /* center all footer text/links */
    grid-template-columns: 1fr; /* stack cols instead of side-by-side */
  }
  .footer-col h4 {
    margin-top: 1rem;
  }
  .footer-bottom {
    flex-direction: column;  /* copyright + extras stack */
    gap: 6px;
    text-align: center;
  }
}
/* Contact form layout */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-form label {
  font-weight: 600;
  margin-bottom: .3rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--chip);
  color: var(--text);
  font-size: 1rem;
}
.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}
.contact-form .hint {
  margin-top: .3rem;
  font-size: .85rem;
  color: var(--muted);
}
/* Inline notices used on contact/prayer cards */
.notice{
  padding:.7rem .9rem;
  border:1px solid rgba(255,255,255,.14);
  border-radius:10px;
  background: rgba(18,24,32,.92);
  margin: .6rem 0 .4rem;
}
.notice.ok{ background:#0f2a1f; border-color:#1d6b48; color:#c8f3da; }
.notice.err{ background:#2a1414; border-color:#6b1d1d; color:#ffd4d4; }
/* Author card */
.author-card {
  margin-top: 1.2rem;
  background: rgba(31,122,236,.14);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}

.author-card h4 {
  margin: 0 0 .6rem;
  color: var(--muted);        /* lighter grey */
  font-size: 1rem;
}

/* Grid layout for avatar + info */
.author-body {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: start;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.author-bio {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
}

.author-name {
  font-weight: 600;
}

.author-meta {
  font-size: .9rem;
  color: var(--muted);
}

