/* ========================================
   HOMEPAGE STYLES — Bartolo Bakehouse
   All values use design tokens from style.css
   ======================================== */

/* ========================================
   SECTION 1: HERO SLIDESHOW
   ======================================== */
.hero-slideshow {
  position: relative;
  width: 100%;
  height: 80vh;
  max-height: 700px;
  min-height: 400px;
  overflow: hidden;
}

.hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: 0;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-bg-hero-overlay);
}

.hero-slide-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
  z-index: 2;
}

.hero-quote {
  max-width: 800px;
  text-align: center;
}

.hero-quote p {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 1rem + 2vw, 2.25rem);
  font-weight: var(--weight-medium);
  font-style: italic;
  line-height: 1.4;
  color: var(--color-white);
  margin-bottom: 0;
}

.hero-heading-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: rgba(var(--color-primary-rgb), 0.85);
  padding: var(--sp-8) 0;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-hero);
  font-weight: var(--weight-semibold);
  font-style: italic;
  color: var(--color-gold);
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.1;
  margin-bottom: var(--sp-6);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
}

.hero-cta-btn {
  font-size: var(--text-sm);
  padding: var(--sp-2d5) var(--sp-6);
}

.hero-cta-btn--outline {
  color: var(--color-white);
  border-color: var(--color-white);
}

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

.hero-dots {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: var(--sp-3);
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--rounded-full);
  background: rgba(var(--color-white-rgb), 0.4);
  border: 2px solid var(--color-white);
  transition: background var(--transition-base);
  cursor: pointer;
}

.hero-dot.is-active {
  background: var(--color-gold);
  border-color: var(--color-gold);
}

/* ========================================
   SECTION 2: CATEGORY QUICK LINKS
   ======================================== */
.category-links {
  background: var(--color-bg-page);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-grid);
}

.category-card {
  display: block;
  border-radius: var(--rounded-card);
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.category-card-img-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.category-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(var(--color-primary-rgb), 0.6) 0%, transparent 50%);
}

.category-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-heading);
  font-size: var(--text-card-title);
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: var(--heading-letter-spacing);
  z-index: 1;
}

/* ========================================
   SECTION 3: SEASONAL SPECIALS
   ======================================== */
.seasonal-specials {
  background: var(--color-white);
}

.specials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-grid);
}

.specials-item {
  border-radius: var(--rounded-card);
  overflow: hidden;
}

.specials-item-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.specials-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.specials-item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: var(--sp-4);
  background: linear-gradient(to top, rgba(var(--color-primary-rgb), 0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.specials-item:hover .specials-item-overlay {
  opacity: 1;
}

.specials-item-name {
  font-family: var(--font-heading);
  font-size: var(--text-card-title);
  font-weight: var(--weight-semibold);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: var(--heading-letter-spacing);
}

/* ========================================
   SECTION 4: ABOUT US
   ======================================== */
.about-section {
  background: var(--color-cream);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  align-items: center;
}

.about-image-col {
  position: relative;
}

.about-photo {
  width: 100%;
  border-radius: var(--rounded-card);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.about-bica-icon {
  position: absolute;
  bottom: calc(-1 * var(--sp-8));
  right: var(--sp-4);
  width: 80px;
  height: auto;
  opacity: 0.25;
}

.about-text-col {
  max-width: 640px;
}

.section-heading--left {
  text-align: left;
}

.heading-line--left {
  margin-left: 0;
  margin-right: auto;
}

.about-text-col p {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--sp-5);
}

.about-story-link {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 2px solid var(--color-gold);
  padding-bottom: var(--sp-1);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.about-story-link:hover {
  color: var(--color-gold);
}

/* ========================================
   SECTION 5: CUSTOMER REVIEWS
   ======================================== */
.reviews-section {
  background: var(--color-white);
}

.reviews-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-10);
  padding: var(--sp-3) var(--sp-6);
  background: var(--color-cream);
  border-radius: var(--rounded-button);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.reviews-badge-stars {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-rating);
}

.reviews-badge-text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reviews-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-grid);
}

