/*
 * SGP Live Prices — all visual tokens live here.
 * Colors are sampled from the site logo (navy #033E87, gold #F9BE3C) and Neve's
 * text/background colors; the font is inherited from the theme (Tajawal).
 * A future redesign only needs to change the custom properties below.
 */
:root {
	--sgp-primary: #033e87;  /* logo navy */
	--sgp-accent: #f9be3c;   /* logo gold */
	--sgp-text: #272626;     /* Neve text color */
	--sgp-bg: #ffffff;
	--sgp-border: #e1e5eb;
	--sgp-soft: #f4f5f7;     /* Neve light background */
	--sgp-muted: #5c6673;
	--sgp-up: #2d6a4f;       /* muted, text only */
	--sgp-down: #a63d40;     /* muted, text only */
	--sgp-radius: 10px;
}

.sgp-block {
	margin: 1.25rem 0 2rem;
	color: var(--sgp-text);
	max-width: 100%;
}
.sgp-block p { margin: 0; }
.sgp-num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.sgp-unit { font-size: .8em; color: var(--sgp-muted); font-weight: 400; }
.sgp-code { font-size: .8em; color: var(--sgp-muted); font-weight: 400; }
.sgp-note { font-size: .9rem; color: var(--sgp-muted); margin-top: .6rem !important; line-height: 1.7; }
.sgp-upd { font-size: .85rem; color: var(--sgp-muted); margin-top: .5rem !important; }
.sgp-empty { padding: 1rem; border: 1px solid var(--sgp-border); border-radius: var(--sgp-radius); background: var(--sgp-soft); }

