/**
 * BAYVIEW CEMETERY INC. - style.css
 * Core Design System and Styles
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+Pro:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette */
  --color-primary: #1A3A2A; /* Deep Forest Green */
  --color-primary-alt: #1E2D40; /* Slate Navy */
  --color-accent: #B8943F; /* Antique Bronze */
  --color-accent-hover: #cbae5d;
  --color-bg: #F7F4EF; /* Off-White / Warm Ivory */
  --color-text: #2C2C2C; /* Charcoal */
  --color-text-secondary: #6E7C74; /* Stone Gray */
  --color-white: #ffffff;
  
  /* Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Source Sans Pro', sans-serif;
  
  /* Layout */
  --max-width: 1200px;
  --header-height: 80px;
  --header-height-mobile: 60px;
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: var(--color-accent);
  transition: color 0.3s ease;
}

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

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

ul, ol {
  list-style: none;
}

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

.section {
  padding: 5rem 0;
}

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

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }

.heading-border {
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-white);
  padding: 0.75rem 2rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* Base Form Styles */
input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Header & Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-bg);
  height: var(--header-height);
  z-index: 1000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, height 0.3s ease;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.site-header.scrolled {
  background-color: rgba(247, 244, 239, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  height: 70px;
}

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

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.site-title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 1px;
  white-space: nowrap;
}

.main-nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
  white-space: nowrap;
}

.main-nav a {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

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

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--color-primary);
  margin: 5px 0;
  transition: 0.3s;
}

/* Page Layout for header offset */
main {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Hero Section */
.hero {
  position: relative;
  height: calc(100vh - var(--header-height));
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: var(--color-primary); /* Fallback */
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 58, 42, 0.4);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  color: var(--color-white);
  padding: 2rem;
  max-width: 800px;
}

.hero h1 {
  color: var(--color-white);
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hero-sub {
  height: 40vh;
  min-height: 300px;
}
.hero-sub h1 {
  font-size: 2.5rem;
}

/* Cards & Content Blocks */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 2.5rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.card-image-wrapper {
  margin: -2rem -2rem 1.5rem -2rem;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  aspect-ratio: 16/9;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* Feature Block */
.feature-block {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.feature-block-reverse {
  flex-direction: column-reverse;
}

@media(min-width: 768px) {
  .feature-block, .feature-block-reverse {
    flex-direction: row;
    align-items: center;
  }
  .feature-block > *, .feature-block-reverse > * {
    flex: 1;
  }
}

.feature-img {
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* Galleries */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Forms */
.contact-form .form-group {
  margin-bottom: 1.5rem;
}
.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-primary);
}

.error-message {
  color: #d32f2f;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: block;
}

/* Footer */
.site-footer {
  background-color: var(--color-primary);
  color: rgba(255,255,255,0.8);
  padding: 4rem 0 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-logo {
  height: 40px;
}

.footer-title {
  color: var(--color-white);
  font-size: 1.25rem;
  margin: 0;
}

.footer-heading {
  color: var(--color-accent);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  display: block;
  margin-bottom: 0.5rem;
}

.footer-links a:hover {
  color: var(--color-accent);
  padding-left: 5px;
}

.footer-contact p {
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}

.footer-bottom span {
  display: inline-block;
  margin: 0 0.5rem;
}

/* Animation Utilities */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  border: 2px solid var(--color-accent);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  line-height: 1;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: var(--header-height-mobile);
  }
  
  .site-title {
    font-size: 1.1rem;
  }
  
  .logo-img {
    height: 40px;
  }
  
  .hamburger {
    display: block;
  }
  
  .main-nav {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    width: 100%;
    background-color: var(--color-bg);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 999;
  }
  
  .main-nav.active {
    transform: translateY(0);
  }
  
  .main-nav ul {
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    align-items: center;
  }

  .grid-3, .grid-2, .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .section {
    padding: 3rem 0;
  }
}
