/* «Gem en opskrift fra et link» (WEB-011): the tool page's and the import pages' box's own styles, prefix .li-.
   Reads the page's tokens (styles.css :root and the skeleton block: --sp-*, --panel-*, --card-*, --ease-land)
   and never changes them; uses the skeleton's classes (.sk-head-center, .sk-section, .sk-sec-head, .sk-panel) as
   they are. Loaded after styles.css (the tool page) or funktioner.css (the import pages). */

/* ── The tool page: the first screen is a hero. On a wide screen two columns across the page's container: the copy,
   «Sådan virker det» and the field on the left, the example card on the right. On a phone one column in the order of
   the markup: the copy, the field, «Sådan virker det», the example. ── */
.li-hero { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-6); }
/* The head is the skeleton's head, left-aligned and without its rule: the same label, headline and lede numbers. */
.li-tool-head h1 { margin: 0 0 var(--head-lede-gap); font-size: var(--h1-page); line-height: 1.08; text-wrap: balance; }
.li-hero-sub { margin: 0 0 var(--sp-3); font: 700 var(--h3-card)/1.25 var(--serif); color: var(--deep); }
.li-hero-form { max-width: 560px; }
.li-noscript { margin: 0; color: var(--deep-soft); }
.li-noscript a { color: var(--terra-deep); text-decoration: underline; text-underline-offset: .2em; }
.li-how { list-style: none; counter-reset: li-how; margin: 0; padding: 0; max-width: 36em; }
.li-how li {
  counter-increment: li-how; display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0 var(--sp-2);
  margin: 0 0 var(--sp-2); font-size: 1rem; line-height: 1.6; color: var(--deep-soft);
}
.li-how li:last-child { margin-bottom: 0; }
.li-how li::before { content: counter(li-how, decimal-leading-zero); font: italic 600 1.02rem/1.6 var(--serif); color: var(--terra); }

/* A message (social link, cannot be read) at the field. */
.li-note { margin-top: var(--sp-4); }
.li-note[hidden] { display: none; }
.li-note .li-msg { padding: clamp(16px, 2vw, 22px); }

/* The example card: the recipe card itself in one column, a little turned, its bottom faded out. Never a result. */
.li-hero-example { min-width: 0; }
.li-example-tag {
  display: inline-block; margin: 0 0 var(--sp-3); padding: 4px 12px; border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill); background: rgba(255, 255, 255, .55);
  font: 600 .72rem/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.li-recipe.li-example {
  max-height: 560px; overflow: hidden; pointer-events: none; user-select: none; -webkit-user-select: none;
  transform: rotate(1.2deg); transform-origin: 50% 0; box-shadow: var(--card-shadow-lift);
  padding: clamp(20px, 2.2vw, 30px);
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 98%); mask-image: linear-gradient(to bottom, #000 68%, transparent 98%);
}

.li-example .li-r-body { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); margin-top: var(--sp-4); padding-top: var(--sp-4); }
.li-example .li-sec { margin-bottom: var(--sp-2); font-size: 1.05rem; }
.li-example .li-group { margin-bottom: var(--sp-1); }
.li-example .li-ingr-list li { padding: 5px 0; font-size: .9rem; line-height: 1.4; }
.li-example .li-ingr-list li:first-child { padding-top: 0; }
.li-example .li-steps-list li { margin-bottom: var(--sp-2); font-size: .92rem; line-height: 1.5; }
.li-example-src { color: var(--terra-deep); text-decoration: underline; text-decoration-color: rgba(184, 95, 40, .35); text-underline-offset: .2em; }

@media (min-width: 880px) {
  .li-hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); grid-template-rows: auto auto 1fr;
    grid-template-areas: "head ex" "how ex" "form ex"; column-gap: clamp(32px, 5vw, 72px); row-gap: var(--sp-5); align-items: start;
  }
  .li-tool-head { grid-area: head; }
  .li-hero-how { grid-area: how; }
  .li-hero-form { grid-area: form; }
  .li-hero-example { grid-area: ex; padding-top: var(--sp-2); }
}
@media (max-width: 879.98px) {
  .li-recipe.li-example { max-height: 440px; transform: rotate(.8deg); }
}

/* The fetched recipe: under the hero, centred, in the width the card had in the panel. */
.li-tool .li-out { max-width: 1008px; margin: var(--sp-7) auto 0; scroll-margin-top: var(--sp-5); }
.li-tool .li-next { text-align: center; }
.li-tool .li-next-text { margin-left: auto; margin-right: auto; }
.li-tool .li-out .li-actions { justify-content: center; }

/* Under the tool: one centred reading column of sections, each with the skeleton's head and its one line; the text
   fills the column, so nothing stands left with an empty right side. */
