/* Fonts (Inter, Cormorant Garamond) are self-hosted: header.php loads them from the child theme's fonts/ folder. */
/*
 * Jorts — Urban Outfitters Pack v1.0
 *
 * CSS custom properties are set here with defaults that match the store's
 * store_config.json theme.tokens section. The `install-theme-snippet` command
 * (Task 1.6.5) will generate a _tokens.css file that overrides these values
 * with the actual store config, so changing store_config.json propagates here.
 *
 * Layout: mobile-first, single column.
 * Desktop breakpoint: min-width 1024px, two-column grid.
 */

/* ── Design tokens (defaults from store_config.json theme.tokens) ──────────── */

:root {
  /* Trays palette "Stone & Oak": warm neutrals, one dark colour, no other accent. */
  --jorts-color-primary: #2b1e16;   /* espresso: text, buttons, announcement bar */
  --jorts-color-accent:  #2b1e16;   /* links in page text: espresso, underlined */
  --jorts-color-bg:      #ffffff;
  --jorts-color-border:  #e6e0d9;
  --jorts-color-muted:   #6b635c;   /* 5.9:1 on white, 5.3:1 on --trays-color-soft */
  --trays-color-text:    #1f1b18;
  --trays-color-soft:    #f6f3ef;   /* footer, image backgrounds, search box */
  --trays-color-chip:    #f1ebe4;
  --trays-color-line:    #d6cec5;   /* stronger borders: chips, swatches, inputs */
  --trays-color-sale:    #9a4f37;   /* terracotta, only for sale prices (5.9:1 on white) */
  --trays-font-display:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;   /* H1 headings (loaded in header.php) */
  --jorts-font-heading:  'Inter', system-ui, -apple-system, sans-serif;
  --jorts-font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --jorts-radius:        4px;
  --jorts-gap:           16px;
  --jorts-gap-sm:        8px;
}

/* ── Accessibility utilities ──────────────────────────────────────────────────
 *
 * .screen-reader-text visually hides content while keeping it in the
 * accessibility tree for assistive technology (the standard WordPress clip
 * technique — uses clip/clip-path, NOT display:none, so it stays exposed to
 * screen readers and works for aria-live regions). Defined here so the theme no
 * longer depends on Astra's stylesheet providing this class. The :focus reveal
 * brings an element on-screen when keyboard-focused.
 *
 * .skip-link is the "Skip to content" target in header.php: off-screen until it
 * receives keyboard focus, then it pins to the top-left so a keyboard or screen
 * reader user can jump past the header/nav straight to #content.
 */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none;
  width: auto;
  height: auto;
  margin: 0;
  padding: 16px 24px;
  background: var(--jorts-color-bg);
  color: var(--jorts-color-primary);
  font-size: 14px;
  line-height: normal;
  text-decoration: none;
  z-index: 100000;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  padding: 12px 20px;
  background: var(--jorts-color-primary);
  color: var(--jorts-color-bg);
  font-family: var(--jorts-font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--jorts-radius) 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

/* ── Page container ─────────────────────────────────────────────────────────── */

.jorts-product-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: var(--jorts-font-body);
  background: var(--jorts-color-bg);
  color: var(--jorts-color-primary);
}

/* ── Two-column grid ────────────────────────────────────────────────────────── */

.jorts-product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--jorts-gap);
}

@media (min-width: 1024px) {
  .jorts-product-grid {
    grid-template-columns: 55% 1fr;
    gap: 48px;
    align-items: start;
  }
}

/* ── Gallery ────────────────────────────────────────────────────────────────── */

.jorts-product-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--jorts-gap-sm);
}

.jorts-gallery-image {
  width: 100%;
  display: block;
  border-radius: var(--jorts-radius);
  aspect-ratio: 1 / 1;
  object-fit: contain;    /* contain keeps full image visible — no logo clipping */
  background: var(--trays-color-soft);    /* letterbox fill for images that aren't exactly square */
}

/* All images are equal size — no hero/featured first image.
 * Odd total count: last image sits alone in the left column of its row,
 * which is standard 2-column grid behaviour with no extra CSS needed. */

/* ── Info panel ─────────────────────────────────────────────────────────────── */

.jorts-product-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .jorts-product-info {
    position: sticky;
    top: 24px;
  }
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */

.jorts-breadcrumb {
  font-size: 12px;
  color: var(--jorts-color-muted);
}

.jorts-breadcrumb a {
  color: var(--jorts-color-muted);
  text-decoration: none;
}

