/* ============================================================
   BAKER'S TOOLBOX — Design System
   Version: 1.0

   A warm, modern, mobile-first design system for professional
   and home bakers. Optimized for kitchen environments with
   large touch targets and high readability.
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */

:root {
  /* -----------------------------------------------------------
     1a. COLOR PALETTE
     Warm, artisanal bakery aesthetic with clean contrasts.
     ----------------------------------------------------------- */

  /* Primary — Warm Terracotta */
  --color-primary-50:  #fef7f4;
  --color-primary-100: #fce8de;
  --color-primary-200: #f9ccb4;
  --color-primary-300: #f4a77a;
  --color-primary-400: #e8854a;
  --color-primary-500: #d4692e;  /* Main brand color */
  --color-primary-600: #b85424;
  --color-primary-700: #9a4320;
  --color-primary-800: #7d371d;
  --color-primary-900: #672f1c;

  /* Secondary — Warm Cream/Gold */
  --color-secondary-50:  #fefcf5;
  --color-secondary-100: #fdf6e3;
  --color-secondary-200: #faeabc;
  --color-secondary-300: #f5d88a;
  --color-secondary-400: #efc255;
  --color-secondary-500: #dba832;  /* Accent gold */
  --color-secondary-600: #c08a22;
  --color-secondary-700: #9f6b1e;
  --color-secondary-800: #835520;
  --color-secondary-900: #6e471e;

  /* Neutral — Warm Grays (slightly brown-tinted) */
  --color-neutral-0:   #ffffff;
  --color-neutral-50:  #faf9f7;
  --color-neutral-100: #f3f1ed;
  --color-neutral-200: #e6e2db;
  --color-neutral-300: #d4cfc5;
  --color-neutral-400: #b5ae9f;
  --color-neutral-500: #968d7d;
  --color-neutral-600: #7a7164;
  --color-neutral-700: #5e564c;
  --color-neutral-800: #433d36;
  --color-neutral-900: #2c2822;
  --color-neutral-950: #1a1714;

  /* Semantic Colors */
  --color-success-light: #e8f5e9;
  --color-success:       #43a047;
  --color-success-dark:  #2e7d32;

  --color-warning-light: #fff8e1;
  --color-warning:       #f9a825;
  --color-warning-dark:  #f57f17;

  --color-error-light:   #fce4ec;
  --color-error:         #e53935;
  --color-error-dark:    #c62828;

  --color-info-light:    #e3f2fd;
  --color-info:          #1e88e5;
  --color-info-dark:     #1565c0;

  /* Surface Colors */
  --surface-page:     var(--color-neutral-50);
  --surface-card:     var(--color-neutral-0);
  --surface-elevated: var(--color-neutral-0);
  --surface-sunken:   var(--color-neutral-100);
  --surface-overlay:  rgba(26, 23, 20, 0.5);

  /* Text Colors */
  --text-primary:     var(--color-neutral-900);
  --text-secondary:   var(--color-neutral-600);
  --text-tertiary:    var(--color-neutral-500);
  --text-inverse:     var(--color-neutral-0);
  --text-link:        var(--color-primary-600);
  --text-link-hover:  var(--color-primary-700);

  /* Border Colors */
  --border-light:     var(--color-neutral-200);
  --border-default:   var(--color-neutral-300);
  --border-strong:    var(--color-neutral-400);
  --border-focus:     var(--color-primary-500);

  /* -----------------------------------------------------------
     1b. TYPOGRAPHY
     Readable on mobile, warm personality via serif headings.
     ----------------------------------------------------------- */

  /* Font Families */
  --font-heading: 'DM Serif Display', 'Georgia', serif;
  --font-body:    'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  /* Font Sizes — Mobile-first (min 16px for body to avoid iOS zoom) */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */

  /* Line Heights */
  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Font Weights */
  --font-regular:  400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;

  /* Letter Spacing */
  --tracking-tight:  -0.025em;
  --tracking-normal:  0;
  --tracking-wide:    0.025em;
  --tracking-wider:   0.05em;

  /* -----------------------------------------------------------
     1c. SPACING
     8px base unit for consistent rhythm.
     ----------------------------------------------------------- */

  --space-0:   0;
  --space-1:   0.25rem;  /* 4px */
  --space-2:   0.5rem;   /* 8px */
  --space-3:   0.75rem;  /* 12px */
  --space-4:   1rem;     /* 16px */
  --space-5:   1.25rem;  /* 20px */
  --space-6:   1.5rem;   /* 24px */
  --space-8:   2rem;     /* 32px */
  --space-10:  2.5rem;   /* 40px */
  --space-12:  3rem;     /* 48px */
  --space-16:  4rem;     /* 64px */
  --space-20:  5rem;     /* 80px */
  --space-24:  6rem;     /* 96px */

  /* Page Gutters */
  --gutter-mobile:  var(--space-4);   /* 16px */
  --gutter-tablet:  var(--space-6);   /* 24px */
  --gutter-desktop: var(--space-8);   /* 32px */

  /* -----------------------------------------------------------
     1d. BORDER RADIUS
     ----------------------------------------------------------- */

  --radius-sm:   0.375rem;  /* 6px — small chips/badges */
  --radius-md:   0.5rem;    /* 8px — buttons, inputs */
  --radius-lg:   0.75rem;   /* 12px — cards */
  --radius-xl:   1rem;      /* 16px — modals, large cards */
  --radius-2xl:  1.5rem;    /* 24px — floating elements */
  --radius-full: 9999px;    /* pills, circles */

  /* -----------------------------------------------------------
     1e. SHADOWS
     Soft, warm shadows (slightly tinted brown).
     ----------------------------------------------------------- */

  --shadow-xs:  0 1px 2px rgba(44, 40, 34, 0.05);
  --shadow-sm:  0 1px 3px rgba(44, 40, 34, 0.08), 0 1px 2px rgba(44, 40, 34, 0.06);
  --shadow-md:  0 4px 6px rgba(44, 40, 34, 0.07), 0 2px 4px rgba(44, 40, 34, 0.06);
  --shadow-lg:  0 10px 15px rgba(44, 40, 34, 0.08), 0 4px 6px rgba(44, 40, 34, 0.05);
  --shadow-xl:  0 20px 25px rgba(44, 40, 34, 0.10), 0 8px 10px rgba(44, 40, 34, 0.04);
  --shadow-inner: inset 0 2px 4px rgba(44, 40, 34, 0.06);

  /* -----------------------------------------------------------
     1f. TRANSITIONS
     ----------------------------------------------------------- */

  --transition-fast:   150ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   300ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* -----------------------------------------------------------
     1g. TOUCH TARGETS — Kitchen-friendly sizing
     Minimum 48px for WCAG, we use 52px+ for flour-covered hands.
     ----------------------------------------------------------- */

  --touch-target-min: 52px;
  --touch-target-lg:  60px;

  /* -----------------------------------------------------------
     1h. Z-INDEX SCALE
     ----------------------------------------------------------- */

  --z-base:      0;
  --z-above:     10;
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-overlay:   300;
  --z-modal:     400;
  --z-toast:     500;
  --z-tooltip:   600;

  /* -----------------------------------------------------------
     1i. LAYOUT
     ----------------------------------------------------------- */

  --max-width-content: 1200px;
  --max-width-text:    720px;
  --nav-height-mobile: 64px;
  --tab-bar-height:    68px;
  --sidebar-width:     260px;
}

