/* ============================================
   Eskdale Art Show — Design System & Styles
   ============================================ */

/* --- Design Tokens --- */
:root {
  --color-bg: #F7F5F0;
  --color-bg-alt: #EDE8DF;
  --color-text: #2C3338;
  --color-text-secondary: #6B6560;
  --color-accent-warm: #B8860B;
  --color-accent-cool: #4A6FA5;
  --color-fell-green: #5B7B5E;
  --color-border: #C8C3BA;
  --color-blush: #D4A9A0;
  --color-dark: #1E2328;
  --color-overlay: rgba(237, 232, 223, 0.6);
  --color-white: #FFFFFF;

  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --shadow-soft: 0 1px 2px rgba(44,51,56,0.04), 0 2px 4px rgba(44,51,56,0.04), 0 4px 8px rgba(44,51,56,0.04);
  --shadow-hover: 0 2px 4px rgba(44,51,56,0.04), 0 4px 8px rgba(44,51,56,0.06), 0 8px 16px rgba(44,51,56,0.06);
  --shadow-frame: 0 0 0 1px rgba(200,195,186,0.5), 0 2px 8px rgba(44,51,56,0.06), 0 8px 24px rgba(44,51,56,0.04);

  --radius: 6px;
  --nav-height: 3.5rem;
  --section-pad: clamp(3rem, 6vw, 6rem);
  --content-max: 72rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-accent-warm); text-decoration: none; transition: color 0.2s; }
a:hover, a:focus-visible { color: var(--color-text); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

h1 { font-size: clamp(2.25rem, 1.5rem + 3.5vw, 4rem); }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.25vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem); }

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-dark);
  color: var(--color-bg);
  border-radius: var(--radius);
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { top: 0.5rem; }

/* --- Paper Texture (global) --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='6' height='6' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* --- Navigation --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1rem;
  height: var(--nav-height);
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav a {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-accent-warm);
  border-bottom-color: var(--color-accent-warm);
}

@media (max-width: 500px) {
  .site-nav {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1.25rem;
    padding: 0 1rem;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
}

/* --- Container --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* --- Section Base --- */
.section {
  padding: var(--section-pad) 0;
}
.section--alt {
  background-color: var(--color-bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.section-header h2 {
  margin-bottom: 0.75rem;
}
.section-header p {
  color: var(--color-text-secondary);
  max-width: 40rem;
  margin: 0 auto;
}

/* --- Watercolour Wash Divider --- */
.wash-divider {
  width: 100%;
  height: 60px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(74, 111, 165, 0.07) 20%,
    rgba(91, 123, 94, 0.05) 50%,
    rgba(184, 134, 11, 0.06) 80%,
    transparent 100%
  );
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='60'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015' numOctaves='4' seed='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='1200' height='60' filter='url(%23w)'/%3E%3C/svg%3E");
  mask-size: cover;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='60'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015' numOctaves='4' seed='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='1200' height='60' filter='url(%23w)'/%3E%3C/svg%3E");
  -webkit-mask-size: cover;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: var(--color-bg-alt);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem 1rem;
  max-width: 48rem;
}

.hero-edition {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent-warm);
  margin-bottom: 1rem;
}

.hero h1 {
  margin-bottom: 1rem;
}

.about-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--color-accent-warm);
  margin-bottom: 1rem;
}

.hero-dates {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.hero-times {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.hero-admission {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--color-accent-warm);
  border-radius: 2rem;
  color: var(--color-accent-warm);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
}

.hero-countdown {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--color-accent-warm);
  color: var(--color-white);
}
.btn--primary:hover { background: #9A7009; color: var(--color-white); }

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn--outline:hover {
  border-color: var(--color-accent-warm);
  color: var(--color-accent-warm);
}

/* --- Poster Carousel --- */
.carousel {
  position: relative;
  max-width: 36rem;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-frame);
  background: var(--color-white);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  width: 100%;
  flex: 0 0 100%;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: rgba(247, 245, 240, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.carousel-btn:hover {
  background: var(--color-white);
  box-shadow: var(--shadow-hover);
}
.carousel-btn--prev { left: 0.75rem; }
.carousel-btn--next { right: 0.75rem; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
  background: var(--color-accent-warm);
  transform: scale(1.3);
}

@media (max-width: 768px) {
  .carousel { max-width: 100%; }
  .carousel-btn { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
  .carousel-btn--prev { left: 0.5rem; }
  .carousel-btn--next { right: 0.5rem; }
}

/* --- Category Cards --- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.category-card {
  padding: 1.75rem 1.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow-soft);
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.category-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}
.category-card p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* --- Gallery --- */
.gallery-grid {
  columns: 3 280px;
  column-gap: 1.25rem;
}

@supports (grid-template-rows: masonry) {
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-template-rows: masonry;
    gap: 1.25rem;
    columns: unset;
  }
  .gallery-item { margin-bottom: 0; }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-white);
  box-shadow: var(--shadow-frame);
  transition: box-shadow 0.3s, transform 0.3s;
  cursor: pointer;
}
.gallery-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--color-bg-alt);
  aspect-ratio: 4/3;
  object-fit: cover;
}

.gallery-caption {
  padding: 0.75rem 1rem;
}
.gallery-caption h4 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}
.gallery-caption p {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

/* --- Info Cards --- */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.info-card {
  padding: 2rem 1.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.info-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.info-card h3 {
  margin-bottom: 0.5rem;
}
.info-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Visit / Directions --- */
.directions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .directions-grid {
    grid-template-columns: 1fr;
  }
}

.directions-text address {
  font-style: normal;
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.directions-text p {
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}

.directions-map iframe {
  width: 100%;
  height: 350px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* --- Open Gardens --- */
.gardens-intro {
  max-width: 48rem;
  color: var(--color-text-secondary);
}

/* --- Refreshments --- */
.refreshments-callout {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.refreshments-callout .callout-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.contact-item {
  padding: 1.5rem;
}

.contact-item a {
  display: block;
  font-weight: 600;
  margin-top: 0.25rem;
}

.contact-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

/* --- Exhibitor CTA --- */
.exhibitor-cta {
  text-align: center;
  padding: 2.5rem;
  background: var(--color-dark);
  color: var(--color-bg);
  border-radius: var(--radius);
  margin-top: 2rem;
}
.exhibitor-cta h3 {
  color: var(--color-bg);
  margin-bottom: 0.75rem;
}
.exhibitor-cta p {
  color: var(--color-border);
  margin-bottom: 1.25rem;
}
.exhibitor-cta .btn--primary:hover {
  background: var(--color-bg);
  color: var(--color-dark);
}

/* --- Footer --- */
.site-footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.site-footer p {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}
.site-footer a {
  color: var(--color-text-secondary);
}
.site-footer a:hover {
  color: var(--color-accent-warm);
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 35, 40, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 2rem;
  cursor: pointer;
}
.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  object-fit: contain;
}

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-bg);
  text-align: center;
  font-size: 0.9375rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: var(--color-bg);
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 0.5rem;
}

/* --- Scroll Reveal --- */
.reveal { opacity: 1; transform: translateY(0); }

@supports (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    animation: fadeSlideIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

@keyframes fadeSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* --- Print --- */
@media print {
  .site-nav, .hero-canvas, .wash-divider, .lightbox { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .section { padding: 1rem 0; }
}
