/* shopsite — descended from Hugo Minivox v20260710
 *
 * Mobile-first. Base rules target phones; media queries layer on
 * progressively larger devices.
 *
 * Breakpoints:
 *   phone    <  600px   (base styles, hamburger nav)
 *   tablet   >= 600px   (hamburger nav)
 *   laptop   >= 900px   (inline nav)
 *   desktop  >= 1280px  (inline nav, classic 65vw column)
 *
 * To change where the hamburger switches to the inline menu, edit the
 * two "900px" media queries in the NAVIGATION section.
 */

/* Fonts are self-hosted per site. A business provides its own @font-face
 * rules (see static/res/fonts.css, generated alongside its webfonts) and
 * sets --font-primary / --font-mono in brand.css. When neither is present
 * the system stacks below apply and the site still renders correctly.
 */

/* Fallback palette. A site overrides every one of these in brand.css;
 * these values exist only so the theme renders sanely on its own. */
:root {
  --color1: #f6f4f0;
  /* background */
  /* color for table header */
  /* color for table rows (even) */

  --color2: #1a1a1a;
  /* primary text color */
  /* color for table text */

  --color3: #d5d0c8;
  /* article header background */
  /* background color for code blocks */
  /* background color for blockquotes */
  /* hr color */
  /* borders */
  /* color for table rows (odd) */

  --color4: #3c3a36;
  /* secondary text color */
  /* text color in blockquotes */
  /* text color in code blocks */
  /* headers */
  /* checkbox color */
  /* links */

  --accent: #6b5d49;
  /* color for shadows */
  /* accent for buttons and highlights */

  --ok: #2b6b3a;
  /* in-stock badge */

  --danger: #8b1a1a;
  /* sold-out badge */

  --muted: #6a6a6a;
  /* secondary text: blurbs, captions, prices notes */

  --paper: #f0f0f0;
  /* inset surfaces: code blocks, blockquotes, article headers, cards.
     Sits between --color1 and --color3 in value. */

  /* Typography. A business overrides these in brand.css; the stacks here
     are the fallbacks used when it does not. */
  --font-primary: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;


  /* Content column: fluid on small screens, capped on large.
     Overridden per breakpoint below. */
  --content-width: 100%;
  --content-pad: 1rem;
}

/* tablet */
@media (min-width: 600px) {
  :root {
    --content-width: 92vw;
    --content-pad: 1.25rem;
  }
}

/* laptop */
@media (min-width: 900px) {
  :root {
    --content-width: 78vw;
    --content-pad: 1.5rem;
  }
}

/* desktop — the classic 65vw column */
@media (min-width: 1280px) {
  :root {
    --content-width: 65vw;
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-optical-sizing: auto;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
}

/* Structure */

html {
  scroll-behavior: smooth;
}

body {
  width: var(--content-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--content-pad);
  line-height: 1.5;
  background-color: var(--color1);
  color: var(--color2);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  scrollbar-color: var(--color1) transparent;
}

header {
  text-align: center;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color4);
  text-decoration: none;
  font-variant-caps: small-caps;
  overflow-wrap: break-word;
}

/* Slightly smaller site title on phones so it shares a row
   with the hamburger comfortably */
header h1 {
  font-size: 1.5em;
  margin: 0.5em 0;
}

@media (min-width: 600px) {
  header h1 {
    font-size: 2em;
  }
}

/* ------------------------------------------------------------------ */
/* NAVIGATION                                                          */
/*                                                                     */
/* Phone & tablet (<900px): hamburger button toggling a popout panel. */
/* Laptop & desktop (>=900px): classic inline centered menu.          */
/*                                                                     */
/* Toggle is a hidden checkbox (#nav-toggle) — no JS required.        */
/* Markup lives in layouts/_default/baseof.html.                       */
/* ------------------------------------------------------------------ */

/* the checkbox itself is never visible */
.nav-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* title + hamburger row */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* hamburger button (phone/tablet only) */
.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  cursor: pointer;
  border: 1px solid var(--color3);
  border-radius: 5px;
  background: var(--color3);
  flex-shrink: 0;
}

.nav-toggle-label span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--color4);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* hamburger -> X when open */
#nav-toggle:checked ~ .header-bar .nav-toggle-label span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#nav-toggle:checked ~ .header-bar .nav-toggle-label span:nth-child(2) {
  opacity: 0;
}
#nav-toggle:checked ~ .header-bar .nav-toggle-label span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

