/* =============================================
   GOOGLE FONT — DM Serif Display
   Loaded via <link> in each HTML file.
   Applied to all headings and the logo below.
============================================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&display=swap');

/* =============================================
   RESET & BASE
   Browsers have their own default styles that
   differ from each other. This block wipes them
   out so we start from a consistent blank slate.
============================================= */
*, *::before, *::after {
  box-sizing: border-box; /* padding/border are included in element width */
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* makes anchor links glide instead of jump */
}

h1, h2, h3, h4, .nav-logo {
  font-family: 'DM Serif Display', serif;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%; /* images never overflow their container */
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}


/* =============================================
   CSS VARIABLES (Design Tokens)
   Define colours and sizes once here.
   Change a value here and it updates everywhere.
============================================= */
:root {
  --clr-bg:        #faf7f2; /* warm off-white page background */
  --clr-bg-alt:    #f0e9df; /* slightly darker, used for alternate sections */
  --clr-brown:     #3d1f0a; /* deep espresso brown — headings, navbar */
  --clr-mid:       #6b3a1f; /* medium roast — hover states */
  --clr-amber:     #c8873a; /* warm amber — accent colour, buttons */
  --clr-amber-dk:  #a86c28; /* darker amber — button hover */
  --clr-text:      #2c1810; /* near-black for body text */
  --clr-muted:     #7a6355; /* softer colour for subtitles */
  --clr-white:     #ffffff;

  --max-width: 1100px;      /* widest the content ever gets */
  --section-pad: 5rem 1.5rem; /* top/bottom and left/right padding for sections */
  --radius: 10px;           /* rounded corner size used on cards etc. */
  --shadow: 0 4px 20px rgba(61, 31, 10, 0.08); /* subtle drop shadow */
}


/* =============================================
   REUSABLE UTILITIES
   Small helper classes used across many sections.
============================================= */

/* .container centres content and caps its max width */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* .section applies consistent top/bottom space to every section */
.section {
  padding: var(--section-pad);
}

/* Alternate sections get a slightly different background so
   the page doesn't look like one flat wall of colour */
.about,
.hours {
  background-color: var(--clr-bg-alt);
}

/* Section headings — the big h2 titles */
.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem); /* scales with viewport width */
  color: var(--clr-brown);
  margin-bottom: 0.5rem;
}

/* Subtitle text that sits just below a section heading */
.section-sub {
  color: var(--clr-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* .btn — the reusable amber call-to-action button */
.btn {
  display: inline-block;
  background-color: var(--clr-amber);
  color: var(--clr-white);
  padding: 0.75rem 2rem;
  border-radius: 50px; /* fully rounded pill shape */
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  background-color: var(--clr-amber-dk);
  transform: translateY(-2px); /* tiny lift on hover */
}


/* =============================================
   NAVBAR
   Fixed to the top of the screen so it stays
   visible as the user scrolls.
============================================= */
.navbar {
  position: fixed;     /* sticks to the top even while scrolling */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;       /* sits above all other content */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background-color: var(--clr-brown);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* The shop name / logo on the left */
.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--clr-white);
  letter-spacing: 0.5px;
}

/* The list of page-section links on the right */
.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--clr-amber);
}

/* The hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none; /* hidden by default; shown in the mobile media query below */
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

/* Each of the three hamburger lines */
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--clr-white);
  border-radius: 2px;
  transition: all 0.3s ease;
}


/* =============================================
   HERO
   The big opening banner. Uses a dark background
   colour with a radial gradient for depth.
   The page content starts below the fixed navbar,
   so we use min-height: 100vh.
============================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
  /* Two backgrounds stacked: a dark gradient on top of a cafe photo.
     The gradient dims the photo so the white text stays easy to read.
     To use your own photo, replace the URL with your image file name,
     e.g. url('images/my-cafe.jpg') */
  background:
    linear-gradient(rgba(30, 10, 0, 0.60), rgba(30, 10, 0, 0.70)),
    url('front page.avif') center / cover no-repeat;
  color: var(--clr-white);
}

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.hero-kosher {
  display: inline-block;
  border: 1.5px solid var(--clr-amber);
  color: var(--clr-amber);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 1.2rem;
}

.hero-tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: rgba(255,255,255,0.8);
  margin-bottom: 2.5rem;
  font-style: italic;
}


