/*
Theme Name: Haven Dietary
Theme URI: https://example.com/haven-dietary
Author: Haven Dietary
Author URI: https://example.com
Description: A warm, hand-crafted single-page WordPress theme for hospital meal services. Features a masonry-style menu grid, a featured kitchen video, a staff section, and a calming sage / cream / terracotta palette. Fully Elementor-compatible with custom widgets and page templates.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: haven-dietary
Tags: one-page, restaurant, food, healthcare, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --background: #FCFAF8;
  --foreground: #2E382E;
  --muted: #F5F3F0;
  --muted-foreground: #5C665C;
  --border: #E9E7E2;
  --card: #FFFFFF;
  --primary: #85A07E;       /* sage */
  --primary-foreground: #FFFFFF;
  --secondary: #7593A3;     /* ocean blue */
  --secondary-foreground: #FFFFFF;
  --accent: #D58C6C;        /* terracotta */
  --accent-foreground: #FFFFFF;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Outfit', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --shadow-sm: 0 1px 2px rgba(46, 56, 46, 0.04);
  --shadow-md: 0 4px 12px rgba(46, 56, 46, 0.06);
  --shadow-2xl: 0 25px 50px -12px rgba(46, 56, 46, 0.18);
}

/* =========================================================
   Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: rgba(133, 160, 126, 0.2); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 9999px;
  padding: 0.65rem 1.5rem;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: #738D6D; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: rgba(133, 160, 126, 0.06); }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; height: 3.5rem; }

/* =========================================================
   Navigation
   ========================================================= */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(252, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(233, 231, 226, 0.5);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.nav-links {
  display: none;
  gap: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a { transition: color 0.25s ease; }
.nav-links a:hover { color: var(--primary); }
@media (min-width: 768px) { .nav-links { display: flex; } }

/* =========================================================
   Hero
   ========================================================= */
.hero { padding: 8rem 0 5rem; }
@media (min-width: 768px) { .hero { padding: 10rem 0 8rem; } }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr 1fr; } }
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 1.5rem;
}
.hero h1 .accent { color: var(--primary); font-style: italic; display: block; }
.hero p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  line-height: 1.65;
  max-width: 32rem;
}
@media (min-width: 768px) { .hero p { font-size: 1.25rem; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-image {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  aspect-ratio: 4 / 3;
}
@media (min-width: 768px) { .hero-image { aspect-ratio: 1 / 1; } }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   Section utilities
   ========================================================= */
.section { padding: 6rem 0; }
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
.section-lede {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  max-width: 36rem;
}

/* =========================================================
   Philosophy
   ========================================================= */
.philosophy {
  background: rgba(245, 243, 240, 0.6);
  text-align: center;
}
.philosophy-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3.5vw, 3rem);
  line-height: 1.25;
  max-width: 56rem;
  margin: 0 auto;
}

/* =========================================================
   Dietary Accommodations
   ========================================================= */
.diet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  text-align: center;
}
@media (min-width: 768px) {
  .diet-grid { grid-template-columns: repeat(3, 1fr); text-align: left; }
}
.diet-grid h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.diet-grid p { color: var(--muted-foreground); line-height: 1.7; }

/* =========================================================
   Menu (masonry)
   ========================================================= */
.menu-section { padding: 8rem 0; }
.menu-header { text-align: center; margin-bottom: 4rem; }
.menu-header .section-lede { margin: 0 auto; }

.menu-masonry {
  --haven-meal-cols: 3;          /* widget overrides via inline style */
  column-count: 1;               /* mobile: always 1 */
  column-gap: 2rem;
}
@media (min-width: 640px) {
  /* tablet: at most 2 columns, but never more than the widget asks for */
  .menu-masonry { column-count: min(2, var(--haven-meal-cols)); }
}
@media (min-width: 1024px) {
  /* desktop: honor whatever the widget requested */
  .menu-masonry { column-count: var(--haven-meal-cols); }
}

.meal-card {
  break-inside: avoid;
  margin-bottom: 2rem;
  cursor: pointer;
  display: block;
}
.meal-image {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}
.meal-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.meal-card:hover .meal-image img { transform: scale(1.05); }
.meal-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.5s ease;
}
.meal-card:hover .meal-image::after { background: rgba(0,0,0,0.1); }

.meal-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.meal-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  background: rgba(213, 140, 108, 0.1);
  color: var(--accent);
  border-radius: 0.25rem;
}
.meal-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  transition: color 0.25s ease;
}
.meal-card:hover h3 { color: var(--primary); }
.meal-card p { color: var(--muted-foreground); font-size: 0.9rem; line-height: 1.65; }

/* aspect helpers (mirroring the original layout) */
.aspect-square  { aspect-ratio: 1 / 1; }
.aspect-3-4     { aspect-ratio: 3 / 4; }
.aspect-4-3     { aspect-ratio: 4 / 3; }

/* =========================================================
   Kitchen / Video
   ========================================================= */
