/* Responsive Google Maps iframe */
.responsive-map {
  width: 100%;
  height: 500px;
  display: block;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .responsive-map {
    height: 300px;
  }
}
/* CSS Variables */
:root {
  --color-primary: #0369a1; /* sky-700 */
  --color-primary-dark: #0c4a6e; /* sky-900 */
  --color-text: #44403c; /* stone-700 */
  --color-text-light: #78716c; /* stone-500 */
  --color-bg: #f5f5f4; /* stone-100 */
  --color-bg-light: #fafaf9; /* stone-50 */
  --color-white: #ffffff;
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Lora', serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: #44403c; /* Adjust text color for better contrast */
  background-image: url('images/wrapperbg.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  line-height: 1.6;
}

/* On mobile, the background image will not be fixed
 as there are issues with this in mobile browsers */
@media (max-width: 600px) {
  body {
    background-attachment: scroll;
    background-repeat: repeat;
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* 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-width: 0;
}

/* Header */
.site-header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border-bottom: 1px solid #e7e5e4; /* stone-200 */
}

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

.header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.church-name,
.church-name-english {
  text-align: left;
}

.church-name a {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.church-name-english {
  font-size: 0.95rem;
  color: var(--color-text-light);
  font-family: var(--font-serif);
  margin-top: 0.2em;
  margin-bottom: 0.5em;
  letter-spacing: 0.01em;
}

/* Navigation */
.nav-desktop { display: none; }
.nav-desktop ul { list-style: none; display: flex; gap: 2rem; }
.nav-desktop a {
  text-decoration: none;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.3s ease;
  padding: 0.25rem 0;
}
.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}

/* Mobile Menu Button */
.menu-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile Navigation */
.nav-mobile {
  visibility: hidden;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--color-white);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out, visibility 0.3s;
  z-index: 101;
  background-color: rgba(255, 255, 255, 0.8); /* Glass effect */
  backdrop-filter: blur(10px);
}
.nav-mobile.is-open {
  transform: translateX(0);
  visibility: visible;
}
.menu-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-mobile ul {
  list-style: none;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.nav-mobile li { margin-bottom: 2.5rem; }
.nav-mobile a {
  font-family: var(--font-serif);
  font-size: 2rem;
  text-decoration: none;
  color: var(--color-text);
}
.nav-mobile a.active { color: var(--color-primary); }

.icon { width: 2rem; height: 2rem; color: var(--color-text); }

/* Main Content & Sections */
main { flex-grow: 1; }
section { padding: 4rem 0; }
.section-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  text-align: center;
  margin-bottom: 3rem;
}

/* Hero Section (Home) */
.hero {
  background-color: rgba(255, 255, 255, 0.6); /* Glass effect */
  backdrop-filter: blur(10px);
  color: var(--color-primary-dark);
  text-align: center;
  padding: 5rem 0;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero .subtitle { font-size: 1.25rem; max-width: 600px; margin: 0 auto 2rem; opacity: 0.9; }
.service-details {
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}
.service-details h2 { font-family: var(--font-serif); font-size: 1.5rem; margin-bottom: 1.5rem; }
.service-times { display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.service-times h3 { font-weight: 600; }
.hero .address { font-size: 0.9rem; opacity: 0.9; }

/* Welcome Section */
.welcome-section {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.6); /* Glass effect */
  backdrop-filter: blur(8px);
  padding: 2rem;
  border-radius: 8px;
}
.welcome-section p { 
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-light);
  text-align: left;
}

.text-indent p {
  /* Indent paragraphs in standard Chinese style */
  text-indent: 2.4rem;
}

/* Programs Section */
.programs-container {
  max-width: 1000px; /* Limits items to max 3 per row */
}
.programs-section { background-color: var(--color-bg); }
.programs-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}
.program-card {
  background-color: rgba(255, 255, 255, 0.6); /* Glass effect */
  backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.program-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); }
.program-card .time { font-size: 0.875rem; font-weight: 600; color: var(--color-primary); }
.program-card h3 { font-family: var(--font-serif); font-size: 1.25rem; margin: 0.5rem 0; color: var(--color-primary-dark); }
.program-card p { color: var(--color-text-light); font-size: 0.95rem; }