.review-card {
  background: var(--color-bg-card);
  border: 1px solid rgba(var(--color-primary-rgb), 0.08);
  border-radius: var(--rounded-card);
  padding: var(--sp-8) var(--sp-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.review-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.review-card-icon {
  margin-bottom: var(--sp-4);
}

.review-swallow {
  width: 32px;
  height: auto;
  opacity: 0.3;
}

.review-card-quote {
  margin-bottom: var(--sp-4);
}

.review-card-quote p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 0;
  /* Clamp long reviews */
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-card:hover .review-card-quote p {
  -webkit-line-clamp: unset;
}

.review-card-author {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-style: normal;
  color: var(--color-primary);
  margin-bottom: var(--sp-1);
}

.review-card-source {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* ========================================
   SECTION 6: RESERVE A TABLE CTA
   ======================================== */
.reserve-section {
  position: relative;
  padding: var(--sp-32) 0;
  overflow: hidden;
}

.reserve-bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.reserve-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reserve-overlay {
  position: absolute;
  inset: 0;
  background: rgba(var(--color-primary-rgb), 0.8);
}

.reserve-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.reserve-icon {
  width: 64px;
  height: auto;
  margin: 0 auto var(--sp-6);
  opacity: 0.6;
}

.reserve-title {
  font-family: var(--font-heading);
  font-size: var(--text-section);
  color: var(--color-white);
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.reserve-text {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  color: rgba(var(--color-white-rgb), 0.85);
  max-width: 500px;
  margin: 0 auto var(--sp-8);
}

.reserve-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
}

.reserve-cta-btn--on-dark {
  background: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-primary);
}

.reserve-cta-btn--on-dark:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-primary);
}

.reserve-cta-btn--on-dark.btn-secondary {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

.reserve-cta-btn--on-dark.btn-secondary:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

/* ========================================
   SECTION 7: INSTAGRAM FEED PLACEHOLDER
   ======================================== */
.instagram-section {
  background: var(--color-bg-page);
}

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}

.instagram-placeholder-item {
  aspect-ratio: 1 / 1;
  border-radius: var(--rounded-md);
  overflow: hidden;
}

.instagram-placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.instagram-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.instagram-handle:hover {
  color: var(--color-gold);
}

/* ========================================
   SECTION 8: SOCIAL PROOF STRIP
   ======================================== */
.proof-strip {
  background: var(--color-primary);
  padding: var(--sp-10) 0;
}

.proof-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.proof-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-1);
  padding: 0 var(--sp-6);
}

.proof-strip-number {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-gold);
  line-height: 1;
}