.li-col { max-width: var(--read-col); margin-left: auto; margin-right: auto; }
.li-info p { margin: 0; font-size: 1.02rem; line-height: 1.65; color: var(--deep-soft); text-wrap: pretty; }
.li-info p + p { margin-top: var(--sp-3); }
.li-pdf { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--sp-6); align-items: start; }
.li-pdf-figure { margin: 0; }
.li-pdf-figure img {
  display: block; width: 100%; height: auto; border: 1px solid var(--card-line); border-radius: 4px;
  background: #fff; box-shadow: var(--card-shadow);
}
.li-app { text-align: center; }
.li-app.sk-panel > h2 { margin-bottom: var(--sp-3); }
.li-app > p { max-width: 52ch; margin: 0 auto var(--sp-5); font-size: 1.02rem; line-height: 1.6; color: var(--deep-soft); }
.li-app-actions { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); }
.li-more { margin: var(--sp-6) 0 0; text-align: center; font-size: .98rem; line-height: 1.5; color: var(--muted); }
.li-more a { color: var(--terra-deep); text-decoration: underline; text-decoration-color: rgba(184, 95, 40, .35); text-underline-offset: .2em; }
@media (max-width: 639.98px) {
  .li-pdf { grid-template-columns: minmax(0, 1fr); }
  .li-pdf-figure { max-width: 280px; }
}

/* ── The import pages' box: low and narrow, centred; it hands the link to the tool page ── */
section.section.li-box-section { padding: var(--section-gap) 0 0; }
.li-box {
  max-width: 720px; margin: 0 auto; padding: clamp(20px, 2.6vw, 30px) clamp(18px, 3vw, 36px);
  border: 1px solid var(--card-line); border-radius: var(--panel-radius); background: var(--panel-bg); text-align: center;
}
.li-box .eyebrow { display: block; margin: 0 0 var(--head-label-gap); }
.li-box .li-box-heading { margin: 0; font-size: var(--h2-section); line-height: 1.15; text-wrap: balance; }
.li-box .li-box-form { max-width: none; margin: var(--sp-4) 0 0; text-align: left; }
.li-box-note, .li-box-noscript { margin: var(--sp-3) 0 0; font-size: .92rem; line-height: 1.45; color: var(--muted); }
.li-box-noscript a { font-weight: 600; color: var(--terra-deep); text-decoration: underline; text-underline-offset: .2em; }
.li-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The field and the button: one row on a wider screen, stacked on a phone. 48 px high as the planner's fields, 17 px type (iOS zooms under 16). */
.li-form { max-width: 640px; }
.li-form[hidden] { display: none; }
.li-label { display: block; margin: 0 0 var(--sp-2); font: 600 .92rem/1.3 var(--sans); color: var(--deep); }
.li-row { display: flex; gap: var(--sp-3); }
.li-input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; margin: 0; padding: 0 var(--sp-4);
  font: 400 17px/1.3 var(--sans); color: var(--ink);
  background: #fff; border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
}
.li-input::placeholder { color: var(--muted-soft); }
.li-input:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px rgba(212, 118, 58, .18); }
.li-input[aria-invalid="true"] { border-color: var(--terra-deep); }
.li-submit {
  flex: none; min-height: 48px; padding: 0 var(--sp-5); border-radius: var(--radius-sm);
  font: 600 1rem/1.2 var(--sans); color: var(--cream); background: var(--ink);
  transition: transform var(--t-press) ease, opacity var(--t-hover) ease;
  -webkit-tap-highlight-color: transparent;
}
.li-submit:active { transform: scale(.98); }
.li-submit:disabled { opacity: .55; cursor: progress; transform: none; }
.li-field-msg { margin: var(--sp-2) 0 0; font-size: .95rem; line-height: 1.45; color: #9a4b1c; }
.li-field-msg[hidden] { display: none; }

/* «Zimmer henter opskriften»: the live region, with a quiet simmering dot while it fetches. */
.li-status { margin: 0; font-size: .98rem; color: var(--deep-soft); }
.li-is-loading .li-status { display: flex; align-items: center; gap: 10px; margin-top: var(--sp-4); }
.li-is-loading .li-status::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--terra); }
@keyframes li-simmer { 0%, 100% { opacity: .3; scale: .8; } 50% { opacity: 1; scale: 1; } }

.li-out { margin-top: var(--sp-5); }
.li-out[hidden] { display: none; }
@keyframes li-arrive { from { opacity: 0; translate: 0 12px; } }
/* The fetched recipe is an answer that opens (--t-settle); the dot is a wait signal and the only loop on the page. */
@media screen and (prefers-reduced-motion: no-preference) {
  .li-out > * { animation: li-arrive var(--t-settle) var(--ease-land) backwards; }
  .li-is-loading .li-status::before { animation: li-simmer 1.1s ease-in-out infinite; }
}

