/* ==========================================================================
   Psychotron Records - site-wide visual system
   Independent vinyl record shop: warm paper background, near-black ink,
   burnt-orange (vinyl label) accent. Plain CSS, no framework.
   ========================================================================== */

/* --------------------------------------------------------------------- */
/* Typography: self-hosted webfonts                                     */
/* Fraunces (display serif, warm/vintage character) for headings and    */
/* the header brand; Public Sans (clean humanist sans) for body copy.   */
/* Both are variable fonts covering their full weight range, so one     */
/* file per family serves every weight used on the site. No CDN.        */
/* Licenses: wwwroot/fonts/OFL-fraunces.txt, OFL-public-sans.txt.       */
/* --------------------------------------------------------------------- */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/fraunces-variable-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/public-sans-variable-latin.woff2") format("woff2");
}

:root {
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --color-bg: #faf6ef;
  --color-surface: #ffffff;
  --color-ink: #1c1a17;
  --color-ink-muted: #5c574f;
  --color-border: #e2dbcd;
  --color-border-strong: #c9c0ac;
  --color-accent: #b3541e;
  --color-accent-dark: #8a3f15;
  --color-header: #1c1a17;
  --color-header-ink: #f5efe4;
  --color-warning-bg: #fff4e5;
  --color-warning-border: #e5c07b;
  --color-danger: #a8261e;
  --color-success: #2f6b34;

  --radius: 0.375rem;
  --radius-lg: 0.75rem;
  --shadow-card: 0 1px 2px rgba(28, 26, 23, 0.06), 0 1px 3px rgba(28, 26, 23, 0.08);
  --shadow-card-hover: 0 4px 10px rgba(28, 26, 23, 0.12);
  --max-width: 64rem;

  /* Spacing rhythm: a consistent scale used instead of ad-hoc rem values. */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-ink);
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}

h1 {
  font-size: clamp(2rem, 1.65rem + 1.5vw, 2.75rem);
  margin: 0 0 var(--space-2);
}

h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.75vw, 1.75rem);
  margin: var(--space-5) 0 var(--space-2);
}

h3 {
  font-size: 1.125rem;
  margin: var(--space-3) 0 var(--space-1);
}

a {
  color: var(--color-accent-dark);
  text-decoration-thickness: from-font;
  text-underline-offset: 0.15em;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* Visible, high-contrast focus states everywhere (accessibility pass). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background-color: var(--color-header-ink);
  color: var(--color-ink);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 100;
  transition: top 0.15s ease-in-out;
}

.skip-link:focus {
  top: 0.5rem;
}

/* --------------------------------------------------------------------- */
/* Header / nav                                                          */
/* --------------------------------------------------------------------- */

.site-header {
  background-color: var(--color-header);
  color: var(--color-header-ink);
  padding: var(--space-2);
  border-bottom: 1px solid rgba(245, 239, 228, 0.08);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-header-ink);
}

.site-header__brand-image {
  max-width: 100%;
  max-height: 72px;
  width: auto;
  height: auto;
  display: block;
  transition: opacity 0.15s ease-in-out;
}

.site-header__brand:hover {
  opacity: 0.85;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-header-ink);
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  display: inline-block;
}

.site-nav a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* --------------------------------------------------------------------- */
/* Layout                                                                 */
/* --------------------------------------------------------------------- */

.site-main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-3) var(--space-2) var(--space-6);
}

.hero {
  padding: var(--space-2) 0 var(--space-4);
}

.hero__lead {
  font-size: 1.15rem;
  max-width: 40rem;
  color: var(--color-ink-muted);
}

.cta {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
  margin-top: var(--space-4);
}

.section__figure {
  margin: var(--space-3) 0;
}

.section__image {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.section__image--portrait {
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}

.label-releases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--space-3);
  padding-left: 0;
  list-style: none;
}

.label-releases li {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.label-releases img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.label-releases strong {
  display: block;
}

.label-releases em {
  display: block;
  color: var(--color-ink-muted);
}

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

.site-footer {
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface);
  padding: var(--space-4) var(--space-2);
  color: var(--color-ink-muted);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-footer address {
  font-style: normal;
}

.site-footer strong {
  color: var(--color-ink);
}

.site-footer__hours ul {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
}

.site-footer__meta p {
  margin: 0.25rem 0;
}

/* --------------------------------------------------------------------- */
/* Buttons                                                                */
/* --------------------------------------------------------------------- */

.button {
  display: inline-block;
  background-color: var(--color-accent);
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  font-weight: bold;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.3;
  transition: background-color 0.15s ease-in-out, transform 0.1s ease-in-out;
}

.button:hover {
  background-color: var(--color-accent-dark);
  color: #fff;
}

.button:active {
  transform: translateY(1px);
}

.button--small {
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
}

.button--secondary {
  background-color: var(--color-ink-muted);
}

.button--secondary:hover {
  background-color: var(--color-ink);
}

button:not(.button) {
  font: inherit;
  background-color: var(--color-accent);
  color: #fff;
  border: 1px solid transparent;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

button:not(.button):hover {
  background-color: var(--color-accent-dark);
}

/* --------------------------------------------------------------------- */
/* Forms                                                                  */
/* --------------------------------------------------------------------- */

form fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0 0 1.25rem;
}

form legend {
  font-family: var(--font-heading);
  font-weight: bold;
  padding: 0 0.4rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
  max-width: 28rem;
}

.form-field label {
  font-weight: bold;
  font-size: 0.95rem;
}

.form-field--checkbox {
  flex-direction: row;
  align-items: center;
}

.form-field--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
}

