/* ========================================
   DESIGN SYSTEM - Eben-Ezer Wendlingen
   ======================================== */

/* --- Font Faces --- */
@font-face {
  font-family: 'Playfair Display';
  src: url('../Fonts/PlayfairDisplay-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('../Fonts/PlayfairDisplay-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../Fonts/LibreBaskerville-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../Fonts/LibreBaskerville-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../Fonts/LibreBaskerville-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors - Blue palette derived from the dove logo */
  --color-primary-deep:   #1a3a5c;
  --color-primary:        #2d5f8a;
  --color-primary-light:  #5b8db8;
  --color-accent:         #89c2d9;
  --color-surface-light:  #e8f1f8;
  --color-dark-bg:        #0f2235;
  --color-white:          #ffffff;
  --color-text:           #1a1a2e;
  --color-text-muted:     #5a6677;
  --color-text-on-dark:   #e0e8f0;
  --color-border:         #d4dce6;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Libre Baskerville', Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale (8px base) */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-text: 680px;
  --header-height: 80px;
  --border-radius: 8px;
  --border-radius-lg: 16px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 34, 53, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 34, 53, 0.08);
  --shadow-lg: 0 8px 30px rgba(15, 34, 53, 0.12);
  --shadow-xl: 0 20px 60px rgba(15, 34, 53, 0.15);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: var(--header-height);
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-deep);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
p  { margin-bottom: var(--space-md); }

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--text {
  max-width: var(--max-width-text);
}

.section {
  padding: var(--space-5xl) 0;
}

.section--dark {
  background-color: var(--color-dark-bg);
  color: var(--color-text-on-dark);
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* --- Page Hero (reusable across subpages) --- */
.page-hero {
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
}

.page-hero__subtitle {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  margin-top: var(--space-sm);
  font-weight: 600;
}

/* --- Header Placeholder (prevents layout shift) --- */
#header-placeholder {
  min-height: 0;
}

/* --- Shared Header Styles --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  height: var(--header-height);
}

.logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

#logo {
  height: 58px;
  width: auto;
  border-radius: 6px;
  transition: transform var(--transition-fast);
}

#logo:hover {
  transform: scale(1.05);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text);
  padding: var(--space-xs) 0;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

/* --- Language Switcher --- */
#language-switcher {
  display: flex;
  gap: var(--space-xs);
  margin-left: var(--space-md);
}

.language-button {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.35em 0.9em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.language-button:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.language-button.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

/* --- Hamburger Menu --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
  position: relative;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-fast);
  transform-origin: center;
}

.hamburger.is-active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Mobile Overlay --- */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* --- Mobile Navigation --- */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xl);
    background: var(--color-white);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 999;
    padding: var(--space-3xl) var(--space-xl);
  }

  .main-nav.is-open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.02em;
    width: 100%;
    text-wrap: balance;
  }

  #language-switcher {
    margin-left: auto;
    margin-top: 0;
    margin-right: var(--space-xs);
  }

  .header-inner {
    height: 60px;
    justify-content: flex-start;
  }

  :root {
    --header-height: 60px;
  }
}

/* --- Shared Footer Styles --- */
.site-footer {
  background-color: var(--color-dark-bg);
  color: var(--color-text-on-dark);
  padding-top: var(--space-2xl);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
  justify-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
  justify-self: center;
}

.footer-church-name {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.4;
}

.footer-brand-email {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  opacity: 0.85;
  margin: 0;
}

.footer-brand-email a {
  color: var(--color-accent);
  transition: color var(--transition-fast);
}

.footer-brand-email a:hover {
  color: var(--color-white);
}

.footer-contact,
.footer-schedule {
  text-align: center;
  justify-self: center;
}

.footer-contact h3,
.footer-brand h3,
.footer-schedule h3 {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.footer-contact p,
.footer-schedule p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: var(--space-sm);
  line-height: 1.45;
}

.footer-contact a,
.footer-schedule a {
  color: var(--color-accent);
  transition: color var(--transition-fast);
}

.footer-contact a:hover,
.footer-schedule a:hover {
  color: var(--color-white);
}

.footer-contact iframe {
  width: 100%;
  max-width: 360px;
  height: 115px;
  display: block;
  margin: var(--space-sm) auto 0;
  border-radius: var(--border-radius);
  opacity: 0.9;
}

.footer-bottom-bar {
  max-width: var(--max-width);
  margin: var(--space-xl) auto 0;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  opacity: 0.6;
}

.footer-bottom-bar p {
  margin: 0;
}

.footer-bottom-bar a {
  color: inherit;
  transition: opacity var(--transition-fast);
}

.footer-bottom-bar a:hover {
  opacity: 1;
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom-bar {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

/* --- Cookie Banner --- */
#cookie-banner {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 560px;
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  z-index: 2000;
  font-family: var(--font-ui);
  animation: cookieSlideUp 0.5s ease-out;
}

@keyframes cookieSlideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

#cookie-banner p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

#cookie-banner a {
  color: var(--color-primary);
  font-weight: 600;
}

#cookie-banner button {
  margin: 0 var(--space-xs);
  padding: 0.6em 1.5em;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

#accept-cookies {
  background: var(--color-primary);
  color: var(--color-white);
}

#accept-cookies:hover {
  background: var(--color-primary-deep);
  transform: translateY(-1px);
}

#decline-cookies {
  background: var(--color-surface-light);
  color: var(--color-text-muted);
}

#decline-cookies:hover {
  background: var(--color-border);
}
