/* ============================================================
   CAFÉ WEBSITE — MAIN STYLESHEET
   A warm, modern café theme built mobile-first.
   Font stack: Playfair Display (headings) + Lato (body)
   Breakpoints: 768px (tablet) · 1024px (desktop)
   ============================================================ */

/* ---------- Google Fonts import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

/* ==========================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================== */
:root {
  /* --- Colour palette --- */
  --clr-espresso: #3E2723;
  /* deep brown            */
  --clr-mocha: #5D4037;
  /* medium brown           */
  --clr-latte: #8D6E63;
  /* warm mid-tone          */
  --clr-cream: #FFF8E1;
  /* warm off-white bg      */
  --clr-beige: #D7CCC8;
  /* soft neutral           */
  --clr-green: #2E7D32;
  /* accent dark green      */
  --clr-green-light: #4CAF50;
  /* lighter green hover    */
  --clr-charcoal: #212121;
  /* near-black text        */
  --clr-white: #FFFFFF;
  --clr-overlay: rgba(62, 39, 35, 0.65);

  /* --- Typography --- */
  --ff-heading: 'Playfair Display', Georgia, serif;
  --ff-body: 'Lato', 'Segoe UI', sans-serif;

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

  /* --- Misc --- */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --transition: 0.3s ease;
}

/* ==========================================================
   2. RESET & BASE STYLES
   ========================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--ff-body);
  color: var(--clr-charcoal);
  background-color: var(--clr-cream);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* ==========================================================
   3. TYPOGRAPHY
   ========================================================== */
h1,
h2,
h3,
h4 {
  font-family: var(--ff-heading);
  color: var(--clr-espresso);
  line-height: 1.25;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

p {
  margin-bottom: var(--sp-md);
  color: var(--clr-mocha);
}

/* ==========================================================
   4. UTILITY / LAYOUT HELPERS
   ========================================================== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  padding: var(--sp-3xl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--sp-xl);
  position: relative;
}

/* decorative underline after section titles */
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--clr-green);
  margin: var(--sp-sm) auto 0;
  border-radius: 2px;
}

.text-center {
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

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

.btn-primary:hover {
  background: var(--clr-green-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.btn-outline:hover {
  background: var(--clr-white);
  color: var(--clr-espresso);
  transform: translateY(-2px);
}

.btn-dark {
  background: var(--clr-espresso);
  color: var(--clr-cream);
}

.btn-dark:hover {
  background: var(--clr-mocha);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ==========================================================
   5. NAVIGATION BAR (sticky + transparent → solid)
   ========================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: var(--sp-md) 0;
  transition: background var(--transition), box-shadow var(--transition);
}

/* when scrolled, JS adds .scrolled */
.navbar.scrolled {
  background: var(--clr-espresso);
  box-shadow: var(--shadow);
  padding: var(--sp-sm) 0;
}

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

/* --- Logo --- */
.navbar .logo {
  font-family: var(--ff-heading);
  font-size: 1.6rem;
  color: var(--clr-white);
  font-weight: 700;
}

.navbar .logo span {
  color: var(--clr-green-light);
}

/* --- Nav links (desktop) --- */
.nav-links {
  display: flex;
  gap: var(--sp-lg);
}

.nav-links a {
  color: var(--clr-white);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 4px;
}

/* animated underline on hover */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--clr-green-light);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* --- Hamburger button (mobile) --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--clr-white);
  border-radius: 2px;
  transition: all var(--transition);
}

/* hamburger → X animation */
.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================
   6. HERO SECTION
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--clr-white);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* dark overlay on hero image */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--clr-overlay);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 0 var(--sp-md);
}

.hero-content h1 {
  color: var(--clr-white);
  margin-bottom: var(--sp-md);
}

.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  margin-bottom: var(--sp-xl);
}

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

/* ---- Page hero (shorter, for inner pages) ---- */
.page-hero {
  min-height: 45vh;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--clr-white);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--clr-overlay);
  z-index: 1;
}

.page-hero-content {
  position: relative;
  z-index: 2;
}

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

.page-hero-content p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
}

/* ==========================================================
   7. ABOUT PREVIEW (Home page)
   ========================================================== */
.about-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
  align-items: center;
}

.about-preview img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.about-preview-text h2 {
  margin-bottom: var(--sp-md);
}

/* ==========================================================
   8. FEATURED MENU ITEMS (Home page)
   ========================================================== */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
}

/* individual menu card */
.menu-card {
  background: var(--clr-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.menu-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.menu-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.menu-card-body {
  padding: var(--sp-lg);
}

.menu-card-body h3 {
  margin-bottom: var(--sp-xs);
}

.menu-card-body .price {
  font-weight: 700;
  color: var(--clr-green);
  font-size: 1.1rem;
  margin-top: var(--sp-sm);
  display: block;
}

.menu-card-body p {
  font-size: 0.92rem;
}

/* ==========================================================
   9. TESTIMONIALS
   ========================================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
}

.testimonial-card {
  background: var(--clr-white);
  padding: var(--sp-xl);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
}

/* big quote mark */
.testimonial-card::before {
  content: '\201C';
  font-family: var(--ff-heading);
  font-size: 4rem;
  color: var(--clr-beige);
  position: absolute;
  top: 10px;
  left: 20px;
  line-height: 1;
}

.testimonial-card p {
  font-style: italic;
  margin-bottom: var(--sp-md);
}

.testimonial-card .author {
  font-weight: 700;
  color: var(--clr-espresso);
  font-style: normal;
}

/* ==========================================================
   10. INSTAGRAM-STYLE GALLERY GRID
   ========================================================== */
.insta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-sm);
}

