/* Public-site page layout. Components and their look come from design-system/css/components.css;
   this file only places them (grid, max width, gutters) and adds the few page pieces the design
   system has no class for, using tokens only: no colour, size or duration of its own. */

body { margin: 0; }
.sg-root { min-height: 100vh; display: flex; flex-direction: column; }
:where(.sg-root a) { color: inherit; } /* zero specificity: component colours (.sg-btn--primary) win */
img { max-width: 100%; height: auto; }

/* Centre every band on --sg-layout-max-width without a wrapper element. */
.sg-header, .sg-footer, .site-main {
  --gutter: var(--sg-layout-gutter-phone);
  padding-inline: max(var(--gutter), calc((100% - var(--sg-layout-max-width)) / 2));
}
@media (min-width: 600px) { /* = --sg-layout-bp1 */
  .sg-header, .sg-footer, .site-main { --gutter: var(--sg-layout-gutter); }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; inset-inline-start: var(--sg-space-8); top: -100px; z-index: 70; }
.skip-link:focus { top: var(--sg-space-8); }

/* ---------- header ---------- */
.sg-header { position: relative; }
.site-brand { display: flex; align-items: center; text-decoration: none; }
.site-brand img { display: block; width: auto; height: 40px; }
.site-nav { display: none; gap: var(--sg-space-4); }
.site-nav a, .site-menu__list a {
  display: block; padding: var(--sg-space-8) var(--sg-space-12);
  border-radius: var(--sg-radius-control);
  font-size: var(--sg-text-label-size); font-weight: var(--sg-text-label-weight);
  color: var(--sg-color-muted); text-decoration: none;
  transition: background-color var(--sg-motion-t2) var(--sg-motion-ease-out), color var(--sg-motion-t2) var(--sg-motion-ease-out);
}
.site-nav a:hover, .site-menu__list a:hover { background: var(--sg-color-fill2); color: var(--sg-color-lapis); }
.site-nav a[aria-current="page"], .site-menu__list a[aria-current="page"] { color: var(--sg-color-lapis); background: var(--sg-color-fill); }
.site-menu > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--sg-radius-control);
  font-size: var(--sg-text-h2-size);
}
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary:focus-visible { outline: 2px solid var(--sg-color-lapis); outline-offset: 2px; }
.site-menu[open] > summary { background: var(--sg-color-fill); }
.site-menu__list {
  position: absolute; inset-inline: 0; top: 100%; z-index: 30;
  margin: 0; padding: var(--sg-space-8) var(--sg-layout-gutter-phone) var(--sg-space-16);
  list-style: none;
  background: var(--sg-color-white); border-bottom: 1px solid var(--sg-color-line);
  box-shadow: var(--sg-shadow-overlay);
}
@media (min-width: 1024px) { /* = --sg-layout-bp2 */
  .site-nav { display: flex; }
  .site-menu { display: none; }
}