.proof-strip-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(var(--color-white-rgb), 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.proof-strip-divider {
  width: 1px;
  height: 40px;
  background: rgba(var(--color-white-rgb), 0.2);
}

/* ========================================
   RESPONSIVE: MOBILE (max-width: 767px)
   ======================================== */
@media (max-width: 767px) {
  /* --- Hero: 50–55vh, text readable, dots visible --- */
  .hero-slideshow {
    height: 52vh;
    min-height: 340px;
    max-height: 500px;
  }

  .hero-quote p {
    font-size: clamp(1rem, 0.85rem + 1.5vw, 1.5rem);
    padding: 0 var(--sp-3);
  }

  /* Move dots above the heading bar so they're always visible */
  .hero-dots {
    bottom: auto;
    top: var(--sp-4);
    z-index: 5;
  }

  .hero-slide-content {
    padding: var(--sp-4);
    /* Push content up away from heading bar */
    padding-bottom: 0;
    align-items: flex-start;
    padding-top: calc(var(--sp-10) + 28px); /* below dots */
  }

  /* Heading bar: compact on mobile */
  .hero-heading-bar {
    padding: var(--sp-4) 0 var(--sp-5);
  }

  .hero-title {
    font-size: clamp(1.375rem, 1rem + 2.5vw, 2.25rem);
    margin-bottom: var(--sp-4);
    padding: 0 var(--sp-4);
    line-height: 1.15;
  }

  /* Hero CTAs: stacked, full-width, proper touch targets */
  .hero-ctas {
    flex-direction: column;
    gap: var(--sp-3);
    padding: 0 var(--sp-4);
    width: 100%;
  }

  .hero-cta-btn {
    width: 100%;
    font-size: var(--text-base);
    padding: var(--sp-3) var(--sp-6);
    min-height: 48px;
    justify-content: center;
    text-align: center;
    flex: none;
    white-space: normal;
  }

  /* --- Category Cards: 2×2 grid --- */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .category-card-img-wrap {
    aspect-ratio: 3 / 3.5;
  }

  .category-card-title {
    font-size: var(--text-sm);
    padding: var(--sp-3) var(--sp-3);
    letter-spacing: 0.03em;
  }

  /* --- Seasonal Specials: always show labels (no hover) --- */
  .specials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .specials-item-img-wrap {
    aspect-ratio: 1 / 1;
  }

  /* Force overlay visible — no hover on touch devices */
  .specials-item-overlay {
    opacity: 1 !important;
    background: linear-gradient(to top, rgba(var(--color-primary-rgb), 0.75) 0%, transparent 60%);
    transition: none;
  }

  /* Disable the hover-triggered opacity change on mobile */
  .specials-item:hover .specials-item-overlay {
    opacity: 1;
  }

  .specials-item-name {
    font-size: var(--text-sm);
  }

  /* --- About Section --- */
  .about-grid {
    gap: var(--sp-6);
  }

  .about-text-col p {
    font-size: var(--text-base);
    line-height: 1.6;
    margin-bottom: var(--sp-4);
  }

  .about-photo {
    aspect-ratio: 16 / 10;
  }

  .about-bica-icon {
    width: 60px;
    bottom: calc(-1 * var(--sp-6));
  }

  /* --- Reviews: horizontal scroll carousel with snap --- */
  .reviews-badge {
    margin-bottom: var(--sp-6);
    padding: var(--sp-2) var(--sp-4);
  }

  .reviews-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: var(--sp-3); /* space for scroll bar */
    /* Negative margin trick to extend scroll to page edge */
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    /* Hide scrollbar visually but keep functional */
    scrollbar-width: none;
  }

  .reviews-grid::-webkit-scrollbar {
    display: none;
  }

  .review-card {
    flex: 0 0 80vw;
    max-width: 320px;
    scroll-snap-align: start;
    padding: var(--sp-5) var(--sp-4);
    /* Ensure full review text visible in carousel */
  }

  /* Show full review text on mobile (not clamp-hidden) */
  .review-card-quote p {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
  }

  /* Carousel scroll indicator */
  .reviews-section::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(var(--color-primary-rgb), 0.15);
    border-radius: var(--rounded-full);
    margin: var(--sp-4) auto 0;
  }

  /* --- Reserve CTA: full-width stacked buttons --- */
  .reserve-section {
    padding: var(--sp-16) 0;
  }

  .reserve-title {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    margin-bottom: var(--sp-3);
  }

  .reserve-text {
    font-size: var(--text-base);
    margin: 0 auto var(--sp-6);
  }

  .reserve-icon {
    width: 48px;
    margin-bottom: var(--sp-4);
  }

  .reserve-ctas {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
    padding: 0 var(--sp-4);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  .reserve-ctas .btn-primary,
  .reserve-ctas .btn-secondary,
  .reserve-ctas .btn-gold {
    width: 100%;
    flex: none;
    justify-content: center;
  }

  /* --- Instagram: 3×2 grid (6 photos) --- */
  .instagram-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-1d5);
  }

  .instagram-handle {
    font-size: var(--text-xl);
  }

  /* --- Social Proof Strip: wrap gracefully --- */
  .proof-strip {
    padding: var(--sp-6) 0;
  }

  .proof-strip-inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-4) var(--sp-2);
  }

  .proof-strip-item {
    padding: 0 var(--sp-3);
    flex: 0 0 auto;
    min-width: 80px;
  }

  .proof-strip-number {
    font-size: var(--text-2xl);
  }

  .proof-strip-label {
    font-size: var(--text-xs);
    white-space: nowrap;
  }

  .proof-strip-divider {
    height: 32px;
    /* Hide dividers when wrapping — they look odd mid-wrap */
    display: none;
  }

  /* --- Section padding mobile --- */
  .category-links,
  .seasonal-specials,
  .about-section,
  .reviews-section,
  .instagram-section {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

/* ========================================
   RESPONSIVE: TABLET (768px+)
   ======================================== */
@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .specials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .instagram-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-16);
  }

  .hero-dots {
    bottom: 140px;
  }
}

/* ========================================
   RESPONSIVE: DESKTOP (1024px+)
   ======================================== */
@media (min-width: 1024px) {
  .hero-cta-btn {
    font-size: var(--text-button);
    padding: var(--sp-3) var(--sp-8);
  }

  .specials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .reviews-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .about-bica-icon {
    width: 120px;
  }

  .proof-strip-number {
    font-size: var(--text-4xl);
  }
}

/* ========================================
   HERO SLIDESHOW JS-DRIVEN ANIMATION
   ======================================== */
.hero-slide.is-entering {
  opacity: 1;
  z-index: 2;
}

.hero-slide.is-leaving {
  opacity: 0;
  z-index: 1;
}
