/* Smyckoteket v2 — dark, monochrome, close to smyckoteket.se.
   The jewelry supplies the colour; the only bold typographic move is the
   artist name set large in Wigrum. */

/* Rian designmuseum's typefaces: TT Norms Pro (TypeType) for text, Wigrum (Production
   Type) for headings, buttons and navigation – as on rian.se and bokning.rian.se. The files
   are the foundries' own web kits (from joomla_rian's images/fonts), not conversions:
   Wigrum's licence forbids converting the desktop OTFs. Licensed for Rian's web use only. */
@font-face { font-family: "TT Norms Pro"; src: url("/static/fonts/TTNormsPro-Normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "TT Norms Pro"; src: url("/static/fonts/TTNormsPro-NormalItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "TT Norms Pro"; src: url("/static/fonts/TTNormsPro-DemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "TT Norms Pro"; src: url("/static/fonts/TTNormsPro-DemiBoldItalic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Wigrum"; src: url("/static/fonts/Wigrum-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --black: #000;
  --coal: #1a1a1a;       /* smyckoteket.se page grey — used for image wells */
  --graphite: #222426;   /* smyckoteket.se menu/footer */
  --white: #fff;
  --grey: #a8a8a8;       /* secondary text, 9.2:1 on black */
  --line: #3a3c3e;

  --font: "TT Norms Pro", "Helvetica Neue", Arial, sans-serif;           /* text: 400, 600 */
  --font-display: "Wigrum", "Helvetica Neue", Arial, sans-serif;        /* headings: 500 only */
  /* Scale: 1.25 steps from a 17px base */
  --s-1: 0.8125rem;
  --s0: 1.0625rem;
  --s1: 1.3125rem;
  --s2: 1.625rem;
  --s3: 2.0625rem;
  --display: clamp(2.5rem, 1.4rem + 4.6vw, 5.5rem);

  --gap: 8px;
  --pad: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --measure: 38rem;
}

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

html { background: var(--black); color: var(--white); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html, .gallery__track { scroll-behavior: smooth; } }

body {
  margin: 0;
  font: 400 var(--s0)/1.55 var(--font);
  font-feature-settings: "kern", "liga";
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0; }

.skip {
  position: absolute; left: var(--pad); top: -4rem; z-index: 10;
  background: var(--white); color: var(--black); padding: 0.6rem 1rem; font-weight: 600;
}
.skip:focus { top: 0.5rem; }

main:focus { outline: none; }

/* --- Sender strip: Rian as the institution behind the site ---------------- */

.sender {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.55rem var(--pad);
  background: var(--graphite);
  font-size: var(--s-1);
}
.sender__logo img { height: 1.6rem; width: auto; }
.sender__nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.sender__nav a { text-decoration: none; color: var(--grey); }
.sender__nav a:hover, .sender__nav a[aria-current] { color: var(--white); text-decoration: underline; }

/* --- Header: Smyckoteket mark + jewelry types ---------------------------- */

.head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  padding: 1.1rem var(--pad);
}
.head__brand img { height: clamp(3rem, 2.2rem + 2.4vw, 4.5rem); width: auto; }

.catnav ul { display: flex; flex-wrap: wrap; gap: 0.35rem 1.6rem; margin: 0; padding: 0; list-style: none; }
.catnav a {
  display: inline-block; padding: 0.2rem 0;
  font-family: var(--font-display); font-size: var(--s1); font-weight: 500; text-decoration: none;
  border-bottom: 2px solid transparent;
}
.catnav a:hover { border-bottom-color: var(--grey); }
.catnav a[aria-current] { border-bottom-color: var(--white); }
.catnav__artists { margin-left: 0.8rem; }
.catnav__info { display: none; }

.head__toggle {
  display: none;
  font: 500 var(--s-1)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--white); background: var(--graphite); border: 2px solid var(--graphite);
  padding: 0.75rem 1rem; cursor: pointer;
}
.head__toggle:hover { border-color: var(--white); }

@media (max-width: 52em) {
  .js .head__toggle { display: inline-block; }
  .js .catnav { display: none; flex-basis: 100%; }
  .js .catnav.is-open { display: block; }
  .catnav ul { flex-direction: column; gap: 0; }
  .catnav li { border-top: 1px solid var(--line); }
  .catnav a { display: block; padding: 0.8rem 0; font-size: var(--s2); border-bottom: 0; }
  .catnav a[aria-current] { text-decoration: underline; }
  .catnav__artists { margin-left: 0; }
  /* The sender strip keeps only Rian's logo; its links move into the menu */
  .js .sender__nav { display: none; }
  .js .catnav__info { display: block; }
  .js .catnav__info a { font-size: var(--s1); font-weight: 400; color: var(--grey); }
  .js .catnav__info:first-of-type { margin-top: 1rem; }
}

