/*
Theme Name: Members Directory
Theme URI:
Description: A membership directory theme with custom post types for Members and Events, powered by ACF.
Version: 1.0.0
Author: Melissa Shephard
Text Domain: members-directory
*/

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Variables ─── */
:root {
  --rose: #C08B76;
  --rose-dark: #A97560;
  --rose-light: #D4A896;
  --brown: #5A3A2C;
  --brown-light: #7A5A4A;
  --cream: #F6EDE8;
  --cream-dark: #EDE4DE;
  --warm-white: #FBF7F4;
  --white: #ffffff;
  --taupe: #B8A99A;
  --taupe-light: #D5C9BD;
  --text: #4A3428;
  --text-light: #8A7568;
  --text-muted: #A99688;
  --shadow: 0 2px 16px rgba(90, 58, 44, 0.06);
  --shadow-hover: 0 12px 36px rgba(90, 58, 44, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1200px;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.7;
  background: var(--warm-white);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
  color: var(--brown);
}

a {
  color: var(--rose);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--rose-dark);
}

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

/* ─── Layout ─── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-main {
  min-height: calc(100vh - 160px);
}

/* ─── Header ─── */
.site-header {
  background: var(--white);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--cream-dark);
  box-shadow: 0 1px 8px rgba(90, 58, 44, 0.04);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown) !important;
  letter-spacing: 0.5px;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
}

.site-header nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  transition: all 0.2s;
}

.site-header nav a:hover,
.site-header nav .current-menu-item a {
  background: var(--rose);
  color: var(--white);
}

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, var(--cream), var(--cream-dark));
  color: var(--brown);
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(192, 139, 118, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(192, 139, 118, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--brown);
  position: relative;
  z-index: 1;
}

.hero h1 em {
  font-style: italic;
  color: var(--rose);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ─── Filter ─── */
.filter-bar {
  max-width: 480px;
  margin: 2.5rem auto;
  position: relative;
}

.filter-bar input {
  width: 100%;
  padding: 0.95rem 1.25rem 0.95rem 3rem;
  border: 1.5px solid var(--taupe-light);
  border-radius: 50px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.filter-bar input::placeholder {
  color: var(--text-muted);
}

.filter-bar input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(192, 139, 118, 0.15);
}

.filter-bar .search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--taupe);
  pointer-events: none;
}

.filter-bar .search-icon svg {
  width: 18px;
  height: 18px;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
  font-size: 1.05rem;
  display: none;
  font-family: var(--font-serif);
  font-style: italic;
}

/* ─── Member Grid ─── */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 1rem 0 4rem;
}

/* ─── Member Card ─── */
.member-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(213, 201, 189, 0.3);
}

.member-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.member-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--cream);
}

.member-card-body {
  padding: 1.5rem;
}

.member-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--brown);
}

.member-card-body .bio-excerpt {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-card-body .view-profile {
  display: inline-block;
  padding: 0.5rem 1.4rem;
  background: var(--rose);
  color: var(--white);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.2s;
}

.member-card-body .view-profile:hover {
  background: var(--rose-dark);
  color: var(--white);
  transform: translateY(-1px);
}

/* ─── Single Member Profile ─── */
.member-profile {
  max-width: 800px;
  margin: 3rem auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(213, 201, 189, 0.3);
}

.member-profile-header {
  text-align: center;
  padding: 3.5rem 2rem 2.5rem;
  background: linear-gradient(135deg, var(--brown), var(--brown-light));
  color: var(--white);
  position: relative;
}

.member-profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(192, 139, 118, 0.2) 0%, transparent 60%);
}

.member-profile-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.15);
  margin: 0 auto 1.5rem;
  background: var(--cream);
  position: relative;
  z-index: 1;
}

.member-profile-header h1 {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--white);
  position: relative;
  z-index: 1;
}

.member-profile-body {
  padding: 2.5rem;
}

.member-profile-body .bio {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 2rem;
}

.member-profile-body .bio p {
  margin-bottom: 1rem;
}

/* ─── Social Links (header) ─── */
.social-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding-top: 0.5rem;
  padding-bottom: 0.25rem;
  position: relative;
  z-index: 1;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  transition: background 0.2s, transform 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
  transform: translateY(-2px);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Social links (below bio) */
.social-links-alt {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.social-links-alt a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  background: var(--cream);
  border-radius: 50px;
  color: var(--brown);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid var(--cream-dark);
}

.social-links-alt a:hover {
  background: var(--rose);
  color: var(--white);
  border-color: var(--rose);
}

.social-links-alt a svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ─── Back Link ─── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 2rem 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--rose);
}

.back-link:hover {
  color: var(--rose-dark);
}

/* ─── Events ─── */
.events-list {
  max-width: 800px;
  margin: 3rem auto;
}

.event-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(213, 201, 189, 0.3);
  transition: box-shadow 0.2s;
}

.event-item:hover {
  box-shadow: var(--shadow-hover);
}

.event-item h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.event-item h2 a {
  color: var(--brown);
}

.event-item h2 a:hover {
  color: var(--rose);
}

.event-item .excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Single event */
.single-event-content {
  max-width: 800px;
  margin: 3rem auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem;
  border: 1px solid rgba(213, 201, 189, 0.3);
}

.single-event-content h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--brown);
}

/* ─── Default Content ─── */
.default-content {
  max-width: 800px;
  margin: 3rem auto;
}

.default-content article {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(213, 201, 189, 0.3);
}

.default-content article h2 {
  margin-bottom: 0.5rem;
}

.default-content article h2 a {
  color: var(--brown);
}

.default-content article h2 a:hover {
  color: var(--rose);
}

/* ─── Footer ─── */
.site-footer {
  background: var(--brown);
  color: rgba(255, 255, 255, 0.55);
  padding: 1.75rem 0;
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.3px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero {
    padding: 3.5rem 0;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .member-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
  }

  .member-profile-body {
    padding: 1.5rem;
  }

  .member-profile-header {
    padding: 2.5rem 1.5rem 2rem;
  }

  .site-header .container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-header nav ul {
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .member-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .member-profile-image {
    width: 140px;
    height: 140px;
  }

  .member-profile-header h1 {
    font-size: 1.75rem;
  }
}
