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

:root {
  --bg: #f5f2ed;
  --text: #2c2c2c;
  --text-light: #6b6259;
  --accent: #8b4513;
  --border: #2c2c2c;
  --border-light: #d9d4cc;
  --card-bg: #f9f7f5;
  --note-bg: #f0ebe3;
  --max-width: 1440px;
}

html {
  font-size: 16px;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Header ===== */
header {
  border-bottom: 2px solid var(--border);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.site-name:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===== Search ===== */
.search-wrapper {
  position: relative;
}

.search-input {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  width: 200px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-light);
  font-weight: 300;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

/* Remove default search input decorations */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 3rem);
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(44, 44, 44, 0.08);
  overflow: hidden;
  z-index: 100;
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s ease, padding-left 0.12s ease;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover,
.search-result.active {
  background: var(--note-bg);
  text-decoration: none;
  padding-left: 1.1rem;
  color: var(--accent);
}

.search-result-title {
  font-weight: 500;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.search-result-meta {
  font-family: 'Sora', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  flex-shrink: 0;
}

.search-result:hover .search-result-meta,
.search-result.active .search-result-meta {
  color: var(--accent);
}

.search-no-results {
  padding: 0.9rem;
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
  font-style: italic;
}

/* ===== Main ===== */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  width: 100%;
}

/* ===== Footer ===== */
footer {
  /* border-top: 2px solid var(--border); */
  text-align: center;
  padding: 1.5rem;
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== Home Page ===== */
.more-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.more-link:hover {
  color: var(--accent);
  text-decoration: none;
  padding-left: 0.25rem;
}

.hero {
  text-align: center;
  padding: 3rem 0 1rem;
}

.hero h1 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-light);
  font-weight: 300;
}

/* ===== Recipe Index ===== */
.recipe-index h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.recipe-index h2,
.recipe-index h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.recipe-index h2 {
  font-size: 1.3rem;
}

.category-heading {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-light);
}

/* Recipe index header (title + category dropdown inline) */
.recipe-index-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.recipe-index-header h1 {
  margin-bottom: 0;
}

.category-dropdown {
  position: relative;
}

.category-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.15s ease;
}

.category-dropdown-toggle:hover,
.category-dropdown-toggle[aria-expanded="true"] {
  color: var(--accent);
}

.category-dropdown-toggle .chevron {
  transition: transform 0.15s ease;
}

.category-dropdown-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.category-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 160px;
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(44, 44, 44, 0.08);
  padding: 0.3rem 0;
  margin: 0;
  z-index: 50;
}

.category-dropdown-menu[hidden] {
  display: none;
}

.category-dropdown-menu li {
  list-style: none;
  border-bottom: none;
}

.category-dropdown-menu a {
  display: block;
  padding: 0.5rem 0.95rem;
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  color: var(--text);
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
}

.category-dropdown-menu a:hover {
  background: var(--note-bg);
  color: var(--accent);
  text-decoration: none;
  padding-left: 1.15rem;
}

.recipe-list {
  list-style: none;
}

.recipe-list li {
  border-bottom: 1px solid var(--border-light);
}

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

.recipe-list a {
  display: flex;
  align-items: center;
  padding: 0.85rem 0.25rem;
  color: var(--text);
  transition: padding-left 0.15s ease;
}

.recipe-list a:hover {
  text-decoration: none;
  padding-left: 0.5rem;
  color: var(--accent);
}

.recipe-name {
  flex-shrink: 0;
  font-weight: 500;
  margin-right: 0.75rem;
}

.recipe-desc {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-right: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.arrow {
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.recipe-list a:hover .arrow {
  opacity: 1;
}

/* ===== Recipe Page ===== */
.recipe-header {
  margin-bottom: 1rem;
}

.recipe-category {
  display: inline-block;
  font-family: 'Sora', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.recipe-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
}

.description {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* Meta Bar */
.recipe-meta {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--card-bg);
  margin-bottom: 1rem;
}

.meta-item {
  flex: 1;
  text-align: center;
  padding: 1rem 0.5rem;
}

.meta-item + .meta-item {
  border-left: 1px solid var(--border-light);
}

.meta-label {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.meta-value {
  font-size: 1rem;
  font-weight: 500;
}

/* Recipe Body Sections */
.recipe-body section {
  margin-bottom: 1rem;
}

.recipe-body h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Equipment */
.equipment {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.5rem 2rem;
}

.instructions {
  /* background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px; */
  padding: 1.5rem 2rem;
}

.equipment ul {
  list-style: none;
}

.equipment li {
  padding: 0.3rem 0;
  padding-left: 1rem;
  position: relative;
}

.equipment li::before {
  content: "·";
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.7;
}

/* Ingredients */
.ingredients {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.5rem 2rem;
}

.ingredients h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.ingredients h3:first-of-type {
  margin-top: 0.5rem;
}

.ingredients ul {
  list-style: none;
}

.ingredients li {
  padding: 0.3rem 0;
  padding-left: 1rem;
  position: relative;
}

.ingredients li::before {
  content: "·";
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.7;
}

/* Directions */
.instructions ol {
  list-style: none;
  counter-reset: steps;
}

.instructions li {
  counter-increment: steps;
  padding: 1rem 0;
  padding-left: 1rem;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

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

.instructions li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 1rem;
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
}

.instructions h3 {
  margin-top: 2.5rem;
}

.instructions h3:first-of-type {
  margin-top: 0;
}

/* Step Ingredients */
.step-ingredients {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Notes */
.notes {
  background: var(--note-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.5rem 2rem;
  color: var(--text-light);
}

.notes p {
  line-height: 1.7;
}

.notes ul {
  list-style: none;
}

.notes li {
  padding: 0.3rem 0;
  padding-left: 1rem;
  position: relative;
}

.notes li::before {
  content: "·";
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.7;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero h1 {
      font-size: 1.8rem;
  }

  .recipe-header h1 {
      font-size: 1.6rem;
  }

  .recipe-meta {
      flex-wrap: wrap;
  }

  .meta-item {
      flex: 1 1 50%;
  }

  .meta-item:nth-child(1),
  .meta-item:nth-child(2) {
      border-bottom: 1px solid var(--border-light);
  }

  .meta-item:nth-child(2n+1) {
      border-left: none;
  }

  .equipment,
  .ingredients {
      padding: 1.25rem 1.25rem;
  }

  .notes {
      padding: 1.25rem;
  }

  .instructions li {
      padding-left: 2rem;
  }

  .search-input {
      width: 140px;
  }

  .search-results {
      width: 280px;
  }
}