/* --- Image grid (the site's main surface) --------------------------------- */

.grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  margin: 0; padding: 0; list-style: none;
}
@media (min-width: 60em) { .grid { grid-template-columns: repeat(3, 1fr); } }

.grid--mosaic { grid-template-columns: repeat(2, 1fr); }
.grid--mosaic .tile:first-child { grid-column: span 2; }
@media (min-width: 40em) {
  .grid--mosaic { grid-template-columns: repeat(6, 1fr); }
  .grid--mosaic .tile { grid-column: span 2; }
  .grid--mosaic .tile:nth-child(n+4) { grid-column: span 3; }
  .grid--mosaic .tile:nth-child(n+4) .tile__img { aspect-ratio: 3 / 2; }
}

.grid--strip { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 60em) { .grid--strip { grid-template-columns: repeat(4, 1fr); } }

.tile { position: relative; background: var(--coal); }
.tile__link { display: block; text-decoration: none; }
.tile__img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tile__link::after {  /* the fade-to-black that carries the caption */
  content: ""; position: absolute; inset: 45% 0 0;
  background: linear-gradient(to top, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0));
  pointer-events: none;
}
.tile__cap {
  position: absolute; left: 0; bottom: 0; z-index: 1;
  max-width: calc(100% - 1.5rem); margin: 0 0 1rem 1rem; padding: 0.35rem 0.6rem;
  line-height: 1.3;
}
.tile__title { display: block; font-size: var(--s1); font-family: var(--font-display); font-weight: 500; }
.tile__by { display: block; font-size: var(--s-1); }
/* Narrow two-up tiles: smaller caption so long titles don't bury the image */
@media (max-width: 39.99em) {
  .grid--mosaic .tile:not(:first-child) .tile__cap,
  .grid--strip .tile__cap { margin: 0 0 0.5rem 0.5rem; padding: 0.25rem 0.4rem; max-width: calc(100% - 1rem); }
  .grid--mosaic .tile:not(:first-child) .tile__title,
  .grid--strip .tile__title { font-size: var(--s-1); }
}
/* smyckoteket.se's signature: the caption flips to white on black text */
.tile__link:hover .tile__cap,
.tile__link:focus-visible .tile__cap { background: var(--white); color: var(--black); }
.tile__link:focus-visible { outline-offset: -3px; }

.empty { padding: 3rem var(--pad); color: var(--grey); }

/* --- Start ----------------------------------------------------------------- */

.hero { padding: clamp(1.5rem, 1rem + 3vw, 4rem) var(--pad) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.hero__title { font-size: var(--display); font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.hero__lead { margin: 0.6rem 0 0; font-size: var(--s1); color: var(--grey); max-width: var(--measure); }

.intro {
  display: grid; gap: 2rem;
  padding: clamp(2.5rem, 2rem + 3vw, 5rem) var(--pad);
}
@media (min-width: 60em) {
  .intro { grid-template-columns: minmax(0, var(--measure)) auto; align-items: end; justify-content: space-between; }
}

/* --- Buttons: square, uppercase, 2px border as on smyckoteket.se ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0; }
.intro .actions { margin: 0; }
.button {
  display: inline-block; padding: 0.9rem 1.4rem;
  font-family: var(--font-display); font-size: var(--s-1); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em;
  text-decoration: none; color: var(--white);
  background: var(--graphite); border: 2px solid var(--graphite);
}
.button:hover { border-color: var(--white); }
.button--ghost { background: transparent; border-color: var(--line); }

/* --- Running text ---------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose h2 { font-size: var(--s1); font-family: var(--font-display); font-weight: 500; margin: 2em 0 0.6em; }
.prose h3 { font-size: var(--s0); font-family: var(--font-display); font-weight: 500; margin: 1.8em 0 0.4em; }
.prose > h2:first-child { margin-top: 0; }
.prose--small { font-size: var(--s-1); line-height: 1.6; color: var(--grey); margin-top: 2.5rem; }
.prose--small h2 { color: var(--white); }

/* --- List pages ------------------------------------------------------------ */

.listhead {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.25rem;
  padding: clamp(1.5rem, 1rem + 2vw, 3rem) var(--pad) 1.5rem;
}
.listhead__title { font-size: var(--display); font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.listhead__count { margin: 0; color: var(--grey); font-size: var(--s1); }

/* --- Jewelry page: images · who/what · text (smyckoteket.se's three columns) */

.piece {
  display: grid; gap: 2rem var(--pad);
  padding: 0 0 clamp(2.5rem, 2rem + 3vw, 5rem);
}
.piece__meta, .piece__text { padding: 0 var(--pad); }
@media (min-width: 60em) {
  .piece { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); padding-right: var(--pad); }
  .piece__meta, .piece__text { padding: 0; }
  .piece__meta { padding-top: 0.5rem; }
  .piece__text { padding-top: 0.9rem; }
}

.piece__artist { margin: 0; font-size: var(--display); font-family: var(--font-display); font-weight: 500; line-height: 0.95; letter-spacing: -0.015em; }
.piece__artist a { text-decoration: none; }
.piece__artist a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
@media (min-width: 60em) { .piece__artist { font-size: clamp(2.2rem, 0.6rem + 2.6vw, 3.75rem); } }
.piece__born { margin: 0.6rem 0 0; color: var(--grey); }
.piece__title { margin-top: 1.75rem; font-size: var(--s2); font-family: var(--font-display); font-weight: 500; }
.piece__year { margin: 0.2rem 0 0; font-size: var(--s1); color: var(--grey); }

.facts { margin: 1.75rem 0 0; border-top: 1px solid var(--line); }
.facts__row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--grey); }
.facts dd { margin: 0; }