/* ---------- main ---------- */
.site-main { flex: 1; padding-block: var(--sg-space-24) var(--sg-space-48); }
.page-title { margin: 0; font-size: var(--sg-text-h1-size); line-height: var(--sg-text-h1-lh); font-weight: var(--sg-text-h1-weight); }
.page-lead { margin: var(--sg-space-4) 0 var(--sg-space-24); color: var(--sg-color-muted); font-size: var(--sg-text-label-size); }
.section-title { margin: var(--sg-space-32) 0 var(--sg-space-4); font-size: var(--sg-text-h2-size); line-height: var(--sg-text-h2-lh); font-weight: var(--sg-text-h2-weight); }
.empty { margin: var(--sg-space-16) 0; color: var(--sg-color-muted); }
.narrow { max-width: 760px; }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sg-space-32); }
@media (min-width: 1024px) {
  .home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sg-space-64); align-items: start; }
  .home-news .section-title { margin-top: 0; }
}
.home-price__top { display: flex; justify-content: space-between; align-items: center; gap: var(--sg-space-12); }
.hero-label { margin-top: var(--sg-space-16); font-size: var(--sg-text-label-size); font-weight: var(--sg-text-label-weight); }
.price-row { display: flex; align-items: baseline; gap: var(--sg-space-12); flex-wrap: wrap; }
.price-cur { font-size: var(--sg-text-h3-size); font-weight: var(--sg-text-label-weight); color: var(--sg-color-muted); }
.price-buy { display: flex; align-items: baseline; gap: var(--sg-space-8); font-size: var(--sg-text-body-size); }
.price-buy__label, .price-buy__cur { color: var(--sg-color-muted); }
.price-accent { height: 3px; width: 48px; background: var(--sg-color-gold); border-radius: 2px; margin: var(--sg-space-12) 0 var(--sg-space-8); }
.price-updated { font-size: var(--sg-text-caption-size); color: var(--sg-color-muted); }
.price-updated time { padding: 2px 4px; border-radius: 4px; }
.price-table { margin-top: var(--sg-space-16); }
.price-table th[scope="row"] { color: var(--sg-color-lapis); font-size: var(--sg-text-body-size); font-weight: var(--sg-text-h3-weight); }
.home-price__actions { display: flex; gap: var(--sg-space-12); margin-top: var(--sg-space-16); }
.home-price__actions > .sg-btn { flex: 1; }
.price-empty { margin-top: var(--sg-space-16); }
.price-empty__title { margin: 0; font-size: var(--sg-text-h2-size); line-height: var(--sg-text-h2-lh); font-weight: var(--sg-text-h2-weight); }
.price-empty__help { margin: var(--sg-space-4) 0 0; color: var(--sg-color-muted); font-size: var(--sg-text-label-size); }
.more-link { display: inline-block; margin-top: var(--sg-space-16); font-size: var(--sg-text-label-size); font-weight: var(--sg-text-label-weight); }

/* gram / mithqal switch with no JavaScript: two radios before the control and the views.
   The labels are the segment options; the thumb follows the checked radio (its slide is the
   design system's own transition on .sg-seg__thumb). */
.unit-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.unit-mithqal { display: none; }
#unit-mithqal:checked ~ .unit-views .unit-mithqal { display: block; }
#unit-mithqal:checked ~ .unit-views .unit-gram { display: none; }
#unit-mithqal:checked ~ .home-price__top .sg-seg__thumb { transform: translateX(-100%); }
#unit-gram:checked ~ .home-price__top label[for="unit-gram"],
#unit-mithqal:checked ~ .home-price__top label[for="unit-mithqal"] { color: var(--sg-color-lapis); }
#unit-gram:focus-visible ~ .home-price__top label[for="unit-gram"],
#unit-mithqal:focus-visible ~ .home-price__top label[for="unit-mithqal"] { outline: 2px solid var(--sg-color-lapis); outline-offset: -2px; border-radius: calc(var(--sg-radius-control) - 2px); }
.sg-seg label.sg-seg__opt { text-align: center; user-select: none; }

/* ---------- contact strip ---------- */
.contact-strip { margin-top: var(--sg-space-32); }
.contact-strip__title { margin: 0 0 var(--sg-space-12); font-size: var(--sg-text-h3-size); line-height: var(--sg-text-h3-lh); font-weight: var(--sg-text-h3-weight); }
.contact-strip__links { display: flex; flex-wrap: wrap; gap: var(--sg-space-8); }

/* ---------- link tabs: plain links styled as .sg-tabs; each is a page, so the bar sits under
   the current one (aria-current) and nothing slides ---------- */
.link-tabs { margin-bottom: var(--sg-space-8); overflow-x: auto; }
.link-tabs .sg-tab { position: relative; text-decoration: none; white-space: nowrap; }
.link-tabs .sg-tab[aria-current="page"] { color: var(--sg-color-lapis); }
.link-tabs .sg-tab[aria-current="page"]::after {
  content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 3px;
  background: var(--sg-color-lapis); border-radius: 1px;
}

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sg-space-12); margin-top: var(--sg-space-24); }
.pager__status { font-size: var(--sg-text-caption-size); color: var(--sg-color-muted); }
.pager__spacer { width: 1px; }