.jorts-breadcrumb a:hover {
  text-decoration: underline;
}

/* ── Brand / title / price ──────────────────────────────────────────────────── */

.jorts-brand {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}

.jorts-product-title {
  font-family: var(--jorts-font-heading);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

@media (min-width: 1024px) {
  .jorts-product-title {
    font-size: 26px;
  }
}

.jorts-price {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.jorts-shipping-note {
  font-size: 13px;
  margin: 0;
  color: var(--jorts-color-muted);
}

.jorts-photo-disclaimer,
.jorts-video-disclaimer {
  font-size: 12px;
  margin: 4px 0 0;
  color: var(--jorts-color-muted);
  font-style: italic;
}

/* ── Product video (responsive embed — landscape 16:9 or vertical Shorts 9:16) ─ */

.jorts-product-video-section {
  margin-top: 16px;
}

.jorts-video-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 for a normal upload/watch link */
  overflow: hidden;
}

/* YouTube Shorts are filmed vertically — give them a tall, phone-shaped box
   instead of stretching a 16:9 frame full-width (which would letterbox it). */
.jorts-video-wrap.jorts-video-wrap--vertical {
  max-width: 380px;
  margin: 0 auto;
  padding-bottom: 177.78%; /* 9:16 */
}

.jorts-video-wrap .jorts-video-embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Color swatches ─────────────────────────────────────────────────────────── */

.jorts-color-swatches {
  display: flex;
  gap: var(--jorts-gap-sm);
  flex-wrap: wrap;
}

.jorts-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--jorts-color-border);
  cursor: pointer;
  padding: 0;
}

