/* ============================================================
   South Haldimand Market — Main Stylesheet
   Color palette matched to "Who We Are" brand image
   ============================================================ */

/* ── Custom Properties ───────────────────────────────────── */
:root {
  /* Colors */
  --color-primary:        #2D5016;
  --color-primary-light:  #4A7A2B;
  --color-accent:         #C8820A;
  --color-accent-light:   #E09A20;
  --color-bg:             #FDFAF3;
  --color-bg-alt:         #F2E9D6;
  --color-text:           #1A1A1A;
  --color-text-light:     #6B6B6B;
  --color-border:         #D4C5A0;
  --color-white:          #FFFFFF;

  /* Typography */
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body:    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;

  /* Layout */
  --max-width:      1100px;
  --nav-height:     64px;
  --border-radius:  6px;

  /* Transitions */
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

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

ul {
  list-style: none;
}

/* ── Base Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-primary);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.1rem, 3vw, 1.4rem); margin-bottom: var(--space-sm); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

p:last-child {
  margin-bottom: 0;
}

/* ── Layout Utilities ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section {
  padding-block: var(--space-3xl);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section__header p {
  color: var(--color-text-light);
  max-width: 60ch;
  margin-inline: auto;
}

/* Two-column layout */
.two-col {
  display: grid;
  gap: var(--space-2xl);
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .two-col--60-40 {
    grid-template-columns: 3fr 2fr;
  }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
  text-align: center;
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-primary-light);
  color: var(--color-white);
}

.btn--accent {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn--accent:hover {
  background-color: var(--color-accent-light);
  color: var(--color-white);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ── Header / Nav ────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--color-primary);
  border-bottom: 3px solid var(--color-accent);
  display: flex;
  align-items: center;
}

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

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-white);
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-logo__icon {
  height: 36px;
  width: 36px;
  flex-shrink: 0;
}

.site-logo__text {
  display: flex;
  flex-direction: column;
  font-size: 1.5rem;
  color: var(--color-white);
}

.site-logo__text span {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-body);
  color: var(--color-accent-light);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-logo:hover {
  color: var(--color-white);
}

.nav__list {
  display: flex;
  gap: var(--space-lg);
}

.nav__link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  padding-block: var(--space-xs);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-white);
  border-bottom-color: var(--color-accent);
}

/* Hamburger (hidden on desktop) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Mobile nav */
@media (max-width: 767px) {
  .nav__toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background-color: var(--color-primary);
    padding: var(--space-xl) var(--space-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 99;
  }

  .site-header.nav-open .site-nav {
    transform: translateX(0);
  }

  .nav__list {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .nav__link {
    font-size: 1.2rem;
  }

  /* Hamburger → X animation */
  .site-header.nav-open .nav__toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.nav-open .nav__toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav__toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 60%, #5C9A32 100%);
  color: var(--color-white);
  padding-block: var(--space-3xl) calc(var(--space-3xl) + var(--space-xl));
  text-align: center;
}

.hero__eyebrow {
  font-size: 0.85rem;
  font-family: var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin-bottom: var(--space-md);
}

.hero__title {
  color: var(--color-white);
  margin-bottom: var(--space-lg);
}

.hero__subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Feature Cards ───────────────────────────────────────── */
.card-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: 0 4px 20px rgba(45, 80, 22, 0.12);
  transform: translateY(-2px);
}

.card__icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.card h3 {
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* ── Location / Hours Block ──────────────────────────────── */
.location-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.location-info h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.hours-table {
  border-collapse: collapse;
  width: 100%;
}

.hours-table td {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.95rem;
}

.hours-table td:first-child {
  color: var(--color-text-light);
  width: 140px;
}

.hours-table td:last-child {
  font-weight: 600;
  color: var(--color-primary);
}

.map-embed {
  width: 100%;
  height: 320px;
  border: none;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
}

/* ── Placeholder Image ───────────────────────────────────── */
.img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
  gap: var(--space-sm);
}

.img-placeholder__icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

/* ── Featured Vendors ────────────────────────────────────── */
.featured-eyebrow {
  font-size: 0.8rem;
  font-family: var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.featured-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  border: 2px solid var(--color-accent);
  box-shadow: 0 4px 20px rgba(200, 130, 10, 0.15);
}

