/* Pantry Time — recipe link page, styled like the app's recipe card (RecipeCardComponents.swift). */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.site-header .btn { padding: 8px 16px; min-height: 38px; }
.recipe-main { width: min(860px, 100% - 32px); margin: 20px auto 0; }

/* Hero: full-bleed photo, or a generated two-tone gradient from the title's hash with glyphs */
.hero {
  position: relative; height: clamp(220px, 38vw, 320px); border-radius: 24px; overflow: hidden;
  display: flex; align-items: flex-end; padding: 20px; color: #fff; isolation: isolate;
  background: linear-gradient(135deg, var(--hero-from, hsl(96 41% 52%)), var(--hero-to, hsl(128 46% 44%)));
}
@media (prefers-color-scheme: dark) { .hero { background: linear-gradient(135deg, var(--hero-from-dark, hsl(96 41% 35%)), var(--hero-to-dark, hsl(128 46% 27%))); } }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-glyphs { position: absolute; top: 22px; right: 26px; display: flex; gap: 22px; z-index: 1; }
.hero-glyphs svg { width: 60px; height: 60px; color: rgba(255, 255, 255, .34); }
.hero-glyphs svg:nth-child(odd) { transform: rotate(-10deg); }
.hero-glyphs svg:nth-child(even) { transform: translateY(18px) rotate(8deg); }
.hero-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.15) 55%, rgba(0,0,0,.72) 100%); }
.hero h1 { position: relative; z-index: 2; font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 6px rgba(0,0,0,.35); overflow-wrap: anywhere; }
@media (max-width: 480px) { .hero-glyphs { gap: 12px; right: 16px; } .hero-glyphs svg { width: 44px; height: 44px; } }
/* "Load photo from <host>": the photo is fetched only when this is pressed (r/page.js). White on a dark pill, so it reads on any header. */
.photo-load {
  appearance: none; -webkit-appearance: none; position: absolute; top: 14px; left: 14px; z-index: 3;
  max-width: calc(100% - 28px); min-height: 44px; padding: 8px 16px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px;
  background: rgba(0, 0, 0, .62); color: #fff; font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.25; text-align: left;
  overflow-wrap: anywhere; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.photo-load:hover { background: rgba(0, 0, 0, .74); }
.photo-load:disabled { cursor: default; }
.photo-load:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #1d1d1f; }

/* Meta chips (RecipeMetaChip) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: .95rem; font-weight: 600; white-space: nowrap; }
/* A chip's text never wraps onto a second line; a source host longer than the row (rare) truncates instead. */
.chips li > :not(svg), .chips li a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chips li svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.chips li.link { background: var(--accent-soft); border-color: transparent; }
.chips li.link a { color: var(--accent); text-decoration: none; }
.chips li.link a:hover { text-decoration: underline; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 10px; }
.hint { font-size: .92rem; color: var(--muted); margin: 0 0 20px; }
.hint[data-live] { color: var(--accent); font-weight: 600; }

/* Ingredients + steps */
.recipe-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
@media (max-width: 720px) { .recipe-grid { grid-template-columns: 1fr; } }
.card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.card h3 { font-size: .95rem; color: var(--muted); font-weight: 600; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
ul.ingredients { list-style: none; padding: 0; margin: 0; }
ul.ingredients li { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
ul.ingredients li:last-child { border-bottom: 0; }
ul.ingredients .gl { flex: none; width: 26px; height: 26px; color: var(--muted); margin-top: 1px; }
ul.ingredients .dot { flex: none; width: 26px; height: 26px; display: grid; place-items: center; }
ul.ingredients .dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 12px; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; overflow-wrap: anywhere; }
ol.steps li::before { content: counter(step); width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; }
mark.timer { background: color-mix(in srgb, var(--honey) 28%, transparent); color: inherit; border-radius: 6px; padding: 1px 5px; font-weight: 600; overflow-wrap: anywhere; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
mark.timer::before { content: "⏱ "; font-size: .85em; }
@media (prefers-color-scheme: dark) { mark.timer { background: color-mix(in srgb, var(--honey) 32%, transparent); } }
.notes { white-space: pre-line; }
#notes-card { margin-top: 20px; }
.source { margin-top: 20px; }

/* Problem state */
#problem { max-width: 560px; margin: 40px auto; text-align: center; }
#problem h1 { font-size: 1.6rem; margin-bottom: 10px; }
.error { color: var(--danger); }

/* Print: just the recipe, black on white */
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --line: #ccc; --accent: #000; --accent-soft: #eee; }
  body { font-size: 12pt; }
  .site-header, .actions, .hint, .site-footer, .hero-glyphs, .hero-shade, .photo-load { display: none !important; }
  .recipe-main { width: 100%; margin: 0; }
  .hero { height: auto; padding: 0 0 8pt; border-radius: 0; color: #000; background: none !important; }
  .hero img { display: none; }
  .hero h1 { text-shadow: none; font-size: 22pt; }
  .chips li { border-color: #ccc; }
  .recipe-grid { grid-template-columns: 1fr; gap: 12pt; }
  .card { border: 0; padding: 0; }
  ol.steps li { break-inside: avoid; background: none; }
  mark.timer { background: none; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
}
