/* Hope Beyond Measure — brand styles (see REQUIREMENTS.md §5) */

:root {
  --navy: #002846;
  --sky: #5EB2F2;
  --bright: #0099FF;
  --pale-blue: #E5F4FF;
  --pale-blue-2: #BFEDFF;
  --cream: #F9F4F1;
  --cream-2: #F9EAD8;
  --sand: #D7C9B7;
  --gray: #636A70;
  --white: #FFFFFF;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(0, 40, 70, 0.10);
  --shadow-soft: 0 2px 10px rgba(0, 40, 70, 0.07);
  --font-heading: 'General Sans', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'PT Serif', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray);
  background: var(--white);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
a { color: var(--bright); }
p { margin: 0 0 1em; }
small { color: var(--gray); font-weight: 400; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container.narrow, .narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--gray); opacity: 0.85; font-size: 0.92rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pale-blue);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.wordmark {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.wordmark-logo {
  height: 64px;
  width: auto;
  display: block;
}
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav-link:hover { background: var(--pale-blue); }
.nav-admin { color: var(--bright); }
.nav-button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.inline-form { display: inline; }

/* ---------- Sections ---------- */

.section { padding: 56px 0; }
.section-blue { background: var(--pale-blue); }
.section-cream { background: var(--cream); }

.hero {
  background: linear-gradient(180deg, var(--white) 0%, var(--pale-blue) 100%);
  padding: 72px 0 56px;
  text-align: center;
}
.hero-sub {
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.1rem;
}

.serif-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0 0 1em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 22px;
  border-radius: 0 20px 20px 20px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--bright); transform: translateY(-1px); }
.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--pale-blue-2);
}
.btn-secondary:hover { background: var(--pale-blue); }
.btn-danger { background: #fdecec; color: #b3261e; }
.btn-danger:hover { background: #f9d7d5; }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }
.btn-tiny { padding: 4px 9px; font-size: 0.78rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Profile cards (dashboard) ---------- */

.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 28px;
}
.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--navy);
}
.filter-bar select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--pale-blue-2);
  background: var(--white);
  color: var(--navy);
  min-width: 170px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
}
.profile-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-photo { aspect-ratio: 4 / 5; background: var(--pale-blue); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--pale-blue);
  border-radius: 0;
}
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body h3 { margin: 0; }
.card-location { margin: 0; font-size: 0.9rem; }
.card-dream {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--navy);
}
.card-cta { margin-top: auto; align-self: flex-start; margin-top: 14px; }

.empty-state {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 56px 24px;
  box-shadow: var(--shadow-soft);
}

/* ---------- Profile page ---------- */

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
}
.back-link:hover { color: var(--bright); }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 820px) {
  .profile-layout { grid-template-columns: 1fr; gap: 28px; }
}

.gallery-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--pale-blue);
}
.gallery-main img { width: 100%; display: block; aspect-ratio: 4 / 5; object-fit: cover; }
.gallery-placeholder { border-radius: var(--radius); aspect-ratio: 4 / 5; }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2.5px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: none;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active { border-color: var(--sky); }

.profile-details .age { font-weight: 500; color: var(--sky); }
.profile-location { font-size: 1rem; margin-top: -8px; }
.profile-dream {
  margin: 20px 0;
  padding: 18px 22px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--sand);
}
.detail-block { margin-bottom: 18px; }
.detail-block h2 { font-size: 1.05rem; margin-bottom: 0.25em; }
.detail-block p { white-space: pre-line; }

.sponsor-box {
  margin-top: 28px;
  background: var(--pale-blue);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.sponsor-box h2 { font-size: 1.15rem; }

/* ---------- Flash messages & badges ---------- */

.flash {
  margin: 16px 0;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash-success { background: #e5f7ec; color: #14532d; }
.flash-error { background: #fdecec; color: #b3261e; }
.flash-info { background: var(--cream-2); color: var(--navy); }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 6px;
}
.badge-published { background: #e5f7ec; color: #14532d; }
.badge-draft { background: var(--cream-2); color: var(--navy); }
.badge-warn { background: #fdecec; color: #b3261e; }
.badge-cover {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--sky);
  color: var(--white);
}

/* ---------- Forms ---------- */

.stacked-form { display: flex; flex-direction: column; gap: 16px; }
.stacked-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
}
.stacked-form input[type="text"],
.stacked-form input[type="email"],
.stacked-form input[type="password"],
.stacked-form input[type="date"],
.stacked-form input[type="number"],
.stacked-form input[type="file"],
.stacked-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 14px;
  border: 1.5px solid var(--pale-blue-2);
  border-radius: var(--radius-sm);
  color: var(--navy);
  background: var(--white);
}
.stacked-form input:focus, .stacked-form textarea:focus {
  outline: 2px solid var(--sky);
  outline-offset: 1px;
  border-color: var(--sky);
}
.stacked-form textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.req { color: #b3261e; }

fieldset {
  border: 1.5px solid var(--pale-blue-2);
  border-radius: var(--radius);
  padding: 20px 22px 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--white);
}
legend {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--navy);
  padding: 0 8px;
}
.checkbox-label { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; }
.checkbox-label input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--sky); }
.checkbox-label small { display: block; margin-top: 2px; }
.form-actions { display: flex; gap: 12px; align-items: center; }

.auth-card {
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
}
.auth-alt { margin-top: 18px; font-size: 0.92rem; }

/* ---------- Admin ---------- */

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-toolbar h1 { margin: 0; }
.admin-toolbar .back-link { margin-bottom: 0; }
.admin-toolbar-actions { display: flex; gap: 10px; }

.admin-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1.5px solid var(--pale-blue);
  border-radius: var(--radius);
  padding: 12px 16px;
  flex-wrap: wrap;
}
.admin-row-photo { width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.admin-row-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-row-photo .card-photo-placeholder { min-height: 64px; font-size: 1.5rem; border-radius: var(--radius-sm); }
.admin-row-info { flex: 1; min-width: 200px; }
.admin-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.photos-fieldset { margin-top: 28px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.photo-tile {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--pale-blue-2);
  background: var(--pale-blue);
}
.photo-tile > img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-actions {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--white);
  justify-content: center;
  flex-wrap: wrap;
}
.upload-form { margin-top: 6px; }

.publish-panel {
  margin-top: 28px;
  background: var(--pale-blue);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.publish-panel p { margin-bottom: 10px; }

.danger-zone {
  margin-top: 16px;
  background: #fdecec;
  border-radius: var(--radius);
  padding: 20px 24px;
}
.danger-zone p { margin-bottom: 10px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.85);
  margin-top: 48px;
  padding: 44px 0 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo-icon {
  height: 32px;
  width: auto;
  display: block;
}
.footer-tagline { font-family: var(--font-serif); font-style: italic; margin: 6px 0 0; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.footer-nav a:hover { color: var(--sky); }
.footer-note { padding-top: 18px; font-size: 0.82rem; opacity: 0.7; }
