/* CSS Variables for Theme */
:root {
  --bg-color: #fdfcf9;
  --text-color: #2c2c2c;
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(139, 115, 85, 0.15);
  --nav-bg: rgba(90, 74, 58, 0.97);
  --nav-text: #f5f0e8;
  --accent-color: #8b7355;
  --accent-light: #ffe8c2;
  --footer-bg: #3d3226;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --overlay-opacity: 0.45;
}

[data-theme="dark"] {
  --bg-color: #1a1612;
  --text-color: #e8e2d9;
  --card-bg: rgba(40, 35, 30, 0.95);
  --card-border: rgba(139, 115, 85, 0.3);
  --nav-bg: rgba(30, 25, 20, 0.98);
  --nav-text: #f5f0e8;
  --accent-color: #c4a77d;
  --accent-light: #ffe8c2;
  --footer-bg: #0f0d0a;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --overlay-opacity: 0.25;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: #5a4a3a;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #ffe8c2;
  outline-offset: 2px;
}

/* Accessibility: Focus Indicators */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
  outline: 3px solid #8b7355;
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #8b7355;
  outline-offset: 2px;
}

/* High contrast focus for dark backgrounds */
nav a:focus,
.menu-toggle:focus {
  outline: 3px solid #ffe8c2;
  outline-offset: 2px;
}

body {
  font-family: 'Playfair Display', Georgia, serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: hidden;
  position: relative;
  z-index: 0;
  line-height: 1.7;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Live Animated Forest Background (full site) */
.live-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: url('liveimage.webp') center center / cover no-repeat;
  z-index: -3;
  opacity: var(--overlay-opacity);
  pointer-events: none;
  animation: subtleFloat 60s ease-in-out infinite alternate;
  transition: opacity 0.3s ease;
}

@keyframes subtleFloat {
  0% { transform: scale(1) translateY(0px); }
  100% { transform: scale(1.02) translateY(-10px); }
}

/* Starry Overlay */
.stars, .twinkling {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -2;
  pointer-events: none;
}

.stars {
  background: url('https://www.script-tutorials.com/demos/360/images/stars.png') repeat;
  opacity: 0.2;
}

.twinkling {
  background: url('https://www.script-tutorials.com/demos/360/images/twinkling.png') repeat top center;
  animation: move-twink-back 200s linear infinite;
  opacity: 0.15;
}

@keyframes move-twink-back {
  from { background-position: 0 0; }
  to { background-position: -10000px 5000px; }
}

