@import url('https://fonts.googleapis.com/css2?family=Beth+Ellen&family=Flamenco:wght@400&display=swap');

:root {
  --background: #f1efeb;
  --ink: #171717;
  --ribbon: #f3c53d;
  --muted: #66615a;
  --border: rgba(23, 23, 23, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--ink);
  font-family: "Flamenco", Georgia, serif;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}



/* LINK DECORATIONS */

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ribbon);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, opacity 0.2s ease;
}

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

a:focus-visible {
  outline: 3px solid rgba(243, 197, 61, 0.55);
  outline-offset: 2px;
}


/* PAGE */

.page {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 10px 15px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-heading {
  text-align: center;
  margin-bottom: 0;
}

.page-heading h1 {
  margin: 0;
  font-family: "Beth Ellen", cursive;
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 500;
  line-height: 1;
}

.page-heading p {
  margin: 5px 0 0;
  font-size: clamp(.7rem, 1.4vw, .9rem);
  color: var(--muted);
  letter-spacing: .05em;
}


/* RECIPE CARD */

.recipe-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--background);
  padding: clamp(230px, 22vw, 310px) clamp(110px, 12vw, 80px) clamp(160px, 16vw, 340px);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}


/* RESPONSIVE SVG FRAME */

.ribbon-frame {
  position: absolute;
  top: -50px;
  left: -220px;
  width: calc(100% + 400px);
  height: calc(100% + 300px);
  display: block;
  pointer-events: none;
  z-index: -1;
  overflow: visible;
}

.ribbon-yellow {
  fill: none;
  stroke: var(--ribbon);
  stroke-width: 15;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .62;
}

.ribbon-black {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ribbon-sketch {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .45;
}


/* RECIPE INTRO - TOP PORTION */

.recipe-intro {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(12px, 2.5vw, 24px);
  align-items: center;
  justify-content: center;
}


/* FOOD PHOTO */

.photo-wrap {
  position: relative;
  width: min(100%, 225px);
  margin: 0 auto;
  transform: rotate(-2deg);
}

.recipe-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #ddd;
  border: clamp(6px, 1vw, 10px) solid white;
  box-shadow:
    0 4px 12px rgba(0,0,0,.08),
    0 12px 30px rgba(0,0,0,.08);
}

.photo-wrap::before {
  content: "";
  position: absolute;
  width: clamp(75px, 9vw, 100px);
  height: clamp(22px, 2.5vw, 28px);
  top: clamp(-14px, -1.5vw, -10px);
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  background: var(--ribbon);
  opacity: .5;
  z-index: 2;
  clip-path: polygon(
    0 5%,
    100% 0,
    97% 95%,
    2% 100%
  );
}


/* TITLE */

.recipe-title {
  margin: 0;
  font-family: "Beth Ellen", cursive;
  font-weight: 500;
  font-size: 35px;
  line-height: 1.25;
  overflow-wrap: break-word;
  text-align: center;
}

.recipe-title .line {
  display: block;
}

.title-line {
  width: 100%;
  max-width: 100%;
  height: 2.5px;
  margin: clamp(6px, 1.2vw, 20px) 0;
  background: var(--ribbon);
  border-radius: 50%;
}

.description {
  margin: 0;
  max-width: 980px;
  font-size: 17px;
  line-height: 1.2;
}


/* META */

.recipe-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 1.2vw, 10px);
  margin: clamp(10px, 1.5vw, 14px) 0 0;
  justify-content: center;
}

.meta {
  text-align: center;
  min-width: 0;
}

.meta-icon {
  margin-bottom: 2px;
  color: var(--ribbon);
  font-size: 25px;
}

.meta strong {
  display: block;
  font-size: 17px;
}

.meta span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}


/* SERVINGS CONTROL */

.servings-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 2px;
}

.servings-control button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.2px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: .75rem;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.servings-control button:hover {
  background: var(--ink);
  color: var(--background);
}

.servings-control button:active {
  transform: scale(.92);
}

.servings-control button:focus-visible {
  outline: 3px solid rgba(243,197,61,.55);
  outline-offset: 2px;
}

.servings-number {
  min-width: 50px;
  font-size: clamp(.58rem, .95vw, .72rem);
}


/* FULL RECIPE */

.full-recipe {
  width: 100%;
  max-width: 980px;
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: minmax(180px, .85fr) minmax(0, 1.15fr);
  gap: clamp(12px, 3vw, 26px);
  padding-top: 0;
  justify-content: center;
}