.jorts-color-swatch:hover,
.jorts-color-swatch:focus {
  border-color: var(--jorts-color-primary);
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

/* Visible selected state for a chosen swatch (set by the variant-selector JS),
 * mirroring the focus ring so the choice is not signalled by colour alone. */
.jorts-color-swatch.selected {
  border-color: var(--jorts-color-primary);
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

/* ── Size buttons ───────────────────────────────────────────────────────────── */

.jorts-size-buttons {
  display: flex;
  gap: var(--jorts-gap-sm);
  flex-wrap: wrap;
}

.jorts-size-btn {
  min-width: 48px;
  padding: 8px 12px;
  border: 1px solid var(--jorts-color-primary);
  border-radius: var(--jorts-radius);
  background: transparent;
  font-family: var(--jorts-font-body);
  font-size: 13px;
  cursor: pointer;
}

.jorts-size-btn:hover:not(:disabled),
.jorts-size-btn.selected {
  background: var(--jorts-color-primary);
  color: var(--jorts-color-bg);
}

.jorts-size-btn:focus {
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

.jorts-size-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── CTA button ─────────────────────────────────────────────────────────────── */

.jorts-buy-btn-wrap {
  margin-top: 4px;
}

.jorts-buy-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--jorts-color-primary);
  color: var(--jorts-color-bg);
  text-align: center;
  text-decoration: none;
  font-family: var(--jorts-font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--jorts-color-primary);
  border-radius: var(--jorts-radius);
  cursor: pointer;
  box-sizing: border-box;
}

.jorts-buy-btn:hover {
  background: transparent;
  color: var(--jorts-color-primary);
}

/* Keyboard focus shows a visible ring (WCAG 2.4.7). :focus-visible keeps the
 * ring off for mouse/touch activation so pointer users see no change. */
.jorts-buy-btn:focus-visible {
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

.jorts-pending span {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--jorts-color-border);
  /* Not the --jorts-color-muted token: it is too light on the border-coloured background for
   * this 13px text. #5e5650 on #e6e0d9 gives 5.5:1 (WCAG AA).
   * The token is unchanged because it passes (5.7:1) on the white backgrounds
   * where it is used elsewhere. */
  color: #5e5650;
  text-align: center;
  font-size: 13px;
  border-radius: var(--jorts-radius);
}

/* ── Accordions ─────────────────────────────────────────────────────────────── */

.jorts-accordion {
  border-top: 1px solid var(--jorts-color-border);
}

.jorts-accordion:last-of-type {
  border-bottom: 1px solid var(--jorts-color-border);
}

.jorts-accordion > summary {
  padding: 16px 0;
  font-family: var(--jorts-font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.04em;
}

/* Hide native disclosure triangle — both the modern (::marker) and legacy
 * (-webkit-details-marker) approaches are needed for full browser coverage.
 * display:flex on summary already suppresses it in most browsers, but being
 * explicit prevents Astra or other theme CSS from re-enabling it. */
.jorts-accordion > summary::marker {
  content: '';
}

.jorts-accordion > summary::-webkit-details-marker {
  display: none;
}

.jorts-accordion > summary::after {
  content: '+';
  /* "/ ''" gives the glyph an empty text alternative so screen readers do not
   * read "plus"/"minus" after every heading (browsers without support ignore
   * this line and use the plain content above). */
  content: '+' / '';
  font-size: 18px;
  font-weight: 300;
  flex-shrink: 0;
}

.jorts-accordion[open] > summary::after {
  content: '-';
  content: '-' / '';
}

.jorts-accordion > summary:focus {
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

.jorts-accordion-body {
  padding-bottom: 16px;
  font-size: 13px;
  line-height: 1.65;
}

/* ── Mobile sticky CTA ──────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
  .jorts-cta {
    position: sticky;
    bottom: 0;
    background: var(--jorts-color-bg);
    padding: 12px 0 8px;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  }
}

/* ── Global background override (defeats Astra gray on all pages) ───────────── */

body,
#primary,
#main,
.site-content,
#content,
.ast-container,
.entry-content {
  background-color: #ffffff !important;
}

/* ── Collection archive page ────────────────────────────────────────────────── */

.tax-jorts_collection body,
.search-results body,
.tax-jorts_collection #primary,
.tax-jorts_collection #main,
.tax-jorts_collection .site-content,
.search-results #primary,
.search-results #main,
.search-results .site-content,
body.tax-jorts_collection,
body.search-results {
  background-color: #ffffff !important;
}

.jorts-collection-page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 24px 16px 48px;
  font-family: var(--jorts-font-body);
  background: var(--jorts-color-bg);
  color: var(--jorts-color-primary);
}

.jorts-collection-header {
  margin-bottom: 24px;
  text-align: center;
}

.jorts-collection-title {
  font-family: var(--jorts-font-heading);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

@media (min-width: 768px) {
  .jorts-collection-title {
    font-size: 28px;
  }
}

.jorts-collection-description {
  font-size: 14px;
  color: var(--jorts-color-muted);
  max-width: 480px;
  margin: 0 auto 8px;
  line-height: 1.5;
}

.jorts-collection-count {
  font-size: 12px;
  color: var(--jorts-color-muted);
  margin: 0;
  letter-spacing: 0.06em;
}

/* ── Gender-split sections ──────────────────────────────────────────────────── */

.jorts-collection-section {
  margin: 0 auto;
  max-width: 1280px;
}

.jorts-collection-section + .jorts-collection-section {
  margin-top: 32px;
}

.jorts-section-title {
  font-family: var(--jorts-font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 16px;
  text-align: center;
}

@media (min-width: 768px) {
  .jorts-section-title {
    font-size: 18px;
  }
}

.jorts-section-divider {
  border: 0;
  border-top: 1px solid var(--jorts-color-border, rgba(0, 0, 0, 0.12));
  max-width: 1280px;
  margin: 40px auto;
}

/* ── Sort bar ───────────────────────────────────────────────────────────────── */

.jorts-collection-controls {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.jorts-sort-form {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--jorts-color-muted);
  letter-spacing: 0.06em;
}

.jorts-sort-form label {
  text-transform: uppercase;
}

.jorts-sort-form select {
  font-family: var(--jorts-font-body);
  font-size: 12px;
  border: 1px solid var(--jorts-color-border);
  border-radius: var(--jorts-radius);
  padding: 4px 8px;
  background: var(--jorts-color-bg);
  color: var(--jorts-color-primary);
  cursor: pointer;
}

/* ── Product grid ───────────────────────────────────────────────────────────── */

.jorts-collection-grid {
  list-style: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

@media (min-width: 600px) {
  .jorts-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .jorts-collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

/* ── Product card ───────────────────────────────────────────────────────────── */

.jorts-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.jorts-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

/* Square (1:1) image container (trays pack; product images are 800x800). */
.jorts-card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--trays-color-soft);
}

.jorts-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.3s ease;
}

.jorts-card:hover .jorts-card-image,
.jorts-card-title-link:focus ~ * .jorts-card-image {
  transform: scale(1.04);
}

.jorts-card-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--jorts-color-border);
}

.jorts-card-info {
  padding: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jorts-card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jorts-card-title-link {
  color: inherit;
  text-decoration: none;
}

.jorts-card-title-link:hover,
.jorts-card-title-link:focus {
  text-decoration: underline;
}

.jorts-card-price {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.jorts-card-shipping {
  font-size: 11px;
  color: var(--jorts-color-muted);
  margin: 0;
  letter-spacing: 0.04em;
}

/* ── Pagination ─────────────────────────────────────────────────────────────── */

.jorts-collection-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.jorts-collection-pagination .page-numbers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

.jorts-collection-pagination .page-numbers li {
  display: flex;
}

.jorts-collection-pagination .page-numbers a,
.jorts-collection-pagination .page-numbers span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--jorts-color-border);
  border-radius: var(--jorts-radius);
  text-decoration: none;
  color: var(--jorts-color-primary);
}

.jorts-collection-pagination .page-numbers .current {
  background: var(--jorts-color-primary);
  color: var(--jorts-color-bg);
  border-color: var(--jorts-color-primary);
}

.jorts-collection-pagination .page-numbers a:hover {
  border-color: var(--jorts-color-primary);
}

/* ── Empty state ────────────────────────────────────────────────────────────── */

.jorts-collection-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--jorts-color-muted);
}