/* Gallery: native scroll-snap (works without JS), enhanced with buttons */
.gallery__track {
  display: flex; margin: 0; padding: 0; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  background: var(--coal);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.gallery__slide { flex: 0 0 100%; scroll-snap-align: start; }
.gallery__slide img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.js .gallery__track { scrollbar-width: none; }
.js .gallery__track::-webkit-scrollbar { display: none; }

.gallery__controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem var(--pad) 0; }
@media (min-width: 60em) { .gallery__controls { padding-left: 0; padding-right: 0; } }
.gallery__btn {
  font: 500 var(--s-1)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--white); background: var(--graphite); border: 2px solid var(--graphite);
  padding: 0.75rem 1rem; cursor: pointer;
}
.gallery__btn:hover { border-color: var(--white); }
.gallery__count { margin: 0; color: var(--grey); font-variant-numeric: tabular-nums; }

.gallery__thumbs { display: flex; gap: var(--gap); margin: 0.75rem 0 0; padding: 0 var(--pad); list-style: none; }
@media (min-width: 60em) { .gallery__thumbs { padding: 0; } }
.gallery__thumbs a { display: block; width: 4.5rem; opacity: 0.55; outline-offset: 2px; }
.gallery__thumbs a:hover, .gallery__thumbs a[aria-current] { opacity: 1; }
.gallery__thumbs img { aspect-ratio: 1; object-fit: cover; }

/* --- Related / artist ------------------------------------------------------ */

.related { padding: 0 0 clamp(2.5rem, 2rem + 3vw, 5rem); }
.related__title { padding: 0 var(--pad) 1.25rem; font-size: var(--s2); font-family: var(--font-display); font-weight: 500; }
.related__all { padding: 1.25rem var(--pad) 0; margin: 0; }

.artist { padding: clamp(1.5rem, 1rem + 2vw, 3rem) var(--pad) clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.artist__name { font-size: var(--display); font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; line-height: 0.95; }
.artist__born { margin: 0.75rem 0 0; font-size: var(--s1); color: var(--grey); }
.artist__bio { margin-top: 2rem; }
.artist__works { padding-bottom: clamp(2.5rem, 2rem + 3vw, 5rem); }
@media (min-width: 60em) {
  /* Nearly every artist has one piece: text left, the piece right */
  .artistpage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--pad); align-items: start; }
  .artistpage .grid { grid-template-columns: 1fr; }
  .artistpage--many .grid { grid-template-columns: repeat(2, 1fr); }
  .artist__works { padding: clamp(1.5rem, 1rem + 2vw, 3rem) var(--pad) 0 0; }
  .artist__works .related__title { padding-left: 0; }
}

.alpha { columns: 16rem; column-gap: 3rem; padding: 0 var(--pad) clamp(2.5rem, 2rem + 3vw, 5rem); }
.alpha__group { break-inside: avoid; margin-bottom: 1.75rem; }
.alpha__letter { font-size: var(--s2); font-family: var(--font-display); font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 0.25rem; margin-bottom: 0.5rem; }
.alpha ul { margin: 0; padding: 0; list-style: none; }
.alpha li { padding: 0.15rem 0; }
.alpha a { text-decoration: none; }
.alpha a:hover { text-decoration: underline; }

.page { padding: clamp(1.5rem, 1rem + 2vw, 3rem) var(--pad) clamp(3rem, 2rem + 4vw, 6rem); }
.page__title { font-size: var(--display); font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; margin-bottom: 2rem; }

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

