@font-face {
  font-family: 'TAN Ashford';
  src: url('../assets/fonts/tan_-_ashford-webfont.woff2') format('woff2'),
       url('../assets/fonts/tan_-_ashford-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --orange: #ef8558;
  --navy: #2d3a4e;
  --white: #ffffff;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #555555;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --heading-font: 'TAN Ashford', Georgia, serif;
  --heading-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --orange-text: #b85a2c;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  color: var(--navy);
  line-height: 1.6;
  background-color: var(--white);
}

h1, h2, h3, h4 {
  font-family: var(--heading-sans);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

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

a {
  color: var(--orange-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================
   ACCESSIBILITY
   ============================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 12px 24px;
  background-color: var(--navy);
  color: var(--white);
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

*:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* ============================
   NAVIGATION
   ============================ */

.site-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--medium-gray);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s, border-color 0.3s;
}

/* Transparent header on homepage before scroll */
.site-header.transparent {
  position: fixed;
  left: 0;
  right: 0;
  background-color: transparent;
  border-bottom-color: transparent;
}

.site-header.transparent .nav-logo {
  opacity: 0;
  pointer-events: none;
}

.site-header.transparent .nav-links a {
  color: var(--navy);
}

.site-header.transparent .nav-toggle span {
  background-color: var(--navy);
}

/* Scrolled state — white background, logo visible */
.site-header.transparent.scrolled {
  background-color: var(--white);
  border-bottom-color: var(--medium-gray);
}

.site-header.transparent.scrolled .nav-logo {
  opacity: 1;
  pointer-events: auto;
}

.nav-container {
  width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-family: var(--heading-font);
  font-size: 1.125rem;
  font-weight: normal;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  transition: opacity 0.3s;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--orange-text);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  border-bottom-color: var(--orange);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--navy);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================
   HERO
   ============================ */

.hero {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--orange);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-svg {
  max-width: 75%;
  max-height: 75%;
  display: block;
  margin-top: auto;
}

.hero-svg .draw-path {
  fill: #333f4e;
}

.scroll-down {
  margin-top: auto;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  text-decoration: none;
  animation: bounce 2s infinite;
}

.scroll-down:hover {
  text-decoration: none;
  color: var(--navy);
  opacity: 0.7;
}

.scroll-down-text {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-down-arrow {
  display: flex;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

/* ============================
   PAGE HEADER (Interior Pages)
   ============================ */

.page-header {
  background-color: var(--orange);
  padding: 60px 24px;
  text-align: center;
}

.page-header h1 {
  font-family: var(--heading-font);
  font-weight: normal;
  color: var(--navy);
  font-size: 3rem;
  letter-spacing: -0.02em;
}

/* ============================
   CONTENT SECTIONS
   ============================ */

.section {
  padding: 80px 24px;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--navy);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 1.0625rem;
  color: var(--dark-gray);
  max-width: 1000px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================
   BUTTONS
   ============================ */

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  border: none;
  font-family: var(--font-stack);
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background-color: var(--orange);
  color: var(--navy);
}

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

.btn--outline {
  background-color: transparent;
  color: var(--orange-text);
  border: 2px solid var(--orange-text);
}

.btn--outline:hover {
  background-color: var(--orange-text);
  color: var(--white);
}

.btn--back {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--white);
  color: var(--orange-text);
  border: 2px solid var(--orange-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn--back:hover {
  background-color: var(--orange-text);
  color: var(--white);
}

.btn--back svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================
   VIDEO
   ============================ */

.video-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 40px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================
   LOGO GRID (Homepage Tier 2)
   ============================ */

.logo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px 48px;
  margin-top: 48px;
}

.logo-grid img {
  height: 120px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.logo-grid img:nth-child(-n+5) {
  width: calc((100% - 4 * 48px) / 5);
}

.logo-grid img:nth-child(n+6) {
  width: calc((100% - 5 * 48px) / 6);
}

/* ============================
   FIND A CHURCH - MAP
   ============================ */

.map-container {
  width: 100%;
  height: 400px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 40px;
  border: 1px solid var(--medium-gray);
  position: relative;
  z-index: 1;
}

#church-map {
  width: 100%;
  height: 100%;
}

/* ============================
   FIND A CHURCH - FILTERS
   ============================ */

.filters {
  margin-bottom: 40px;
  padding: 24px;
  background-color: var(--light-gray);
  border-radius: 4px;
}

.filters h3,
.filters .h3-style {
  font-size: 1.375rem;
  margin-bottom: 16px;
  color: var(--navy);
}

.filter-groups {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

fieldset.filter-group {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

fieldset.filter-group legend {
  padding: 0;
}

.filter-group h4 {
  font-family: var(--font-stack);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark-gray);
  margin-bottom: 8px;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--navy);
  cursor: pointer;
  padding: 4px 0;
}

.filter-group input[type="checkbox"] {
  accent-color: var(--orange);
  width: 16px;
  height: 16px;
}

/* ============================
   NO RESULTS MESSAGE
   ============================ */

.no-results {
  text-align: center;
  font-size: 1.0625rem;
  color: var(--dark-gray);
  padding: 48px 24px;
}

/* ============================
   DIRECTORY LISTINGS
   ============================ */

.directory-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.church-card {
  display: flex;
  gap: 24px;
  padding: 24px;
  background-color: var(--white);
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  align-items: flex-start;
}

.church-card-logo {
  width: 150px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.church-card-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.church-card-info {
  flex: 1;
}

.church-card-info h3 {
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.church-card-info .church-address {
  font-size: 0.875rem;
  color: var(--dark-gray);
  margin-bottom: 4px;
}

.church-card-info .church-website {
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.church-card-info .church-description {
  font-size: 0.9375rem;
  color: var(--navy);
  margin-bottom: 16px;
  line-height: 1.6;
}

.church-card-info .btn {
  padding: 10px 24px;
  font-size: 0.875rem;
}

/* ============================
   PROFILE PAGE
   ============================ */

.profile-content {
  max-width: 800px;
  margin: 0 auto;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  padding: 24px;
}

.profile-logo {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.profile-details h2 {
  font-size: 2.25rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.profile-details .pastor-name {
  font-size: 1rem;
  color: var(--dark-gray);
  margin-bottom: 4px;
}

.profile-details .church-address {
  font-size: 0.9375rem;
  color: var(--dark-gray);
  margin-bottom: 4px;
}

.profile-details .church-website a {
  font-size: 0.9375rem;
}

.profile-body {
  margin-bottom: 40px;
}

.profile-body .profile-header {
  margin-bottom: 16px;
}

.profile-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--navy);
}

.profile-headshot {
  float: right;
  width: 280px;
  margin: 0 0 16px 24px;
}

.profile-headshot img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.profile-section {
  margin-bottom: 40px;
}

.profile-section h3 {
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 16px;
}

.profile-section p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--navy);
}

.profile-photos {
  columns: 2 300px;
  column-gap: 16px;
  margin-bottom: 40px;
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 16px;
  border: none;
  background: none;
  cursor: pointer;
  break-inside: avoid;
  position: relative;
}

.lightbox-trigger::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E") center / 40px no-repeat;
  opacity: 0;
  transition: opacity 0.2s;
}

.lightbox-trigger:hover::after {
  opacity: 1;
}

.lightbox-trigger:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
  border-radius: 4px;
}

.profile-photos img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.pastor-headshot {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 24px;
}

/* ============================
   ABOUT PAGE
   ============================ */

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: 2.25rem;
  color: var(--navy);
  margin-bottom: 24px;
}