.jorts-collection-empty p {
  font-size: 15px;
  margin: 0 0 16px;
}

/* ── Astra full-width reset for collection archive and search results ───────── */
/* WordPress adds .tax-jorts_collection / .search-results to <body>.            */
/* Astra's .ast-container and #primary constrain width by default — override.   */

.tax-jorts_collection .ast-container,
.tax-jorts_collection #content.site-content,
.tax-jorts_collection #primary.content-area,
.search-results .ast-container,
.search-results #content.site-content,
.search-results #primary.content-area {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  float: none;
}

/* ── Search empty state ─────────────────────────────────────────────────────── */
/* Scoped to .jorts-collection-empty to avoid conflicting with the header's     */
/* .jorts-search-form and .jorts-search-input defined in header.php inline CSS. */

.jorts-collection-empty .jorts-search-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border: none;
  background: transparent;
  height: auto;
  overflow: visible;
  border-radius: 0;
}

.jorts-collection-empty .jorts-search-input {
  font-family: var(--jorts-font-body);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--jorts-color-border);
  border-radius: var(--jorts-radius);
  min-width: 240px;
  color: var(--jorts-color-primary);
  background: var(--jorts-color-bg);
  outline: none;
}

.jorts-collection-empty .jorts-search-input:focus {
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
  border-color: var(--jorts-color-primary);
}

.jorts-btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--jorts-color-primary);
  color: var(--jorts-color-bg);
  text-decoration: none;
  font-family: var(--jorts-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--jorts-color-primary);
  border-radius: var(--jorts-radius);
  cursor: pointer;
}

.jorts-btn-primary:hover {
  background: transparent;
  color: var(--jorts-color-primary);
}