/* Dark theme — neutral grays with warm accents */
[data-theme="dark"] {
  /* Neutral scale — cool grays (no brown tint) */
  --color-neutral-0:   #1a1a1a;
  --color-neutral-50:  #1e1e1e;
  --color-neutral-100: #2c2c2c;
  --color-neutral-200: #3a3a3a;
  --color-neutral-300: #484848;
  --color-neutral-400: #6b6b6b;
  --color-neutral-500: #909090;
  --color-neutral-600: #a8a8a8;
  --color-neutral-700: #c0c0c0;
  --color-neutral-800: #d8d8d8;
  --color-neutral-900: #e8e8e8;
  --color-neutral-950: #f5f5f5;

  /* Primary — warm terracotta, lightened for dark backgrounds */
  --color-primary-50:  #2a2016;
  --color-primary-100: #3d2a18;
  --color-primary-200: #5c3c1f;
  --color-primary-300: #8a5527;
  --color-primary-400: #b8702e;
  --color-primary-500: #d4893e;
  --color-primary-600: #e8a662;
  --color-primary-700: #f0c08a;
  --color-primary-800: #f6d6b0;
  --color-primary-900: #faecd8;

  /* Secondary — warm gold, lightened for dark backgrounds */
  --color-secondary-50:  #2a2416;
  --color-secondary-100: #3d3318;
  --color-secondary-200: #5c4d20;
  --color-secondary-300: #8a7228;
  --color-secondary-400: #b89630;
  --color-secondary-500: #dbb44a;
  --color-secondary-600: #e8c86e;
  --color-secondary-700: #f0d890;
  --color-secondary-800: #f6e6b4;
  --color-secondary-900: #faf2d8;

  /* Semantic — lightened for dark bg visibility */
  --color-success-light: #1a2e1a;
  --color-success:       #5cb860;
  --color-success-dark:  #81c784;

  --color-warning-light: #2e2a14;
  --color-warning:       #fbc02d;
  --color-warning-dark:  #fdd835;

  --color-error-light:   #2e1418;
  --color-error:         #ef5350;
  --color-error-dark:    #e57373;

  --color-info-light:    #142230;
  --color-info:          #42a5f5;
  --color-info-dark:     #64b5f6;

  /* Surface — gray backgrounds */
  --surface-page:     var(--color-neutral-50);
  --surface-card:     var(--color-neutral-0);
  --surface-elevated: var(--color-neutral-100);
  --surface-sunken:   var(--color-neutral-0);
  --surface-overlay:  rgba(0, 0, 0, 0.6);

  /* Text — light on dark gray */
  --text-primary:     var(--color-neutral-900);
  --text-secondary:   var(--color-neutral-600);
  --text-tertiary:    var(--color-neutral-500);
  --text-inverse:     #1a1a1a;
  --text-link:        var(--color-primary-600);
  --text-link-hover:  var(--color-primary-700);

  /* Borders — visible on dark gray */
  --border-light:     var(--color-neutral-200);
  --border-default:   var(--color-neutral-300);
  --border-strong:    var(--color-neutral-400);
  --border-focus:     var(--color-primary-500);
}


