/* ========================================
   Sober Companions Design System
   Clean production-ready stylesheet
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
  --navy: #061d35;
  --navy-light: #173f69;
  --navy-soft: #0c2c4c;

  --cream: #d9c8ae;
  --cream-light: #f4efe6;
  --cream-muted: #efe6d9;

  --white: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e7e1d7;

  --success: #16a34a;
  --danger: #dc2626;

  --shadow-sm: 0 4px 12px rgba(6, 29, 53, 0.06);
  --shadow-md: 0 12px 30px rgba(6, 29, 53, 0.10);
  --shadow-lg: 0 24px 80px rgba(6, 29, 53, 0.25);

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;

  --container: 1160px;
}

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--cream-light);
  color: var(--text);
  line-height: 1.7;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

code {
  background: var(--cream-muted);
  color: var(--navy);
  padding: 2px 7px;
  border-radius: 6px;
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.1;
}

p {
  margin-bottom: 14px;
}

.eyebrow {
  color: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--navy-light);
}

.lead {
  color: #eef3f7;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.22rem;
  line-height: 1.75;
  max-width: 720px;
  margin-bottom: 32px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 5vw;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 50%;
}

.brand strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand small {
  display: block;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

.nav a {
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  color: var(--navy-light);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.menu-button {
  display: none;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Layout ---------- */
.section,
.page {
  padding: 64px 8vw;
}

.content {
  max-width: var(--container);
  margin: 0 auto;
}

.content.narrow {
  max-width: 760px;
}

.section.cream {
  background: var(--cream-light);
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading.center {
  text-align: center;
}

.section-heading h1,
.section-heading h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin-bottom: 14px;
}

.section-heading p {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 82vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 44px;
  padding: 72px 8vw;
  background:
    radial-gradient(circle at 78% 32%, rgba(217, 200, 174, 0.28), transparent 24rem),
    linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: var(--white);
}

/* Important: keeps hero headline white even with global h1 styles */
.hero h1,
.hero h2,
.hero h3,
.hero p,
.hero .lead {
  color: var(--white) !important;
}

.hero-copy h1,
.hero h1 {
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.hero-logo-card {
  background: rgba(255, 255, 255, 0.96);
  color: var(--navy);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.hero-logo-card img {
  width: min(100%, 360px);
  border-radius: 28px;
  margin: 0 auto 18px;
}

.hero-logo-card h2 {
  color: var(--navy) !important;
  font-size: 1.7rem;
  margin-bottom: 10px;
}

.hero-logo-card p {
  color: var(--muted) !important;
  font-family: Arial, Helvetica, sans-serif;
}

/* ---------- Buttons ---------- */
.actions,
.search-form,
.directory-search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 22px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.98rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.button.primary {
  background: var(--navy);
  color: var(--white);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--white);
}

.button.light {
  background: var(--white);
  color: var(--navy);
  border-color: var(--border);
}

.button.danger {
  background: var(--danger);
  color: var(--white);
}

.button.full {
  width: 100%;
}

.hero .button.primary {
  background: var(--cream);
  color: var(--navy);
}

.hero .button.secondary:hover {
  background: rgba(255, 255, 255, 0.10);
}

/* ---------- Split Feature Section ---------- */
.split {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 48px;
  background: var(--white);
}

.split h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.feature-list {
  display: grid;
  gap: 18px;
}

.feature-list article {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: var(--shadow-md);
}

.feature-list h3 {
  margin-bottom: 10px;
}

.feature-list p {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
}

/* ---------- Cards ---------- */
.profile-grid,
.service-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 22px;
}

.service-grid,
.resource-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.profile-card,
.service-card,
.message-card,
.contact-form,
.notice,
.cta-panel,
.admin-stats article,
.profile-detail-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: var(--shadow-md);
}

.profile-card,
.service-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-card:hover,
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.profile-card h2,
.profile-card h3,
.service-card h2,
.message-card h2,
.message-card h3,
.cta-panel h2 {
  margin-bottom: 10px;
}

.profile-card p,
.service-card p,
.message-card p,
.cta-panel p {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
}

.profile-photo {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--cream-light);
  margin-bottom: 16px;
}

.role {
  color: var(--navy-light) !important;
  font-weight: 900;
}

/* ---------- Profile Detail ---------- */
.profile-detail-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
}

.profile-detail-photo {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 24px;
}

.profile-detail-card p {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
}

.profile-location {
  color: var(--navy);
  font-weight: 900;
}

/* ---------- Tags ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tags span {
  background: var(--cream-light);
  border: 1px solid var(--border);
  color: var(--navy);
  border-radius: 999px;
  padding: 7px 11px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
}

.text-link {
  color: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
}

/* ---------- Forms ---------- */
.search-form,
.directory-search {
  margin-bottom: 28px;
}

.search-form input,
.directory-search input,
.directory-search select,
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  background: var(--white);
  border: 1px solid #d4c8b8;
  border-radius: 14px;
  padding: 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
}

.search-form input,
.directory-search input,
.directory-search select {
  flex: 1;
  min-width: 210px;
}

.contact-form {
  display: grid;
  gap: 18px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
}

.contact-form small {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- Notices ---------- */
.notice {
  margin-bottom: 18px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--navy);
}

.notice.success {
  background: #edf8f1;
  border-color: #b8e2c8;
  color: var(--success);
}

.notice.error {
  background: #fff0f0;
  border-color: #e5b0b0;
  color: var(--danger);
}

/* ---------- Admin ---------- */
.admin-actions {
  margin-bottom: 20px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.admin-stats strong {
  display: block;
  color: var(--navy);
  font-size: 2.8rem;
}

.admin-stats span {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
}

.message-list {
  display: grid;
  gap: 18px;
  margin: 20px 0 40px;
}

/* ---------- CTA ---------- */
.cta-panel {
  margin-top: 28px;
  background: var(--navy);
  color: var(--white);
}

.cta-panel h2,
.cta-panel p {
  color: var(--white);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 42px 24px;
}

.site-footer img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 50%;
  margin: 0 auto 12px;
}

.site-footer p {
  color: #e8edf2;
  font-family: Arial, Helvetica, sans-serif;
}

.footer-note {
  margin-top: 16px;
  opacity: 0.78;
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero,
  .split,
  .profile-detail-card {
    grid-template-columns: 1fr;
  }

  .hero {
    text-align: center;
  }

  .actions {
    justify-content: center;
  }

  .profile-grid,
  .service-grid,
  .resource-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .menu-button {
    display: block;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 12px;
  }

  .nav.open {
    display: flex;
  }

  .brand small {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand strong {
    font-size: 0.95rem;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }

  .hero,
  .section,
  .page {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero-copy h1,
  .hero h1 {
    font-size: clamp(2.7rem, 14vw, 4.5rem);
  }

  .hero-logo-card {
    padding: 24px;
  }
}