.jorts-btn-primary:focus-visible {
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

/* ── Homepage — collection sections ────────────────────────────────────────── */

.jorts-homepage {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  font-family: var(--jorts-font-body);
}

.jorts-homepage .jorts-collection {
  margin-bottom: 48px;
}

.jorts-h2 {
  font-family: var(--jorts-font-heading);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

@media (min-width: 768px) {
  .jorts-h2 {
    font-size: 22px;
  }
}

.jorts-collection-subtitle {
  font-size: 13px;
  color: var(--jorts-color-muted);
  margin: 0 0 16px;
}

/* ── View All link ──────────────────────────────────────────────────────────── */

.jorts-view-all {
  display: block;
  margin-top: 16px;
  text-align: right;
  font-family: var(--jorts-font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--jorts-color-primary);
}

.jorts-view-all:hover {
  text-decoration: underline;
}

.jorts-view-all:focus-visible {
  text-decoration: underline;
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

/* ── Homepage — page-header strip ──────────────────────────────────────────────
 *
 * front-page.php renders a minimal header (h1 + subtitle) above the curated
 * collection sections (.jorts-homepage, styled above). The hero / category grid
 * / manifesto / trust row were removed in the minimal redesign.
 */

/* Remove Astra's default top spacing on the main column so the page header sits
 * directly under the nav. Astra's main.min.css sets `.ast-separate-container
 * #primary { margin: 4em 0 }` (~64px). Scoped to .home (front page) only; the
 * bottom margin is left intact to separate the page from the footer. */
.home #primary,
.home .site-main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.homepage-header {
  text-align: center;
  padding: 1.2rem 1rem;
  background: var(--trays-color-soft);
  border-bottom: 1px solid var(--jorts-color-border);
}

.homepage-header-title {
  font-family: var(--jorts-font-heading);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--jorts-color-primary);
}

.homepage-header-subtitle {
  font-family: var(--jorts-font-body);
  font-size: 14px;
  color: var(--jorts-color-muted);
  margin: 0;
}

.homepage-empty {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 16px;
  text-align: center;
  font-size: 15px;
  color: var(--jorts-color-muted);
}

/* ── Standard WordPress pages & posts ─────────────────────────────────────────
 *
 * The custom header.php opens #content.site-content with no width constraint,
 * and only jorts_product, jorts_collection, the homepage, and search have
 * custom full-bleed templates rendered inside it. Standard pages
 * (privacy-policy, terms, about, …) and standard posts fall through to Astra's
 * default markup, which renders flush-left full-width with no centering or
 * padding. These rules center and pad that content to match the site gutter
 * used by the header / nav / footer, and cap the text measure for readability.
 *
 * Scoped by body class so the full-bleed custom templates are untouched:
 *   - body.page         → all standard pages (any page template)
 *   - body.single       → standard single posts and custom post types
 *   - :not(.home)        → excludes a static front page (custom homepage template)
 *   - :not(.single-jorts_product) → excludes product pages (own template)
 * Collection archives (.tax-jorts_collection) and search (.search) are neither
 * .page nor .single, so they are excluded automatically.
 */

body.page:not(.home) #content.site-content,
body.single:not(.single-jorts_product) #content.site-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 40px 64px;
  box-sizing: border-box;
  font-family: var(--jorts-font-body);
  color: var(--jorts-color-primary);
  line-height: 1.7;
}

/* Neutralize Astra's sidebar-aware width so content fills the centered column.
 * Child elements inherit font-family / color / line-height from the container. */
body.page:not(.home) #content.site-content .content-area,
body.single:not(.single-jorts_product) #content.site-content .content-area,
body.page:not(.home) #content.site-content #primary,
body.single:not(.single-jorts_product) #content.site-content #primary {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  float: none;
}

body.page:not(.home) #content.site-content .entry-title,
body.single:not(.single-jorts_product) #content.site-content .entry-title {
  font-family: var(--jorts-font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 28px;
}

body.page:not(.home) #content.site-content .entry-content h2,
body.single:not(.single-jorts_product) #content.site-content .entry-content h2 {
  font-family: var(--jorts-font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  margin: 40px 0 14px;
}

body.page:not(.home) #content.site-content .entry-content h3,
body.single:not(.single-jorts_product) #content.site-content .entry-content h3 {
  font-family: var(--jorts-font-heading);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  margin: 32px 0 12px;
}

body.page:not(.home) #content.site-content .entry-content p,
body.single:not(.single-jorts_product) #content.site-content .entry-content p {
  font-size: 16px;
  margin: 0 0 18px;
}

body.page:not(.home) #content.site-content .entry-content ul,
body.single:not(.single-jorts_product) #content.site-content .entry-content ul,
body.page:not(.home) #content.site-content .entry-content ol,
body.single:not(.single-jorts_product) #content.site-content .entry-content ol {
  font-size: 16px;
  margin: 0 0 18px;
  padding-left: 24px;
}

body.page:not(.home) #content.site-content .entry-content li,
body.single:not(.single-jorts_product) #content.site-content .entry-content li {
  margin: 0 0 8px;
}

body.page:not(.home) #content.site-content .entry-content a,
body.single:not(.single-jorts_product) #content.site-content .entry-content a {
  color: var(--jorts-color-accent);
  text-decoration: underline;
}

body.page:not(.home) #content.site-content .entry-content img,
body.single:not(.single-jorts_product) #content.site-content .entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--jorts-radius);
}

body.page:not(.home) #content.site-content .entry-content blockquote,
body.single:not(.single-jorts_product) #content.site-content .entry-content blockquote {
  margin: 24px 0;
  padding: 8px 0 8px 20px;
  border-left: 3px solid var(--jorts-color-border);
  color: var(--jorts-color-muted);
}

/* ── Standard-page button (.btn) ──────────────────────────────────────────────
 *
 * Content authors place <a class="btn"> buttons inside standard page/post
 * content (e.g. the Order Tracking and Contact Us pages). Those links live in
 * .entry-content, where the link rule above paints them accent-brown, and
 * Astra's own link colour can otherwise win against an inline color:#fff. These
 * rules give the button white text on a black background and carry enough
 * specificity to win without inline styles: the selector adds the `a.btn` class
 * on top of the already-specific standard-page scope (so it beats
 * `.entry-content a`), and `!important` on the colour/background defeats Astra's
 * theme-generated link colour regardless of its own specificity. Colours come
 * from the shared --jorts-* tokens (primary = black, bg = white), matching the
 * .jorts-buy-btn / .jorts-btn-primary buttons (Rule 3: configuration-driven).
 */
