/* ============================================================
   dyringmaleri.se — css/fonster.css
   Illustrationer, skadekarta och kalkylator för tätningslist.
   Bygger på variablerna i css/style.css. Inga externa fonter.
   ============================================================ */

/* ---------- Figurer ---------- */

.fig { margin: 0; }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: var(--prose-max);
}
.fig-nr {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ochre-text);
  margin-right: 0.5rem;
}

/* Hero: text + växlande illustration */
.hero-split { display: grid; gap: 2rem; align-items: center; }
.fig--hero { width: 100%; max-width: 32rem; margin-inline: auto; }
.fig--hero img { aspect-ratio: 931 / 851; object-fit: contain; }
@media (min-width: 64rem) {
  .hero-split { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
  .fig--hero { max-width: none; }
}

/* Text + figur i två lika spalter */
.split--fig { align-items: center; }
@media (min-width: 64rem) {
  .split--fig { grid-template-columns: 1fr 1fr; }
}
.split + h2 { margin-top: 3rem; }

.fig-stack { display: grid; gap: 2.5rem; margin-top: 3rem; max-width: 56rem; }
.split--fig .delivery { margin: 0; }
.delivery strong { display: block; }

/* ---------- Skadekarta ---------- */

.scen-h {
  --ink: #2E4636; --dim: #4F6155; --line: #2E4636;
  --wood: #DDBB82; --wood-top: #EBD2A4; --wood-mid: #CDA96F; --wood-side: #BE9760; --grain: #8A6430;
  --jarn: #6A7479; --skruv: #DADDD6; --varn: #D6A259; --rota: #4E3D2C; --rost: #9A4A22; --gra: #A69D89; --kitt: #FFFFFF;
  --glass: rgba(46, 70, 54, 0.08);
}
.scen-h .tra { stroke: var(--line); stroke-width: 1.5; stroke-linejoin: round; }
.scen-h .f { fill: var(--wood); }
.scen-h .t { fill: var(--wood-top); }
.scen-h .k { fill: var(--wood-mid); }
.scen-h .s { fill: var(--wood-side); }
.scen-h .adr { fill: none; stroke: var(--grain); stroke-width: 1; stroke-linecap: round; opacity: 0.45; }
.scen-h .glas { fill: var(--glass); stroke: var(--ink); stroke-width: 1.25; }
.scen-h .jarn { fill: var(--jarn); stroke: var(--line); stroke-width: 1.25; stroke-linejoin: round; }
.scen-h .skruv { fill: var(--skruv); stroke: var(--line); stroke-width: 0.75; }
.scen-h .rota { fill: var(--rota); stroke: none; opacity: 0.85; }
.scen-h .rost { fill: var(--rost); stroke: var(--line); stroke-width: 1.25; stroke-linejoin: round; }
.scen-h .rostflack { fill: var(--rost); stroke: none; opacity: 0.4; }
.scen-h .gra { fill: var(--gra); stroke: none; }
.scen-h .tvars { fill: none; stroke: var(--line); stroke-width: 1; stroke-linecap: round; opacity: 0.7; }
.scen-h .kittrest { fill: none; stroke: var(--kitt); stroke-width: 3; stroke-linecap: round; }
.scen-h .skada { transition: opacity 0.25s; }
.scen-h.harval .skada { opacity: 0.3; }
.scen-h.harval .skada.aktiv { opacity: 1; }

.dmap { display: grid; gap: 2rem; align-items: start; margin-top: 1.75rem; }
@media (min-width: 64rem) {
  .dmap { grid-template-columns: 5fr 6fr; gap: 3.5rem; }
}
.dmap-fig { position: relative; width: 100%; max-width: 28rem; margin-inline: auto; }
.dmap-fig svg { display: block; width: 100%; height: auto; }

.dmap .prick {
  position: absolute;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--varn);
  color: #1B2A20;
  font: 600 0.8125rem/30px var(--font-mono);
  text-align: center;
  cursor: pointer;
  animation: dmap-puls 2.6s ease-out infinite;
  transition: opacity 0.25s, transform 0.25s;
}
.dmap .prick::after { content: ""; position: absolute; inset: -8px; }
.dmap.harval .prick { opacity: 0.4; animation: none; }
.dmap.harval .prick.aktiv { opacity: 1; transform: scale(1.2); }
@keyframes dmap-puls {
  0% { box-shadow: 0 0 0 0 rgba(176, 125, 60, 0.55); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(176, 125, 60, 0); }
}