.about-content p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--navy);
  margin-bottom: 24px;
}

.about-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.about-photos img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 4px;
}

/* ============================
   JOIN / FORM
   ============================ */

.join-content {
  max-width: 700px;
  margin: 0 auto;
}

.join-content h2 {
  font-size: 2.25rem;
  color: var(--navy);
  margin-bottom: 16px;
}

.join-content p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--navy);
  margin-bottom: 24px;
}

.join-content a {
  word-break: break-all;
}

.join-form {
  margin-top: 40px;
}

.join-form h3 {
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: var(--font-stack);
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  color: var(--navy);
  background-color: var(--white);
  transition: border-color 0.2s;
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
  border-color: var(--orange);
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.form-message {
  padding: 16px 20px;
  border-radius: 4px;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.form-message--success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.form-message--error {
  background-color: #fbe9e7;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ============================
   FOOTER
   ============================ */

.site-footer {
  background-color: var(--navy);
  color: var(--white);
  padding: 48px 24px 32px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-logo {
  display: block;
  text-decoration: none;
}

.footer-logo img {
  height: 120px;
  width: auto;
}

.footer-logo:hover {
  opacity: 0.8;
}

.footer-nav {
  display: flex;
  gap: 32px;
  list-style: none;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-nav a:hover {
  color: var(--white);
  text-decoration: none;
}

.site-footer p {
  font-size: 0.875rem;
  opacity: 0.5;
  margin-top: 8px;
}

/* ============================
   LIGHTBOX
   ============================ */

.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 300;
  justify-content: center;
  align-items: center;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  padding: 8px 16px;
  line-height: 1;
  z-index: 301;
}

.lightbox-close:hover {
  color: var(--orange);
}

.lightbox-close:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background-color: var(--white);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--medium-gray);
    padding: 16px 24px;
  }

  .site-header.transparent .nav-links a {
    color: var(--navy);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 0;
    border-bottom: none;
  }

  .section {
    padding: 48px 16px;
  }

  .page-header {
    padding: 40px 16px;
  }

  .page-header h1 {
    font-size: 2.25rem;
  }

  .section-header h2 {
    font-size: 1.875rem;
  }

  .filter-groups {
    flex-direction: column;
    gap: 24px;
  }

  .church-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .church-card-info .btn {
    width: 100%;
    text-align: center;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-headshot {
    float: none;
    width: 100%;
    margin: 0 0 16px 0;
  }

  .profile-photos {
    columns: 1;
  }

  .about-photos {
    grid-template-columns: 1fr;
  }

  .logo-grid {
    gap: 24px 16px;
  }

  .logo-grid img,
  .logo-grid img:nth-child(-n+5),
  .logo-grid img:nth-child(n+6) {
    width: calc(50% - 8px);
    height: 80px;
  }

  .footer-nav {
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
  }
}