.foot { background: var(--graphite); padding: 2.5rem var(--pad) 2rem; font-size: var(--s-1); }
.foot__cols { display: grid; gap: 1.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); max-width: 60rem; }
.foot h2 { font-size: var(--s-1); font-family: var(--font-display); font-weight: 500; margin-bottom: 0.4rem; }
.foot p { margin: 0; color: var(--grey); }
.foot a { color: var(--white); }
.foot__owner { margin-top: 2rem !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* --- Booking: the box, forms, messages ------------------------------------ */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.muted { color: var(--grey); }
.notice, .alert { max-width: var(--measure); margin: 0 0 1.5rem; padding: 0.9rem 1.1rem; border-left: 4px solid var(--white); background: var(--graphite); }
.alert { border-left-color: #ff8a80; }          /* 8.4:1 on graphite */

.loan { margin-top: 1.75rem; }
.loan .actions { margin-top: 0.75rem; }
.loan__free { margin: 0; color: var(--grey); }
.actions form { margin: 0; }
button.button { cursor: pointer; }

.booking { max-width: 48rem; }
.boxlist { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.boxlist__item { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.boxlist__item img { width: 5rem; height: 5rem; object-fit: cover; background: var(--coal); }
.boxlist__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.boxlist__title { font-family: var(--font-display); font-weight: 500; font-size: var(--s1); text-decoration: none; }
.boxlist__title:hover { text-decoration: underline; }
.boxlist__by, .boxlist__free { color: var(--grey); font-size: var(--s-1); }
.linkbutton {
  font: inherit; font-size: var(--s-1); color: var(--grey); background: none; border: 0; padding: 0.25rem 0;
  text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
}
.linkbutton:hover { color: var(--white); }

.form { margin: 2rem 0 0; max-width: var(--measure); }
.form__title { font-size: var(--s2); font-family: var(--font-display); font-weight: 500; margin-bottom: 1.25rem; }
.field { margin: 0 0 1.25rem; padding: 0; border: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field input:not([type=checkbox]), .field select, .field textarea, .search input {
  width: 100%; font: inherit; color: var(--white); background: var(--coal);
  border: 1px solid var(--grey); border-radius: 0; padding: 0.7rem 0.8rem;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .search input:focus-visible {
  outline: 3px solid var(--white); outline-offset: 0; border-color: var(--white);
}
.field--check { display: flex; gap: 0.7rem; align-items: flex-start; }
.field--check input { width: 1.25rem; height: 1.25rem; margin: 0.2rem 0 0; accent-color: var(--white); flex: none; }
.field--check label { font-weight: 400; margin: 0; }
.hint { margin: 0.35rem 0 0; font-size: var(--s-1); color: var(--grey); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot */
.summary { max-width: var(--measure); margin: 0 0 1.5rem; }

/* --- Admin ------------------------------------------------------------------ */

.admin__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem;
  padding: 0.9rem var(--pad); background: var(--graphite);
}
.admin__brand { font-family: var(--font-display); font-weight: 500; text-decoration: none; }
.admin__head ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.admin__head a[aria-current] { text-decoration-thickness: 2px; }
.admin__head nav a:not([aria-current]) { text-decoration: none; }
.admin__user { margin: 0 0 0 auto; font-size: var(--s-1); color: var(--grey); }
.admin__main { padding: 1.5rem var(--pad) 4rem; max-width: 80rem; }
.admin__title { font-size: var(--s3); font-family: var(--font-display); font-weight: 500; margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.admin__section { margin-top: 2.25rem; }
.admin__section h2 { font-size: var(--s1); margin-bottom: 0.75rem; }
.count { color: var(--grey); font-weight: 400; }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; max-width: 48rem; }
.search label { flex-basis: 100%; font-weight: 600; }
.search input { flex: 1; min-width: 12rem; }
.form--inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 1rem; margin-top: 1rem; }
.form--inline .button { margin-bottom: 1.25rem; }
.weekdays { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.weekdays label { font-weight: 400; display: flex; gap: 0.4rem; align-items: center; }
.plainlist { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.plainlist li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.plainlist form { margin: 0; }

.tablewrap { overflow-x: auto; }
.bookings { width: 100%; border-collapse: collapse; font-size: var(--s-1); }
.bookings th, .bookings td { text-align: left; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.bookings th { color: var(--grey); font-weight: 400; }
.nowrap { white-space: nowrap; }
.status { display: inline-block; padding: 0.1rem 0.5rem; font-size: var(--s-1); font-weight: 600; border: 1px solid var(--grey); white-space: nowrap; }
.status--pending { border-style: dashed; color: var(--grey); }
.status--picked_up { background: var(--white); color: var(--black); border-color: var(--white); }
.status--cancelled, .status--returned { color: var(--grey); border-color: var(--line); }
