/* ═══════════════════════════════════════════════════════════
   CHEFBOOK AI — Website Stylesheet
   Colors: Terracotta #C45427, Gold #D4A053, Olive #8DB83E
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --terracotta: #C45427;
  --terracotta-dark: #A3431E;
  --gold: #D4A053;
  --olive: #8DB83E;
  --bg: #FAF8F5;
  --bg-warm: #F5F0EB;
  --dark: #2D2A26;
  --text: #4A4540;
  --text-light: #8A8580;
  --card: #FFFFFF;
  --border: #E8E2DA;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--dark);
  line-height: 1.2;
}

a { color: var(--terracotta); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

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

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

/* ─── NAVBAR ──────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.06); }

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-brand img.nav-logo { margin-top: 24px; margin-left: -25px; }

.nav-brand img.nav-icon { height: 120px; width: 120px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(196,84,39,0.3)); }
.nav-brand img.nav-logo { height: 70px; object-fit: contain; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active { color: var(--terracotta); opacity: 1; }

.nav-cta {
  background: var(--terracotta);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--terracotta-dark); transform: translateY(-1px); opacity: 1; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--dark);
  transition: 0.3s;
}

/* ─── LANGUAGE SELECTOR ──────────────────────────────── */

.lang-selector select {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.lang-selector select:hover,
.lang-selector select:focus {
  border-color: var(--terracotta);
}

/* ─── HERO ────────────────────────────────────────────── */

.hero {
  padding: 140px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 em {
  color: var(--terracotta);
  font-style: italic;
}

.hero p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--terracotta);
  color: #fff;
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover { background: var(--terracotta-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(196,84,39,0.3); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--terracotta);
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  border: 2px solid var(--terracotta);
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover { background: var(--terracotta); color: #fff; }

.hero-image {
  margin-top: 60px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.12);
}

.hero-image img { width: 100%; display: block; }

.hero-chef-icon {
  width: 360px;
  height: 360px;
  margin: 0 auto 30px;
  filter: drop-shadow(0 12px 24px rgba(196,84,39,0.25));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* ─── SECTIONS ────────────────────────────────────────── */

section { padding: 100px 0; }

.section-warm { background: var(--bg-warm); }
.section-dark { background: var(--dark); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: rgba(255,255,255,0.8); }

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
}

.section-header p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 12px;
}

/* ─── FEATURE GRID ────────────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.feature-card {
  background: var(--card);
  border-radius: 20px;
  padding: 40px 32px;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.feature-icon.terracotta { background: rgba(196,84,39,0.1); color: var(--terracotta); }
.feature-icon.gold { background: rgba(212,160,83,0.1); color: var(--gold); }
.feature-icon.olive { background: rgba(141,184,62,0.1); color: var(--olive); }

.feature-card h3 { font-size: 22px; margin-bottom: 12px; }
.feature-card p { color: var(--text-light); font-size: 15px; }

/* ─── PRICING ─────────────────────────────────────────── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--card);
  border-radius: 24px;
  padding: 40px 32px;
  border: 2px solid var(--border);
  text-align: center;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

/* .btn-secondary is an inline <a>, which ignores width:100%; pinning every CTA
   to the bottom also lines the three buttons up across cards of uneven length. */
.pricing-card > a { display: flex; justify-content: center; margin-top: auto; }

.pricing-card.featured {
  border-color: var(--terracotta);
  position: relative;
  transform: scale(1.03);
}

.pricing-card.featured::before {
  content: 'BEST VALUE';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--terracotta);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
  letter-spacing: 1px;
}

.pricing-card h3 { font-size: 24px; margin-bottom: 8px; }

.pricing-features {
  list-style: none;
  text-align: left;
  margin: 24px 0;
}

.pricing-features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before { content: '✓'; color: var(--olive); font-weight: 700; }

/* ─── GALLERY GRID ────────────────────────────────────── */

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

.gallery-card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

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

.gallery-card-body { padding: 20px; }

.gallery-card h4 { font-size: 18px; margin-bottom: 6px; }

.gallery-card p { font-size: 13px; color: var(--text-light); }

.gallery-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 10px;
}

.gallery-tag.easy { background: rgba(141,184,62,0.15); color: var(--olive); }
.gallery-tag.medium { background: rgba(212,160,83,0.15); color: var(--gold); }
.gallery-tag.hard { background: rgba(196,84,39,0.15); color: var(--terracotta); }

/* ─── SPLIT SECTION ───────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.split-image {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}

.split-image img { width: 100%; display: block; }

.split-content h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 20px;
}

.split-content p {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 16px;
}

/* ─── QUOTE ───────────────────────────────────────────── */

.quote-section {
  text-align: center;
  padding: 80px 0;
}

.quote-mark {
  font-size: 64px;
  color: var(--terracotta);
  opacity: 0.3;
  line-height: 1;
}

