/* ============================================
   iJournal Public Site - Shared Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --green-50: #e8f5e9;
  --green-100: #c8e6c9;
  --green-200: #a5d6a7;
  --green-300: #81c784;
  --green-400: #66bb6a;
  --green-500: #4caf50;
  --green-600: #43a047;
  --green-700: #388e3c;
  --green-800: #2e7d32;
  --green-900: #1b5e20;

  --orange-500: #ff9800;
  --red-500: #f44336;

  --grey-50: #fafafa;
  --grey-100: #f5f5f5;
  --grey-200: #eeeeee;
  --grey-300: #e0e0e0;
  --grey-400: #bdbdbd;
  --grey-500: #9e9e9e;
  --grey-600: #757575;
  --grey-700: #616161;
  --grey-800: #424242;
  --grey-900: #212121;

  --white: #ffffff;
  --black: #000000;

  --font-primary: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --max-width: 1200px;
  --content-width: 800px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--grey-800);
  background: var(--white);
}

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

a {
  color: var(--green-700);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--green-500);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--grey-900);
  line-height: 1.3;
}

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grey-200);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--green-700);
  letter-spacing: 1px;
  text-decoration: none;
}

.nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

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

.nav-links a {
  color: var(--grey-700);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--green-600);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--green-600);
  color: var(--white) !important;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s;
}

.nav-cta:hover {
  background: var(--green-700);
  color: var(--white) !important;
  transform: translateY(-1px);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--grey-700);
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 80px 24px 100px;
  background: linear-gradient(135deg, var(--green-50) 0%, var(--white) 50%, #f1f8e9 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--green-100) 0%, transparent 70%);
  opacity: 0.5;
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
}

.hero-text h1 {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-text h1 .highlight {
  color: var(--green-600);
}

.hero-text p {
  font-size: 1.2rem;
  color: var(--grey-600);
  margin-bottom: 36px;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-mockup {
  width: 320px;
  height: 580px;
  background: var(--white);
  border-radius: 32px;
  box-shadow: var(--shadow-lg), 0 0 0 8px var(--grey-200);
  overflow: hidden;
  position: relative;
}

.hero-mockup-inner {
  padding: 20px;
  background: linear-gradient(180deg, var(--green-600) 0%, var(--green-700) 100%);
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 30px;
  color: var(--white);
}

.hero-mockup-inner h3 {
  color: var(--white);
  font-size: 1.1rem;
  opacity: 0.9;
}

.hero-mockup-inner .cal-number {
  font-size: 2.5rem;
  font-weight: 900;
}

.hero-mockup-inner .cal-label {
  font-size: 0.85rem;
  opacity: 0.8;
}

.hero-mockup-cards {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mock-meal-card {
  background: var(--grey-50);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mock-meal-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.mock-meal-icon.breakfast { background: #fff3e0; }
.mock-meal-icon.lunch { background: #e8f5e9; }
.mock-meal-icon.dinner { background: #e3f2fd; }
.mock-meal-icon.snack { background: #fce4ec; }

.mock-meal-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--grey-800);
}

.mock-meal-info span {
  font-size: 0.75rem;
  color: var(--grey-500);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--green-700);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--green-700);
  border: 2px solid var(--green-300);
}

.btn-outline:hover {
  background: var(--green-50);
  border-color: var(--green-500);
  color: var(--green-700);
}

/* --- Sections --- */
.section {
  padding: 80px 24px;
}

.section-alt {
  background: var(--grey-50);
}

.section-green {
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-800) 100%);
  color: var(--white);
}

.section-green h2,
.section-green h3 {
  color: var(--white);
}

.section-green p {
  color: rgba(255,255,255,0.85);
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 56px;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--grey-600);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Feature Cards --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-200);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.feature-icon.green { background: var(--green-50); color: var(--green-700); }
.feature-icon.orange { background: #fff3e0; color: var(--orange-500); }
.feature-icon.blue { background: #e3f2fd; color: #1976d2; }

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--grey-600);
  font-size: 0.95rem;
}