body.page:not(.home) #content.site-content .entry-content a.btn,
body.single:not(.single-jorts_product) #content.site-content .entry-content a.btn {
  display: inline-block;
  padding: 14px 28px;
  background-color: var(--jorts-color-primary) !important;
  color: var(--jorts-color-bg) !important;
  font-family: var(--jorts-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none !important;
  border: 2px solid var(--jorts-color-primary);
  border-radius: var(--jorts-radius);
  cursor: pointer;
}

/* Keep white-on-black on hover/focus too — the text must always read white,
 * never revert to Astra's link colour. A subtle opacity shift signals the
 * interaction without changing the colours. */
body.page:not(.home) #content.site-content .entry-content a.btn:hover,
body.page:not(.home) #content.site-content .entry-content a.btn:focus,
body.single:not(.single-jorts_product) #content.site-content .entry-content a.btn:hover,
body.single:not(.single-jorts_product) #content.site-content .entry-content a.btn:focus {
  background-color: var(--jorts-color-primary) !important;
  color: var(--jorts-color-bg) !important;
  opacity: 0.88;
  outline: none;
}

@media (max-width: 600px) {
  body.page:not(.home) #content.site-content,
  body.single:not(.single-jorts_product) #content.site-content {
    padding: 32px 20px 48px;
  }

  body.page:not(.home) #content.site-content .entry-title,
  body.single:not(.single-jorts_product) #content.site-content .entry-title {
    font-size: 26px;
  }
}

/* ── Reduced-motion override ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .jorts-color-swatch,
  .jorts-size-btn,
  .jorts-buy-btn {
    transition: none;
  }
}

/* ── Accessibility enhancements ─────────────────────────────────────────────── */

/* Anchor / keyboard-focus jumps land below the sticky header and above the
 * mobile sticky buy bar instead of underneath them (WCAG 2.4.11 Focus Not
 * Obscured). */
html {
  scroll-padding-top: 96px;
}

@media (max-width: 1023px) {
  html {
    scroll-padding-bottom: 96px;
  }
}

/* One consistent keyboard focus ring for every interactive element. Uses
 * :focus-visible so mouse/touch users do not see it. The extra "body" raises
 * specificity above Astra's own a:focus rules. */
body a:focus-visible,
body button:focus-visible,
body select:focus-visible,
body input:focus-visible,
body textarea:focus-visible,
body summary:focus-visible {
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 2px;
}

/* The skip link target is focused by script, not by the user tabbing to it, so
 * it must not draw a ring around the whole page body. */
#content:focus {
  outline: none;
}

/* Product cards on the collection / search pages are a single link wrapping the
 * image, title and price — ring the whole card when it has keyboard focus. */
.jorts-card-link:focus-visible {
  outline: 2px solid var(--jorts-color-primary);
  outline-offset: 4px;
}

/* Sort form: explicit Apply button (replaces the old auto-submit on change). */
.jorts-sort-apply {
  font-family: var(--jorts-font-body);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--jorts-color-primary);
  border-radius: var(--jorts-radius);
  background: var(--jorts-color-primary);
  color: var(--jorts-color-bg);
  cursor: pointer;
}

.jorts-sort-apply:hover {
  background: transparent;
  color: var(--jorts-color-primary);
}

/* Respect the operating-system "reduce motion" setting everywhere (hover zoom on
 * product images, menu animation, smooth scrolling), not just on three classes. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .jorts-card:hover .jorts-card-image {
    transform: none;
  }
}

/* Windows "High Contrast" / forced-colors mode drops background colours, which
 * would hide which size is selected — draw it with a border/outline instead. */
@media (forced-colors: active) {
  .jorts-size-btn.selected {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
}

/* ── Trays additions: specifications table and collection links ───────────── */
.jorts-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.jorts-specs-table th,
.jorts-specs-table td {
  padding: 0.5rem 0.25rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--jorts-color-border);
}
.jorts-specs-table th {
  width: 40%;
  font-weight: 600;
}
.jorts-related-collections,
.jorts-product-collections {
  margin: 2rem 0 1rem;
}
.jorts-related-title,
.jorts-product-collections-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}
.jorts-related-list,
.jorts-product-collections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.jorts-related-list a,
.jorts-product-collections-list a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--trays-color-line);
  border-radius: 999px;
  text-decoration: none;
}

