/* Compostela — shared shop styles.
   Tokens mirror index.html so the shop reads as the same publication. */

:root {
  --bg: #e5d9c3;
  --bg-raised: #ece2cf;
  --ink: #2b2118;
  --ink-soft: #5c5142;
  --ink-faint: rgba(43, 33, 24, 0.45);
  --hairline: rgba(43, 33, 24, 0.22);
  --hairline-soft: rgba(43, 33, 24, 0.12);
  --accent: #2c1930;
  --accent-hover: #3d2343;
  --accent-text: #f3ead9;
  --gilt: #a9752c;
  --measure: 62ch;
  --gutter: 64px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

/* ---------- type ---------- */

.display {
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.lede {
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- shell ---------- */

.shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline-soft);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 30px;
  font-weight: 500;
  font-size: 17px;
}

.site-nav a {
  text-decoration: none;
  text-underline-offset: 6px;
}

.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current='page'] { color: var(--accent); text-decoration: underline; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cart-button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 2px;
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.cart-button:hover { color: var(--accent); }

.cart-button__count {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span { display: block; width: 24px; height: 2px; background: var(--ink); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 28px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: var(--accent-text);
  font-family: 'EB Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--ghost {
  background: none;
  color: var(--ink);
  border-color: var(--hairline);
}

.btn--ghost:hover { background: none; border-color: var(--accent); color: var(--accent); }

.btn--block { width: 100%; }

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.link-quiet {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--hairline);
}

.link-quiet:hover { color: var(--gilt); text-decoration-color: var(--gilt); }

/* ---------- form controls ---------- */

.field { display: block; }

.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.select,
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
                    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 18px center, right 12px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
  cursor: pointer;
}

/* ---------- artwork plate ---------- */

.plate {
  position: relative;
  display: block;
  width: 100%;
  padding: 7%;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
  overflow: hidden;
}

/* `contain` on purpose: a mat around the work, never a crop through it. */
.plate img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Shown when no image file has been dropped in yet. */
.plate--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(43, 33, 24, 0.035) 0 10px,
      transparent 10px 20px
    ),
    var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--hairline-soft), inset 0 0 0 9px var(--bg-raised), inset 0 0 0 10px var(--hairline-soft);
}

.plate--placeholder span {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--ink-faint);
  overflow: hidden;
}

/* Too small to letter — the mat alone stands in. */
.cart-line__plate .plate--placeholder { padding: 8px; }
.cart-line__plate .plate--placeholder span { display: none; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 34px;
  padding-bottom: 44px;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 16px;
  color: var(--ink-soft);
}

.site-footer__links { display: flex; flex-wrap: wrap; gap: 26px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .mark { height: 44px; width: auto; }

/* ---------- cart drawer ---------- */

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(43, 33, 24, 0.34);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-scrim.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  background: var(--bg);
  border-left: 1px solid var(--hairline);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.6, 0.2, 1);
  visibility: hidden;
}

.drawer.open { transform: none; visibility: visible; }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--hairline-soft);
}

.drawer__title { font-family: 'Cormorant Garamond', serif; font-size: 26px; }

.icon-button {
  background: none;
  border: none;
  padding: 4px;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-button:hover { color: var(--accent); }

.drawer__body { flex: 1; overflow-y: auto; padding: 8px 28px 24px; }

.drawer__empty { padding: 40px 0; color: var(--ink-soft); font-style: italic; }

.cart-line {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline-soft);
}

.cart-line__plate { aspect-ratio: 3 / 4; }
.cart-line__title { font-family: 'Cormorant Garamond', serif; font-size: 20px; line-height: 1.2; }
.cart-line__meta { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }

.cart-line__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--hairline);
  border-radius: 2px;
}

.qty button {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  font: inherit;
  font-size: 16px;
  color: var(--ink-soft);
  cursor: pointer;
}

.qty button:hover { color: var(--accent); }
.qty span { min-width: 26px; text-align: center; font-size: 15px; }

.cart-line__remove {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cart-line__remove:hover { color: var(--accent); }

.drawer__foot { border-top: 1px solid var(--hairline); padding: 22px 28px 28px; }

.drawer__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.drawer__row--total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline-soft);
}

.drawer__note { font-size: 14px; color: var(--ink-soft); margin: 8px 0 18px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 8px);
  z-index: 80;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 2px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  :root { --gutter: 24px; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: var(--gutter);
    flex-direction: column;
    gap: 0;
    min-width: 200px;
    padding: 6px 20px;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 3px;
  }

  .site-nav.open { display: flex; }
  .site-nav a { padding: 13px 0; border-bottom: 1px solid var(--hairline-soft); }
  .site-nav a:last-child { border-bottom: none; }

  .hamburger { display: flex; }
  .site-header__inner { position: relative; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .site-footer .mark { display: none; }
}