/* ---------- price history ---------- */
.chart { margin: 0 0 var(--sg-space-32); padding: var(--sg-space-16); }
.chart__caption { font-size: var(--sg-text-label-size); font-weight: var(--sg-text-label-weight); margin-bottom: var(--sg-space-12); }
.chart__body { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 220px auto; column-gap: var(--sg-space-12); }
@media (min-width: 600px) { .chart__body { grid-template-rows: 280px auto; } }
.chart__y { display: flex; flex-direction: column; justify-content: space-between; }
.price-chart__ytick {
  height: 0; display: flex; align-items: center; justify-content: flex-end;
  font-size: var(--sg-text-caption-size); color: var(--sg-color-muted); font-variant-numeric: tabular-nums;
}
.price-chart { display: block; width: 100%; height: 100%; overflow: visible; }
.price-chart__grid { stroke: var(--sg-color-line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.price-chart__area { fill: var(--sg-color-gold-tint); }
.price-chart__line { fill: none; stroke: var(--sg-color-lapis); stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.price-chart__pt { stroke: var(--sg-color-lapis); stroke-width: 5px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.price-chart__pt[data-last] { stroke: var(--sg-color-gold); stroke-width: 10px; }
.chart__x {
  grid-column: 2; display: flex; justify-content: space-between; margin-top: var(--sg-space-8);
  font-size: var(--sg-text-caption-size); color: var(--sg-color-muted); font-variant-numeric: tabular-nums;
}
.chart__x--single { justify-content: center; }
.history td:first-child { font-size: var(--sg-text-label-size); }
.history th + th, .history td + td { padding-inline-start: var(--sg-space-16); }

/* ---------- news and articles ---------- */
.news-list { margin-top: var(--sg-space-8); }
.sg-list-row > div { min-width: 0; }
.article { max-width: var(--sg-layout-measure); }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sg-space-8) var(--sg-space-12); margin-bottom: var(--sg-space-12); }
.article__date { font-size: var(--sg-text-caption-size); color: var(--sg-color-muted); }
.article__cover { display: block; width: 100%; margin: var(--sg-space-24) 0 0; border-radius: var(--sg-radius-card); }
.article__body, .prose { margin-top: var(--sg-space-24); font-size: var(--sg-text-article-size); line-height: var(--sg-text-article-lh); }
.prose h2 { font-size: var(--sg-text-h2-size); line-height: var(--sg-text-h2-lh); margin: var(--sg-space-32) 0 var(--sg-space-8); }
.prose h3 { font-size: var(--sg-text-h3-size); line-height: var(--sg-text-h3-lh); margin: var(--sg-space-24) 0 var(--sg-space-8); }
.prose p { margin: 0 0 var(--sg-space-16); }
.prose ul, .prose ol { margin: 0 0 var(--sg-space-16); padding-inline-start: var(--sg-space-24); }
.prose li > p { margin: 0 0 var(--sg-space-4); }
.prose a { color: var(--sg-color-info); }
.article__pdf { margin-top: var(--sg-space-24); }

/* ---------- contact page ---------- */
.contact-list { display: grid; gap: var(--sg-space-12); margin: 0; padding: 0; list-style: none; }
.contact-link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sg-space-12);
  text-decoration: none;
  transition: background-color var(--sg-motion-t2) var(--sg-motion-ease-out);
}
.contact-link:hover { background: var(--sg-color-fill2); }
.contact-item__label { display: block; font-size: var(--sg-text-caption-size); color: var(--sg-color-muted); }
.contact-item__value { display: block; font-weight: var(--sg-text-label-weight); }

/* ---------- footer ---------- */
.site-footer__name { font-weight: var(--sg-text-h3-weight); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: var(--sg-space-8) var(--sg-space-16); margin: var(--sg-space-12) 0 0; padding: 0; list-style: none; }
.site-footer__links a, .sg-footer__credit a { text-decoration: none; }
.site-footer__links a:hover, .sg-footer__credit a:hover { text-decoration: underline; }

/* ---------- 404 ---------- */
.not-found { padding-block: var(--sg-space-32); }