input,
select,
textarea {
  font: inherit;
  color: var(--color-ink);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
  transition: border-color 0.15s ease-in-out;
}

input[type="checkbox"],
input[type="radio"] {
  padding: 0;
  width: 1.1rem;
  height: 1.1rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-ink-muted);
}

.form-error {
  color: var(--color-danger);
  font-size: 0.9rem;
}

.form-error:empty {
  display: none;
}

/* --------------------------------------------------------------------- */
/* Tables (basket, checkout summary, admin)                              */
/* --------------------------------------------------------------------- */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-ink-muted);
}

.basket-table,
.record-admin-table {
  min-width: 32rem;
}

.basket-line--unavailable {
  color: var(--color-ink-muted);
}

.basket-line__record {
  display: flex;
  flex-direction: column;
}

.basket-line__unavailable-note {
  color: var(--color-danger);
  font-size: 0.85rem;
}

.basket-line__quantity-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.basket-line__quantity-form input[type="number"] {
  width: 4rem;
}

/* --------------------------------------------------------------------- */
/* Shop grid / record cards                                              */
/* --------------------------------------------------------------------- */

.shop-empty {
  padding: 2rem 0;
  color: var(--color-ink-muted);
}

.record-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1.5rem;
}

.record-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s ease-in-out, box-shadow 0.12s ease-in-out;
}

.record-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(28, 26, 23, 0.12);
}

.record-card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.record-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-color: var(--color-bg);
  display: block;
}

.record-card__artist,
.record-card__title,
.record-card__label,
.record-card__condition,
.record-card__price {
  display: block;
  padding: 0 0.75rem;
}

.record-card__artist {
  margin-top: 0.75rem;
  font-weight: bold;
}

.record-card__title {
  color: var(--color-ink);
}

.record-card__label,
.record-card__condition {
  color: var(--color-ink-muted);
  font-size: 0.9rem;
}

.record-card__price {
  margin: 0.5rem 0 0.75rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent-dark);
}

/* --------------------------------------------------------------------- */
/* Record detail                                                         */
/* --------------------------------------------------------------------- */

.record-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.record-detail__image {
  width: 100%;
  max-width: 24rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background-color: var(--color-surface);
}

.record-detail__info {
  flex: 1;
  min-width: 16rem;
}

.record-detail__label,
.record-detail__condition {
  color: var(--color-ink-muted);
}

.record-detail__price {
  font-size: 1.5rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent-dark);
}

.record-detail__add-to-basket {
  margin-top: 1rem;
}

/* --------------------------------------------------------------------- */
/* Basket mini-count (header)                                            */
/* --------------------------------------------------------------------- */

.mini-basket-count {
  text-decoration: none;
  color: inherit;
}

.mini-basket-count__badge {
  display: inline-block;
  margin-left: 0.35rem;
  background-color: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.85rem;
  font-weight: bold;
}

/* --------------------------------------------------------------------- */
/* Basket page                                                           */
/* --------------------------------------------------------------------- */

.basket-empty {
  padding: 2rem 0;
  color: var(--color-ink-muted);
}

.basket-warning {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.basket-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.basket-summary__total {
  font-size: 1.25rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------- */
/* Checkout                                                               */
/* --------------------------------------------------------------------- */

.checkout {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.checkout-form {
  flex: 2;
  min-width: 18rem;
}

.checkout-summary {
  flex: 1;
  min-width: 16rem;
}

.checkout-error {
  margin-bottom: 1rem;
}

.order-summary {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.order-summary h2 {
  margin-top: 0;
}

.order-summary__totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  margin: 1rem 0 0;
}

.order-summary__totals dt {
  color: var(--color-ink-muted);
}

.order-summary__totals dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.order-summary__total-label {
  font-weight: bold;
  color: var(--color-ink);
  border-top: 1px solid var(--color-border);
  padding-top: 0.5rem;
}

.order-summary__total-value {
  font-weight: bold;
  font-size: 1.15rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.5rem;
}

.checkout-confirmation__intro {
  font-size: 1.05rem;
}

.checkout-confirmation__address address {
  margin-top: 0.25rem;
}

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

.record-admin-table {
  width: 100%;
}

.record-admin__thumbnail {
  width: 3.5rem;
  height: 3.5rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  display: block;
}

.order-admin-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.order-admin-filter select {
  max-width: 14rem;
}

/* --------------------------------------------------------------------- */
/* Utility                                                                */
/* --------------------------------------------------------------------- */

.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;
}

.text-danger {
  color: var(--color-danger);
}

/* --------------------------------------------------------------------- */
/* Responsive: usable down to 375px                                      */
/* --------------------------------------------------------------------- */

@media (max-width: 40rem) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .site-header__brand-image {
    max-height: 56px;
  }

  .site-nav ul {
    gap: 0.5rem 1rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .record-grid {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 1rem;
  }

  .checkout {
    flex-direction: column;
  }

  .checkout-form,
  .checkout-summary {
    min-width: 0;
    width: 100%;
  }

  .basket-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .basket-summary .button {
    text-align: center;
  }

  .site-footer__inner {
    flex-direction: column;
    gap: 1.25rem;
  }
}
