/* ==========================================================================
   Receptlådan.se — Svensk matkultur och receptdesign
   ========================================================================== */

:root {
  --primary-forest: #17382B;
  --primary-forest-hover: #235441;
  --primary-forest-light: #F2F7F4;
  --nordic-cream: #FAF7F2;
  --nordic-warm-white: #FFFFFF;
  --nordic-amber: #D97706;
  --nordic-amber-light: #FEF3C7;
  --nordic-sage: #E8EFE9;
  --nordic-sage-dark: #3A6351;
  --nordic-text-main: #1C2520;
  --nordic-text-muted: #5C6B64;
  --nordic-border: #E5E0D8;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--nordic-cream);
  color: var(--nordic-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-serif {
  font-family: 'Playfair Display', Georgia, serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F1ECE4;
}
::-webkit-scrollbar-thumb {
  background: #C8BFB3;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9D9387;
}

/* Recipe Card Micro-Interactions */
.recipe-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(23, 56, 43, 0.08), 0 8px 10px -6px rgba(23, 56, 43, 0.04);
}
.recipe-card .card-img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.recipe-card:hover .card-img {
  transform: scale(1.06);
}

/* Category Filter Active States */
.category-pill {
  transition: all 0.2s ease;
}
.category-pill.active {
  background-color: var(--primary-forest) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(23, 56, 43, 0.2);
}

/* Checkbox customizations */
.ingredient-checkbox {
  accent-color: var(--primary-forest);
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}
.ingredient-checkbox:checked + label span.ing-text {
  text-decoration: line-through;
  color: #8E9B94;
}

/* Star Rating styling */
.star-filled {
  color: #F59E0B;
}

/* ==================== INTERACTIVE COOKING TIMERS ==================== */
.timer-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.timer-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

/* Floating Active Kitchen Timer Bar */
#floating-timer-dock {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 60;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#floating-timer-dock.active {
  transform: translateX(-50%) translateY(0);
}

/* Pulse animation when timer is running */
@keyframes timerPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(217, 119, 6, 0);
  }
}
.timer-running-pulse {
  animation: timerPulse 2s infinite;
}

/* Finished Alarm Pulse */
@keyframes alarmRinging {
  0%, 100% {
    transform: scale(1);
    background-color: #B91C1C;
  }
  50% {
    transform: scale(1.05);
    background-color: #DC2626;
  }
}
.alarm-ringing {
  animation: alarmRinging 0.8s infinite;
}

/* Equipment Chips */
.equipment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: #FFFFFF;
  border: 1px solid var(--nordic-border);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-forest);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Star Rating Picker */
.star-picker-btn {
  font-size: 1.4rem;
  color: #D1D5DB;
  transition: color 0.15s ease, transform 0.15s ease;
}
.star-picker-btn.selected,
.star-picker-btn.hovered {
  color: #F59E0B;
}
.star-picker-btn:hover {
  transform: scale(1.2);
}

/* Modal Backdrops */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Print Friendly Styles */
@media print {
  body {
    background-color: #FFFFFF !important;
    color: #000000 !important;
  }
  header, footer, #hero-section, #filter-section, #weekly-section, #kitchen-school-modal, #floating-timer-dock, #toast-container, .no-print, button, .modal-backdrop {
    display: none !important;
  }
  #detail-modal {
    position: static !important;
    background: white !important;
    display: block !important;
    padding: 0 !important;
  }
  #detail-modal-content {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
/* Stable responsive recipe-image frame, including offline previews without Tailwind CDN. */
.aspect-\[4\/3\] {
  aspect-ratio: 4 / 3;
}

/* ==========================================================================
   Recipe card export — printable A6 "receptkort" (front + back)
   Populated on demand by printRecipeCard() in recipe-page.js. Invisible on
   screen at all times; only ever shown mid-print, and only for the two A6
   faces themselves — see the scoped rules under @media print below.
   ========================================================================== */
#recipe-card-print { display: none; }

.rcp-face {
  width: 105mm;
  height: 148mm;
  background: #FCFAF7;
  color: #0F251C;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  page-break-after: always;
}
.rcp-face:last-child { page-break-after: auto; }

.rcp-inner {
  flex: 1;
  padding: 8mm 8mm 6mm;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.rcp-tag-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4mm; }
