/* =============================================================
   RECIPES — Standalone stylesheet
   CSS variables mirror the main portfolio site (styles.css)
   ============================================================= */

/* ---- Variables ---- */
:root {
  --primary-color: #23aeb3;
  --secondary-color: #2e6771;
  --accent-color: #02385c;
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #666666;
  --border-color: #333333;
  --border-radius: 12px;
  --transition: all 0.3s ease;
  --navbar-height: 64px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---- Subtle gradient background ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(35, 174, 179, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(2, 56, 92, 0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Navbar ---- */
.recipe-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(51, 51, 51, 0.6);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-back {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.nav-back:hover { color: var(--primary-color); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  transition: var(--transition);
}
.lang-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ---- Container ---- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   GALLERY PAGE
   ============================================================ */

.recipes-header {
  padding: calc(var(--navbar-height) + 3rem) 0 2rem;
}

.recipes-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.recipes-header h1 .highlight {
  color: var(--primary-color);
}

.recipes-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.recipes-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding-bottom: 4rem;
}

/* ---- Recipe Card ---- */
.recipe-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: block;
}

.recipe-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.recipe-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(35, 174, 179, 0.12);
}

.recipe-card-body {
  padding: 1.5rem;
}

.recipe-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.recipe-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.recipe-card-meta i {
  color: var(--primary-color);
  margin-right: 0.25rem;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.recipe-tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

/* ---- Gallery Controls (search + filters) ---- */
.gallery-controls {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 1.75rem;
}

.search-bar {
  position: relative;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(35, 174, 179, 0.08);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.filter-group + .filter-group {
  padding-left: 1.25rem;
  border-left: 1px solid var(--border-color);
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.no-results {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem 0;
}

/* ---- Gallery footer ---- */
.recipes-page-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   RECIPE PAGE — Two-column layout
   ============================================================ */

.recipe-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - var(--navbar-height));
  margin-top: var(--navbar-height);
  position: relative;
  z-index: 1;
}

/* ---- Ingredients Panel (sticky left) ---- */
.ingredients-panel {
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  gap: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.ingredients-panel::-webkit-scrollbar { width: 4px; }
.ingredients-panel::-webkit-scrollbar-track { background: transparent; }
.ingredients-panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.ingredients-panel-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ---- Portions Control ---- */
.portions-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portions-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: inherit;
  flex-shrink: 0;
}

.portions-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(35, 174, 179, 0.08);
}

.portions-display-group {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

#portions-display {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
  min-width: 1.5ch;
  text-align: center;
}

#portions-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---- Unit toggle (imperial / metric) ---- */
.unit-toggle-row {
  display: flex;
}

.unit-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.unit-toggle-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.unit-toggle-btn.active {
  background: rgba(35, 174, 179, 0.12);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ---- Ingredients List ---- */
.ingredients-list {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ingredient-group-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary-color);
  margin-top: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(35, 174, 179, 0.2);
}

.ingredient-group-label:first-child { margin-top: 0; }

.ingredient-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.5rem;
  line-height: 1.4;
}

.ingredient-qty {
  color: var(--text-primary);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---- Edit on GitHub ---- */
.btn-edit-github {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: var(--transition);
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.btn-edit-github:hover { color: var(--text-secondary); }
.btn-edit-github i { font-size: 0.85rem; }

/* ---- Recipe header image ---- */
.recipe-header-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  display: block;
}

/* ---- Recipe Content (right) ---- */
.recipe-content {
  padding: 2.5rem 3rem;
  max-width: 760px;
}

.recipe-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.recipe-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.recipe-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.recipe-meta i {
  color: var(--primary-color);
  margin-right: 0.3rem;
}

.recipe-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.recipe-tag-meta {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* ---- Steps Section ---- */
.steps-section { margin-bottom: 2rem; }

.steps-section h2 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.steps-list {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0;
}

.step-item {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 1rem;
  align-items: start;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.step-item::before {
  content: counter(steps);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--primary-color);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 25px;
  flex-shrink: 0;
}

/* ---- Notes ---- */
.recipe-notes {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
}

.recipe-notes h3 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-color);
  margin-bottom: 0.6rem;
}