.section-title {
  margin: 0 0 clamp(6px, 1.2vw, 10px);
  font-family: "Beth Ellen", cursive;
  font-size: 21px;
  font-weight: 500;
}


/* INGREDIENTS */

.ingredients {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ingredients li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(23,23,23,.18);
  font-size: 17px;
  line-height: 1.3;
}

.ingredients .name {
  min-width: 0;
}

.ingredients .amount {
  flex-shrink: 0;
  font-weight: 700;
  white-space: nowrap;
}


/* COOKING INSTRUCTIONS */

.instructions {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: recipe-step;
}

.instructions li {
  position: relative;
  padding-left: clamp(26px, 2.8vw, 32px);
  margin-bottom: clamp(10px, 1.8vw, 14px);
  line-height: 1.15;
  font-size: 17px;
  counter-increment: recipe-step;
}

.instructions li::before {
  content: counter(recipe-step);
  position: absolute;
  left: 0;
  top: -2px;
  width: clamp(18px, 2.2vw, 24px);
  height: clamp(18px, 2.2vw, 24px);
  display: grid;
  place-items: center;
  border: 1.8px solid var(--ribbon);
  border-radius: 50%;
  font-family: "Beth Ellen", cursive;
  font-size: clamp(0.7rem, 1.2vw, .88rem);
}


/* NOTES SECTION */

.recipe-notes {
  width: 100%;
  max-width: 980px;
  margin: clamp(16px, 2.5vw, 20px) auto 0;
  padding: clamp(10px, 1.8vw, 25px);
  background: rgba(243,197,61,.12);
  border-left: 3.5px solid var(--ribbon);
}

.recipe-notes h3 {
  margin: 0 0 6px;
  font-family: "Beth Ellen", cursive;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 500;
}

.recipe-notes ul {
  margin: 0;
  padding-left: 18px;
}

.recipe-notes li {
  font-size: 17px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.recipe-notes li:last-child {
  margin-bottom: 0;
}


/* FOOTER */

.recipe-footer {
  width: 100%;
  max-width: 680px;
  text-align: center;
  margin-top: clamp(20px, 3.5vw, 30px);
  font-family: "Beth Ellen", cursive;
  font-size: clamp(.9rem, 1.4vw, 1.05rem);
}


/* TABLET ≤ 800px */

@media (max-width: 800px) {
  .page {
    width: 100%;
    padding-inline: 12px;
  }

  .recipe-card {
    padding: clamp(150px, 20vw, 210px) clamp(30px, 6vw, 50px) clamp(110px, 14vw, 150px);
  }

  .recipe-intro {
    grid-template-columns: 1fr;
    gap: clamp(16px, 4vw, 26px);
    text-align: center;
  }

  .photo-wrap {
    width: min(75vw, 160px);
  }

  .recipe-title {
    text-align: center;
    font-size: clamp(1.7rem, 6vw, 2.3rem);
  }

  .description {
    margin-inline: auto;
    text-align: center;
    max-width: 500px;
  }

  .title-line {
    max-width: 500px;
    margin-inline: auto;
  }

  .recipe-meta {
    max-width: 480px;
    margin-inline: auto;
  }

  .full-recipe {
    grid-template-columns: 1fr;
    gap: clamp(16px, 4vw, 26px);
    padding-inline: 0;
  }
}


/* MOBILE ≤ 640px */

@media (max-width: 640px) {
  /* Hide SVG frame completely on mobile */
  .ribbon-frame {
    display: none;
  }

  body {
    background-color: var(--ribbon);
  }

  /* Clean card presentation without oversized frame padding */
  .recipe-card {
    padding: 28px 18px 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  }

  .photo-wrap {
    width: min(75vw, 145px);
  }

  .recipe-title {
    font-size: clamp(1.4rem, 6.5vw, 1.8rem);
  }

  .description {
    font-size: 15px;
  }

  .recipe-meta {
    gap: 4px;
  }

  .servings-control button {
    width: 22px;
    height: 22px;
  }

  .servings-number {
    min-width: 46px;
    font-size: .65rem;
  }

  .ingredients li,
  .instructions li,
  .recipe-notes li {
    font-size: 15px;
  }

  .instructions li {
    padding-left: 28px;
    line-height: 1.25;
  }

  .recipe-notes {
    padding: 12px 14px;
    margin-top: 16px;
  }
}