/* ============================================================
   2. GLOBAL RESET & BASE STYLES
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Prevent iOS zoom on input focus */
input, select, textarea {
  font-size: max(16px, 1rem);
}

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

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

a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--color-primary-400);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ============================================================
   3. TYPOGRAPHY CLASSES
   ============================================================ */

.heading-1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-regular);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.heading-2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-regular);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

.heading-3 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.heading-4 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.body-lg {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.body-base {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.body-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.body-xs {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-tertiary {
  color: var(--text-tertiary);
}

.label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Desktop typography scaling */
@media (min-width: 1024px) {
  .heading-1 { font-size: var(--text-5xl); }
  .heading-2 { font-size: var(--text-3xl); }
  .heading-3 { font-size: var(--text-2xl); }
  .heading-4 { font-size: var(--text-xl); }
}


/* ============================================================
   4. LAYOUT SYSTEM
   ============================================================ */

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-inline: auto;
  padding-inline: var(--gutter-mobile);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--gutter-tablet); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--gutter-desktop); }
}

/* --- Page Shell (mobile: content + bottom tab bar) --- */
.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: var(--tab-bar-height);
}

@media (min-width: 1024px) {
  .page-shell {
    flex-direction: row;
    padding-bottom: 0;
  }
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  padding-top: var(--space-4);
  padding-bottom: var(--space-8);
}

@media (min-width: 1024px) {
  .main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--space-8);
    padding-bottom: var(--space-12);
  }
}

/* --- Section Spacing --- */
.section {
  margin-bottom: var(--space-8);
}

.section-header {
  margin-bottom: var(--space-4);
}

