/*
Theme Name: Sam Bettley Art
Description: Carries the marketing site's design onto the store, so paying for a
             commission doesn't feel like leaving the site you enquired from.
Version: 0.1.0
Requires PHP: 8.0
Text Domain: sam-bettley-art
*/

:root {
  --canvas: #0a0a0a;
  --canvas-raised: #111111;
  --bone: #f2f1ee;
  --bone-dim: #9a978f;
  --oxblood: #c41e1e;
  --oxblood-bright: #ff2d2d;
  --ochre: #ff2d2d;
  --grey: #5e5b56;
  --line: rgba(232, 230, 226, 0.08);

  --display: 'Big Shoulders Display', sans-serif;
  --body: 'Space Grotesk', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--canvas);
  color: var(--bone);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--oxblood); color: var(--bone); }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

/* ---------- nav ---------- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
}

.nav-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-links { display: flex; gap: 36px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; }
.nav-links a { opacity: 0.75; transition: opacity 0.2s ease; }
.nav-links a:hover { opacity: 1; }

@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- page scaffolding ---------- */
.site-main { padding: 70px 0 110px; min-height: 60vh; }

.page-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ochre);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--ochre); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

h1 { font-size: clamp(32px, 4.2vw, 54px); margin-bottom: 28px; }
h2 { font-size: clamp(24px, 3vw, 34px); margin: 40px 0 18px; }
h3 { font-size: 22px; margin: 28px 0 14px; }

p { margin-bottom: 16px; color: var(--bone-dim); }
.site-main a:not(.button) { color: var(--ochre); }
.site-main a:not(.button):hover { text-decoration: underline; }

/* ---------- buttons ---------- */
/* WooCommerce Blocks renders its own controls — quantity steppers, remove-item
   icons, the coupon toggle — as bare <button>s. They are UI chrome, not calls to
   action, so they are excluded here and styled deliberately further down. The
   block CTAs are opted back in by class. */
.site-main .button,
.site-main button:not([class*="wc-block-"]),
.site-main input[type="submit"],
.woocommerce-button,
a.button.wc-forward,
.site-main .wc-block-components-button.contained,
#place_order {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 16px 30px !important;
  font-family: var(--body) !important;
  font-size: 13px !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600 !important;
  border-radius: 2px !important;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent !important;
  background: var(--oxblood) !important;
  color: var(--bone) !important;
  line-height: 1.2;
}

.site-main .button:hover,
.site-main button:not([class*="wc-block-"]):hover,
.site-main input[type="submit"]:hover,
.site-main .wc-block-components-button.contained:hover,
#place_order:hover { background: var(--oxblood-bright) !important; }

/* The block CTAs own their column, so they fill it rather than sitting inline. */
.site-main .wc-block-cart__submit-button,
.site-main .wc-block-components-checkout-place-order-button {
  width: 100%;
  justify-content: center;
}

.wc-block-components-button__text { color: inherit; }

/* The admin bar is WordPress chrome, not part of the store's design. */
#wpadminbar, #wpadminbar * { font-family: inherit; }
#wpadminbar .ab-item { text-transform: none; letter-spacing: normal; }

/* ---------- forms ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="search"], select, textarea,
.select2-container .select2-selection {
  width: 100%;
  background: var(--canvas-raised) !important;
  border: 1px solid var(--line) !important;
  color: var(--bone) !important;
  padding: 14px 16px !important;
  font-family: var(--body);
  font-size: 15px;
  border-radius: 2px;
  transition: border-color 0.2s ease;
  height: auto !important;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ochre) !important; }

label, .woocommerce-form__label span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey);
  margin-bottom: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--bone) !important; line-height: 1.6 !important; }
.select2-dropdown { background: var(--canvas-raised); border-color: var(--line); color: var(--bone); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--oxblood); }

/* ---------- WooCommerce tables ---------- */
.woocommerce table.shop_table {
  border: 1px solid var(--line);
  border-radius: 2px;
  border-collapse: collapse;
  width: 100%;
  background: var(--canvas-raised);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  color: var(--bone-dim);
}

.woocommerce table.shop_table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey);
  font-weight: 600;
}

.woocommerce table.shop_table td strong,
.woocommerce table.shop_table .amount { color: var(--bone); }

.woocommerce table.shop_table tfoot th,
.woocommerce table.shop_table tfoot td { color: var(--bone); font-weight: 600; }

.woocommerce table.shop_table tfoot tr:last-child .amount {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
}

