/*
 * corpus.css — the single design sheet for the morado.dev family.
 *
 * PRINCIPLE: the gospel needs no adornment. One file, copied into every app,
 * served at /corpus.css. CSS exists only to arrange the layout so content is
 * readable: monospace type, measure, spacing, block flow, image containment,
 * and the minimal show/hide an interactive control needs. No color, no
 * decoration, no emotion-engineering. Semantic HTML carries the meaning;
 * this sheet only positions it.
 */

* { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
  max-width: 72ch;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

img, video { max-width: 100%; height: auto; }

a { color: inherit; text-decoration: underline; }
a:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 1.5em 0 0.5em; }
h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }

p, ul, ol, blockquote, pre, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.4em; }

code, pre { font-family: inherit; }
pre { overflow-x: auto; padding: 0.75rem 0; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; opacity: 0.85; }

blockquote { margin-left: 1.5em; }

hr { border: none; border-top: 1px solid currentColor; opacity: 0.3; margin: 2.5rem 0; }

/* Uniform separation between major content blocks. */
.section-divider { border: none; border-top: 1px solid currentColor; opacity: 0.15; margin: 2rem 0; }
.section-divider span { font-size: 0.85em; opacity: 0.7; }

/* Footer carries all navigation, names, and links (no header anywhere). */
footer { margin-top: 3rem; }
footer nav, footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin: 0.3rem 0; }
footer .footer-mission { opacity: 0.7; margin: 1.25rem 0; }

/* Minimal functional form controls (layout only, monochrome). */
input, textarea, select {
  font-family: inherit; font-size: 1rem;
  width: 100%; padding: 0.5rem; margin-bottom: 0.75rem;
  border: 1px solid currentColor; background: transparent; color: inherit;
}
button {
  font-family: inherit; font-size: 1rem;
  padding: 0.5rem 1rem; margin-bottom: 0.75rem;
  border: 1px solid currentColor; background: transparent; color: inherit;
  cursor: pointer;
}

/* ── Blog: post list (homepage) ────────────────────────────────
   Titles read at near-full opacity so they pop; the supporting
   meta/excerpt stay faint. Separation comes from margin + hairline. */
.post-item {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid currentColor;
}
.post-item:last-child { border-bottom: none; }
.post-title {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  opacity: 0.95;
}
.post-meta { opacity: 0.2; font-size: 0.9em; margin-bottom: 0.6rem; }
.post-excerpt { opacity: 0.35; }
.empty { opacity: 0.7; }

/* ── Shop: product grid (two columns, half-size items) ───────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
.card { display: block; }
.card-img { display: block; }
.card-img img { display: block; width: 100%; height: auto; }
.card-body { display: block; }
.card-title { font-weight: 600; }
.color-dots { margin-top: 0.5rem; }
.color-dot { display: inline-block; width: 12px; height: 12px; border: 1px solid currentColor; }
.color-dot-more { font-size: 0.85em; }

/* Quick-add: functional show/hide only (no color). */
.qa-toggle { cursor: pointer; font-family: inherit; font-size: 1rem; border: 1px solid currentColor; background: transparent; color: inherit; padding: 0.25rem 0.6rem; }
.quick-add { display: none; margin-top: 0.5rem; }
.card.qa-open .quick-add { display: block; }
.quick-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.quick-size-btn { font-family: inherit; font-size: 0.9rem; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; padding: 0.3rem 0.6rem; }

/* Product detail: two columns on wide screens, stacked on narrow. */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.product-images { display: flex; flex-direction: column; gap: 0.5rem; }
.main-img img, .thumb img { width: 100%; height: auto; display: block; }
.thumbs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.thumb { width: 60px; cursor: pointer; border: 1px solid currentColor; }
.options { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.opt-select { font-family: inherit; font-size: 1rem; border: 1px solid currentColor; background: transparent; color: inherit; padding: 0.4rem; }

/* Cart + checkout: simple block layout. */
.cart-item { display: flex; gap: 1rem; align-items: center; border-top: 1px solid currentColor; padding: 1rem 0; }
.cart-item-img { width: 70px; flex-shrink: 0; }
.cart-item-img img { width: 100%; height: auto; display: block; }
.item-controls { margin-left: auto; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.qty { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn, .remove-btn { font-family: inherit; font-size: 0.95rem; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; padding: 0.2rem 0.5rem; }
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.field label { font-size: 0.85em; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-top: 1px solid currentColor; }

/* Pager. */
.product-pager { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid currentColor; margin-top: 2rem; padding-top: 1rem; }

/* Responsive stacking. */
@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
  .product, .checkout-grid { grid-template-columns: 1fr; }
}