.recipe-notes p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Footer area ---- */
.recipe-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  align-self: flex-start;
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ---- Source link ---- */
.recipe-source {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recipe-source a {
  color: var(--primary-color);
  word-break: break-all;
}

.recipe-source a:hover { text-decoration: underline; }

/* ---- Loading / empty states ---- */
.loading, .no-recipes {
  color: var(--text-muted);
  font-size: 0.95rem;
  grid-column: 1 / -1;
  padding: 2rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .recipe-layout {
    grid-template-columns: 260px 1fr;
  }
  .recipe-content {
    padding: 2rem 2rem;
  }
}

@media (max-width: 640px) {
  .filter-group + .filter-group {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    width: 100%;
  }
  .search-bar { max-width: 100%; }
}

@media (max-width: 768px) {
  .recipe-layout {
    grid-template-columns: 1fr;
  }

  .ingredients-panel {
    position: static;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .recipe-content {
    padding: 2rem 1.5rem;
  }

  .recipes-header h1 { font-size: 1.8rem; }
  .recipe-title { font-size: 1.6rem; }
  .recipe-meta { gap: 0.75rem; }
}

@media (max-width: 480px) {
  .nav-container { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  .recipe-content { padding: 1.5rem 1rem; }
  .ingredients-panel { padding: 1.5rem 1rem; }
  .recipes-header { padding-top: calc(var(--navbar-height) + 2rem); }
}

/* =========================================
   THEME TOGGLE BUTTON
   ========================================= */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* =========================================
   LIGHT MODE OVERRIDES
   ========================================= */
body.light-mode {
  --primary-color: #9b1b30;
  --secondary-color: #7a1428;
  --accent-color: #c2185b;
  --bg-primary: #FAF7F2;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F0EBE3;
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-muted: #717171;
  --border-color: #E0D8CC;
  background-color: transparent;
}

html:has(body.light-mode) {
  background-color: #FAF7F2;
}

/* Subtle gradient background in light mode */
body.light-mode::before {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(155, 27, 48, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(194, 24, 91, 0.04) 0%, transparent 50%);
}

/* Gradient blob container and elements */
#light-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.light-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 1;
  pointer-events: none;
  will-change: transform;
}

.light-blob-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(155, 27, 48, 0.5), transparent 70%);
  top: -10%;
  left: -10%;
  animation: blobFloat1 18s ease-in-out infinite;
}

.light-blob-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(194, 24, 91, 0.35), transparent 70%);
  top: 40%;
  right: -12%;
  animation: blobFloat2 22s ease-in-out infinite;
}

.light-blob-3 {
  width: 750px;
  height: 750px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3), transparent 70%);
  bottom: -15%;
  left: 25%;
  animation: blobFloat3 20s ease-in-out infinite;
}

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.1); }
  66% { transform: translate(-40px, 100px) scale(0.95); }
}

@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -80px) scale(1.05); }
  66% { transform: translate(50px, -40px) scale(0.9); }
}

@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -50px) scale(1.15); }
  66% { transform: translate(-80px, 30px) scale(0.95); }
}

/* Navbar in light mode */
body.light-mode .recipe-nav {
  background: rgba(250, 247, 242, 0.92);
  border-bottom-color: var(--border-color);
}

body.light-mode .nav-brand {
  color: var(--primary-color);
}

/* Cards in light mode */
body.light-mode .recipe-card {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

body.light-mode .recipe-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 8px 30px rgba(155, 27, 48, 0.1);
}

/* Highlight */
body.light-mode .highlight {
  color: var(--primary-color);
}

/* Search bar */
body.light-mode .search-input {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.light-mode .search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(155, 27, 48, 0.08);
}

/* Filter buttons */
body.light-mode .filter-btn {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.light-mode .filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

body.light-mode .filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* Recipe tags */
body.light-mode .recipe-tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Ingredients panel */
body.light-mode .ingredients-panel {
  background: var(--bg-secondary);
  border-right-color: var(--border-color);
}

/* Recipe notes */
body.light-mode .recipe-notes {
  background: var(--bg-tertiary);
  border-left-color: var(--primary-color);
}

/* Footer */
body.light-mode .recipes-page-footer {
  border-top-color: var(--border-color);
  color: var(--text-muted);
}

/* Buttons */
body.light-mode .btn-secondary {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.light-mode .btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Toggle buttons in light mode */
body.light-mode .theme-toggle,
body.light-mode .lang-toggle {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.light-mode .theme-toggle:hover,
body.light-mode .lang-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