/* --- Content Cards (Recipes, Meal Plans) --- */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.content-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-200);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.content-card-image {
  height: 200px;
  background: var(--green-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
}

.content-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.content-card-body p {
  color: var(--grey-600);
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex: 1;
}

.content-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--green-50);
  color: var(--green-700);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.meta-tag.calories {
  background: #fff3e0;
  color: #e65100;
}

/* --- Recipe / Meal Plan Detail Pages --- */
.detail-hero {
  padding: 48px 24px;
  background: linear-gradient(135deg, var(--green-50) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--grey-200);
}

.detail-hero .container {
  max-width: var(--content-width);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--grey-500);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--grey-500);
}

.breadcrumb a:hover {
  color: var(--green-600);
}

.detail-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.detail-hero .subtitle {
  font-size: 1.1rem;
  color: var(--grey-600);
  margin-bottom: 20px;
}

.detail-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.detail-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.detail-section {
  margin-bottom: 48px;
}

.detail-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-100);
}

/* Ingredients list */
.ingredients-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.ingredients-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--grey-50);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.ingredients-list li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-400);
  flex-shrink: 0;
}

/* Instructions */
.instructions-list {
  list-style: none;
  counter-reset: step;
}

.instructions-list li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--grey-100);
}

.instructions-list li::before {
  content: counter(step);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-600);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.instructions-list li:last-child {
  border-bottom: none;
}

/* Notes */
.notes-list {
  list-style: none;
}

.notes-list li {
  padding: 10px 16px;
  margin-bottom: 8px;
  background: #fff8e1;
  border-left: 3px solid var(--orange-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
}

/* Meal plan cards */
.meal-plan-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meal-plan-card {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-sm);
  align-items: flex-start;
}

.meal-plan-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.meal-plan-card-content {
  flex: 1;
}

.meal-plan-card-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.meal-plan-card-content .meal-type {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green-600);
  font-weight: 700;
  margin-bottom: 6px;
}

.meal-plan-card-content p {
  color: var(--grey-600);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.meal-plan-card-content .ingredients-inline {
  font-size: 0.85rem;
  color: var(--grey-500);
}

.meal-plan-card .cal-badge {
  padding: 6px 14px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* --- CTA Banner --- */
.cta-banner {
  text-align: center;
  padding: 64px 24px;
}

.cta-banner h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.cta-banner p {
  margin-bottom: 28px;
  font-size: 1.1rem;
}

.cta-banner .btn {
  font-size: 1.05rem;
  padding: 16px 40px;
}

/* --- Footer --- */
.site-footer {
  background: var(--grey-900);
  color: var(--grey-400);
  padding: 56px 24px 32px;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand h3 {
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer-links h4 {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer-links ul {
  list-style: none;
}

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

.footer-links a {
  color: var(--grey-400);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--green-400);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--grey-800);
  text-align: center;
  font-size: 0.85rem;
}

/* --- Listing Page Header --- */
.listing-hero {
  padding: 48px 24px 40px;
  background: linear-gradient(135deg, var(--green-50) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--grey-200);
  text-align: center;
}

.listing-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.listing-hero p {
  font-size: 1.1rem;
  color: var(--grey-600);
  max-width: 550px;
  margin: 0 auto;
}

/* --- Nutrition Table --- */
.nutrition-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.nutrition-item {
  text-align: center;
  padding: 16px;
  background: var(--grey-50);
  border-radius: var(--radius-md);
}

.nutrition-item .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-700);
}

.nutrition-item .label {
  font-size: 0.8rem;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    display: none;
  }

  .hero-text h1 {
    font-size: 2.4rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .detail-hero h1 {
    font-size: 1.8rem;
  }

  .meal-plan-card {
    flex-direction: column;
  }

  .meal-plan-card .cal-badge {
    align-self: flex-start;
  }
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 20px 24px;
    border-bottom: 1px solid var(--grey-200);
    box-shadow: var(--shadow-md);
    gap: 16px;
  }

  .hero {
    padding: 48px 24px 60px;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .section {
    padding: 48px 24px;
  }

  .section-header h2 {
    font-size: 1.7rem;
  }

  .listing-hero h1 {
    font-size: 1.8rem;
  }

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