/* ===== HERO SECTION ===== */
.hero {
  margin-bottom: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
}

/* Slider Right (default) — headings left, slider right */
.hero-inner.hero-align-right {
  grid-template-columns: 1fr 1.1fr;
}

/* Slider Left — slider left, headings right */
.hero-inner.hero-align-left {
  grid-template-columns: 1.1fr 1fr;
}
.hero-inner.hero-align-left > .hero-text {
  order: 2;
}
.hero-inner.hero-align-left > .slide-show {
  order: 1;
}

/* Slider Center — slider centered on page, headings in remaining left space */
.hero-inner.hero-align-center {
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  width: auto;
  max-width: 100%;
  margin: 0;
}
.hero-inner.hero-align-center > .hero-text {
  grid-column: 1;
  justify-self: end;
  padding-right: 48px;
}
.hero-inner.hero-align-center > .slide-show {
  grid-column: 2;
}

/* Slider only — no headings */
.hero-slider-only {
  display: grid;
}

/* Headings only — no slider */
.hero-headings-only {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero-headings-only .hero-actions {
  justify-content: center;
}

.hero-text {
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: 20px;
  color: var(--text);
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
  margin: 0;
  min-width: 140px;
}

/* Button styling from Site Design — uniform for all buttons */
.page-home .btn-primary,
.page-home .btn-secondary {
  background: var(--btn-bg, var(--accent-warm));
  color: var(--btn-text, #fff);
  border-radius: var(--btn-radius, 8px);
  border: none;
  font-family: var(--body-font, 'Inter', sans-serif);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Social button icons */
.hero-actions a svg {
  vertical-align: middle;
  margin-right: 4px;
}

/* ===== HERO IMAGE / SLIDER ===== */
.hero-image {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: var(--border);
}

.slide-show {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f3f0 0%, #e8e6e0 100%);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.slide-item {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: absolute;
  top: 0; left: 0;
  display: block;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: 1;
}
.slide-item.slide-active { opacity: 1; }
.slide-item.slide-out { opacity: 0; }

/* Fade animation (default) */
.slide-anim-fade { opacity: 0; }
.slide-anim-fade.slide-active { opacity: 1; }

/* Slide animation */
.slide-anim-slide { transform: translateX(100%); opacity: 1; }
.slide-anim-slide.slide-active { transform: translateX(0); opacity: 1; }
.slide-anim-slide.slide-out { transform: translateX(-100%); opacity: 1; }

/* Zoom animation */
.slide-anim-zoom { transform: scale(0.85); opacity: 0; }
.slide-anim-zoom.slide-active { transform: scale(1); opacity: 1; }
.slide-anim-zoom.slide-out { transform: scale(1.15); opacity: 0; }

/* Flip animation */
.slide-anim-flip { transform: perspective(800px) rotateY(90deg); opacity: 0; }
.slide-anim-flip.slide-active { transform: perspective(800px) rotateY(0); opacity: 1; }
.slide-anim-flip.slide-out { transform: perspective(800px) rotateY(-90deg); opacity: 0; }

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

.slide-item:hover img {
  transform: scale(1.02);
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 20px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}
.slide-caption-text {
  color: rgba(255,255,255,0.92);
  font-family: var(--body-font, 'Inter', sans-serif);
  font-size: var(--slider-caption-size, 0.85rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ===== SLIDER ARROWS ===== */
.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s ease;
  padding: 0;
}
.slide-show:hover .slide-arrow { opacity: 1; }
.slide-arrow:hover {
  background: rgba(0, 0, 0, 0.65);
}
.slide-arrow:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(255,255,255,0.7);
  outline-offset: 2px;
}
.slide-arrow-prev { left: 12px; }
.slide-arrow-next { right: 12px; }

/* Slide-from-prev (reverse direction) */
.slide-anim-slide.slide-from-prev { transform: translateX(-100%); }
.slide-anim-slide.slide-from-prev.slide-active { transform: translateX(0); }
.slide-anim-slide.slide-out-next { transform: translateX(100%); }

.slide-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f3f0 0%, #e8e6e0 100%);
}
.slide-placeholder {
  font-size: 1.2rem;
  color: var(--text-muted, #8b8b87);
  font-style: italic;
}

/* ===== CARDS SECTION ===== */
.cards-section {
  margin-top: 80px;
  padding-top: 80px;
  border-top: 1px solid var(--border);
}

.section-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

.section-intro .eyebrow {
  display: block;
  margin-bottom: 12px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--accent-warm);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.card h3 {
  margin-bottom: 12px;
  color: var(--text);
}

.card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

a.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

/* ===== FEATURED ARTWORKS GRID ===== */
.featured-artworks-section {
  margin-top: 80px;
  padding-top: 80px;
  border-top: 1px solid var(--border);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  gap: 24px;
  justify-content: center;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.featured-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
  display: block;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.featured-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

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

.featured-item:hover img {
  transform: scale(1.05);
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
}

.featured-overlay h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

/* ===== NEWSLETTER SECTION ===== */
.newsletter-section {
  margin-top: 80px;
  padding: 64px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.newsletter-section .container {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-section h2 {
  font-family: var(--heading-font);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.newsletter-section p {
  color: var(--text);
  opacity: 0.7;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.newsletter-form {
  position: relative;
}

.newsletter-input-group {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.newsletter-input-group input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border, #ddd);
  border-radius: var(--btn-radius, 6px);
  font-size: 0.95rem;
  font-family: var(--body-font);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-input-group input[type="email"]:focus {
  border-color: var(--accent-warm, #8b7355);
}

.newsletter-input-group .btn-primary {
  white-space: nowrap;
  padding: 12px 28px;
}

.newsletter-msg {
  max-width: 480px;
  margin: 0 auto 16px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.newsletter-msg-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.newsletter-msg-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .hero-inner {
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-inner.hero-align-left > .hero-text,
  .hero-inner.hero-align-left > .slide-show {
    order: unset;
  }

  .hero-inner.hero-align-center {
    grid-template-columns: 1fr;
    gap: 32px;
    width: auto;
    max-width: 100%;
  }
  .hero-inner.hero-align-center > .hero-text {
    grid-column: auto;
    justify-self: auto;
    padding-right: 0;
  }
  .hero-inner.hero-align-center > .slide-show {
    grid-column: auto;
  }

  .hero-headings-only {
    max-width: 100%;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card {
    padding: 24px 20px;
  }

  .newsletter-input-group {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 0;
  }

  .hero-inner {
    gap: 24px;
  }

  /* Force slider to obey viewport width even when inline width is set */
  .slide-show,
  .hero-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
  }

  .hero-text {
    text-align: center;
    max-width: 100%;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    min-width: 0;
    width: 100%;
    min-height: 44px;
  }

  .cards-section,
  .featured-artworks-section,
  .newsletter-section {
    margin-top: 48px;
    padding-top: 48px;
  }

  .section-intro {
    margin-bottom: 28px;
    text-align: center;
  }

  /* Featured grid: allow items to fill width on mobile (override 280px cap) */
  .featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    max-width: 100%;
  }

  .newsletter-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .newsletter-input-group .btn-primary {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    margin-bottom: 14px;
  }

  .hero p {
    font-size: 1rem;
  }

  .cards-section,
  .featured-artworks-section,
  .newsletter-section {
    margin-top: 36px;
    padding-top: 36px;
  }

  .card {
    padding: 20px 16px;
  }

  /* On smallest phones, single column for featured to keep images legible */
  .featured-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .newsletter-section h2 {
    font-size: 1.4rem;
  }
}