/* The commission breakdown rides on the line item as item meta. */
.woocommerce table.shop_table .wc-item-meta,
.woocommerce .variation {
  list-style: none;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--grey);
}
.woocommerce table.shop_table .wc-item-meta li { margin: 3px 0; }
.woocommerce table.shop_table .wc-item-meta p { margin: 0; display: inline; }
.woocommerce table.shop_table .wc-item-meta strong { color: var(--bone-dim); font-weight: 500; }

/* ---------- WooCommerce Blocks: cart line items ---------- */
/* The item name is the row's subject, not a call to action — the accent red the
   theme gives links reads as an error state here. */
.site-main a.wc-block-components-product-name { color: var(--bone); }
.site-main a.wc-block-components-product-name:hover { color: var(--ochre); text-decoration: none; }

.wc-block-cart-item__quantity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.wc-block-components-quantity-selector {
  display: inline-flex;
  align-items: stretch;
  width: auto;
  min-width: 0;
  margin: 0;
  background: var(--canvas-raised);
  border: 1px solid var(--line);
  border-radius: 2px;
}
/* Blocks draws the stepper's frame with a pseudo-element; the border above
   replaces it, and leaving both gives a doubled outline. */
.wc-block-components-quantity-selector::after { display: none; }

.wc-block-components-quantity-selector__input {
  order: 2;
  width: 42px !important;
  min-width: 0;
  padding: 8px 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--bone) !important;
  font-size: 14px;
  text-align: center;
}

.wc-block-components-quantity-selector__button {
  width: 32px;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  color: var(--bone-dim) !important;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}
.wc-block-components-quantity-selector__button--minus { order: 1; }
.wc-block-components-quantity-selector__button--plus { order: 3; }
.wc-block-components-quantity-selector__button:hover:not(:disabled) { color: var(--bone) !important; }
.wc-block-components-quantity-selector__button:disabled { opacity: 0.35; cursor: default; }

.wc-block-cart-item__remove-link {
  display: inline-flex !important;
  align-items: center;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  /* --grey falls under 3:1 against the canvas, which an icon-only control needs. */
  color: var(--bone-dim) !important;
  cursor: pointer;
  transition: color 0.2s ease;
}
.wc-block-cart-item__remove-link:hover { color: var(--oxblood-bright) !important; }
.wc-block-cart-item__remove-link svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- WooCommerce Blocks: checkout order summary ---------- */
/* Blocks fills this count badge with currentColor and leaves the numeral to
   inherit, which on a light theme gives dark-on-light. Here both resolve to
   --bone and the count disappears into its own chip. */
.wc-block-components-order-summary-item__quantity {
  background: var(--bone) !important;
  color: var(--canvas) !important;
  border: 0 !important;
  /* Reads as a chip rather than a smudge on the thumbnail's corner. */
  box-shadow: 0 0 0 2px var(--canvas-raised) !important;
  font-weight: 600;
}
/* The numeral sits in its own span that Blocks colours white directly, so the
   badge's own colour never reaches it. */
.wc-block-components-order-summary-item__quantity > span { color: var(--canvas) !important; }

/* ---------- notices ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
  background: var(--canvas-raised);
  border: 1px solid var(--line);
  border-left: 2px solid var(--ochre);
  padding: 18px 24px;
  margin-bottom: 28px;
  border-radius: 2px;
  list-style: none;
  color: var(--bone);
}

.woocommerce-error { border-left-color: var(--oxblood-bright); }

/* ---------- order details / thank you ---------- */
.woocommerce-order-overview {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 26px 28px;
  margin: 0 0 36px;
  background: var(--canvas-raised);
}

.woocommerce-order-overview li {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey);
}

.woocommerce-order-overview li strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.005em;
  color: var(--bone);
  text-transform: none;
}

.woocommerce-customer-details address {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 20px 24px;
  font-style: normal;
  color: var(--bone-dim);
}

/* ---------- checkout layout ---------- */
.woocommerce-checkout .col2-set { display: grid; grid-template-columns: 1fr; gap: 28px; }
.woocommerce form .form-row { margin-bottom: 20px; }
#order_review_heading { margin-top: 44px; }

.woocommerce-privacy-policy-text, .woocommerce-terms-and-conditions-wrapper { font-size: 13px; color: var(--grey); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  font-size: 13px;
  color: var(--grey);
}

.footer-grid { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }

.footer-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.footer-links { display: flex; gap: 24px; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-links a { opacity: 0.75; }
.footer-links a:hover { opacity: 1; }
