/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ---------- Public store: a product's shipping line ----------
 * "Free shipping" or "+ $5 shipping", inside the price element of a store
 * card and of the product page, on its own line in the page's text color
 * (a theme may color the price itself). */

body[data-layout="public"] .merch-product__shipping,
body[data-layout="public"] .merch-product-page__shipping {
  display: block;
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.75;
}

/* ---------- Public pages: Markdown text ----------
 * A member's Markdown text (MarkdownHelper#markdown): the About story and
 * summary, a job posting, a product or category description. Tailwind's
 * reset leaves lists without markers and headings at body size, so every
 * theme gets these. :where() keeps them below any theme rule: a theme's
 * own h2, h3, and main a.underline styles apply to the text too. */

body[data-layout="public"] :where(.markdown) {
  overflow-wrap: break-word;
}

body[data-layout="public"] :where(.markdown) > * + * {
  margin-top: 1em;
}

body[data-layout="public"] :where(.markdown) :is(h2, h3, h4, h5, h6) {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
}

body[data-layout="public"] :where(.markdown) > :is(h2, h3, h4, h5, h6):not(:first-child) {
  margin-top: 1.5em;
}

body[data-layout="public"] :where(.markdown) h2 { font-size: 1.5em; }
body[data-layout="public"] :where(.markdown) h3 { font-size: 1.25em; }
body[data-layout="public"] :where(.markdown) h4 { font-size: 1.1em; }

body[data-layout="public"] :where(.markdown) :is(ul, ol) {
  padding-left: 1.5em;
}

body[data-layout="public"] :where(.markdown) ul { list-style: disc; }
body[data-layout="public"] :where(.markdown) ol { list-style: decimal; }

body[data-layout="public"] :where(.markdown) li + li,
body[data-layout="public"] :where(.markdown) li > :is(ul, ol) {
  margin-top: 0.25em;
}

body[data-layout="public"] :where(.markdown) blockquote {
  padding-left: 1em;
  border-left: 3px solid var(--color-accent);
  font-style: italic;
}

body[data-layout="public"] :where(.markdown) blockquote > * + * {
  margin-top: 1em;
}

body[data-layout="public"] :where(.markdown) hr {
  border: 0;
  border-top: 1px solid currentColor;
  opacity: 0.25;
}

body[data-layout="public"] :where(.markdown) code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

body[data-layout="public"] :where(.markdown) pre {
  padding: 0.75em 1em;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  overflow-x: auto;
}

/* ---------- Public product page: photo gallery ----------
 * The "Gallery" photo display: one square photo per slide in a scroll-snap
 * strip (a plain scrolling strip without JavaScript), with arrows and dots
 * that photo_gallery_controller.js reveals. Every public theme uses these;
 * colors come from the theme's own custom properties. Square corners. */

body[data-layout="public"] .merch-product-page__photos--gallery {
  position: relative;
  display: block;
  width: 100%;
  max-width: 36rem;
}

body[data-layout="public"] .merch-gallery__strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

body[data-layout="public"] .merch-gallery__strip::-webkit-scrollbar { display: none; }

body[data-layout="public"] .merch-gallery__strip:focus-visible {
  outline: 2px solid var(--color-accent, currentColor);
  outline-offset: 2px;
}

body[data-layout="public"] .merch-gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

body[data-layout="public"] .merch-gallery__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0;
}

body[data-layout="public"] .merch-gallery__arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 0;
  background: var(--color-bg, #fff);
  color: var(--color-text, #111);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

body[data-layout="public"] .merch-gallery__arrow[hidden] { display: none; }
body[data-layout="public"] .merch-gallery__arrow:disabled { opacity: 0.4; cursor: default; }
body[data-layout="public"] .merch-gallery__arrow--prev { left: 0.5rem; }
body[data-layout="public"] .merch-gallery__arrow--next { right: 0.5rem; }

body[data-layout="public"] .merch-gallery__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

body[data-layout="public"] .merch-gallery__dots[hidden] { display: none; }

body[data-layout="public"] .merch-gallery__dot {
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

body[data-layout="public"] .merch-gallery__dot[aria-current="true"] {
  background: currentColor;
}

/* Shoply and Shopkeeper put the photos in the left column beside the details. */
body[data-layout="public"][data-theme="shoply"] .merch-product-page__photos--gallery,
body[data-layout="public"][data-theme="shopkeeper"] .merch-product-page__photos--gallery {
  max-width: none;
}

/* The paid-order receipt page (public/merch_receipts): print only the receipt. */
@media print {
  body[data-layout="public"] header,
  body[data-layout="public"] footer,
  body[data-layout="public"] nav,
  .merch-receipt__note {
    display: none;
  }
}