/* --- Grid System --- */
.grid {
  display: grid;
  gap: var(--space-4);
}

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

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Flexbox Utilities --- */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }


/* ============================================================
   5. NAVIGATION
   ============================================================ */

/* --- Mobile Bottom Tab Bar --- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-bar-height);
  background: var(--surface-elevated);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: var(--z-sticky);
  box-shadow: 0 -2px 8px rgba(44, 40, 34, 0.06);
}

.tab-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: var(--space-2);
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.tab-bar__item:hover,
.tab-bar__item:focus-visible {
  text-decoration: none;
}

.tab-bar__item.is-active {
  color: var(--color-primary-600);
}

.tab-bar__item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--color-primary-500);
  border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.tab-bar__icon {
  width: 24px;
  height: 24px;
}

.tab-bar__label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* Hide tab bar on desktop */
@media (min-width: 1024px) {
  .tab-bar { display: none; }
}

/* --- Desktop Sidebar --- */
.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface-elevated);
    border-right: 1px solid var(--border-light);
    padding: var(--space-6) var(--space-4);
    z-index: var(--z-sticky);
    overflow-y: auto;
  }
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  padding: var(--space-2);
}

.sidebar__logo-icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary-500);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: var(--text-xl);
}

.sidebar__logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  text-decoration: none;
  min-height: 44px;
}

.sidebar__link:hover {
  background: var(--color-neutral-100);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar__link.is-active {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.sidebar__link-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- Mobile Top Header --- */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height-mobile);
  padding-inline: var(--gutter-mobile);
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.mobile-header__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--text-primary);
}

@media (min-width: 1024px) {
  .mobile-header { display: none; }
}


/* ============================================================
   6. COMPONENTS
   ============================================================ */

/* --- 6a. Cards --- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card--interactive {
  cursor: pointer;
}

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

.card--interactive:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.card__image {
  margin: calc(var(--space-4) * -1);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

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

.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.card__description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.card__tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* --- Recipe Card (specialized) --- */
.recipe-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
}

.recipe-card__thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.recipe-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card__body {
  flex: 1;
  min-width: 0;
}

.recipe-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-card__info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}


/* --- 6b. Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target-min);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-primary-400);
  outline-offset: 2px;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary Button */
.btn--primary {
  background: var(--color-primary-500);
  color: var(--text-inverse);
}

.btn--primary:hover {
  background: var(--color-primary-600);
  text-decoration: none;
  color: var(--text-inverse);
}

.btn--primary:active {
  background: var(--color-primary-700);
}

/* Secondary / Outline Button */
.btn--secondary {
  background: transparent;
  color: var(--color-primary-600);
  border-color: var(--color-primary-300);
}

.btn--secondary:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-500);
  text-decoration: none;
  color: var(--color-primary-700);
}

/* Ghost Button */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover {
  background: var(--color-neutral-100);
  color: var(--text-primary);
  text-decoration: none;
}

/* Danger Button */
.btn--danger {
  background: var(--color-error);
  color: var(--text-inverse);
}

.btn--danger:hover {
  background: var(--color-error-dark);
  text-decoration: none;
  color: var(--text-inverse);
}

/* Button Sizes */
.btn--sm {
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.btn--lg {
  min-height: var(--touch-target-lg);
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* Full-width button (mobile) */
.btn--block {
  width: 100%;
}

/* Icon-only button (round) */
.btn--icon {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  padding: 0;
  border-radius: var(--radius-full);
}

.btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}


/* --- 6c. Form Inputs --- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.form-input {
  display: block;
  width: 100%;
  min-height: var(--touch-target-min);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--surface-card);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:hover {
  border-color: var(--border-strong);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(212, 105, 46, 0.15);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input--error {
  border-color: var(--color-error);
}

.form-input--error:focus {
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-1);
}

/* Number input with stepper (for recipe scaling) */
.number-input {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-card);
}

.number-input:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(212, 105, 46, 0.15);
}

.number-input__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  background: var(--color-neutral-100);
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  transition: background var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
}

.number-input__btn:hover {
  background: var(--color-neutral-200);
}