/* Header with Forest Background */
header {
  background: linear-gradient(to bottom, rgba(45, 35, 28, 0.7), rgba(45, 35, 28, 0.85)), 
              url('liveimage.webp') center center / cover no-repeat;
  color: white;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  z-index: 1;
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

header p {
  font-size: 1.15rem;
  margin: 0;
  opacity: 0.95;
  font-style: italic;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

header img {
  max-width: 220px;
  height: auto;
  margin-bottom: 1rem;
  border-radius: 8px;
}

/* Navigation */
nav {
  background: linear-gradient(135deg, rgba(139, 115, 85, 0.98), rgba(107, 87, 70, 0.98));
  text-align: center;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-links {
  display: flex;
  gap: 0;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: block;
  letter-spacing: 0.03em;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: #ffe8c2;
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 60%;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffe8c2;
}

/* Mobile Menu Toggle - Hidden on desktop */
.menu-toggle {
  display: none !important;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  z-index: 101;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
  margin: 5px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Content Box */
main {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 2.5rem 2rem;
  max-width: 850px;
  margin: 2.5rem auto;
  border-radius: 12px;
  box-shadow: 0 10px 40px var(--shadow-color);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(5px);
  transition: background 0.3s ease, color 0.3s ease;
}

main h2 {
  font-size: 2rem;
  color: var(--accent-color);
  margin-top: 0;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

main h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #a88b6a, transparent);
  border-radius: 2px;
}

main h3 {
  font-size: 1.4rem;
  color: #5a4a3a;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

main p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

main a {
  color: #7a6350;
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 99, 80, 0.3);
  transition: all 0.3s ease;
}

main a:hover {
  color: #5a4a3a;
  border-bottom-color: #5a4a3a;
}

/* Lists */
main ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

main ul li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

main ul li:last-child {
  border-bottom: none;
}

/* Contact Info Cards */
.contact-item {
  background: linear-gradient(135deg, #f8f6f3, #fff);
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border-left: 4px solid #a88b6a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-item strong {
  color: #5a4a3a;
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Store Hours Table */
.hours-grid {
  display: grid;
  gap: 0;
  background: #f8f6f3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hours-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.hours-row:last-child {
  border-bottom: none;
}

.hours-row.closed {
  background: rgba(0, 0, 0, 0.03);
  color: #888;
}

.hours-row .day {
  font-weight: 600;
  color: #5a4a3a;
}

.hours-row .time {
  color: #666;
}

/* CTA Button */
.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, #8b7355, #6b5746);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(107, 87, 70, 0.3);
  border: none;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(107, 87, 70, 0.4);
  background: linear-gradient(135deg, #9a8265, #7a6655);
  color: white;
  border-bottom: none;
}

/* Calendar Container */
.calendar-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background: white;
  margin-top: 1.5rem;
}

.calendar-container iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0;
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  transition: background 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--nav-bg);
  color: var(--nav-text);
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform 0.2s ease, background 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle:focus {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

footer img {
  max-width: 100px;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  opacity: 0.9;
  border-radius: 8px;
}

footer a {
  color: #ffe8c2;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: white;
}

footer p {
  margin: 0.5rem 0;
}

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

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

/* Responsive - Tablet */
@media screen and (max-width: 768px) {
  header {
    padding: 2.5rem 1.25rem 1.75rem;
  }

  header h1 {
    font-size: 2rem;
  }

  header p {
    font-size: 1rem;
  }

  main {
    margin: 1.5rem 1rem;
    padding: 2rem 1.5rem;
  }

  main h2 {
    font-size: 1.75rem;
  }

  .calendar-container iframe {
    height: 400px;
  }
}

/* Responsive - Mobile */
@media screen and (max-width: 600px) {
  header h1 {
    font-size: 1.75rem;
    letter-spacing: 0.02em;
  }

  header p {
    font-size: 0.95rem;
  }

  nav {
    padding: 0;
  }

  .nav-container {
    justify-content: space-between;
  }

  .menu-toggle {
    display: block !important;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 87, 70, 0.98), rgba(85, 70, 55, 0.98));
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
  }

  nav a {
    font-size: 1.25rem;
    padding: 1.25rem 2rem;
    width: 100%;
    text-align: center;
  }

  nav a::after {
    display: none;
  }

  main {
    margin: 1rem 0.75rem;
    padding: 1.75rem 1.25rem;
    border-radius: 10px;
  }

  main h2 {
    font-size: 1.5rem;
  }

  main h3 {
    font-size: 1.2rem;
  }

  main p {
    font-size: 1rem;
  }

  .cta-button {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    width: 100%;
    text-align: center;
  }

  .contact-item {
    padding: 1rem 1.25rem;
  }

  .hours-row {
    padding: 0.85rem 1rem;
    flex-direction: column;
    gap: 0.25rem;
  }

  .hours-row .time {
    font-size: 0.95rem;
  }

  .calendar-container iframe {
    height: 350px;
  }

  footer {
    padding: 1.75rem 1rem;
  }

  footer img {
    max-width: 80px;
  }
}

/* Map Container */
.map-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-top: 1rem;
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 350px;
  border: none;
}

@media screen and (max-width: 600px) {
  .map-container iframe {
    height: 280px;
  }
}

/* Photo Gallery */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #f5f3f0;
  aspect-ratio: 4/3;
}

.gallery-item:focus {
  outline: 3px solid #8b7355;
  outline-offset: 3px;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

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

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Small Mobile */
@media screen and (max-width: 380px) {
  header h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 1.5rem 1rem;
  }

  main h2 {
    font-size: 1.35rem;
  }
}

/* Reduced Motion - Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .live-bg {
    animation: none;
  }

  .twinkling {
    animation: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  .gallery-item:hover,
  .gallery-item:hover img {
    transform: none;
  }

  .cta-button:hover {
    transform: none;
  }

  .theme-toggle:hover {
    transform: none;
  }
}