nav {
  position: relative;
}

/* popout panel — hidden until the checkbox is checked */
.menu {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  flex-direction: column;
  background: var(--color1);
  border: 1px solid var(--color3);
  border-radius: 5px;
  box-shadow: 3px 3px 3px var(--accent);
}

#nav-toggle:checked ~ nav .menu {
  display: flex;
}

.menu li {
  display: block;
}

.menu a {
  display: block;
  background: var(--color3) !important;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0;
  border-radius: 5px;
  text-align: center;
}

/* laptop & desktop: inline menu, no hamburger */
@media (min-width: 900px) {
  .nav-toggle-label {
    display: none;
  }

  .header-bar {
    display: block;
    text-align: center;
  }

  .menu,
  #nav-toggle:checked ~ nav .menu {
    display: block;
    position: static;
    padding: 0;
    text-align: center;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .menu li {
    display: inline-block;
  }

  .menu a {
    display: inline-block;
    padding: 5px;
    margin: 0;
    /*  -webkit-filter: drop-shadow(1px 1px 0px var(--accent));*/
    /*  filter: drop-shadow(1px 1px 0px var(--accent));*/
  }
}

/* ------------------------------------------------------------------ */

main {
  hyphens: auto;
  overflow-wrap: break-word;
}

.article-meta, .article-meta h1, .article-meta h2 {
  text-decoration: none;
  color: var(--color4) !important;
  background: var(--paper) !important;
  padding: 5px;
  border-radius: 5px;
  margin: 0em !important;
  text-align: center;
}

.title {
  font-size: 1.4em;
}

@media (min-width: 600px) {
  .title {
    font-size: 1.75em;
  }
}

.article {
  color: var(--color2);
}

footer {
  text-align: center;
  margin-top: auto;
  padding-bottom: 1rem;
}

/* Style */

a, a:visited, a:link, a:hover, a:active, .menu a {
  text-decoration: underline dotted !important;
  text-underline-offset: .33em;
  color: var(--color4) !important;
}

a:hover {
  text-decoration: none;
  -webkit-filter: drop-shadow(1px 1px 0px var(--accent));
  filter: drop-shadow(1px 1px 0px var(--accent));
}

hr {
  /*  border-style: dashed;*/
  color: var(--color3);
}

/* code */
pre {
  border: 1px solid var(--color3);
  box-shadow: 3px 3px 3px var(--accent);
  padding: 1em;
  overflow-x: auto;
  background-color: var(--paper);
  max-width: 100%;
}

code {
  background-color: var(--paper);
  color: var(--color4);
  overflow-wrap: break-word;
}
pre code {
  color: var(--color4);
  overflow-wrap: normal;
}

/* misc elements */
img, iframe, video {
  max-width: 100%;
  height: auto;
}

img {
  box-shadow: 3px 3px 3px var(--accent);
  /*  padding: 1em;*/
}

blockquote {
  background: var(--paper);
  color: var(--color4);
  border-left: 5px solid var(--color4);
  padding: 3px 1em 3px;
  margin: 1em 0;
}

table {
  margin: auto;
  border: 1px solid var(--color3);
  border-collapse: collapse;
  max-width: 100%;
}

/* phone: wide tables scroll sideways instead of blowing out the page */
@media (max-width: 599px) {
  table {
    display: block;
    overflow-x: auto;
    width: fit-content;
    max-width: 100%;
  }
}

table thead th {
  border-bottom: 1px solid var(--color3);
}

th, td {
  padding: 5px;
}

thead, tfoot, tr:nth-child(even) {
  background: var(--color1);
  color: var(--color2);
}
tr:nth-child(odd) {
  background: var(--paper);
  color: var(--color2);
}
th, tr, td {
  border: 1px solid var(--color3);
}

.postMeta {
  color: var(--color4);
}

.container {
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* Post listing rows (home.html, list.html): title left, date right.
   Wraps gracefully on narrow screens — a long title takes the full
   line and the date drops below it, still right-aligned. */
.postRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1rem;
  margin: 0.4em 0;
}

.postRow .postDate {
  margin-left: auto;
  text-align: right;
}