.insta-grid .grid-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 1 / 1;
}

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

.insta-grid .grid-item:hover img {
  transform: scale(1.08);
}

/* hover overlay */
.insta-grid .grid-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(62, 39, 35, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.insta-grid .grid-item:hover .overlay {
  opacity: 1;
}

.insta-grid .grid-item .overlay span {
  color: var(--clr-white);
  font-size: 1.5rem;
}

/* ==========================================================
   11. FULL GALLERY PAGE
   ========================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
}

.gallery-grid .gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

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

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

.gallery-grid .gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(62, 39, 35, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-grid .gallery-item:hover .overlay {
  opacity: 1;
}

.gallery-grid .gallery-item .overlay span {
  color: var(--clr-white);
  font-size: 2rem;
}

/* --- Lightbox modal --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: var(--clr-white);
  cursor: pointer;
  background: none;
  border: none;
  transition: transform var(--transition);
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: var(--clr-white);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* ==========================================================
   12. ABOUT PAGE — STORY SPLIT, TEAM, MISSION
   ========================================================== */
.story-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
  align-items: center;
}

.story-split img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.story-text h2 {
  margin-bottom: var(--sp-md);
}

/* Mission / Values */
.values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
  margin-top: var(--sp-xl);
}

.value-card {
  background: var(--clr-white);
  padding: var(--sp-xl);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform var(--transition);
}

.value-card:hover {
  transform: translateY(-4px);
}

.value-card .icon {
  font-size: 2.5rem;
  margin-bottom: var(--sp-md);
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-xl);
  text-align: center;
}

.team-member img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--sp-md);
  border: 4px solid var(--clr-beige);
  box-shadow: var(--shadow);
}

.team-member h3 {
  margin-bottom: var(--sp-xs);
}

.team-member p {
  font-size: 0.9rem;
}

/* ==========================================================
   13. CONTACT PAGE
   ========================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
}

/* --- Form --- */
.contact-form {
  background: var(--clr-white);
  padding: var(--sp-xl);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: var(--sp-lg);
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
  color: var(--clr-espresso);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--clr-beige);
  border-radius: var(--radius-sm);
  font-family: var(--ff-body);
  font-size: 1rem;
  transition: border-color var(--transition);
  background: var(--clr-cream);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--clr-green);
}

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

/* --- Info cards --- */
.contact-info-card {
  background: var(--clr-white);
  padding: var(--sp-xl);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-info-card h3 {
  margin-bottom: var(--sp-md);
}

.contact-info-card p {
  margin-bottom: var(--sp-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.contact-info-card .icon {
  font-size: 1.2rem;
  color: var(--clr-green);
}

/* map container */
.map-wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: var(--sp-xl);
}

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

/* social links row */
.social-links {
  display: flex;
  gap: var(--sp-md);
  margin-top: var(--sp-md);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clr-espresso);
  color: var(--clr-white);
  font-size: 1.1rem;
  transition: background var(--transition), transform var(--transition);
}

.social-links a:hover {
  background: var(--clr-green);
  transform: translateY(-3px);
}

/* ==========================================================
   14. FOOTER
   ========================================================== */
.site-footer {
  background: var(--clr-espresso);
  color: var(--clr-beige);
  padding: var(--sp-3xl) 0 var(--sp-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}

.footer-col h4 {
  color: var(--clr-white);
  margin-bottom: var(--sp-md);
  font-size: 1.1rem;
}

.footer-col p,
.footer-col li {
  font-size: 0.9rem;
  color: var(--clr-beige);
  margin-bottom: var(--sp-sm);
}

.footer-col a {
  color: var(--clr-beige);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--clr-green-light);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--sp-md);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================
   15. BACK-TO-TOP BUTTON
   ========================================================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--clr-green);
  color: var(--clr-white);
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--clr-green-light);
  transform: translateY(-3px);
}

/* ==========================================================
   16. SCROLL FADE-IN ANIMATIONS
   ========================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ==========================================================
   17. RESPONSIVE — TABLET (≥ 768px)
   ========================================================== */
@media (min-width: 768px) {

  /* Two-column grids */
  .about-preview,
  .story-split,
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

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

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

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

/* ==========================================================
   18. RESPONSIVE — DESKTOP (≥ 1024px)
   ========================================================== */
@media (min-width: 1024px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

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

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

  /* larger hero text */
  .hero-content p {
    font-size: 1.25rem;
  }
}

/* ==========================================================
   19. MOBILE NAV DRAWER (< 768px)
   ========================================================== */
@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--clr-espresso);
    flex-direction: column;
    padding: 5rem var(--sp-xl) var(--sp-xl);
    gap: var(--sp-lg);
    transition: right var(--transition);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    /* Must be above the overlay (z-index: 999) so links receive tap events */
    z-index: 1000;
  }

  .nav-links.open {
    right: 0;
  }

  /* dim background when nav open */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .nav-overlay.active {
    display: block;
  }
}

/* Large screens: hide overlay helper div */
@media (min-width: 768px) {
  .nav-overlay {
    display: none !important;
  }
}