/* dergoldrechner.de – fonts are self-hosted (DSGVO): Fraunces + Inter, both SIL OFL */
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/Fraunces-normal.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/Fraunces-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* Light-only brand palette (deliberate: trust and readability for the audience) */
:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --ink: #16130f;
  --muted: #6e6658;
  --line: #e4ded1;
  --gold: #a8802f;
  --gold-dark: #7f5f1d;
  --gold-soft: #f1e8d3;
  --ok: #2f6b3a;
  --warn: #8a4b12;
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --num: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; /* all figures: clear, tabular */
}
.big, td.num, .num { font-family: var(--num); font-variant-numeric: tabular-nums; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
a { color: var(--gold-dark); }
img { max-width: 100%; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.logo { font: 400 1.35rem var(--serif); letter-spacing: -.01em; color: var(--ink); text-decoration: none; display: flex; align-items: baseline; gap: .26em; }
.logo em { font-style: italic; color: var(--gold); }
.logo-mark { display: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
.nav a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; padding: 6px 0 4px; border-bottom: 2px solid transparent; } /* top padding = bottom padding + border: text stays centred */
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); border-bottom-color: var(--gold); }
/* live rate of the page's metal, top of the calculator card; one font size so everything sits on one line */
.rate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: -4px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.rate-row { display: flex; align-items: center; gap: 10px; margin: 0; }
.rate-val { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--num); font-variant-numeric: tabular-nums; }
.rate-val b { font-weight: 600; color: var(--ink); }
.rate-g { color: var(--muted); }
/* min-width keeps prices in one column when two metals are listed; 3px/1px padding centres the cap height in the chip */
.rate .k { display: inline-block; min-width: 6.8em; text-align: center; padding: 3px 10px 1px; border-radius: 999px; font-weight: 600; line-height: 1.35; }
.rate .k-gold { background: #f6e7c2; color: #7a5a12; }
.rate .k-silver { background: #e9edf2; color: #3f4a57; }
.rate .k-platinum, .rate .k-palladium { background: #eceae6; color: #4a4740; }
.rate-live { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.rate-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #2f9e5b; box-shadow: 0 0 0 0 rgba(47, 158, 91, .5); animation: livePulse 2s ease-out infinite; position: relative; top: -1px; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px rgba(47, 158, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 158, 91, 0); } }
@media (prefers-reduced-motion: reduce) { .rate-live .dot { animation: none; } }
/* phones: gram value below the ounce price; price line as tall as the chip so both stay centred */
@media (max-width: 600px) { .rate-row { align-items: flex-start; } .rate-val { flex-direction: column; align-items: flex-start; gap: 0; } .rate-val b { line-height: calc(1.35em + 2px); padding-top: 2px; white-space: nowrap; } }

/* Hero */
.hero { padding: 36px 0 12px; }
.hero h1 { font: 700 clamp(1.8rem, 4.5vw, 2.6rem)/1.15 var(--serif); margin: 0 0 12px; }
.hero p { margin: 0; color: var(--muted); max-width: 680px; font-size: 1.05rem; }

/* Calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0 8px; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }
@media (min-width: 761px) and (max-width: 960px) { .calc { align-items: start; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h2 { font: 700 1.2rem var(--serif); margin: 0 0 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: .85rem; }
/* mixed lot: one row per piece (weight + stamp) */
.mix-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; align-items: start; }
.mix-row input, .mix-row select { box-sizing: border-box; height: 50px; } /* same height: labels and fields line up */
.mix-row label { white-space: nowrap; }
@media (max-width: 600px) { .mix-row { grid-template-columns: 104px minmax(0, 1fr); } }
.mix-row .field { margin-bottom: 12px; }
.mix-add { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; margin: 2px 0 8px;
  font: 600 .95rem/1 inherit; color: var(--ink); background: transparent; border: 1px dashed var(--gold); border-radius: 999px; cursor: pointer; }
.mix-add:hover { background: #f6e7c2; }
.mix-help { display: block; color: var(--muted); font-size: .85rem; }
input, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px; min-height: 48px;
}
input:focus, select:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--warn); }
.result { background: var(--gold-soft); border-color: transparent; }
.result .big { font: 600 clamp(1.6rem, 4vw, 2.2rem)/1.1 var(--num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.result .label { font-size: .9rem; color: var(--muted); }
.result .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.result .big + .row { border-top: 0; }
.result .note { font-size: .82rem; color: var(--muted); margin-top: 12px; }
.stale { color: var(--warn); font-weight: 600; }

/* CTA */
.cta { margin: 20px 0; }
.cta .ad-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cta-list { display: grid; gap: 10px; margin-top: 8px; }
.cta-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  text-decoration: none; color: var(--ink); font-weight: 600;
}
.cta-link:hover { border-color: var(--gold); }
.cta-link span { color: var(--gold-dark); white-space: nowrap; }

/* Content */
main section { margin: 36px 0; }
main h2 { font: 700 1.5rem/1.25 var(--serif); margin: 0 0 12px; }
main h3 { font-size: 1.1rem; margin: 20px 0 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--gold-soft); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 10px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--gold); }
.tile strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
.tile span { color: var(--muted); font-size: .9rem; }
.disclaimer { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 40px; font-size: .9rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }

table caption { caption-side: bottom; text-align: left; font-size: .82rem; color: var(--muted); padding: 8px 2px; }