.dmap-list { list-style: none; margin: 0; padding: 0; }
.dmap-list li { border-top: 1px solid var(--border); transition: opacity 0.25s; }
.dmap-list li:last-child { border-bottom: 1px solid var(--border); }
.dmap.harval .dmap-list li { opacity: 0.5; }
.dmap.harval .dmap-list li.aktiv { opacity: 1; }
.dmap-rad {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0.875rem 0 0.25rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dmap-rad .nr {
  flex: none;
  width: 28px; height: 28px;
  border: 1.5px solid var(--ochre);
  border-radius: 50%;
  font: 600 0.8125rem/25px var(--font-mono);
  text-align: center;
}
.dmap-list li.aktiv .nr { background: var(--varn); border-color: var(--varn); color: #1B2A20; }
.dmap-rad b { display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.dmap-rad span span { display: block; font-size: 1rem; color: var(--ink-muted); line-height: 1.45; }
.dmap-atgard {
  margin: 0;
  padding: 0 0 0.875rem calc(28px + 1rem);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ochre-text);
}
.dmap-atgard a { font-weight: 600; }

/* ---------- Kalkylator ---------- */

.kalk {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 2rem);
  max-width: 40rem;
}
.kalk [hidden] { display: none !important; }
.kalk-title { font-family: var(--font-heading); font-weight: 400; font-size: 1.5rem; line-height: 1.2; margin: 0; }
.kalk fieldset { margin: 1.5rem 0 0; padding: 0; border: 0; min-width: 0; }
.kalk legend {
  padding: 0;
  margin-bottom: 0.625rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ochre-text);
}
.kalk-val { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr)); gap: 0.5rem; }
.kalk-val button {
  min-height: 4rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.kalk-val button:hover { border-color: var(--green-800); }
.kalk-val b { display: block; font-size: 1rem; font-weight: 600; }
.kalk-val span { font-size: 0.875rem; color: var(--ink-muted); }
.kalk-val button[aria-pressed="true"] { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.kalk-val button[aria-pressed="true"] span { color: #DCE5DE; }

.kalk-rad { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.kalk-bild { flex: none; width: 2.25rem; height: 2.25rem; color: #B5B0A2; transition: color 0.15s ease; }
.kalk-bild svg { display: block; width: 100%; height: 100%; }
.kalk-bild.pa { color: var(--ochre); }
.kalk-namn { flex: 1 1 auto; min-width: 0; hyphens: auto; overflow-wrap: anywhere; }
.kalk-namn b { display: block; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.kalk-namn span { font-size: 0.875rem; color: var(--ink-muted); }
.kalk-steg { display: flex; align-items: center; gap: 0.25rem; flex: none; }
.kalk-steg button {
  width: 2.75rem; height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.kalk-steg button:hover { border-color: var(--green-800); }
.kalk-antal { min-width: 2.125rem; text-align: center; font-family: var(--font-mono); font-size: 1rem; font-variant-numeric: tabular-nums; }
.kalk-antal.bred { min-width: 4.25rem; font-size: 0.875rem; }
.kalk-antal.pa { font-weight: 600; color: var(--ochre-text); }

.kalk-kryss { display: flex; gap: 0.75rem; align-items: flex-start; margin-top: 1rem; font-size: 0.9375rem; line-height: 1.45; color: var(--ink-muted); cursor: pointer; }
.kalk-kryss input { flex: none; width: 1.375rem; height: 1.375rem; margin: 0.125rem 0 0; accent-color: var(--green-800); }
.kalk-kryss b { display: block; font-size: 1rem; font-weight: 600; color: var(--ink); }

.kalk-kvitto { margin: 1.5rem 0 1.25rem; padding: 1rem 1.125rem; background: var(--green-100); border-radius: var(--radius); font-size: 0.9375rem; }
.kalk-kvitto div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; }
.kalk-kvitto div span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kalk-kvitto .summa { margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--green-800); font-size: 1.125rem; font-weight: 600; }
.kalk-kvitto p { margin: 0; }
.kalk .btn { display: block; width: 100%; }
.kalk-fin { margin: 0.875rem 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--ink-muted); }

@media (max-width: 30rem) {
  .kalk-rad { gap: 0.5rem; }
  .kalk-bild { width: 2rem; height: 2rem; }
  .kalk-steg button { width: 2.5rem; height: 2.5rem; }
}

/* Kalkylen i kontaktformuläret */
.kalk-bifogad { background: var(--green-100); border-left: 3px solid var(--green-800); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.kalk-bifogad strong { display: block; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green-900); margin-bottom: 0.5rem; }
.kalk-bifogad pre { margin: 0 0 0.75rem; font: 400 0.9375rem/1.5 var(--font-body); white-space: pre-wrap; }
.kalk-bifogad button { background: none; border: 0; padding: 0; font: inherit; font-size: 0.9375rem; color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Stegen på startsidan (Så går det till) ---------- */

.step-ikon { display: block; width: 2.75rem; height: 2.75rem; margin-bottom: 1rem; color: var(--ochre); }
.step-ikon svg { display: block; width: 100%; height: 100%; }
.step-ikon .fyll { fill: var(--paper); }

/* Smalare än dator: en kolumn, ikonen till vänster om texten */
@media (max-width: 63.999rem) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 40rem; }
  .steps .step { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); column-gap: 1.25rem; padding-block: 1.25rem; }
  .steps .step-ikon { grid-row: 1 / span 3; margin: 0.125rem 0 0; }
  .steps .step > :not(.step-ikon) { grid-column: 2; }
  .steps .step:last-child { border-bottom: 1px solid var(--border); }
}

/* Dator: alla fem stegen på en rad */
@media (min-width: 64rem) {
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.75rem; }
  .steps .step h3 { hyphens: auto; }
  .steps .step p:not(.num) { font-size: 1rem; }
}

/* ---------- Ekonomiblocket på startsidan: siffran tätt intill texten ---------- */

.split--tal { align-items: start; }
@media (min-width: 64rem) {
  .split--tal { grid-template-columns: max-content minmax(0, 42rem); column-gap: 5rem; }
}