/* Collection page built by hand (collection_editor.php) */
.jorts-hub-top { margin: 0 0 1rem; }
.jorts-hub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.jorts-hub-links a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--trays-color-line);
  border-radius: 999px;
  text-decoration: none;
}
.jorts-hub-links a:focus-visible,
.jorts-hub-viewall a:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.jorts-hub-layout { display: block; }
.jorts-hub-layout.has-side { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; }
.jorts-hub-side-group { margin: 0 0 1.5rem; }
.jorts-hub-side-title { font-size: 1rem; margin: 0 0 0.5rem; }
.jorts-hub-side .jorts-hub-links { display: block; }
.jorts-hub-side .jorts-hub-links li { margin: 0 0 0.35rem; }
.jorts-hub-side .jorts-hub-links a { border: 0; padding: 0; border-radius: 0; text-decoration: underline; }
.jorts-hub-section { margin: 0 0 2.5rem; }
.jorts-hub-heading { margin: 0 0 1rem; }
.jorts-hub-viewall { margin: 1rem 0 0; font-weight: 600; }
@media (max-width: 720px) {
  .jorts-hub-layout.has-side { grid-template-columns: 1fr; gap: 1rem; }
}

/* Hand-made sections on a product page (product_editor.php) */
.jorts-manual-heading { margin: 1rem 0 0.5rem; }
.jorts-section-text p { margin: 0 0 0.75rem; }

/* ── Shopping-style collection page (collection_refine.php) ─────────────────── */
.trays-refine-page .trays-refine-chips { max-width: 1280px; margin: 0 auto 1.25rem; }
.trays-refine-page .trays-refine-chips .jorts-hub-links { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.trays-refine-page .trays-refine-chips .jorts-hub-links li { flex: 0 0 auto; }
.trays-refine-page .trays-refine-chips .jorts-hub-links a { font-size: 13px; color: var(--jorts-color-primary); background: var(--jorts-color-bg); white-space: nowrap; }
.trays-refine-page .trays-refine-chips .jorts-hub-links a:hover { border-color: var(--jorts-color-primary); }
@media (min-width: 900px) {
  .trays-refine-page .trays-refine-chips .jorts-hub-links { flex-wrap: wrap; overflow: visible; }
}

.trays-refine-layout { max-width: 1280px; margin: 0 auto; }
@media (min-width: 900px) {
  .trays-refine-layout.has-sidebar { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; align-items: start; }
}

.trays-refine-drawer > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--trays-color-line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 1rem;
}
.trays-refine-drawer > summary::-webkit-details-marker { display: none; }
.trays-refine-drawer > summary:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
@media (min-width: 900px) {
  .trays-refine-drawer > summary { display: none; } /* the sidebar is always open on wide screens */
}

.trays-refine-title { font-size: 15px; font-weight: 700; margin: 0 0 0.75rem; }
.trays-refine-group { border: 0; border-top: 1px solid var(--jorts-color-border); margin: 0; padding: 0.85rem 0; min-width: 0; }
.trays-refine-group legend { font-size: 13px; font-weight: 600; padding: 0.85rem 0 0.5rem; margin: 0; float: left; width: 100%; }
.trays-refine-options { clear: both; list-style: none; margin: 0; padding: 0; }
.trays-refine-options li { margin: 0 0 0.45rem; }
.trays-refine-option { display: flex; align-items: center; gap: 0.5rem; font-size: 13px; color: #3d3631; cursor: pointer; text-decoration: none; }
.trays-refine-option input { margin: 0; width: 16px; height: 16px; accent-color: var(--jorts-color-primary); flex: 0 0 16px; }
a.trays-refine-link { color: #3d3631; }
a.trays-refine-link:hover span { text-decoration: underline; }
a.trays-refine-link::after { content: "›"; margin-left: auto; color: #a39a91; }
.trays-refine-option:focus-within, a.trays-refine-link:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; border-radius: 4px; }
.trays-refine-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--trays-color-line); flex: 0 0 16px; }