.number-input__btn:active {
  background: var(--color-neutral-300);
}

.number-input__field {
  flex: 1;
  min-width: 0;
  height: var(--touch-target-min);
  border: none;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: transparent;
  outline: none;
}

/* Select / Dropdown */
.form-select {
  display: block;
  width: 100%;
  min-height: var(--touch-target-min);
  padding: var(--space-3) var(--space-10) var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--surface-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7164' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(212, 105, 46, 0.15);
}

/* Checkbox (large touch targets) */
.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-target-min);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.checkbox__input {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}

.checkbox__input:checked {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
}

.checkbox__input:checked::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  width: 8px;
  height: 14px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.checkbox__label {
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: var(--leading-snug);
}

.checkbox__input:checked + .checkbox__label {
  text-decoration: line-through;
  color: var(--text-tertiary);
}


/* --- 6d. Range Slider (Recipe Scaling) --- */
.slider {
  width: 100%;
  padding: var(--space-4) 0;
}

.slider__track {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-neutral-200);
  outline: none;
}

.slider__track::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary-500);
  cursor: pointer;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-spring);
}

.slider__track::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider__track::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

.slider__track::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary-500);
  cursor: pointer;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
}

.slider__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.slider__value {
  text-align: center;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-primary-600);
  margin-bottom: var(--space-2);
}


/* --- 6e. Timer Display --- */
.timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6);
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}

.timer__display {
  font-family: var(--font-mono);
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.timer__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.timer__controls {
  display: flex;
  gap: var(--space-3);
}

.timer--running .timer__display {
  color: var(--color-primary-600);
}

.timer--alert .timer__display {
  color: var(--color-error);
  animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}


/* --- 6f. Ingredient List --- */
.ingredient-list {
  list-style: none;
}

.ingredient-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
  min-height: var(--touch-target-min);
}

.ingredient-list__item:last-child {
  border-bottom: none;
}

.ingredient-list__quantity {
  font-weight: var(--font-semibold);
  min-width: 80px;
  color: var(--color-primary-700);
  font-variant-numeric: tabular-nums;
}

.ingredient-list__unit {
  color: var(--text-secondary);
  min-width: 48px;
}

.ingredient-list__name {
  flex: 1;
}

.ingredient-list__item.is-checked .ingredient-list__name {
  text-decoration: line-through;
  color: var(--text-tertiary);
}


/* --- 6g. Workflow Timeline (Gantt-style) --- */
.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-6);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: calc(var(--space-6) * -1);
  top: var(--space-1);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--surface-card);
  border: 3px solid var(--color-primary-400);
  z-index: 1;
}

.timeline__item.is-active .timeline__dot {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
}

.timeline__item.is-complete .timeline__dot {
  background: var(--color-success);
  border-color: var(--color-success);
}

.timeline__card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
}

.timeline__card-title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.timeline__card-time {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.timeline__card-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-neutral-200);
  margin-top: var(--space-2);
  overflow: hidden;
}

.timeline__card-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary-400), var(--color-primary-500));
  transition: width var(--transition-slow);
}


/* --- 6h. Unit Conversion Dropdown --- */
.unit-converter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
}

.unit-converter__value {
  flex: 1;
}

.unit-converter__value input {
  width: 100%;
  min-height: var(--touch-target-min);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  text-align: right;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  font-family: var(--font-body);
  color: var(--text-primary);
}

.unit-converter__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.unit-converter__select {
  flex: 1;
}


/* --- 6i. Badges & Chips --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.badge--primary {
  background: var(--color-primary-100);
  color: var(--color-primary-800);
}

.badge--secondary {
  background: var(--color-secondary-100);
  color: var(--color-secondary-800);
}

.badge--success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.badge--warning {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.badge--error {
  background: var(--color-error-light);
  color: var(--color-error-dark);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  background: var(--color-neutral-100);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 40px;
}

.chip:hover {
  background: var(--color-neutral-200);
}

.chip.is-selected {
  background: var(--color-primary-50);
  border-color: var(--color-primary-300);
  color: var(--color-primary-700);
}


/* --- 6j. Toast / Notification --- */
.toast {
  position: fixed;
  bottom: calc(var(--tab-bar-height) + var(--space-4));
  left: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-neutral-900);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-toast);
  transform: translateY(120%);
  transition: transform var(--transition-spring);
}

