@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700;800&display=swap");

:root {
  --orange: #ff5a1f;
  --orange-deep: #e8450f;
  --ink: #2c2c2b;
  --muted: #7d7a75;
  --line: #e8e5df;
  --cream: #f6f1ea;
  --sage: #e8efe6;
  --white: #ffffff;
  --shadow: 0 8px 24px rgba(44, 44, 43, 0.08);
  --radius: 12px;
  --max: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255, 90, 31, 0.08), transparent),
    var(--white);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.brand__mark {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--orange);
}

.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  min-width: min(260px, 48vw);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap {
  position: relative;
  min-width: min(280px, 52vw);
}

.search-wrap .search {
  min-width: 100%;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 30;
  max-height: 340px;
  overflow-y: auto;
}

.search-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.search-item:last-child {
  border-bottom: 0;
}

.search-item:hover {
  background: var(--cream);
}

.search-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--cream);
}

.search-item strong {
  display: block;
  font-size: 0.85rem;
}

.search-item small {
  color: var(--muted);
}

.search-empty {
  padding: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  user-select: none;
}

.lang-switch__icon {
  display: inline-flex;
  margin-right: 0.15rem;
  color: var(--ink);
  opacity: 0.75;
}

.lang-switch__btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.lang-switch__btn.is-active {
  color: var(--ink);
  font-weight: 800;
}

.lang-switch__btn:hover {
  color: var(--orange);
}

.lang-switch__sep {
  color: #b0aaa3;
}

.header-link {
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}

.header-link:hover {
  color: var(--orange);
}

.search:focus-within {
  border-color: rgba(255, 90, 31, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12);
}

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  color: var(--ink);
}

.search input::placeholder {
  color: var(--muted);
}

.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--orange);
  line-height: 0;
}

.hero__art {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.hero.has-image .hero__fallback {
  display: none;
}

.hero__fallback {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
  text-align: center;
  color: white;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  animation: rise 0.7s ease both;
}

.hero__fallback span {
  display: block;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.page-title {
  margin: 0 0 1.5rem;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  animation: rise 0.6s ease 0.05s both;
}

.section-label {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  animation: rise 0.6s ease 0.1s both;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tab:hover {
  background: var(--cream);
  transform: translateY(-1px);
}

.tab.is-active {
  background: rgba(255, 90, 31, 0.12);
  color: var(--orange-deep);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem 0.85rem;
  animation: rise 0.65s ease 0.15s both;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card__media {
  aspect-ratio: 1 / 1.05;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--line);
  position: relative;
}

.card__media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card__media img {
  transform: scale(1.04);
}

.card__placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.card__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.25;
}

.empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

/* Recipe detail */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.back:hover {
  color: var(--orange);
}

.recipe {
  max-width: 720px;
  margin: 0 auto;
  animation: rise 0.55s ease both;
}

.recipe__hero {
  border-radius: 16px;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  margin-bottom: 1.5rem;
  position: relative;
}

.recipe__hero img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe__title {
  margin: 0 0 1rem;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
}

.meta {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.meta__row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.meta__label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.meta__value {
  font-weight: 600;
  line-height: 1.45;
}

.block-title {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  background: var(--sage);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.list {
  margin: 0 0 1.75rem;
  padding: 0 0 0 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.list li {
  line-height: 1.45;
  font-weight: 600;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  line-height: 1.5;
  font-weight: 600;
}

.steps__num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: rgba(255, 90, 31, 0.12);
  color: var(--orange-deep);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.note {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--cream);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.servings-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.servings-control button,
.btn {
  appearance: none;
  border: 0;
  background: rgba(255, 90, 31, 0.12);
  color: var(--orange-deep);
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}

.btn {
  width: auto;
  padding: 0.65rem 1rem;
  background: var(--orange);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.danger {
  background: #b42318;
  color: #fff;
}

.servings-control input {
  width: 4.2rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem;
  font: inherit;
  font-weight: 700;
}

.servings-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
}

.shopping-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.shopping-list li {
  background: var(--cream);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.shopping-list label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  cursor: pointer;
}

.shopping-list strong {
  display: block;
}

.shopping-list small {
  color: var(--muted);
}

.shopping-list .is-done strong {
  text-decoration: line-through;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