.trays-refine-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding: 0.9rem 0 1rem; border-top: 1px solid var(--jorts-color-border); }
.trays-refine-apply { background: var(--jorts-color-primary); color: var(--jorts-color-bg); border: 0; border-radius: 999px; padding: 0.5rem 1.1rem; font-size: 13px; font-weight: 600; cursor: pointer; }
.trays-refine-apply:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.trays-refine-clear { font-size: 13px; color: #3d3631; }
.trays-refine-side { border-top: 1px solid var(--jorts-color-border); padding-top: 0.85rem; }

.trays-refine-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin: 0 0 1rem; }
.trays-refine-count { margin: 0; font-size: 13px; color: var(--jorts-color-muted); }
.trays-refine-active { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; flex: 1 1 auto; }
.trays-refine-active a { display: inline-block; padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--trays-color-chip); font-size: 12px; text-decoration: none; color: var(--trays-color-text); }
.trays-refine-active a:hover { background: var(--jorts-color-border); }
.trays-refine-active a:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }
.trays-refine-sort { display: flex; align-items: center; gap: 0.4rem; }
.trays-refine-sort label { white-space: nowrap; }

.trays-refine-main .jorts-collection-grid { max-width: none; }
@media (min-width: 1024px) {
  .trays-refine-layout.has-sidebar .jorts-collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .trays-refine-layout.has-sidebar .jorts-collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Text and FAQs under the products (every collection) */
.trays-collection-guide, .trays-faq { max-width: 820px; margin: 3rem auto 0; padding: 0 1rem; }
.trays-collection-guide h2, .trays-faq > h2 { font-size: 20px; margin: 0 0 0.75rem; }
.trays-collection-guide h3 { font-size: 16px; margin: 1.25rem 0 0.4rem; }
.trays-collection-guide p, .trays-collection-guide li, .trays-faq p { font-size: 14.5px; line-height: 1.7; color: #3d3631; }
.trays-faq-item { border-top: 1px solid var(--jorts-color-border); padding: 1rem 0; }
.trays-faq-item h3 { font-size: 15px; margin: 0 0 0.35rem; }
.trays-faq-item p { margin: 0 0 0.5rem; }

/* ── Trays palette: images, header and footer ──────────────────────────────────
 * Product photos usually have a white background; on the warm soft background "multiply" lets that white
 * melt into the page, so photos from different suppliers look like one set. (White products turn a very
 * light warm white.) */
.jorts-card-image-wrap { background: var(--trays-color-soft); }
.jorts-card-image { mix-blend-mode: multiply; }
.jorts-product-gallery { background: var(--trays-color-soft); border-radius: var(--jorts-radius); }
.jorts-gallery-image { background: transparent; mix-blend-mode: multiply; }


/* Astra's own colour palette (Customizer defaults: blue links, slate text and headings) still colours the
 * page title, body text and Astra's widgets. Set on body, these win over Astra's :root values. */
body {
  --ast-global-color-0: #2b1e16;   /* was #046bd2: links, buttons */
  --ast-global-color-1: #45332a;   /* was #045cb4: link/button hover */
  --ast-global-color-2: #1f1b18;   /* was #1e293b: headings */
  --ast-global-color-3: #3d3631;   /* was #334155: body text (11.9:1 on white) */
  --ast-global-color-4: #ffffff;
  --ast-global-color-5: #f6f3ef;   /* was #F0F5FA: light background */
  --ast-global-color-6: #1f1b18;   /* was #111111 */
  --ast-global-color-7: #d6cec5;   /* was #D1D5DB: borders */
  --ast-global-color-8: #1f1b18;   /* was #111111 */
}

/* Serif for every H1 (page, collection, product and homepage headings). Only the typeface is set here;
 * size, weight and letter case stay as each template sets them. !important because several templates set
 * the heading font with more specific selectors. */
body h1 { font-family: var(--trays-font-display) !important; font-weight: 600; letter-spacing: 0.01em; }

/* Sale prices (sale_price.php): sale price in terracotta, old price struck through, saving as a pill. */
.trays-price-now { color: var(--trays-color-sale); font-weight: 600; }
.trays-price-was { color: var(--jorts-color-muted); font-weight: 400; font-size: 0.9em; margin-left: 0.3em; text-decoration: line-through; }
.trays-price-save {
  display: inline-block;
  margin-left: 0.45em;
  padding: 0.05em 0.5em;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--trays-color-sale);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}

/* Support and policy pages (their own card styles live in the page content): less padding on phones so the
 * text is not squeezed into a narrow column. "body" makes this win over the page's inline rules. */
@media (max-width: 600px) {
  body .trays-page { padding: 16px 12px; }
  body .trays-page .card { padding: 28px 20px; }
}
