/* Site-wide chrome: banner, sticky menu, cart panel, pop-ups. Loaded on EVERY page, including
   the legacy HTML pages, so every rule here is scoped to its own classes and never restyles
   a page's own content. Mobile-first: base = phones, min-width queries add the larger layouts. */
:root {
  --bg: #000;
  --surface: #0c0c0e;
  --surface-2: #16161a;
  --line: #2a2a30;
  --text: #c8c8c8;
  --text-strong: #ececec;
  --muted: #9a9aa2;
  --link: #8a8ae6;        /* the site's #6666cc, lightened for readable contrast on black */
  --link-hover: #b4b4ff;
  --accent: #c9a24a;      /* antique gold for badges/notes */
  --danger: #e07a6a;
  --light: #efefef;       /* white buttons: cart, Add to cart, Checkout */
  --radius: 10px;
  --gutter: 16px;
  --nav-h: 60px;
  --font: Georgia, 'Times New Roman', serif;
  --font-orig: 'Times New Roman', Times, serif; /* what the original site's menu and headings were set in */
  --header-text: 1.25rem; /* the words under a page's heading (Home, shop page intros): one size everywhere */
  --header-leading: 1.25; /* and one tight line spacing */
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 8px); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); }

.skip-link,
.site-banner, .site-banner *,
.site-nav, .site-nav *,
.cart, .cart *,
.notice-dialog, .notice-dialog *,
.toast { box-sizing: border-box; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--surface-2); color: var(--text-strong); padding: 8px 12px; z-index: 40; font: 15px var(--font-ui); }
.skip-link:focus { left: 8px; }

/* ---- Banner photo: part of the page, scrolls away */
.site-banner { text-align: center; line-height: 0; }
.site-banner a { display: block; }
.site-banner img { display: block; width: 100%; max-width: 1337px; height: auto; margin: 0 auto; }

/* ---- Sticky menu */
.site-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(0, 0, 0, .94); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 700 16px/1.2 var(--font-orig); text-align: left;
}
.site-nav__bar {
  max-width: 1440px; margin: 0 auto; min-height: var(--nav-h);
  display: flex; align-items: center; gap: 10px; padding: 8px var(--gutter);
}
.site-nav__logo { display: block; width: 30px; height: auto; flex: none; }
/* the Urweg knot on both ends of the links (desktop only; phones and tablets have the one in the bar) */
.site-nav__links .site-nav__ornament { display: none; }

.site-nav__toggle,
.cart-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px;
  border-radius: 999px; font: inherit; cursor: pointer;
}
.site-nav__toggle { color: var(--text-strong); background: var(--surface-2); border: 1px solid var(--line); }
.site-nav__toggle[aria-expanded='true'] { border-color: var(--text-strong); }