.kitchen-section { background: var(--card); padding: 8rem 0; }
.kitchen-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}
@media (min-width: 1024px) { .kitchen-grid { grid-template-columns: 1fr 1fr; } }
.kitchen-video {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--muted);
  order: 2;
}
.kitchen-video video { width: 100%; height: 100%; object-fit: cover; }
.kitchen-text { order: 1; display: flex; flex-direction: column; gap: 1.5rem; }
.kitchen-text h2 { font-size: clamp(2rem, 4vw, 3rem); }
.kitchen-text p { color: var(--muted-foreground); font-size: 1.125rem; line-height: 1.7; }
@media (min-width: 1024px) {
  .kitchen-video { order: 1; }
  .kitchen-text { order: 2; }
}

/* =========================================================
   Testimonials
   ========================================================= */
.testimonials { background: rgba(117, 147, 163, 0.08); padding: 8rem 0; }
.testimonials-header { text-align: center; margin-bottom: 4rem; }
.testimonials-header h2 { font-size: 2.25rem; color: var(--secondary); }
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) { .testimonials-grid { grid-template-columns: repeat(3, 1fr); } }
.testimonial-card {
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.testimonial-card .quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}
.testimonial-card .author { font-weight: 700; font-size: 0.875rem; }
.testimonial-card .role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* =========================================================
   Staff
   ========================================================= */
.staff-section { padding: 8rem 0; }
.staff-header { margin-bottom: 4rem; max-width: 36rem; }
.staff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem 2rem;
}
@media (min-width: 768px) { .staff-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .staff-grid { grid-template-columns: repeat(3, 1fr); } }

.staff-card .portrait {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--muted);
}
.staff-card .portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.staff-card:hover .portrait img { transform: scale(1.05); }
.staff-card h3 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.staff-card .role { color: var(--primary); font-weight: 500; margin-bottom: 0.75rem; }
.staff-card p { color: var(--muted-foreground); line-height: 1.7; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--foreground);
  color: var(--background);
  padding: 5rem 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 2rem; } }
.footer-brand .brand-text {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  color: rgba(252, 250, 248, 0.9);
  margin-bottom: 1.5rem;
}
.footer-brand p {
  color: rgba(252, 250, 248, 0.6);
  max-width: 28rem;
  line-height: 1.7;
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: rgba(252, 250, 248, 0.4);
  margin-bottom: 1.5rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; color: rgba(252, 250, 248, 0.8); }
.footer-col a { transition: color 0.25s ease; }
.footer-col a:hover { color: #fff; }
.footer-col li.address { padding-top: 1rem; color: rgba(252, 250, 248, 0.4); font-size: 0.875rem; }

/* =========================================================
   Reveal animations
   ========================================================= */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-left.is-visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-right.is-visible { opacity: 1; transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right {
    opacity: 1; transform: none; transition: none;
  }
  html { scroll-behavior: auto; }
}

/* =========================================================
   Elementor / Page templates
   ========================================================= */
.haven-page { padding-top: 80px; } /* offset for sticky header */
.haven-canvas { padding-top: 0; }
.haven-page--fullwidth > .elementor { width: 100%; }
.haven-page-article .haven-page-content > * + * { margin-top: 1.25rem; }
.haven-page-article .haven-page-content { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; }
.haven-page--fullwidth .haven-page-content { max-width: none; padding: 0; }
.haven-post-header { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem 0; }

/* Make sure custom widgets honor section padding even when nested in Elementor sections */
.elementor-widget-haven_meal_grid .menu-section,
.elementor-widget-haven_staff_grid .staff-section,
.elementor-widget-haven_video_block .kitchen-section,
.elementor-widget-haven_testimonials .testimonials { padding-block: 6rem; }

/* =========================================================
   Featured (single) testimonial widget
   ========================================================= */
.featured-testimonial { padding: 6rem 0; }
.featured-testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 64rem;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .featured-testimonial-grid {
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 3.5rem;
  }
  .featured-testimonial--right .featured-testimonial-person { order: 2; }
  .featured-testimonial--right .featured-testimonial-quote  { order: 1; }
}
.featured-testimonial-person {
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.featured-testimonial-photo {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--muted);
  box-shadow: 0 12px 32px rgba(46, 56, 46, 0.12);
}
.featured-testimonial-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.featured-testimonial-name {
  font-family: var(--font-serif, 'Fraunces', serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
}
.featured-testimonial-role {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  letter-spacing: 0.04em;
}
.featured-testimonial-quote {
  margin: 0;
  border-left: 3px solid var(--primary);
  padding-left: 1.75rem;
}
.featured-testimonial-quote p {
  font-family: var(--font-serif, 'Fraunces', serif);
  font-size: 1.5rem;
  line-height: 1.5;
  color: var(--foreground);
  font-style: italic;
  margin: 0;
}
@media (min-width: 768px) {
  .featured-testimonial-quote p { font-size: 1.75rem; }
}

/* =========================================================
   Hero widget — image fit overrides
   ========================================================= */
.haven-hero-image { overflow: hidden; }
.haven-hero-image img {
  /* Inline styles set by the widget will override these. */
  width: 100%;
  height: 100%;
  display: block;
}
/* Reset the legacy hard-coded aspect ratios when our widget is in control. */
.hero-image.haven-hero-image { aspect-ratio: unset; }
@media (min-width: 768px) {
  .hero-image.haven-hero-image { aspect-ratio: unset; }
}