.toast.is-visible {
  transform: translateY(0);
}

.toast__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast__message {
  flex: 1;
  font-size: var(--text-sm);
}

.toast__action {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-primary-300);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .toast {
    bottom: var(--space-8);
    left: auto;
    right: var(--space-8);
    max-width: 400px;
  }
}


/* --- 6k. Modal / Sheet --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  width: 100%;
  max-height: 90dvh;
  background: var(--surface-elevated);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-6);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--transition-slow);
}

.modal-overlay.is-open .modal-sheet {
  transform: translateY(0);
}

.modal-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--color-neutral-300);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
}

.modal-sheet__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

/* Desktop: center modal */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
    justify-content: center;
  }

  .modal-sheet {
    max-width: 560px;
    max-height: 80dvh;
    border-radius: var(--radius-xl);
    padding-bottom: var(--space-6);
    transform: translateY(20px);
  }

  .modal-sheet__handle { display: none; }
}


/* --- 6l. Loading / Skeleton --- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-neutral-200) 25%,
    var(--color-neutral-100) 50%,
    var(--color-neutral-200) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton--text {
  height: 1em;
  width: 100%;
  margin-bottom: var(--space-2);
}

.skeleton--text:last-child {
  width: 70%;
}

.skeleton--circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

.skeleton--image {
  width: 100%;
  aspect-ratio: 16 / 10;
}


/* --- 6m. Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  color: var(--color-neutral-300);
  margin-bottom: var(--space-4);
}

.empty-state__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.empty-state__description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 280px;
  margin-bottom: var(--space-6);
}


/* ============================================================
   7. AD PLACEMENT ZONES (Raptive / AdThrive compatible)
   ============================================================ */

/*
  Ad Zone Strategy (aligned with SEO team's Raptive integration):
  ================================================================
  Uses both .ad-zone design classes and .adthrive-* integration classes.
  The .ad-zone classes handle visual layout; .adthrive-* classes are
  Raptive's hook for injecting ads. Both can coexist on the same element.

  Zones:
  1. .ad-zone--header      Header leaderboard (728x90 desktop / 320x50 mobile)
  2. .ad-zone--in-content   In-content ad between sections (300x250 / 336x280)
  3. .ad-zone--sidebar      Desktop-only sticky sidebar (300x600 / 300x250)
  4. .ad-zone--post-result  After tool results/output (300x250, lazy)
  5. .ad-zone--footer       Footer leaderboard (728x90 desktop / 320x50 mobile)
  6. .ad-zone--in-feed      Between recipe cards in feed view (300x250)

  Rules:
  - NO ads inside interactive tool areas (inputs, sliders, timers)
  - Max 1 ad per viewport height on mobile
  - Min 250px content between ad slots
  - All zones have min-height to prevent CLS
  - Sidebar ads desktop-only — never overlap mobile
  - Tool pages use 2-column grid on desktop: tool + sidebar ad
*/

/* --- Base ad zone --- */
.ad-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: transparent;
  overflow: hidden;
  margin-block: var(--space-4);
  text-align: center;
}

.ad-zone:empty {
  display: none;
}

/* "Advertisement" label — matches Raptive convention */
.ad-zone__label {
  font-size: 11px;
  font-family: var(--font-body);
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* --- 2-column tool page layout (tool + sidebar ad) --- */
.tool-layout {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.tool-layout__main {
  flex: 1;
  min-width: 0;
}

.tool-layout__sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .tool-layout__sidebar {
    display: block;
    width: 300px;
    flex-shrink: 0;
  }
}

/* --- 1. Header Leaderboard Ad --- */
.ad-zone--header {
  min-height: 50px; /* 320x50 mobile */
  max-width: 320px;
  margin-inline: auto;
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .ad-zone--header {
    min-height: 90px; /* 728x90 leaderboard */
    max-width: 728px;
  }
}

/* --- 2. In-Content Ad (between sections) --- */
.ad-zone--in-content {
  min-height: 250px;
  max-width: 336px;
  margin: var(--space-8) auto;
}

@media (max-width: 767px) {
  .ad-zone--in-content {
    max-width: 300px;
  }
}

/* --- 3. Sidebar Ad (desktop only, sticky) --- */
.ad-zone--sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .ad-zone--sidebar {
    display: flex;
    position: sticky;
    top: 80px;
    width: 300px;
    min-height: 600px;
    flex-shrink: 0;
  }
}