/* =============================================
   ABOUT
   Two-column layout: text left, image right.
   gap controls the space between the columns.
============================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two equal columns */
  gap: 3rem;
  align-items: center;
}

.about-text h2 {
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--clr-text);
  margin-bottom: 1rem;
}

.about-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  object-fit: cover;
}


/* =============================================
   MENU
   Category headings + a three-card grid per category.
   Cards use flexbox to push the price to the bottom.
============================================= */
.menu-category {
  font-size: 1.2rem;
  color: var(--clr-amber);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--clr-amber);
  padding-bottom: 0.4rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* three cards side by side */
  gap: 1.5rem;
}

.menu-card {
  background: var(--clr-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column; /* stack children vertically */
}

.menu-card h4 {
  font-size: 1.05rem;
  color: var(--clr-brown);
  margin-bottom: 0.4rem;
}

.menu-card p {
  font-size: 0.9rem;
  color: var(--clr-muted);
  flex-grow: 1; /* pushes the price to the bottom of the card */
}

.price {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--clr-amber-dk);
}


/* =============================================
   GALLERY
   A CSS grid of images. The grid auto-fills
   columns that are at least 280px wide.
============================================= */
.gallery {
  background-color: var(--clr-brown);
}

.gallery h2,
.gallery .section-sub {
  color: var(--clr-white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Each gallery item is a box that clips the image and holds the label */
.gallery-item {
  position: relative;       /* lets us position the label inside it */
  overflow: hidden;         /* hides any part of the image that sticks out */
  border-radius: var(--radius);
  height: 220px;            /* all items the same height — keeps the grid uniform */
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* crops to fill without stretching */
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);   /* subtle zoom on hover */
}

/* Dark gradient that fades from transparent at the top to dark at the bottom.
   This is what makes the white label text easy to read. */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;                 /* stretches to all four edges */
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(0, 0, 0, 0.65) 100%
  );
  border-radius: var(--radius);
}

/* Make the <a> gallery items behave like the old <div> ones */
a.gallery-item {
  cursor: pointer;
  text-decoration: none;
}

/* The label text — sits at the bottom of the image, on top of the gradient */
.gallery-label {
  position: absolute;
  bottom: 0.9rem;
  left: 1rem;
  z-index: 1;
  color: var(--clr-white);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}

/* "Tap to explore →" hint — hidden until hover */
.gallery-hint {
  position: absolute;
  bottom: 0.9rem;
  right: 1rem;
  z-index: 1;
  color: var(--clr-amber);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;               /* invisible by default */
  transform: translateX(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover .gallery-hint {
  opacity: 1;               /* fades in on hover */
  transform: translateX(0);
}

.gallery-item:hover .gallery-label {
  transform: translateX(-4px);
}


/* =============================================
   PAGE FADE-IN TRANSITION
   Every page (including sub-pages) fades in
   gently when it loads. script.js adds a
   fade-out before navigating away.
============================================= */
body {
  animation: pageFadeIn 0.4s ease both;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Class added by script.js just before navigating away */
body.fade-out {
  animation: pageFadeOut 0.3s ease both;
}

@keyframes pageFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}


/* =============================================
   SUB-PAGES (espresso, cold brew, etc.)
   Shared styles used by all six detail pages.
============================================= */

/* Push content below the fixed navbar */
.subpage-hero {
  position: relative;
  height: 380px;
  margin-top: 68px;
  overflow: hidden;
}

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

/* Same dark gradient trick as the gallery items */
.subpage-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20,8,0,0.35), rgba(20,8,0,0.72));
}

.subpage-hero-text {
  position: absolute;
  bottom: 2.5rem;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 1;
  color: var(--clr-white);
  padding: 0 1.5rem;
}

