/* ==========================================================================
   QatarGoldLive
   Concept: het prijsbord uit de goudwinkels van de souq. Bordeaux paneel,
   gouden cijfers. Alles daaromheen blijft wit en rustig.
   ========================================================================== */

:root {
	--maroon: #5c0f28;      /* diep Qatari-bordeaux */
	--maroon-2: #8a1538;    /* vlagkleur, voor links en accenten */
	--maroon-deep: #3a0918; /* footer en ticker */
	--gold: #d4a744;        /* goud op bordeaux */
	--gold-ink: #8a6516;    /* goud op wit (voldoende contrast) */
	--paper: #ffffff;
	--mist: #f7f3f3;        /* zachte achtergrond met een zweem bordeaux */
	--ink: #241a1d;
	--muted: #6a5e62;
	--line: #eadfe1;
	--up: #17734a;
	--down: #b3261e;

	/* door de plugin gebruikt (grafiek) */
	--qgl-gold: #b8892b;
	--qgl-line: #eee6e7;
	--qgl-muted: #6a5e62;

	--font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;

	--step--1: 0.875rem;
	--step-0: 1rem;
	--step-1: 1.25rem;
	--step-2: 1.5625rem;
	--step-3: clamp(1.75rem, 1.2rem + 2vw, 2.4rem);
	--step-num: clamp(2.6rem, 1.6rem + 4vw, 4rem);

	--wrap: 1120px;
	--gutter: clamp(16px, 4vw, 32px);
	--radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: var(--step-0);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.is-ar body, body.is-ar { font-family: var(--font-ar); line-height: 1.75; }

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--maroon-2); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--maroon); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; margin: 0 0 0.5em; letter-spacing: -0.01em; }
.is-ar h1, .is-ar h2, .is-ar h3 { letter-spacing: 0; line-height: 1.4; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--radius); }
.skip-link:focus { top: 8px; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --------------------------------------------------------------------------
   Ticker
   -------------------------------------------------------------------------- */

.topbar { background: var(--maroon-deep); color: #e9dcdf; font-size: var(--step--1); }
.qgl-ticker ul {
	display: flex; align-items: center; gap: 6px 22px; margin: 0; padding: 7px 0; list-style: none;
	overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.qgl-ticker ul::-webkit-scrollbar { display: none; }
.qgl-ticker li { display: inline-flex; align-items: baseline; gap: 6px; }
.qgl-tk-k { color: #c9b5ba; }
.qgl-ticker .qgl-live { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.qgl-tk-cur { color: #a99398; font-size: 0.85em; }
.qgl-tk-time { margin-inline-start: auto; color: #b9a4a9; }
.qgl-ticker .qgl-chg-up { color: #7fd6a8; }
.qgl-ticker .qgl-chg-down { color: #ff9b91; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 1.2rem; font-weight: 500; letter-spacing: -0.01em; }
.brand-name b { color: var(--gold-ink); font-weight: 700; }
.custom-logo { max-height: 44px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 8px; }
.menu { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.menu a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; border-radius: var(--radius); font-weight: 500; }
.menu a:hover { background: var(--mist); color: var(--maroon); }
.menu .current-menu-item > a, .menu a[aria-current="page"] { color: var(--maroon); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }

.lang-switch {
	margin-inline-start: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
	color: var(--maroon); text-decoration: none; font-weight: 500; font-size: var(--step--1);
}
.lang-switch:hover { border-color: var(--maroon-2); }
.lang-switch[lang="ar"] { font-family: var(--font-ar); }

.nav-toggle { display: none; }

@media (max-width: 1100px) {
	.nav-toggle {
		display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line);
		border-radius: var(--radius); padding: 8px 12px; font: inherit; color: var(--ink); cursor: pointer;
	}
	.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
		display: block; width: 16px; height: 2px; background: currentColor; position: relative; content: "";
	}
	.nav-toggle-bars::before { position: absolute; top: -5px; }
	.nav-toggle-bars::after { position: absolute; top: 5px; }
	.site-nav {
		display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--paper);
		border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; flex-direction: column; align-items: stretch;
	}
	.site-nav.is-open { display: flex; }
	.menu { flex-direction: column; }
	.menu a { padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
	.menu .current-menu-item > a { box-shadow: none; }
	.lang-switch { align-self: flex-start; margin: 12px 0 0; }
}

/* --------------------------------------------------------------------------
   Hero: titel links, het prijsbord rechts
   -------------------------------------------------------------------------- */

.hero-band { background: linear-gradient(var(--mist), var(--paper)); border-bottom: 1px solid var(--line); }

.qgl-hero {
	display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px);
	align-items: center; padding-block: clamp(28px, 5vw, 56px);
}
.qgl-kicker { color: var(--gold-ink); font-weight: 600; margin: 0 0 8px; }
.qgl-hero h1 { font-size: var(--step-3); max-width: 22ch; margin-bottom: 20px; text-wrap: balance; }

.qgl-hero-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.qgl-hero-label { flex-basis: 100%; color: var(--muted); font-size: var(--step--1); }
.qgl-hero-num { font-size: var(--step-num); font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.qgl-hero-num small { font-size: 0.35em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.qgl-hero-vs { color: var(--muted); font-size: var(--step--1); }
.qgl-hero-range { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 14px 0 0; color: var(--muted); font-size: var(--step--1); }
.qgl-hero-range strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.qgl-hero-sub { color: var(--muted); max-width: 52ch; margin: 18px 0 0; }
.qgl-hero-intro { max-width: 60ch; margin-top: 12px; }
.qgl-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }

.qgl-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.qgl-chg-up { color: var(--up); }
.qgl-chg-down { color: var(--down); }
.qgl-chg-flat { color: var(--muted); }
.qgl-hero-price .qgl-chg { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); font-size: var(--step--1); }

/* Het prijsbord */
.qgl-board {
	position: relative; background: var(--maroon); color: #f3e7ea; border-radius: 10px; padding: 26px 26px 18px;
	box-shadow: inset 0 0 0 1px rgba(212, 167, 68, 0.55), inset 0 0 0 5px var(--maroon), inset 0 0 0 6px rgba(212, 167, 68, 0.3);
}
.qgl-board-title { font-size: var(--step-0); font-weight: 500; color: #dccbcf; margin: 0 0 6px; }
.qgl-board ul { list-style: none; margin: 0; padding: 0; }
.qgl-board li {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 14px 0; border-bottom: 1px solid rgba(212, 167, 68, 0.22);
}
.qgl-board li:last-child { border-bottom: 0; }
.qgl-board-k { display: flex; flex-direction: column; font-size: var(--step-1); font-weight: 600; color: #fff; line-height: 1.2; }
.qgl-board-k small { font-size: 0.65em; font-weight: 400; color: #c8b3b8; }
.qgl-board-p { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.qgl-board-p small { font-size: 0.45em; font-weight: 500; color: #d9c08a; letter-spacing: 0; }
.qgl-board-time { margin: 10px 0 0; font-size: var(--step--1); color: #c8b3b8; }

@media (max-width: 860px) {
	.qgl-hero { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Knoppen
   -------------------------------------------------------------------------- */

.qgl-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
	border: 1px solid var(--maroon); border-radius: var(--radius); color: var(--maroon); background: transparent;
	font-weight: 600; text-decoration: none; transition: background-color .15s, color .15s;
}
.qgl-btn:hover { background: var(--mist); color: var(--maroon); text-decoration: none; }
.qgl-btn-primary { background: var(--maroon); color: #fff; }
.qgl-btn-primary:hover { background: var(--maroon-2); color: #fff; }

/* --------------------------------------------------------------------------
   Secties en tabellen
   -------------------------------------------------------------------------- */

.stack { padding-block: clamp(32px, 5vw, 56px); display: grid; gap: clamp(40px, 6vw, 64px); }
.qgl-section { margin: 0; min-width: 0; }
.qgl-head { margin-bottom: 18px; max-width: 70ch; }
.qgl-head h2 { font-size: var(--step-2); margin-bottom: 6px; }
.qgl-head p { color: var(--muted); margin: 0; }
.qgl-meta { color: var(--muted); font-size: var(--step--1); margin: 10px 0 0; }
.qgl-tz { color: var(--muted); }

.qgl-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.qgl-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.qgl-table th, .qgl-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qgl-table thead th { background: var(--mist); font-size: var(--step--1); font-weight: 600; color: var(--muted); text-align: end; }
.qgl-table thead th:first-child, .qgl-table tbody th { text-align: start; }
.qgl-table thead th small { font-weight: 400; }
.qgl-table tbody th { font-weight: 600; }
.qgl-table td { text-align: end; }
.qgl-table tbody tr:last-child > * { border-bottom: 0; }
.qgl-table tbody tr:hover { background: #fcf9f9; }
.qgl-row-home th, .qgl-row-home td { background: #fbf5e8; }

/* Koop/verkoop: één doorlopend paneel met vier kolommen, geen losse kaartjes */
.qgl-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); }
.qgl-card { padding: 18px 20px; border-inline-start: 1px solid var(--line); }
.qgl-card:first-child { border-inline-start: 0; }
.qgl-card h3 { font-size: var(--step-1); margin-bottom: 10px; color: var(--maroon); }
.qgl-card dl { margin: 0; display: grid; gap: 10px; }
.qgl-card dt { font-size: var(--step--1); color: var(--muted); }
.qgl-card dd { margin: 0; font-size: var(--step-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.qgl-card dd small { font-size: 0.7em; color: var(--muted); font-weight: 500; }
@media (max-width: 760px) {
	.qgl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.qgl-card:nth-child(odd) { border-inline-start: 0; }
	.qgl-card:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Grafiek + historie naast elkaar op brede schermen */
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 48px); align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }

.qgl-chart-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.qgl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qgl-seg button {
	font: inherit; font-size: var(--step--1); padding: 8px 14px; min-height: 40px; background: var(--paper); color: var(--ink);
	border: 0; border-inline-start: 1px solid var(--line); cursor: pointer;
}
.qgl-seg button:first-child { border-inline-start: 0; }
.qgl-seg button[aria-pressed="true"] { background: var(--maroon); color: #fff; }
.qgl-chart-k select, :is(.qgl-calc, .qgl-tool) select, :is(.qgl-calc, .qgl-tool) input[type="number"] {
	font: inherit; min-height: 44px; padding: 8px 12px; border: 1px solid #d9cccf; border-radius: var(--radius); background: var(--paper); color: var(--ink);
}
.qgl-chart-box { position: relative; height: clamp(240px, 40vw, 340px); }
.qgl-chart.is-loading .qgl-chart-box { opacity: 0.5; }
.qgl-chart-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; color: var(--muted); font-size: var(--step--1); }
.qgl-chart-stats strong { color: var(--ink); }

/* Marktindicatoren */
.qgl-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.qgl-stat { padding: 16px 18px; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.qgl-stat span { display: block; font-size: var(--step--1); color: var(--muted); margin-bottom: 2px; }
.qgl-stat strong { font-size: var(--step-1); font-variant-numeric: tabular-nums; }
.qgl-stat strong small { font-size: 0.7em; color: var(--muted); font-weight: 500; }
.qgl-trend { margin: 16px 0 0; padding-inline-start: 14px; border-inline-start: 3px solid var(--gold); font-weight: 500; }

/* --------------------------------------------------------------------------
   Calculator: velden links, uitkomst op een bordeaux paneel
   -------------------------------------------------------------------------- */

:is(.qgl-calc, .qgl-tool) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qgl-calc-fields { display: grid; gap: 18px; padding: clamp(20px, 3vw, 32px); }
:is(.qgl-calc, .qgl-tool) label { display: grid; gap: 6px; font-weight: 500; }
:is(.qgl-calc, .qgl-tool) fieldset { border: 0; padding: 0; margin: 0; }
:is(.qgl-calc, .qgl-tool) legend { font-weight: 500; margin-bottom: 8px; padding: 0; }
.qgl-calc-karat { display: flex; flex-wrap: wrap; gap: 8px; }
.qgl-calc-karat legend { flex-basis: 100%; }
.qgl-calc-karat label { display: inline-flex; position: relative; }
.qgl-calc-karat input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.qgl-calc-karat span {
	display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid #d9cccf;
	border-radius: 999px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.qgl-calc-karat input:checked + span { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.qgl-calc-karat input:focus-visible + span { outline: 2px solid var(--gold-ink); outline-offset: 2px; }

.qgl-calc-out { display: flex; flex-direction: column; gap: 14px; background: var(--maroon); color: #e8d9dd; padding: clamp(20px, 3vw, 32px); }
.qgl-calc-out > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(212, 167, 68, 0.22); }
.qgl-calc-out strong { color: #fff; font-size: var(--step-1); font-variant-numeric: tabular-nums; }
.qgl-calc-out .qgl-calc-total strong { color: var(--gold); font-size: var(--step-3); }
.qgl-calc-out .qgl-calc-sell { border-bottom: 0; }
.qgl-calc-out small { color: #c8b3b8; margin-top: auto; }
@media (max-width: 760px) { :is(.qgl-calc, .qgl-tool) { grid-template-columns: minmax(0, 1fr); } }

/* Live update: kort oplichten */
.qgl-live { border-radius: 3px; transition: background-color 1.2s ease; }
.qgl-flash { background-color: rgba(212, 167, 68, 0.35); transition: none; }

.qgl-error { padding: 14px 16px; border-inline-start: 3px solid var(--down); background: #fdf3f2; }
.qgl-disclaimer { color: var(--muted); font-size: var(--step--1); max-width: 80ch; }

/* --------------------------------------------------------------------------
   Pagina's en lopende tekst (je bestaande teksten)
   -------------------------------------------------------------------------- */

.page-head { background: var(--mist); border-bottom: 1px solid var(--line); padding-block: clamp(28px, 5vw, 48px); }
.page-title { font-size: var(--step-3); max-width: 28ch; margin: 0; text-wrap: balance; }
.page-lede { color: var(--muted); max-width: 62ch; margin: 12px 0 0; font-size: var(--step-1); line-height: 1.5; }
.page-meta { color: var(--muted); font-size: var(--step--1); margin: 8px 0 0; }

.prose { max-width: 72ch; padding-block: clamp(28px, 4vw, 48px); font-size: 1.0625rem; line-height: 1.75; }
.is-ar .prose { line-height: 1.95; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--step-2); margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.5em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--gold-ink); }
.prose blockquote { margin-inline: 0; padding-inline-start: 18px; border-inline-start: 3px solid var(--gold); color: var(--muted); }
.prose img { border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95em; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; }
.prose thead th { background: var(--mist); }
.prose details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.prose summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.prose .wp-block-buttons a, .prose .wp-block-button__link { background: var(--maroon); color: #fff; border-radius: var(--radius); }

/* Gidsen: tekst met meelopend prijsbord */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.aside-rates { position: sticky; top: 88px; margin-block: clamp(28px, 4vw, 48px); display: grid; gap: 12px; }
.aside-note { color: var(--muted); font-size: var(--step--1); margin: 0; }
.aside-rates .qgl-table th, .aside-rates .qgl-table td { padding: 10px 12px; }
@media (max-width: 900px) {
	.with-aside { grid-template-columns: minmax(0, 1fr); }
	.aside-rates { position: static; order: -1; margin-bottom: 0; }
}

.post-list { list-style: none; padding: 0; margin: 32px 0; display: grid; gap: 28px; max-width: 72ch; }
.post-list h2 { font-size: var(--step-1); margin: 0; }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--maroon); }
.post-image { margin: 28px 0 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer { background: var(--maroon-deep); color: #d9c8cc; margin-top: clamp(40px, 6vw, 72px); font-size: var(--step--1); }
.site-footer a { color: #f1e6e8; text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-block: 48px 32px; }
.footer-about p { max-width: 38ch; margin: 14px 0 0; }
.site-footer .brand { color: #fff; }
.site-footer .brand-name b { color: var(--gold); }
.site-footer .brand-mark circle:nth-child(2), .site-footer .brand-mark path { stroke: var(--maroon-deep); }
.footer-col h2 { font-size: var(--step-0); color: #fff; margin-bottom: 12px; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-menu a[aria-current] { color: var(--gold); }
.footer-price { margin: 0 0 6px; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.footer-price .qgl-live { color: var(--gold); }
.footer-rate .lang-switch { border-color: rgba(255, 255, 255, 0.25); color: #fff; margin: 8px 0 0; display: inline-block; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding-block: 20px 28px; }
.footer-bottom p { margin: 0 0 6px; }
.site-footer .qgl-disclaimer { color: #b9a4a9; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-about { grid-column: 1 / -1; } }

/* --------------------------------------------------------------------------
   Arabisch
   -------------------------------------------------------------------------- */

.is-ar .qgl-hero-num, .is-ar .qgl-board-p, .is-ar .qgl-live { font-family: var(--font); }

/* Minder beweging */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
	.topbar, .site-header, .site-footer, .qgl-chart, .qgl-ctas { display: none; }
}

/* ==========================================================================
   Mobiel: niets mag breder zijn dan het scherm
   ========================================================================== */

html, body { overflow-x: clip; max-width: 100%; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }

.site-main, .wrap, .stack, .split, .with-aside, .qgl-section, .qgl-hero > * { min-width: 0; }

/* Je eigen paginateksten: brede afbeeldingen, embeds, tabellen en lange links passend maken */
.prose { overflow-wrap: break-word; }
.prose img, .prose video, .prose iframe, .prose embed, .prose object, .prose svg, .prose canvas { max-width: 100% !important; height: auto; }
.prose iframe { width: 100%; }
.prose figure, .prose .wp-block-image, .prose .wp-block-table, .prose .wp-block-embed, .prose .wp-block-columns, .prose .wp-block-group, .prose div { max-width: 100% !important; }
.prose [style*="width"] { max-width: 100% !important; }
.prose pre, .prose code { white-space: pre-wrap; overflow-wrap: anywhere; }
.prose table { display: table; table-layout: auto; width: 100% !important; max-width: 100%; }
.prose th, .prose td { white-space: normal; overflow-wrap: break-word; word-break: normal; }
.prose .alignwide, .prose .alignfull { margin-inline: 0; width: 100%; }

@media (max-width: 600px) {
	:root { --gutter: 16px; }

	/* Ticker: 2×2 raster in plaats van zijwaarts scrollen */
	.qgl-ticker ul { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; overflow: visible; white-space: normal; padding: 8px 0; }
	.qgl-ticker li { justify-content: space-between; }
	.qgl-tk-chg { grid-column: 1; }
	.qgl-tk-time { grid-column: 2; margin: 0; justify-content: flex-end; font-size: 0.8em; }
	.qgl-tk-time .qgl-tz { display: none; }

	.header-inner { min-height: 56px; }
	.brand-name { font-size: 1.05rem; }

	.qgl-board { padding: 20px 18px 14px; }
	.qgl-hero-range { font-size: 0.8125rem; }

	/* Compacte tabellen (3–4 kolommen) */
	.qgl-table-wrap { overflow-x: visible; }
	.qgl-table { table-layout: auto; font-size: 0.8125rem; }
	.qgl-table th, .qgl-table td { padding: 10px 5px; }
	.qgl-table td { white-space: nowrap; }
	.qgl-table tbody th { white-space: normal; overflow-wrap: break-word; }
	.qgl-table thead th { white-space: normal; }
	/* Prijs per karaat: kg-kolom verbergen op mobiel, zodat de tabel compact blijft */
	.qgl-karats .qgl-table tr > :nth-child(5) { display: none; }
	.qgl-table th:first-child, .qgl-table td:first-child { padding-inline-start: 12px; }
	.qgl-table th:last-child, .qgl-table td:last-child { padding-inline-end: 12px; }
	.qgl-table thead th { font-size: 0.75rem; line-height: 1.3; }
	.qgl-table thead th small { display: block; }
	.qgl-card { padding: 14px; }
	.qgl-card dt { font-size: 0.75rem; line-height: 1.35; }

	/* Brede tabellen (5 kolommen, regio's): elke rij wordt een blok met label en waarde */
	.qgl-stack { border: 0; border-radius: 0; }
	.qgl-stack .qgl-table, .qgl-stack .qgl-table tbody, .qgl-stack .qgl-table tr { display: block; width: 100%; }
	.qgl-stack .qgl-table { table-layout: auto; font-size: 0.9375rem; }
	.qgl-stack .qgl-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.qgl-stack .qgl-table tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
	.qgl-stack .qgl-table tbody th { display: block; padding: 10px 12px; background: var(--mist); border-bottom: 1px solid var(--line); text-align: start; }
	.qgl-stack .qgl-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 12px; text-align: end; }
	.qgl-stack .qgl-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; text-align: start; }
	.qgl-stack .qgl-table tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
	.qgl-stack .qgl-table tbody tr > *:last-child { border-bottom: 0; }
	.qgl-stack .qgl-table tbody tr:hover { background: none; }

	/* Grafiek-knoppen passen altijd */
	.qgl-chart-controls { flex-direction: column; align-items: stretch; }
	.qgl-seg { display: grid; grid-template-columns: repeat(5, 1fr); }
	.qgl-seg button { padding: 8px 4px; }
	.qgl-chart-k select { width: 100%; }

	.qgl-calc-out .qgl-calc-total strong { font-size: 1.6rem; }
	.qgl-calc-karat span { padding: 8px 14px; }

	.footer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Heel smalle telefoons (320–360 px) */
@media (max-width: 360px) {
	.qgl-table { font-size: 0.75rem; }
	.qgl-table th, .qgl-table td { padding: 9px 3px; }
	.qgl-table th:first-child, .qgl-table td:first-child { padding-inline-start: 8px; }
	.qgl-table th:last-child, .qgl-table td:last-child { padding-inline-end: 8px; }
	.qgl-table thead th small { display: none; }
	.qgl-cards { grid-template-columns: minmax(0, 1fr); }
	.qgl-card { border-inline-start: 0 !important; border-top: 1px solid var(--line); }
	.qgl-card:first-child { border-top: 0; }
}
.qgl-updated, .qgl-live, .qgl-chg { unicode-bidi: isolate; direction: ltr; }

/* ==========================================================================
   Vangnet voor oude HTML in paginateksten (samen met assets/js/fit.js)
   ========================================================================== */

body { min-width: 0 !important; }
.site-main { overflow-x: clip; }
@supports not (overflow: clip) { .site-main { overflow-x: hidden; } }

.prose *:not(.qgl-section *) { max-width: 100%; box-sizing: border-box; }
.prose input, .prose select, .prose textarea, .prose button { max-width: 100%; }
.prose [style*="100vw"] { width: 100% !important; margin-inline: 0 !important; left: auto !important; }
.prose [style*="min-width"] { min-width: 0 !important; }
.prose .wp-block-columns { flex-wrap: wrap; }

@media (max-width: 781px) {
	.prose .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
	.prose [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
	.prose [style*="nowrap"] { white-space: normal !important; flex-wrap: wrap !important; }
}

/* Tabellen die het script als lijst toont */
.qgl-fit-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.qgl-fit-stack, table.qgl-fit-stack tbody, table.qgl-fit-stack tr { display: block; width: 100% !important; }
table.qgl-fit-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
table.qgl-fit-stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
table.qgl-fit-stack tr:first-child:not(:has(td)) { display: none; }
table.qgl-fit-stack th, table.qgl-fit-stack td { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: end; white-space: normal; }
table.qgl-fit-stack tr > :last-child { border-bottom: 0; }
table.qgl-fit-stack tbody th { display: block; background: var(--mist); text-align: start; font-weight: 600; }
table.qgl-fit-stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; text-align: start; font-weight: 400; }
table.qgl-fit-stack td:not([data-label])::before { content: none; }

.prose figure { margin-inline: 0; }

@media (max-width: 781px) {
	/* Tekst die nooit mocht afbreken (white-space: nowrap) toch laten doorlopen */
	.prose *:not(pre):not(code):not(pre *):not(.qgl-section *):not(.qgl-section) { white-space: normal !important; }
}

table.qgl-fit-stack td { overflow-wrap: break-word; word-break: normal; }
table.qgl-fit-stack td::before { flex: 0 0 38%; overflow-wrap: normal; word-break: normal; }

/* Tabel zonder kolomkoppen met maar één of twee rijen: cellen laten doorlopen */
table.qgl-fit-flow, table.qgl-fit-flow tbody { display: block; width: 100% !important; }
table.qgl-fit-flow tr { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
table.qgl-fit-flow td, table.qgl-fit-flow th { display: block; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); white-space: nowrap; }

.qgl-chart-box canvas { max-width: 100%; }
:is(.qgl-calc, .qgl-tool) fieldset, .qgl-calc-fields, .qgl-calc-fields > * { min-width: 0; }
:is(.qgl-calc, .qgl-tool) input[type="number"], :is(.qgl-calc, .qgl-tool) select { width: 100%; max-width: 100%; }
.qgl-calc-karat input { margin: 0; width: 100%; height: 100%; }


/* Extra rekenhulpen */
.qgl-own[hidden] { display: none; }
.qgl-worth { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.qgl-worth-title, .qgl-out-title { margin: 0; font-weight: 600; }
.qgl-out-title { color: #fff; }
.qgl-worth > div { display: flex; justify-content: space-between; gap: 12px; }
.qgl-worth strong { font-variant-numeric: tabular-nums; }
.qgl-tool .qgl-calc-out .qgl-calc-total strong { font-size: var(--step-2); }

.tools-nav { max-width: 72ch; padding-block: 8px 24px; }
.tools-nav h2 { font-size: var(--step-1); }
.tools-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tools-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--maroon); text-decoration: none; font-weight: 500; }
.tools-nav a:hover { border-color: var(--maroon-2); background: var(--mist); }

@media (max-width: 600px) {
	:is(.qgl-calc, .qgl-tool) .qgl-calc-out .qgl-calc-total { flex-direction: column; align-items: flex-start; gap: 4px; }
}


/* ==========================================================================
   Uitklapmenu's
   ========================================================================== */

.menu > li { position: relative; }
.menu .submenu-toggle::after {
	content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-start: 8px;
	border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
	transform: translateY(-3px) rotate(45deg); transition: transform .15s;
}
.menu .submenu-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.menu .sub-menu { list-style: none; margin: 0; padding: 0; display: none; }

@media (min-width: 1101px) {
	.menu .sub-menu {
		position: absolute; top: 100%; inset-inline-start: 0; z-index: 30; min-width: 230px; padding: 6px;
		background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
		box-shadow: 0 10px 30px rgba(58, 9, 24, 0.12);
	}
	.menu > li:hover > .sub-menu, .menu > li:focus-within > .sub-menu { display: block; }
	.menu .sub-menu a { padding: 9px 12px; white-space: nowrap; font-weight: 400; }
	.menu .sub-menu a:hover { background: var(--mist); }
	.menu .sub-menu .current-menu-item > a { box-shadow: none; background: var(--mist); }
	.menu a { padding: 8px 10px; }
}

@media (max-width: 1100px) {
	.site-nav { max-height: calc(100vh - 120px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
	.menu .sub-menu { padding: 0 0 8px; }
	.menu .sub-menu a { padding: 11px 4px 11px 18px; font-weight: 400; font-size: 0.95rem; color: var(--ink); border-bottom: 1px solid var(--line); }
	.menu .submenu-toggle { display: flex; justify-content: space-between; align-items: center; }
	.menu .submenu-toggle::after { width: 8px; height: 8px; }
}

/* Footer: kopjes met onderliggende links netjes onder elkaar */
.footer-menu .sub-menu { list-style: none; margin: 6px 0 10px; padding-inline-start: 12px; display: grid; gap: 6px; }
.footer-menu .submenu-toggle, .footer-menu .menu-dummy { color: #fff; font-weight: 600; pointer-events: none; }
.footer-menu .submenu-toggle::after { display: none; }