/* Change indicators: arrows + muted text colors, never colored backgrounds. */
.sgp-chg { white-space: nowrap; font-size: .92em; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.sgp-up { color: var(--sgp-up); }
.sgp-down { color: var(--sgp-down); }
.sgp-flat, .sgp-none { color: var(--sgp-muted); }

/* Cards */
.sgp-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 760px) { .sgp-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
.sgp-card {
	background: var(--sgp-bg);
	border: 1px solid var(--sgp-border);
	border-top: 3px solid var(--sgp-accent);
	border-radius: var(--sgp-radius);
	padding: .9rem .8rem;
	text-align: center;
	min-width: 0;
}
.sgp-card-label { font-size: .9rem; color: var(--sgp-muted); }
.sgp-card-value { font-size: clamp(1.2rem, 5.2vw, 1.75rem); font-weight: 700; color: var(--sgp-primary); line-height: 1.3; margin: .35rem 0 !important; overflow-wrap: anywhere; }
.sgp-card-chg { font-size: .9rem; }

/* Tables: only the table scrolls sideways, never the page. */
.sgp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border: 1px solid var(--sgp-border); border-radius: var(--sgp-radius); }
.sgp-scroll:focus-visible { outline: 2px solid var(--sgp-primary); outline-offset: 2px; }
.sgp-table { width: 100%; border-collapse: collapse; margin: 0; background: var(--sgp-bg); font-size: .95rem; border: 0; }
.sgp-wide { min-width: 540px; }
/* Visible table title sits above the scroll box; <caption> is kept for screen readers only. */
.sgp-cap { font-weight: 700; color: var(--sgp-primary); margin: 0 0 .45rem !important; line-height: 1.6; }
.sgp-hint { display: none; font-size: .8rem; color: var(--sgp-muted); margin: -.2rem 0 .4rem !important; }
@media (max-width: 540px) { .sgp-hint { display: block; } }
.sgp-table caption { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sgp-table th, .sgp-table td { padding: .6rem .8rem; border: 0; border-bottom: 1px solid var(--sgp-border); text-align: start; vertical-align: middle; }
.sgp-table thead th { font-size: .85rem; color: var(--sgp-muted); font-weight: 600; background: var(--sgp-bg); white-space: nowrap; }
.sgp-table tbody th { font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) {
	.sgp-table { font-size: .88rem; }
	.sgp-table th, .sgp-table td { padding: .5rem .45rem; }
	.sgp-table .sgp-chg { white-space: normal; }
	.sgp-table thead th { white-space: normal; }
	.sgp-wide { min-width: 500px; }
}
.sgp-table tbody tr:last-child th, .sgp-table tbody tr:last-child td { border-bottom: 0; }
.sgp-table td .sgp-num { font-weight: 700; }

/* Calculators and forms */
.sgp-panels { display: grid; gap: 1rem; }
@media (min-width: 760px) { .sgp-panels { grid-template-columns: 1fr 1fr; } }
.sgp-panel, .sgp-est, .sgp-zakat {
	border: 1px solid var(--sgp-border);
	border-radius: var(--sgp-radius);
	padding: 1rem;
	background: var(--sgp-bg);
}
.sgp-panel-title { font-weight: 700; color: var(--sgp-primary); margin-bottom: .6rem !important; }
.sgp-block label { display: block; margin-bottom: .7rem; font-size: .95rem; }
.sgp-block label.sgp-inline { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.sgp-block input[type="number"], .sgp-block select {
	display: block; width: 100%; max-width: 100%; box-sizing: border-box; margin-top: .3rem;
	padding: .55rem .7rem; border: 1px solid var(--sgp-border); border-radius: 8px;
	background: var(--sgp-bg); color: var(--sgp-text); font: inherit; font-size: 1rem;
}
.sgp-block input:focus, .sgp-block select:focus { outline: 2px solid var(--sgp-primary); outline-offset: 1px; }
.sgp-block fieldset { border: 1px solid var(--sgp-border); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 .8rem; }
.sgp-block legend { padding: 0 .3rem; font-size: .95rem; }
.sgp-block small { color: var(--sgp-muted); }
.sgp-fields-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .8rem; }
@media (min-width: 760px) { .sgp-fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sgp-out { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .8rem; background: var(--sgp-soft); border-radius: 8px; }
.sgp-out b, .sgp-result b { color: var(--sgp-primary); font-size: 1.1em; font-variant-numeric: tabular-nums; }
.sgp-result { margin-top: .6rem; border: 1px solid var(--sgp-border); border-radius: 8px; }
.sgp-total th, .sgp-total td { font-weight: 700; border-top: 2px solid var(--sgp-accent); }

/* History */
.sgp-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.sgp-seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.sgp-seg button {
	font: inherit; font-size: .9rem; padding: .4rem .75rem; border-radius: 999px; cursor: pointer;
	border: 1px solid var(--sgp-border); background: var(--sgp-bg); color: var(--sgp-text); line-height: 1.4;
}
.sgp-seg button[aria-pressed="true"] { background: var(--sgp-primary); border-color: var(--sgp-primary); color: #fff; }
.sgp-seg button:focus-visible { outline: 2px solid var(--sgp-accent); outline-offset: 2px; }
.sgp-hist-title { font-weight: 700; color: var(--sgp-primary); margin-bottom: .4rem !important; }
.sgp-chart-wrap { border: 1px solid var(--sgp-border); border-radius: var(--sgp-radius); padding: .6rem .6rem .3rem; margin: .5rem 0 .8rem; }
.sgp-chart { display: block; width: 100%; height: 200px; }
.sgp-grid { stroke: var(--sgp-border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sgp-line { fill: none; stroke: var(--sgp-primary); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sgp-area { fill: var(--sgp-primary); opacity: .07; }
.sgp-dot { fill: var(--sgp-accent); stroke: var(--sgp-primary); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.sgp-axis, .sgp-scale { display: flex; justify-content: space-between; font-size: .8rem; color: var(--sgp-muted); gap: .5rem; }
.sgp-scale b { color: var(--sgp-text); }
.sgp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 0 0 1rem; }
@media (min-width: 760px) { .sgp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sgp-stats > div { border: 1px solid var(--sgp-border); border-radius: 8px; padding: .55rem .7rem; }
.sgp-stats dt { font-size: .82rem; color: var(--sgp-muted); }
.sgp-stats dd { margin: .15rem 0 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: start; }

/* App box */
.sgp-app { text-align: center; margin: 2rem 0; padding: 1.4rem 1rem; border: 1px solid var(--sgp-border); border-top: 3px solid var(--sgp-accent); border-radius: var(--sgp-radius); background: var(--sgp-bg); }
.sgp-app-title { font-size: 1.3rem; font-weight: 700; color: var(--sgp-primary); margin: 0 0 .4rem; }
.sgp-app p { margin: 0 0 1rem; }
.sgp-btn, .sgp-btn:visited { display: inline-block; padding: .7rem 1.4rem; border-radius: 999px; background: var(--sgp-primary); color: #fff !important; text-decoration: none; font-weight: 700; }
.sgp-btn:hover, .sgp-btn:focus { background: #022f66; color: #fff; }

.sgp-examples ol { margin: .6rem 0 0; padding-inline-start: 1.3rem; line-height: 1.9; }
.sgp-ad { margin: 1.5rem 0; text-align: center; min-height: 0; }

/* Content helpers used by the pages (source links, footer). */
.sgp-source { font-size: .85rem; color: var(--sgp-muted); }
.sgp-footer-legal { font-size: .9rem; line-height: 2; }
.sgp-footer-legal a { white-space: nowrap; }

/* Content blocks written in the pages: FAQ (details/summary) and plain tables. */
.entry-content .wp-block-details, .nv-content-wrap .wp-block-details {
	border: 1px solid var(--sgp-border); border-radius: 8px; padding: 0; margin: 0 0 .6rem; background: var(--sgp-bg);
}
.wp-block-details summary {
	cursor: pointer; padding: .75rem .9rem; font-weight: 700; color: var(--sgp-primary); list-style-position: inside;
}
.wp-block-details[open] summary { border-bottom: 1px solid var(--sgp-border); }
.wp-block-details > p { padding: .6rem .9rem 0; margin: 0 0 .6rem; }
.wp-block-details > p:last-child { padding-bottom: .4rem; }
.sgp-content-table { overflow-x: auto; margin: 1rem 0 1.5rem; }
.sgp-content-table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.sgp-content-table th, .sgp-content-table td { border: 1px solid var(--sgp-border); padding: .55rem .7rem; text-align: start; vertical-align: top; }
.sgp-content-table thead th { background: var(--sgp-soft); color: var(--sgp-primary); font-weight: 700; }
.sgp-content-table figcaption { font-size: .85rem; color: var(--sgp-muted); text-align: start; margin-top: .4rem; }
@media (max-width: 480px) { .sgp-content-table table { font-size: .88rem; } .sgp-content-table th, .sgp-content-table td { padding: .45rem .45rem; } }