/* The recipe: one card. Ingredients beside the method on a wider screen, under it on a phone. */
.li-recipe {
  padding: clamp(20px, 3.2vw, 40px);
  border: 1px solid var(--card-line); border-radius: var(--card-radius);
  background: var(--card-bg); box-shadow: var(--card-shadow);
}
.li-source { margin: 0 0 var(--sp-2); font: 500 .92rem/1.4 var(--sans); color: var(--muted); overflow-wrap: anywhere; }
.li-source a { color: var(--terra-deep); text-decoration: underline; text-decoration-color: rgba(184, 95, 40, .35); text-underline-offset: .2em; }
.li-source-url { display: none; }
.li-r-title {
  margin: 0; font: 800 var(--h2-section)/1.15 var(--serif); letter-spacing: -.015em;
  color: var(--ink); text-wrap: balance; overflow-wrap: break-word; scroll-margin-top: var(--sp-6);
}
.li-r-title:focus, .li-msg:focus { outline: none; }
.li-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: var(--sp-2) 0 0; font-size: .95rem; color: var(--muted); }
.li-meta-dot { color: var(--muted-soft); }
.li-r-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: clamp(28px, 4vw, 56px);
  margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--hairline);
}
.li-sec { margin: 0 0 var(--sp-3); font: 700 1.15rem/1.25 var(--serif); color: var(--deep); }
.li-group { margin: var(--sp-5) 0 var(--sp-2); font: 600 .74rem/1.35 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--terra-deep); }
.li-sec + .li-group { margin-top: 0; }
.li-ingr-list { list-style: none; margin: 0; padding: 0; }
.li-ingr-list li { padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: .98rem; line-height: 1.45; overflow-wrap: break-word; }
.li-ingr-list li:first-child { padding-top: 0; }
.li-steps-list { margin: 0; padding-left: 1.5em; }
.li-steps-list li { margin: 0 0 var(--sp-3); padding-left: 4px; font-size: 1rem; line-height: 1.62; color: var(--deep); overflow-wrap: break-word; }
.li-steps-list li::marker { font-weight: 700; color: var(--terra-deep); }

/* Under the recipe and in the other outcomes: one line and the buttons. */
.li-next { margin-top: var(--sp-5); }
.li-msg { padding: clamp(18px, 2.6vw, 28px); border: 1px solid var(--card-line); border-radius: var(--card-radius); background: var(--card-bg); }
.li-next-text, .li-msg-text { margin: 0; max-width: 40em; font-size: 1rem; line-height: 1.55; color: var(--deep); }
.li-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-4); }
.li-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-pill); font: 600 .98rem/1.2 var(--sans); text-align: center; text-decoration: none;
  transition: transform var(--t-press) ease, background var(--t-hover) ease, border-color var(--t-hover) ease;
  -webkit-tap-highlight-color: transparent;
}
.li-btn:active { transform: scale(.98); }
.li-btn-primary { background: var(--ink); color: var(--cream); }
.li-btn-ghost { border: 1px solid var(--hairline-strong); background: rgba(255, 255, 255, .55); color: var(--deep); }
@media (hover: hover) { .li-btn-ghost:hover { border-color: var(--terra); } }

@media (max-width: 759.98px) {
  .li-r-body { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
}
@media (max-width: 559.98px) {
  .li-row { flex-direction: column; }
  .li-submit { width: 100%; }
  .li-recipe { padding: 20px 18px; }
  .li-ingr-list li { padding: 7px 0; }
  /* Buttons share the row by their own width, so «Prøv et andet link» never breaks over two lines. */
  .li-actions .li-btn { flex: 1 1 auto; padding: 0 18px; white-space: nowrap; }
}

/* Print: «Print» marks the path from the page down to the recipe (linkimport.js) and prints only that card with its
   source line and address. A plain print of the page without that class is the page's own print. */
@media print {
  html.li-printing body > *:not(.li-print-path),
  html.li-printing .li-print-path > *:not(.li-print-path):not(.li-recipe) { display: none !important; }
  html.li-printing .li-print-path {
    margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important;
    box-shadow: none !important; max-width: none !important; min-height: 0 !important; animation: none !important;
  }
  html.li-printing .li-print-path::before, html.li-printing .li-print-path::after { display: none !important; }
  html.li-printing body { background: #fff !important; font-size: 10.5pt; }
  html.li-printing .li-recipe { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; animation: none; }
  html.li-printing .li-source { font-size: 9.5pt; color: #444; }
  html.li-printing .li-source a { color: inherit; text-decoration: none; }
  html.li-printing .li-source-url { display: block; margin-top: 2pt; font-size: 8.5pt; color: #666; overflow-wrap: anywhere; }
  html.li-printing .li-r-title { font-size: 20pt; color: #000; }
  html.li-printing .li-meta { font-size: 10pt; color: #444; }
  html.li-printing .li-r-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: 22pt; margin-top: 12pt; padding-top: 12pt; }
  html.li-printing .li-sec { font-size: 12pt; color: #000; }
  html.li-printing .li-group { font-size: 8pt; color: #000; }
  html.li-printing .li-ingr-list li { padding: 3pt 0; font-size: 10pt; }
  html.li-printing .li-steps-list li { margin-bottom: 6pt; font-size: 10.5pt; line-height: 1.45; color: #000; }
  html.li-printing .li-ingr-list li, html.li-printing .li-steps-list li { break-inside: avoid; }
  html.li-printing .li-steps-list li::marker { color: #000; }
}