.quote-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-style: italic;
  color: var(--dark);
  max-width: 700px;
  margin: 20px auto;
  line-height: 1.6;
}

.quote-author {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 16px;
}

/* ─── CTA BANNER ──────────────────────────────────────── */

.cta-banner {
  background: var(--terracotta);
  border-radius: 24px;
  padding: 60px 40px;
  text-align: center;
  color: #fff;
  margin: 60px 0;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.cta-banner h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 16px;
}

.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 30px; font-size: 16px; }

.btn-white {
  background: #fff;
  color: var(--terracotta);
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
}

.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); color: var(--terracotta); }

/* ─── LEGAL (Privacy, Terms) ──────────────────────────── */

.legal-page { padding: 120px 0 80px; }

.legal-page h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.legal-date { color: var(--text-light); font-size: 14px; margin-bottom: 40px; }

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 1.4rem;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--terracotta);
}

.legal-content h3 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-content p { margin-bottom: 16px; font-size: 15px; line-height: 1.8; }
.legal-content ul { margin: 12px 0 16px 24px; }
.legal-content li { margin-bottom: 8px; font-size: 15px; }

.legal-sidebar {
  position: sticky;
  top: 100px;
}

.legal-sidebar a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-light);
  border-left: 2px solid var(--border);
  transition: all 0.2s;
}

.legal-sidebar a:hover, .legal-sidebar a.active {
  color: var(--terracotta);
  border-color: var(--terracotta);
  opacity: 1;
}

/* ─── FAQ ──────────────────────────────────────────────── */

.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--card);
}

.faq-question {
  padding: 20px 24px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.faq-question:hover { background: var(--bg-warm); }

.faq-question::after {
  content: '+';
  font-size: 24px;
  color: var(--terracotta);
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 24px 20px;
}

.faq-answer p { font-size: 15px; color: var(--text-light); line-height: 1.7; }

/* ─── FOOTER ──────────────────────────────────────────── */

.footer {
  background: var(--bg-warm);
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand img { height: 50px; margin-bottom: 16px; }

.footer-brand p { font-size: 14px; color: var(--text-light); max-width: 280px; }

.footer h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer ul { list-style: none; }

.footer li { margin-bottom: 10px; }

.footer li a { font-size: 14px; color: var(--text-light); }
.footer li a:hover { color: var(--terracotta); opacity: 1; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-light);
}

/* ─── ANIMATIONS ──────────────────────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ─── RESPONSIVE ──────────────────────────────────────── */

/* The full nav needs up to 1193px in one line (Vietnamese; English 1034px),
   measured across all 18 languages. Below that it wrapped onto the logo, so
   it collapses to the toggle well before then rather than at tablet width. */
@media (max-width: 1240px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    background: var(--bg);
    padding: 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-toggle { display: flex; }
}

@media (max-width: 768px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split.reverse .split-image { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 120px 0 60px; }
  .pricing-card.featured { transform: none; }
  .hero-chef-icon { width: 240px; height: 240px; }
}

@media (max-width: 480px) {
  /* At desktop size the brand alone is ~330px and ran into the toggle on phones. */
  .nav-brand img.nav-icon { height: 80px; width: 80px; }
  .nav-brand img.nav-logo { height: 46px; margin-top: 16px; margin-left: -16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .features-grid { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
}

/* ─── MULTI-LANGUAGE TYPOGRAPHY ──────────────────────── */

/* Prevent overflow from long translated strings */
h1, h2, h3, h4, p, li, a, span, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* CJK languages (Japanese, Korean, Chinese) — allow line breaks anywhere */
html[lang="ja"] *, html[lang="ko"] *, html[lang="zh"] * {
  word-break: break-all;
  line-break: strict;
}

/* Arabic — RTL support */
html[lang="ar"] {
  direction: rtl;
  text-align: right;
}
html[lang="ar"] .nav-links { flex-direction: row-reverse; }
html[lang="ar"] .nav-links.open { flex-direction: column; }
html[lang="ar"] .split { direction: ltr; }
html[lang="ar"] .split-content { text-align: right; direction: rtl; }
html[lang="ar"] .footer-grid { direction: rtl; }
html[lang="ar"] .pricing-features li { flex-direction: row-reverse; }

/* Thai, Hindi, Vietnamese — slightly larger line-height for diacritics */
html[lang="th"] *, html[lang="hi"] *, html[lang="vi"] * {
  line-height: 1.9;
}

/* Navbar overflow protection for all languages */
.navbar .container {
  min-height: 80px;
  height: auto;
}

.nav-links li {
  flex-shrink: 0;
}

/* Feature cards — equal height and text containment */
.feature-card {
  overflow: hidden;
}

.feature-card h3, .feature-card p {
  overflow-wrap: break-word;
}

/* Pricing card text containment */
.pricing-features li {
  word-break: break-word;
  hyphens: auto;
}