/* Location Section */
.location-grid {
  display: block;
}
.location-text {
  background-color: rgba(255, 255, 255, 0.6); /* Glass effect */
  backdrop-filter: blur(8px);
  padding: 2rem;
  border-radius: 8px;
}
.location-text h3 { font-family: var(--font-serif); font-size: 1.75rem; color: var(--color-primary-dark); margin-bottom: 1rem; }
.location-text p { color: var(--color-text-light); margin-bottom: 1rem; }
.map-placeholder {
  width: 100%;
  height: 320px;
  background-color: #e7e5e4; /* stone-200 */
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  color: var(--color-text-light);
}
.map-image {
  width: 100%;
  max-width: 1000px;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  margin: 1.5rem auto 0 auto;
  position: static;
  left: unset;
  right: unset;
  transform: none;
}

@media (max-width: 1000px) {
  .map-image {
    width: 100%;
    max-width: 100%;
    left: 0;
    transform: none;
  }
}

/* Page-specific Content (History, Contact) */
.page-content { max-width: 800px; margin: 0 auto 3rem auto; text-align: center; }
.page-content h1 { font-family: var(--font-serif); font-size: 2.5rem; color: var(--color-primary-dark); margin-bottom: 1.5rem; }
.page-content p { font-size: 1.125rem; line-height: 1.8; color: var(--color-text-light); margin-bottom: 1rem; }
.page-content img { width: 100%; height: auto; margin-top: 2rem; border-radius: 8px; box-shadow: 0 8px 15px rgba(0,0,0,0.1); }

/* Refactor and apply glass effect for history page */
.page-content {
  background-color: rgba(255, 255, 255, 0.8); /* Glass effect */
  backdrop-filter: blur(8px);
  padding: 2rem;
  border-radius: 8px;
}

.page-content.contact-content {
  margin: 0 auto 1rem auto;
}

.contact-main section {
  padding: 0.5rem;
}

/* History Page Specific */
.history-image {
  width: 100%;
  max-width: 350px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  margin: 2rem auto 2rem auto;
  float: none;
  display: block;
  position: static;
  z-index: auto;
}

.history-content p, .contact-content p {
  text-align: left;
}

@media (min-width: 900px) {
  .history-image {
    float: right;
    margin: 0 0 1.5rem 2rem;
    width: 350px;
    max-width: 40%;
    position: relative;
    top: 0;
    z-index: 1;
  }
}

.page-content:after {
  content: "";
  display: table;
  clear: both;
}

/* Contact Page */
.contact-section { background-color: var(--color-bg); }
.contact-card {
  max-width: 600px;
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.8); /* Slightly transparent white */
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 8px 15px rgba(0,0,0,0.08);
  text-align: left;
}
.contact-card h2 { font-family: var(--font-serif); text-align: center; font-size: 1.75rem; margin-bottom: 2rem; }
.contact-item { margin-bottom: 1.5rem; }
.contact-item h3 { color: var(--color-primary); font-weight: 700; margin-bottom: 0.25rem; }
.contact-item p { color: var(--color-text-light); }
.contact-item a { color: var(--color-text-light); text-decoration: none; }
.contact-item a:hover { color: var(--color-primary); }

/* Footer */
.site-footer {
  background-color: rgba(255, 255, 255, 0.6); /* Glass effect */
  backdrop-filter: blur(5px);
  border-top: 1px solid #e7e5e4; /* stone-200 */
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
}
.site-footer p { margin-bottom: 0.5rem; }
.footer-church-name { font-family: var(--font-serif); font-size: 1.1rem; color: var(--color-primary-dark); }
.site-footer .address { font-size: 0.8rem; }

/* Responsive Design */
@media (min-width: 782px) {
  html { font-size: 17px; }
  .church-name a { font-size: 2rem; }
  .menu-toggle { display: none; }
  .nav-desktop { display: block; }
  .nav-mobile { display: none; }
  .hero h1 { font-size: 3.5rem; }
  .service-times { flex-direction: row; }
  .location-grid { grid-template-columns: 1fr 1fr; }
  .page-content h1 { font-size: 3rem; }
  .contact-card { padding: 3rem; }
}