.summary {
  margin: 0.75em 0;
}

.alignRight {
  text-align: right;
  margin: 0.4em 0 1em;
}

/* Legacy absolute-positioned rows — still used by single.html */
.inlineLeft, .inlineCenter, .inlineRight {
  position: absolute;
  display: inline-block;
  margin: 0 auto;
}

.inlineLeft {
  left: 0;
}

.inlineCenter {

}
.inlineRight {
  right: 0;
}

/* phone: stack the absolute-positioned meta rows so long titles and
   dates don't overlap */
@media (max-width: 599px) {
  .inlineLeft, .inlineCenter, .inlineRight {
    position: static;
    display: block;
  }
  .inlineLeft {
    text-align: left;
  }
  .inlineCenter {
    text-align: center;
  }
  .inlineRight {
    text-align: right;
  }
}

.margin-half {
  margin: .5em;
}

input[type='checkbox']:checked {
  content: 'X';
  margin: auto;
  background-color: var(--color3);
  color: var(--color4);
}

input[type='checkbox']:checked:after {
  content: 'X';
  margin: auto;
  color: var(--color4);
}

input[type='checkbox'] {
  /*  text-align: center;*/
  background-color: var(--color3);
  margin: auto;
  text-align: center;
  /*  display: table-cell;*/
  display: inline;
  vertical-align: middle;
  width: 20px !important;
  height: 20px !important;
  appearance: none;
  font-size: 1em;
  border-radius: 10%;
  border: 1px solid var(--color3);
  box-shadow: none;
}

/* the nav toggle checkbox must stay invisible despite the generic
   checkbox styling above */
input.nav-toggle {
  width: 0 !important;
  height: 0 !important;
  border: none;
  appearance: none;
  position: absolute;
  opacity: 0;
}

/* Glance specific elements */

.widget-content {
  background-color: var(--color1) !important;
  color: var(--color2) !important;
  /*  border: 1px solid var(--color3) !important;*/
  border: none;
  /*  box-shadow: 0px 3px 0px 0px var(--accent) !important;*/
  box-shadow: 3px 3px 3px var(--accent) !important;
}

li {
  color: var(--color2);
}

.widget-group-title {
  color: var(--color4) !important;
  border: none !important;
}

.bookmarks-group-title {
  color: var(--color2) !important;
}

.widget-group-header {
  border: none !important;
}

.widget-content-frameless {
  box-shadow: none !important;
}

.expand-toggle-button {
  background-color: var(--color1);
  color: var(--color4);
}

.color-highlight, .weather-column-value, .bookmarks-link, .bookmarks-link::after, .visited-indicator:not(:visited)::before, .visited-indicator:not(:visited)::after {
  color: var(--color4) !important;
}

.content-bounds {
  padding: 0 !important;
  /*  min-width: calc(--minvw) !important;*/
  /*  max-width: calc(--maxvw) !important;*/
}

.page-columns-transitioned {
  padding: 0 !important;
  min-width: 98vw !important;
  max-width: 98vw !important;
}


/* ================================================================== */
/* STOREFRONT                                                          */
/*                                                                     */
/* Added for catalog pages. Everything above is the original          */
/* Minivox stylesheet and is unchanged, so an existing site keeps      */
/* rendering exactly as it did.                                        */
/*                                                                     */
/* These rules use only the variables declared at the top, so the      */
/* whole storefront reskins with the same five colours as the rest of  */
/* the site — and by any document generator sharing these variables.  */
/* ================================================================== */

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

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
  border: 1px solid var(--color4);
  border-radius: 5px;
  background: transparent;
  color: var(--color4) !important;
  text-decoration: none !important;
  font-weight: 700;
  min-height: 44px;          /* touch target */
  line-height: 1.6;
}

.btn:hover { background: var(--color3); filter: none; }

/* The global `a { color: !important }` rule outranks a plain colour
   here, so the filled button restates its own at the same weight or the
   label renders invisible against the fill. */
.btn-primary,
.btn-primary:link,
.btn-primary:visited,
.btn-primary:hover,
.btn-primary:active {
  background: var(--color4);
  color: var(--color1) !important;
  border-color: var(--color4);
}