.subpage-hero-text h1 {
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.subpage-hero-text p {
  font-size: 1.1rem;
  opacity: 0.85;
  font-style: italic;
}

/* "← Back to Menu" link */
.back-btn {
  display: inline-block;
  margin-bottom: 2.5rem;
  color: var(--clr-amber);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s, transform 0.2s;
}

.back-btn:hover {
  color: var(--clr-amber-dk);
  transform: translateX(-3px);
}

.subpage-content {
  padding: 3rem 1.5rem 5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Three cards side by side */
.subpage-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.subpage-card {
  background: var(--clr-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.subpage-card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.subpage-card h3 {
  color: var(--clr-brown);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.subpage-card p {
  color: var(--clr-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  flex-grow: 1;
}

.subpage-card .price {
  margin-top: 1.2rem;
  font-size: 1.15rem;
}

/* Info pages (The Counter, Cozy Corner) */
.info-section {
  padding: 4rem 1.5rem 5rem;
  max-width: 750px;
  margin: 0 auto;
}

.info-section h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--clr-brown);
  margin-bottom: 1.2rem;
}

.info-section p {
  font-size: 1.05rem;
  color: var(--clr-text);
  line-height: 1.85;
  margin-bottom: 1rem;
}

/* Mobile adjustments for sub-pages */
@media (max-width: 768px) {
  .subpage-hero { height: 260px; }
  .subpage-cards { grid-template-columns: 1fr; }
}


/* =============================================
   HOURS
   Centres the table on the page.
   The "Closed" row is styled a softer colour.
============================================= */
.hours-inner {
  max-width: 500px; /* narrower than full width — keeps table readable */
}

.hours h2 {
  margin-bottom: 1.5rem;
}

.hours-table {
  width: 100%;
  border-collapse: collapse; /* removes gaps between table cells */
}

.hours-table td {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(61, 31, 10, 0.12);
  font-size: 1rem;
}

/* Right-align the times column */
.hours-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--clr-brown);
}

/* Sunday / Closed row */
.hours-table tr.closed td {
  color: var(--clr-muted);
  font-style: italic;
}


/* =============================================
   CONTACT
   Two-column layout: form left, map+address right.
============================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-form-wrap h2 {
  margin-bottom: 0.5rem;
}

.contact-form-wrap > p {
  color: var(--clr-muted);
  margin-bottom: 1.5rem;
}

/* Stack the form labels and inputs vertically */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--clr-brown);
  margin-top: 0.4rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #ddd3c8;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--clr-text);
  background: var(--clr-white);
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--clr-amber); /* amber highlight on focus */
}

.contact-form .btn {
  margin-top: 0.5rem;
  align-self: flex-start; /* don't stretch the button to full width */
}

/* Success message — hidden until form is submitted */
.form-success {
  display: none;
  color: #2e7d32; /* green */
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Map placeholder box */
.map-placeholder {
  background: var(--clr-bg-alt);
  border: 2px dashed #c4b09a;
  border-radius: var(--radius);
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--clr-muted);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.map-sub {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.contact-address h3 {
  color: var(--clr-brown);
  margin-bottom: 0.75rem;
}

.contact-address p {
  color: var(--clr-text);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}


/* =============================================
   FOOTER
   Dark bar at the very bottom of the page.
============================================= */
.footer {
  background-color: var(--clr-brown);
  color: rgba(255,255,255,0.7);
  padding: 4rem 1.5rem;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--clr-amber);
}


/* =============================================
   MOBILE — MEDIA QUERIES
   Everything above is for desktop (wide screens).
   Below we override specific styles for small screens.
   "max-width: 768px" means: apply these rules ONLY
   when the screen is 768px wide or narrower.
============================================= */
@media (max-width: 768px) {

  /* --- Navbar: show hamburger, hide links by default --- */
  .nav-toggle {
    display: flex; /* make the ☰ button visible */
  }

  .nav-links {
    /* Hide the links off-screen above the navbar */
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%; /* drop down just below the navbar */
    left: 0;
    right: 0;
    background-color: var(--clr-brown);
    padding: 0.5rem 0 1rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  }

  /* When script.js adds the class "open", the menu appears */
  .nav-links.open {
    display: flex;
  }

  .nav-links li a {
    display: block;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  /* --- Sections: reduce padding on mobile --- */
  .section {
    padding: 3rem 1.25rem;
  }

  /* --- About: stack image below text --- */
  .about-grid {
    grid-template-columns: 1fr; /* single column */
  }

  /* --- Menu: one card per row on very small screens --- */
  .menu-grid {
    grid-template-columns: 1fr;
  }

  /* --- Contact: stack form above map --- */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* --- Footer: stack copyright above links --- */
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Slightly wider breakpoint for menu — two columns on tablets */
@media (min-width: 500px) and (max-width: 900px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