/* --- 4. Post-Result Ad (after tool output, lazy) --- */
.ad-zone--post-result {
  min-height: 250px;
  max-width: 336px;
  margin: var(--space-8) auto;
}

@media (max-width: 767px) {
  .ad-zone--post-result {
    max-width: 300px;
  }
}

/* --- 5. Footer Ad (above site footer) --- */
.ad-zone--footer {
  min-height: 50px;
  max-width: 320px;
  margin: var(--space-8) auto var(--space-4);
}

@media (min-width: 768px) {
  .ad-zone--footer {
    min-height: 90px;
    max-width: 728px;
  }
}

/* --- 6. In-Feed Ad (between recipe cards, home page) --- */
.ad-zone--in-feed {
  min-height: 250px;
  max-width: 336px;
  margin: var(--space-4) auto;
}

@media (max-width: 767px) {
  .ad-zone--in-feed {
    max-width: 300px;
  }
}

/* Legacy aliases for backwards compat with initial layouts */
.ad-zone--top-banner { /* maps to --header */ }
.ad-zone--interstitial { /* maps to --in-content */ }

/* --- Raptive .adthrive-* integration classes --- */
.adthrive-ad {
  overflow: hidden;
  background: transparent;
  transition: min-height 0.3s ease;
}

.adthrive-ad-label {
  font-family: var(--font-body);
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.adthrive-sidebar-wrapper {
  width: 300px;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 1024px) {
  .adthrive-sidebar-wrapper {
    display: block;
  }
  .adthrive-header-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .adthrive-header-mobile { display: none !important; }
  .adthrive-sidebar-wrapper { display: none !important; }
}

@media (max-width: 767px) {
  .adthrive-header { display: none !important; }
  .adthrive-header-mobile { display: block !important; }
  .adthrive-sidebar-wrapper { display: none !important; }
  .adthrive-content,
  .adthrive-post-result { max-width: 300px; min-height: 250px; }
  .adthrive-footer { max-width: 320px; min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .adthrive-ad { transition: none; }
}


/* ============================================================
   8. UTILITY CLASSES
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mt-0 { margin-top: var(--space-0); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: var(--space-0); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.w-full { width: 100%; }

.hidden { display: none !important; }

/* Show/hide by breakpoint */
.mobile-only  { display: block; }
.tablet-only  { display: none; }
.desktop-only { display: none; }

@media (min-width: 768px) {
  .mobile-only  { display: none; }
  .tablet-only  { display: block; }
}

@media (min-width: 1024px) {
  .tablet-only  { display: none; }
  .desktop-only { display: block; }
}


/* ============================================================
   9. ANIMATIONS
   ============================================================ */

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fade-in var(--transition-base) both;
}

.animate-slide-up {
  animation: slide-up var(--transition-slow) both;
}

.animate-scale-in {
  animation: scale-in var(--transition-base) both;
}

/* Stagger children animations */
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================================
   10. PRINT STYLES
   Bakers may print recipes / ingredient lists.
   ============================================================ */

@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .tab-bar,
  .sidebar,
  .mobile-header,
  .ad-zone,
  .adthrive-ad,
  .adthrive-sidebar-wrapper,
  .toast,
  .btn--ghost,
  .timer__controls {
    display: none !important;
  }

  .page-shell {
    padding-bottom: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .ingredient-list__item {
    padding: 4px 0;
  }

  .checkbox__input {
    width: 16px;
    height: 16px;
    border: 1px solid #333;
  }
}