.featured-carousel__track {
  display: flex;
  transition: transform 0.6s ease;
  will-change: transform;
}

.featured-carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.featured-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color var(--transition);
}

.featured-carousel__dot.active {
  background-color: var(--color-accent);
}

.featured-card {
  flex: 0 0 auto;
  width: 100%;
  display: grid;
  background-color: var(--color-white);
  border: 2px solid var(--color-accent);
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--transition), transform var(--transition);
}

.featured-card__badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background-color: var(--color-accent);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  z-index: 1;
}

.featured-card__img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.featured-card__img-placeholder {
  height: 260px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
}

.featured-card__body {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--color-white);
}

.featured-card__body h3 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin-bottom: var(--space-sm);
}

.featured-card__body p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
}

@media (min-width: 640px) {
  .featured-card {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .featured-card__img {
    height: 100%;
    min-height: 300px;
  }

  .featured-card__img-placeholder {
    height: 100%;
    min-height: 300px;
    border-bottom: none;
    border-right: 1px solid var(--color-border);
  }
}

/* ── Gallery / Artist Section ────────────────────────────── */
.artist {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.artist:last-of-type {
  border-bottom: none;
}

.artist-info h3 {
  font-size: 1.5rem;
}

.artist-bio {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.artist-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.artist-gallery figure {
  cursor: pointer;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.artist-gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background-color: var(--color-bg-alt);
  transition: transform 0.3s ease;
}

.artist-gallery figure:hover img {
  transform: scale(1.04);
}

.artist-gallery figcaption {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  color: var(--color-text-light);
  background-color: var(--color-white);
}

/* Gallery placeholder box */
.gallery-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background-color: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.85rem;
  gap: var(--space-xs);
}

/* ── Vendor Contact ──────────────────────────────────────── */
.vendor-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-md);
}

.vendor-contact__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  margin-bottom: 0;
  width: 100%;
}

.vendor-contact a {
  font-size: 0.85rem;
  color: var(--color-primary);
}

.vendor-contact a:hover {
  color: var(--color-accent);
}

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.lightbox.open {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--border-radius);
}

.lightbox__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: var(--color-white);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── Contact Form ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(74, 122, 43, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.form-error {
  font-size: 0.82rem;
  color: #C0392B;
  display: none;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: #C0392B;
}

.form-group.has-error .form-error {
  display: block;
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.4rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  cursor: pointer;
}

/* ── Contact Info Sidebar ────────────────────────────────── */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-info__item h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.contact-info__item p,
.contact-info__item a {
  font-size: 0.95rem;
  color: var(--color-text);
}

.contact-info__item a:hover {
  color: var(--color-accent);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background-color: var(--color-primary);
  color: rgba(255, 255, 255, 0.8);
  padding-block: var(--space-2xl);
}

.site-footer .container {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .site-footer .container {
    grid-template-columns: 2fr 1fr 1fr;
    align-items: start;
  }
}

.footer__brand {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer__tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0;
}

.footer__heading {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-light);
  margin-bottom: var(--space-md);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__list a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer__list a:hover {
  color: var(--color-white);
}

.footer__contact-item {
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  color: rgba(255, 255, 255, 0.75);
}

.footer__contact-item a {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition);
}

.footer__contact-item a:hover {
  color: var(--color-accent-light);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Page Hero (inner pages) ─────────────────────────────── */
.page-hero {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding-block: var(--space-2xl) var(--space-3xl);
  text-align: center;
}

.page-hero h1 {
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.page-hero p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 52ch;
  margin-inline: auto;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  border: none;
  margin-block: var(--space-md);
}

.divider--center {
  margin-inline: auto;
}

/* ── Promo Modal ─────────────────────────────────────────── */
.promo-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.promo-modal.hidden {
  display: none;
}

.promo-modal__card {
  position: relative;
  max-width: 800px;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  line-height: 0;
}

.promo-modal__card img {
  width: 100%;
  height: auto;
  display: block;
}

.promo-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: var(--color-white);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 10;
}

.promo-modal__close:hover {
  background: rgba(0, 0, 0, 0.85);
}

/* ── Accessibility ───────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.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;
}