/* Sticky result on phones, so the value stays visible while typing */
.sticky-result { display: none; }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header .wrap { padding-top: 8px; padding-bottom: 6px; gap: 4px 12px; }
  .logo { font-size: 1.1rem; }
  .nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; order: 3; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  th, td { padding: 8px; }
  th.num { white-space: normal; }
  table { font-size: .85rem; }
  .sticky-result.offscreen-only { display: none !important; }
  .hero { padding: 20px 0 4px; }
  .hero p { font-size: 1rem; }
  .card { padding: 16px; }
  .sticky-result:not([hidden]) {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--surface); border-top: 2px solid var(--gold); padding: 10px 16px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08); font-size: .85rem; color: var(--muted);
  }
  .sticky-result strong { font: 600 1.05rem var(--num); font-variant-numeric: tabular-nums; color: var(--ink); }
  .site-footer { padding-bottom: 80px; }
  .col-fine { display: none; }
}

.legal h2 { font-size: 1.2rem; margin-top: 28px; }
.placeholder { background: #fff3c4; color: #5a4300; padding: 0 4px; border-radius: 4px; }

.footer-calcs { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
/* copyable embed code */
pre.code { white-space: pre-wrap; word-break: break-all; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font: .85rem/1.5 ui-monospace, Consolas, monospace; }

/* breadcrumbs above the page title; one font size, items centred on one line */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 18px 0 -6px; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { opacity: .6; }
.crumbs [aria-current] { color: var(--ink); }
/* last-updated line at the end of content pages */
.stand { margin: 28px 0 8px; font-size: .85rem; color: var(--muted); }
.stand a { color: var(--muted); }

/* photo band on subpages: real photo, dark overlay as on the home hero, title in the home serif style */
.band { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; min-height: 300px; padding: 26px 0 34px; background: #0e0c09; color: #f6efe0; }
.band-bg { position: absolute; inset: 0; z-index: -2; }
.band-bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transform: scale(var(--zoom, 1)); transform-origin: var(--origin, 50% 50%); }
@media (max-width: 600px) { .band-bg img { object-position: var(--mpos, var(--pos, 50% 50%)); transform: scale(var(--mzoom, var(--zoom, 1))); transform-origin: var(--morigin, var(--origin, 50% 50%)); } }
.band::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(10, 8, 6, .9) 0%, rgba(10, 8, 6, .74) 42%, rgba(10, 8, 6, .3) 75%, rgba(10, 8, 6, .4) 100%),
              linear-gradient(0deg, rgba(10, 8, 6, .5), rgba(10, 8, 6, 0) 45%); }
.band-in { width: 100%; }
@media (min-width: 601px) { .band.focus::before { background: linear-gradient(90deg, rgba(10, 8, 6, .97) 0%, rgba(10, 8, 6, .92) 40%, rgba(10, 8, 6, .35) 68%, rgba(10, 8, 6, .4) 100%), linear-gradient(0deg, rgba(10, 8, 6, .5), rgba(10, 8, 6, 0) 45%); } } /* zoomed coin pages: other coins on the left must not stay legible */
.band .crumbs { margin: 0 0 18px; color: #cfc4ad; }
.band .crumbs a { color: #cfc4ad; }
.band .crumbs a:hover { color: #fff8ea; }
.band .crumbs [aria-current] { color: #fff8ea; }
.band h1 { font: 400 clamp(2rem, 4.2vw, 3.2rem)/1.06 var(--serif); letter-spacing: -.02em; color: #fff8ea; margin: 0 0 14px; max-width: 20em; text-wrap: balance; }
.band p { margin: 0; color: #d7ccb6; max-width: 680px; font-size: 1.05rem; line-height: 1.6; }
.band-bg img.tone { filter: brightness(.68) saturate(1.12) sepia(.12); } /* light photo: darker and warmer, like the home hero */
.band-bg img.tone-strong { filter: brightness(.5) contrast(1.15); } /* very light photo (silver cutlery on white) */
.band-bg img.tone-soft { filter: brightness(.85) saturate(1.05); } /* dark photo (gold bars): keep the shine visible */
.band-bg img.tone-bright { filter: brightness(1.3) contrast(1.05); } /* dark crucible photo: keep the motif recognisable */
.band-bg img.tone-cool { filter: brightness(.8) saturate(.55); } /* strong blue backdrop: calmer, so the white metal leads */
.band-bg img.tone-blur { filter: blur(6px) brightness(.55); transform: scale(1.06); } /* coin heap as calm background, no legible coin */
/* header joins the dark band, as on the home page */
.has-band .site-header { background: #0e0c09; border-bottom-color: rgba(255, 255, 255, .07); }
.has-band .logo { color: #f3ead6; }
.has-band .logo em { color: #e2b95e; }
.has-band .nav a { color: #cfc4ad; }
.has-band .nav a[aria-current="page"], .has-band .nav a:hover { color: #fff8ea; border-bottom-color: #d9ad52; }
.band + main .calc { margin-top: 44px; }
@media (max-width: 600px) {
  .band { min-height: 0; padding: 22px 0 26px; }
  .band h1 { font-size: 1.9rem; }
  .band p { display: none; } /* as on the home page: no intro on phones, the calculator stays close (text stays in the page) */
  .band::before { background: linear-gradient(0deg, rgba(10, 8, 6, .8), rgba(10, 8, 6, .62)); } /* even darkening behind the text */
  .band + main .calc { margin-top: 28px; }
  .band.focus .band-bg img { filter: blur(5px) brightness(.6); transform: scale(1.06); } /* coin pages: the title fills the short band, so no half coin edges behind it */
}

/* Tablet and phone only (desktop stays untouched): amounts, rate pills and value cells never break mid-value */
@media (max-width: 960px) {
  .result { container-type: inline-size; }
  .result .big { font-size: min(2.2rem, 7.6cqi); white-space: nowrap; }
  .result .row > span:last-child { white-space: nowrap; }
  .rate-val b { white-space: nowrap; }
  select { font-size: .85rem; padding-inline: 10px; text-overflow: ellipsis; }
}
.nw { white-space: nowrap; }
.result .label-sub { margin-top: 12px; font-weight: 600; }