.rcp-tag {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-size: 8.6px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 1.6mm 2.8mm;
  border-radius: 999px;
}
.rcp-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: 11px;
  color: #1B4332;
  white-space: nowrap;
}

.rcp-face h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 16.5px;
  line-height: 1.2;
  margin: 0 0 2mm;
  color: #0F251C;
}
.rcp-subtitle { font-size: 9.6px; color: #78716C; line-height: 1.4; margin: 0 0 4mm; }

.rcp-meta-row {
  display: flex;
  gap: 5mm;
  padding-bottom: 3.4mm;
  margin-bottom: 3.6mm;
  border-bottom: .4mm solid #E1EDE6;
  font-variant-numeric: tabular-nums;
}
.rcp-meta-item { display: flex; flex-direction: column; gap: .6mm; }
.rcp-meta-item span { font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: #78716C; font-weight: 700; }
.rcp-meta-item strong { font-size: 11.5px; color: #17382B; font-weight: 800; }

.rcp-section-label {
  font-size: 8.6px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #B45309;
  margin: 0 0 2.4mm;
}

.rcp-ing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.9mm; }
.rcp-ing-list li { display: grid; grid-template-columns: 15mm 1fr; gap: 2.4mm; font-size: 9.6px; line-height: 1.32; color: #44403C; }
.rcp-ing-list b { font-variant-numeric: tabular-nums; color: #0F251C; font-weight: 700; text-align: right; }

.rcp-foot { margin-top: auto; padding-top: 4mm; border-top: .4mm dashed #D6D3D1; display: flex; align-items: flex-end; justify-content: space-between; gap: 3mm; }
.rcp-foot-note { font-size: 8.4px; font-style: italic; line-height: 1.4; color: #78716C; max-width: 62mm; }

.rcp-steps { list-style: none; counter-reset: rcpstep; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2.8mm; }
.rcp-steps li { counter-increment: rcpstep; display: grid; grid-template-columns: 5.6mm 1fr; gap: 2.4mm; font-size: 9.2px; line-height: 1.34; color: #44403C; }
.rcp-steps li::before {
  content: counter(rcpstep);
  width: 5.6mm; height: 5.6mm;
  border-radius: 50%;
  background: #1B4332;
  color: #fff;
  font-weight: 800;
  font-size: 8.8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
}

.rcp-tip-box { margin-top: 3.2mm; background: #FEF3C7; border: .4mm solid #FDE68A; border-radius: 2.2mm; padding: 2.6mm 3.2mm; }
.rcp-tip-box .rcp-section-label { color: #B45309; margin-bottom: 1mm; }
.rcp-tip-box p { margin: 0; font-size: 9px; line-height: 1.4; color: #78350F; }

.rcp-storage-note { margin-top: 2.6mm; }
.rcp-storage-note .rcp-section-label { color: #1B4332; margin-bottom: 1mm; }
.rcp-storage-note p { margin: 0; font-size: 9px; line-height: 1.4; color: #44403C; }

.rcp-scan-row { margin-top: auto; padding-top: 3.6mm; border-top: .4mm dashed #D6D3D1; display: flex; align-items: center; justify-content: space-between; gap: 3mm; }
.rcp-url-label { display: block; font-size: 7.6px; letter-spacing: .1em; text-transform: uppercase; color: #78716C; font-weight: 700; margin-bottom: .8mm; }
.rcp-url-value { display: block; font-size: 9px; font-weight: 700; color: #17382B; word-break: break-word; }

/* Category tag colors — mirror the badge colors used on the recipe-card grid. */
.rcp-tag-husmanskost { background: #1B4332; }
.rcp-tag-kyckling { background: #D97706; }
.rcp-tag-jul-hogtid { background: #991B1B; }
.rcp-tag-fika-bakning { background: #44403C; }
.rcp-tag-fest-forratt { background: #6D28D9; }
.rcp-tag-vardagsmat { background: #0369A1; }

@media print {
  body.printing-recipe-card > *:not(#recipe-card-print) { display: none !important; }
  body.printing-recipe-card #recipe-card-print { display: flex !important; }
  #recipe-card-print { background: #fff; }
  .rcp-face { box-shadow: none; }
}