.cart-toggle { margin-left: auto; background: var(--light); color: #0a0a0a; border: 0; }
.cart-toggle:hover { background: #fff; }
.cart-toggle__count { background: #0a0a0a; color: #fff; border-radius: 999px; min-width: 24px; padding: 2px 7px; font-size: 13px; text-align: center; }

/* Page links: a drop-down panel on phones */
.site-nav__links {
  list-style: none; margin: 0; padding: 12px var(--gutter) 16px;
  position: absolute; left: 0; right: 0; top: 100%;
  display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  background: #050506; border-bottom: 1px solid var(--line);
  max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
}
.site-nav.is-open .site-nav__links { display: grid; }
.site-nav__links a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px;
  color: var(--link); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; text-align: center;
}
.site-nav__links a:hover { color: var(--link-hover); border-color: var(--link); }
.site-nav__links a[aria-current='page'] { color: var(--bg); background: var(--text-strong); border-color: var(--text-strong); }
.site-nav a:focus-visible, .site-nav button:focus-visible { outline: 2px solid var(--link-hover); outline-offset: 2px; }

/* ---- Buttons and fields used in the cart and pop-ups (shop pages reuse them) */
.btn {
  min-height: 48px; padding: 10px 16px; font: 600 16px var(--font-ui); cursor: pointer;
  border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-strong);
}
.btn--primary { background: var(--light); border-color: var(--light); color: #0a0a0a; }
.btn--primary:hover { background: #fff; border-color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }
.field { display: grid; gap: 4px; }
.field > span { color: var(--muted); font-size: 13px; }
.cart select {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 16px var(--font-ui);
  background: var(--surface-2); color: var(--text-strong); border: 1px solid var(--line); border-radius: 6px;
}

/* ---- Cart panel: full screen on phones */
.cart {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
  margin: 0; padding: 0; border: 0;
  background: var(--surface); color: var(--text); font: 16px/1.5 var(--font-ui); text-align: left;
}
.cart::backdrop { background: rgba(0,0,0,.6); }
.cart__inner { display: flex; flex-direction: column; height: 100%; }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 10px var(--gutter); border-bottom: 1px solid var(--line); }
.cart__head h2 { margin: 0; font: 600 1.2rem var(--font); color: var(--text-strong); }
.cart__close { background: none; border: 0; color: var(--text); font-size: 30px; line-height: 1; cursor: pointer; width: 48px; height: 48px; }
.cart__items { flex: 1; overflow-y: auto; padding: 8px var(--gutter); }
/* when the totals and shipping fields need most of the screen, the whole panel scrolls instead of squeezing the items */
.cart__inner { overflow-y: auto; }
.cart__items { min-height: min(160px, 30vh); flex-shrink: 0; }
.cart__empty { color: var(--muted); text-align: center; margin-top: 40px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line img { display: block; width: 56px; height: 56px; object-fit: contain; background: #000; border-radius: 6px; }
.line__name { margin: 0; color: var(--text-strong); font-weight: 600; }
.line__meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.line__meta--mto { color: var(--accent); }
.line__qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.line__qty button:not(.line__remove) { width: 40px; height: 40px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-strong); cursor: pointer; font-size: 18px; }
.line__remove { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 10px 4px; }
.line__price { color: var(--text-strong); font-weight: 600; }
.cart__foot { padding: 14px var(--gutter) max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 10px; }
.cart__foot[hidden] { display: none; }
.cart__subtotal { display: flex; justify-content: space-between; margin: 0; font-size: 1.05rem; }
.cart__subtotal[hidden], .cart__dest[hidden], .cart .check[hidden], .cart .field[hidden] { display: none; }
.cart__dest { display: grid; gap: 10px; }
.cart__total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 1.15rem; }
.cart__fine { margin: 0; color: var(--muted); font-size: 13px; }
.cart__error { margin: 0; color: var(--danger); font-size: 14px; }

/* ---- Made-to-order pop-up */
.notice-dialog {
  width: calc(100vw - 2 * var(--gutter)); max-width: 420px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: 16px/1.5 var(--font-ui); text-align: left;
}
.notice-dialog::backdrop { background: rgba(0,0,0,.6); }
.notice-dialog h2 { margin: 0 0 8px; font: 600 1.25rem var(--font); color: var(--accent); }
.notice-dialog p { margin: 0 0 18px; }
.notice-dialog__actions { display: grid; gap: 10px; }

.toast {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: max(24px, env(safe-area-inset-bottom)); z-index: 35;
  margin: 0; padding: 12px 16px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-strong); font: 15px var(--font-ui); text-align: center;
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translateY(0); }

/* ---- Footer: the same on every page, centred. A ruled line with the Urweg knot on it separates it from the page. */
.site-footer, .site-footer * { box-sizing: border-box; }
.site-footer { margin-top: 64px; background: #050506; color: var(--muted); font: 15px/1.6 var(--font-ui); text-align: center; }
.site-footer__rule { position: relative; height: 0; border-top: 1px solid var(--line); }
.site-footer__rule::before { /* a brighter centre to the line, fading out towards the edges */
  content: ""; position: absolute; left: 50%; top: -1px; transform: translateX(-50%);
  width: min(560px, 80%); height: 1px; background: linear-gradient(90deg, transparent, var(--muted), transparent);
}
.site-footer__rule img {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%);
  display: block; width: 34px; height: auto; padding: 0 12px; background: #050506; box-sizing: content-box;
}
.site-footer__inner { max-width: 820px; margin: 0 auto; padding: 40px var(--gutter) max(28px, env(safe-area-inset-bottom)); display: grid; gap: 18px; justify-items: center; }
.site-footer p { margin: 0; }
.site-footer__name { font: 600 1.5rem/1.1 var(--font); color: var(--text-strong); letter-spacing: .02em; }
.site-footer__tagline { margin-top: -10px !important; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.site-footer a { color: var(--link); text-decoration: none; }
.site-footer a:hover { color: var(--link-hover); text-decoration: underline; }
.site-footer__links ul { gap: 4px 22px; font-weight: 600; }
.site-footer__links a { display: inline-block; padding: 6px 0; }
.site-footer__contact { gap: 4px 0; color: var(--text); }
.site-footer__contact li { padding: 2px 14px; }
.site-footer__contact li + li { border-left: 1px solid var(--line); }
.site-footer__fine { width: 100%; display: grid; gap: 10px; justify-items: center; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.site-footer__top { font-weight: 600; }
/* phones: contact details one per line, no dividers */
@media (max-width: 559px) {
  .site-footer__contact { flex-direction: column; }
  .site-footer__contact li + li { border-left: 0; }
}

/* ---- Home page (and the Yule version): the page's own layout and words, framed in a panel so the text doesn't
   run edge to edge. Style only. The panel stays black like the page (the photos have black backgrounds). */
.legacy-page-index, .legacy-page-index-yule, .legacy-page-ordering {
  max-width: 1166px; margin: 32px auto 0; padding: 32px 64px 40px;
  background: #000;
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .015), 0 18px 50px rgba(0, 0, 0, .55);
}
.legacy-page-index table, .legacy-page-index-yule table { margin: 0 auto; }
/* the heading is set apart from the welcome text; the welcome text is smaller and tighter */
.legacy-page-index .home-h1, .legacy-page-index-yule .home-h1 {
  display: block; margin: 26px 0 12px; text-align: center;
  font: 600 clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem)/1.2 var(--font); color: var(--text-strong); letter-spacing: .01em;
}
.legacy-page-index .home-h1 *, .legacy-page-index-yule .home-h1 * { font: inherit; color: inherit; }
.legacy-page-index .home-header-text, .legacy-page-index-yule .home-header-text { max-width: 62ch; margin: 0 auto; font: var(--header-text)/var(--header-leading) var(--font); color: #c4c4c4; }
.legacy-page-index .home-header-text *, .legacy-page-index-yule .home-header-text * { font: inherit; color: inherit; line-height: inherit; }
/* the page's hidden search heading ("Viking & Celtic Jewelry for sale…") stays for Google but takes no room */
.legacy-page-index > h1, .legacy-page-index-yule > h1 {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* phones: no frame at all; the text uses the whole screen width */
@media (max-width: 559px) { .site-footer { margin-top: 36px; } }
@media (max-width: 700px) {
  .legacy-page-index, .legacy-page-index-yule, .legacy-page-ordering {
    margin: 0; padding: 4px 14px 18px; border: 0; border-radius: 0; box-shadow: none; background: #000;
  }
}

/* Ordering inside the same panel as Home; the divider is the footer's knot-and-line */
.legacy-page-ordering { margin-top: 32px; padding-bottom: 36px; }
/* Home: the rule below the "Since 1998" picture replaces the old blank line */
.legacy-page-index .rule-knot + font, .legacy-page-index-yule .rule-knot + font { display: none; }
.rule-knot { position: relative; height: 0; border-top: 1px solid var(--line); margin: 30px 0; clear: both; }
.rule-knot::before { content: ""; position: absolute; left: 50%; top: -1px; transform: translateX(-50%); width: min(560px, 80%); height: 1px; background: linear-gradient(90deg, transparent, var(--muted), transparent); }
.rule-knot::after {
  content: ""; position: absolute; left: 50%; top: 0; width: 34px; height: 36px; padding: 0 12px; box-sizing: content-box; transform: translate(-50%, -50%);
  background: #000 url('/Buttons/trad%20button_t.jpg') center / 34px 36px no-repeat; background-origin: content-box; background-clip: padding-box;
}

/* Older text pages: the top heading and welcome words, centred like every other page */
.legacy-head { text-align: center; margin: 14px 0 20px; }
.legacy-h1, .legacy-h1 * { display: block; font: 600 clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem)/1.2 var(--font); color: var(--text-strong); text-decoration: none; text-align: center; }
.legacy-head a { display: inline-block; margin-top: 8px; }
td > .legacy-h1 { margin-bottom: 10px; }
.legacy-h1 br { display: none; }
.legacy-header-text { margin: 8px auto 18px; text-align: center; font: var(--header-text)/var(--header-leading) var(--font); color: #c4c4c4; }
.legacy-header-text * { font-size: inherit; line-height: inherit; font-family: inherit; font-weight: 400; color: inherit; }
.legacy-header-text a, .legacy-header-text a * { color: var(--link); }
/* text styles the client picks in Sanity */
.ts-large { font-size: 1.2em; }
.ts-small { font-size: .85em; }
.ts-menu { font-family: var(--font-orig); }
/* the H1: each line of the field is a line on the page; a comma-separated part or a link is never split */
.page-h1__line { display: block; }
.nb, .page-h1 a { display: inline-block; max-width: 100%; }
.legacy-header-text p, .legacy-page-comments > div:first-of-type p { margin: 0; text-align: center; }
.legacy-page-index .home-header-text p, .legacy-page-index-yule .home-header-text p { margin: 0 0 1.25em; }
.legacy-page-index .home-header-text p:last-child, .legacy-page-index-yule .home-header-text p:last-child { margin-bottom: 0; }
/* the larger words shouldn't squeeze the two silversmiths beside them */
@media (min-width: 700px) { .legacy-page-commission img[alt$="Silversmith"] { min-width: 85px; } }

/* ---- Legacy pages' own headings ("Reviews") */
.legacy-title { text-align: center; color: var(--text-strong); font: 600 clamp(1.9rem, 1.4rem + 2vw, 2.6rem)/1.15 var(--font); margin: 28px 0 16px; }

/* ---- Reviews page: each review in its own card */
.legacy-page-comments { max-width: 860px; margin: 0 auto; padding: 8px var(--gutter) 32px; }
.legacy-page-comments > div:first-of-type { max-width: 64ch; margin: 0 auto; font: var(--header-text)/var(--header-leading) var(--font); }
.legacy-page-comments > div:first-of-type, .legacy-page-comments > div:first-of-type * { color: #c4c4c4; font-size: inherit !important; }
.reviews { display: grid; gap: 18px; margin: 28px 0 8px; font: 1.04rem/1.6 var(--font); }
.review {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 26px 18px 34px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.review::before { content: "\201C"; position: absolute; top: 4px; left: 10px; font: 700 44px/1 var(--font); color: var(--accent); opacity: .85; }
.review p { margin: 0 0 .75em; color: #d4d4d4; text-align: left; }
.review p:last-child { margin-bottom: 0; }
.review p.review__by, .reviews__thanks p.review__by { text-align: right; color: var(--muted); font-style: italic; margin-top: .9em; }
.reviews__thanks { margin-top: 14px; text-align: center; color: var(--text-strong); }
.reviews__thanks p { margin: 0 0 .4em; text-align: center; color: var(--text-strong); }
@media (max-width: 559px) { .review { padding: 22px 16px 16px 22px; } .review::before { left: 6px; } }

/* ---- Photo pop-up (shop pages, not on phones): about 80% of the screen's height, framed, over a greyed-out page.
   The frame keeps the card's 4:3 shape and is capped to the screen's width. */
.lightbox {
  margin: auto; padding: 0; border: 0; background: none; overflow: visible; max-width: none; max-height: none;
  color: var(--text-strong); font: 15px var(--font-ui);
}
.lightbox::backdrop { background: rgba(28, 28, 32, .78); }
.lightbox, .lightbox * { box-sizing: border-box; }
.lightbox__panel {
  position: relative; margin: 0; padding: 12px; display: grid; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.lightbox__frame {
  position: relative; width: min(1600px, 94vw, calc(80vh * 4 / 3)); aspect-ratio: 4 / 3;
  background: #000; border-radius: 8px; overflow: hidden;
}
.lightbox__frame img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.lightbox__panel figcaption { color: var(--muted); text-align: center; font-size: 14px; }
.lightbox__close, .lightbox__nav {
  position: absolute; display: grid; place-items: center; cursor: pointer;
  background: rgba(22, 22, 26, .9); color: var(--text-strong); border: 1px solid var(--line); border-radius: 999px;
}
.lightbox__close { top: -16px; right: -16px; width: 40px; height: 40px; font-size: 26px; line-height: 1; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 30px; line-height: 1; }
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }
.lightbox.is-single .lightbox__nav { display: none; }
.lightbox button:focus-visible { outline: 2px solid var(--link-hover); outline-offset: 2px; }

/* Legacy pages: their own content sits in this wrapper (body margin moved here so the menu can span the full width).
   Style-only fixes so the old fixed-width layouts fit a phone screen; the text and pictures themselves are untouched. */
.legacy-content { padding: 8px; overflow-wrap: break-word; }
/* the older text pages (Ordering, Care, Commissions, Links): a comfortable reading width instead of edge to edge */
.legacy-page-care, .legacy-page-commission, .legacy-page-links { max-width: 1100px; margin: 0 auto; padding: 8px 24px 28px; }
@media (max-width: 559px) { .legacy-page-ordering, .legacy-page-care, .legacy-page-commission, .legacy-page-links { padding: 8px 14px 24px; } }
.legacy-content img { max-width: 100%; height: auto !important; }
.legacy-content table { max-width: 100%; }
@media (max-width: 900px) {
  .legacy-content table, .legacy-content tbody, .legacy-content tr { width: auto !important; }
  .legacy-content td { width: auto !important; }
}

@media (min-width: 560px) {
  .notice-dialog__actions { display: flex; justify-content: flex-end; }
  .toast { left: 50%; right: auto; transform: translate(-50%, 20px); }
  .toast.is-on { transform: translate(-50%, 0); }
  .site-nav__links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .cart { width: 440px; margin: 0 0 0 auto; border-left: 1px solid var(--line); }
}

/* ---- Desktop: all 13 links on one row in the bar, no Menu button */
@media (min-width: 1240px) {
  .site-nav__toggle, .site-nav__logo { display: none; }
  .site-nav__links .site-nav__ornament { display: block; flex: none; line-height: 0; }
  .site-nav__ornament img { display: block; width: 28px; height: auto; margin: 0 4px; }
  .site-nav__links {
    position: static; display: flex; flex-wrap: nowrap; justify-content: center; gap: 5px;
    flex: 1; padding: 0; background: none; border: 0; max-height: none; overflow: visible;
  }
  .site-nav__links a { min-height: 38px; padding: 6px 10px; font-size: 16px; white-space: nowrap; }
  .cart-toggle { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