/* ---- Catalog grid ---- */

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color3);
  border-radius: 5px;
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
  box-shadow: 3px 3px 3px var(--accent);
  transform: translateY(-2px);
}

.product-card a { text-decoration: none !important; }
.product-card a:hover { filter: none; }

.product-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color3);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: none;
  display: block;
}

.product-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  font-weight: 700;
  color: var(--color4);
  opacity: 0.35;
}

.product-card-title { margin: 0.6rem 0.75rem 0.3rem; font-size: 1.05em; }

.product-card-blurb {
  margin: 0 0.75rem 0.5rem;
  font-size: 0.85em;
  color: var(--muted);
  flex: 1 0 auto;
}

.product-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin: auto 0.75rem 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color3);
}

/* ---- Price and availability ---- */

.price { font-weight: 700; font-size: 1.1em; color: var(--color4); }
.price-quote { font-size: 0.9em; font-weight: 500; }
.price-note { font-size: 0.75em; color: var(--muted); display: block; }

.availability {
  font-size: 0.75em;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.availability-stock { color: var(--ok); }
.availability-order { color: var(--color4); }
.availability-out   { color: var(--danger); }

/* ---- Product page ---- */

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 900px) {
  .product-layout { grid-template-columns: 3fr 2fr; align-items: start; gap: 1.5rem; }
  .product-gallery { grid-column: 1; }
  .product-panel   { grid-column: 2; position: sticky; top: 1rem; }
  .product-body    { grid-column: 1 / -1; }
}

.product-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.product-gallery figure { margin: 0; }
.product-gallery img { width: 100%; border-radius: 5px; display: block; }
.product-gallery .primary { grid-column: 1 / -1; }

.product-panel {
  border: 1px solid var(--color3);
  border-radius: 5px;
  padding: 1rem;
}

.product-panel .price { font-size: 1.5em; }
.product-panel .btn { width: 100%; text-align: center; }
.product-sku { font-size: 0.75em; color: var(--muted); margin-top: 0.75rem; }

.spec-table { width: 100%; margin: 0.5rem 0 1.5rem; }
.spec-table th { text-align: left; width: 40%; }

.material-list { columns: 2; margin: 0.5rem 0 1.5rem; }
@media (max-width: 599px) { .material-list { columns: 1; } }

.catalog-group { margin: 1.5rem 0 0.5rem; }

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed var(--color3);
  border-radius: 5px;
  color: var(--muted);
}

.breadcrumbs { font-size: 0.8em; margin: 0.5rem 0; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { display: inline; }
.breadcrumbs li + li::before { content: " / "; opacity: 0.6; }

/* Keyboard users land here first; invisible until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  padding: 0.75rem 1rem;
  background: var(--color4);
  color: var(--color1) !important;
  z-index: 200;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .product-card:hover { transform: none; }
}

@media print {
  .skip-link, nav, .nav-toggle-label, .btn { display: none !important; }
}

/* ================================================================== */
/* HEADER BANNER AND SHORTCODES                                        */
/* ================================================================== */

/* The header logo (static/images/banner.svg or .png). Not a photo, so
   no accent shadow, and no link underline. Size it per site in
   brand.css with .banner img { height: … }. */
.header-bar a.banner, .header-bar a.banner:hover {
  text-decoration: none !important;
  filter: none;
  display: inline-block;
}
.header-bar img { box-shadow: none; max-width: 100%; height: auto; }

/* {{< business >}} — contact details */
.business-card {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem;
  padding: 1rem 1.25rem; margin: 1rem 0;
  background: var(--paper); border: 1px solid var(--color3); border-radius: 8px;
}
.business-card dt { font-weight: 600; color: var(--muted); }
.business-card dd { margin: 0; }

/* {{< shot >}} and {{< shots >}} — screenshots and photos in the text.
   Never upscaled past the image's own width; side by side from 700px. */
.shot { margin: 1rem 0 1.5rem; }
.shot img {
  max-width: 100%; width: auto; margin: 0 auto; display: block;
  border: 1px solid var(--color3); border-radius: 6px; box-shadow: none;
}
.shot figcaption { font-size: 0.82em; color: var(--muted); margin: 0.45rem 0 0; text-align: center; }
.shots { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1rem 0 1.5rem; align-items: start; }
.shots .shot { margin: 0; }
@media (min-width: 700px) { .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
