/* PublishMe18 standard page foundation.
   Every new page starts from this file (see docs/PAGE-STANDARD.md).
   Load order: nav.css, theme.css, pm18-ui.css. Body class: "pm18-theme pm18-page".

   Rules baked in:
   - Fixed rows and columns. Text WRAPS onto a new line; nothing is cut off,
     nothing scrolls inside a card. The page is the only scroller.
   - Column widths come in steps of 15 characters: 15, 30, 45 (a --pm18-step
     is 15ch). A column's MINIMUM is its step count x 15ch, so names never
     break into one or three letters per line; content fits in 2-3 lines.
   - One picture per row.
   - The left edge is a strip a finger can always reach (.pm18-leftzone). */

:root {
  --pm18-step: 15ch;       /* one column step: 15 characters */
  --pm18-icon: 40px;       /* one icon size everywhere */
  --pm18-gap: 8px;
  --pm18-indent: 33px;     /* tree child indent: 14 margin + 1 guide + 18 padding */
  --pm18-fs-row: 14px;
  --pm18-fs-head: 15px;
  --pm18-fs-col: 12px;
  --pm18-card-indent: 16px;
  --pm18-leftzone: 14px;   /* always-reachable left strip at 100% zoom */
}

/* ---- page ---- */
.pm18-page { margin: 0; padding: 16px; }
.pm18-page .pm18-page-body {
  box-sizing: border-box; max-width: 1100px; margin: 0 auto;
  font-family: var(--pm18-font-ui, system-ui, sans-serif); color: var(--pm18-ink);
}
.pm18-page h1, .pm18-page h2 { margin: 0 0 4px; font-size: 22px; }
.pm18-page .pm18-note { margin: 0 0 12px; color: var(--pm18-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

/* ---- left scroll zone: a finger can always land here and scroll the page ---- */
.pm18-leftzone {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--pm18-leftzone);
  z-index: 800; touch-action: pan-y pan-x;
  border-right: 1px dotted var(--pm18-line); background: transparent;
}

/* ---- pills (view / sort / zoom buttons) ---- */
.pm18-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.pm18-pill {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--pm18-line);
  background: var(--pm18-surface); color: var(--pm18-ink); font: inherit; font-weight: 600; cursor: pointer;
}
.pm18-pill.is-on { background: var(--pm18-accent); color: #fff; border-color: var(--pm18-accent); }
.pm18-pill-sm { padding: 6px 12px; font-weight: 400; }

/* ---- navigational links ---- */
.pm18-link { color: var(--pm18-accent); text-decoration: none; overflow-wrap: anywhere; }
.pm18-link:hover { text-decoration: underline; }
.pm18-linklist { list-style: none; margin: 4px 0 0; padding: 0 0 0 16px; display: grid; gap: 6px; }
.pm18-linklist a { color: var(--pm18-ink); text-decoration: none; overflow-wrap: anywhere; }
.pm18-linklist a:hover { color: var(--pm18-accent); text-decoration: underline; }

/* ---- tree: group header + indented children under a dotted guide ---- */
.pm18-tree-group { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 16px 0 6px; }
.pm18-tree-group > .pm18-tree-title { font-weight: 800; font-size: var(--pm18-fs-head); min-width: 0; overflow-wrap: anywhere; }
.pm18-tree-expander {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 6px; padding: 0;
  border: 1px solid var(--pm18-line); background: var(--pm18-surface); color: var(--pm18-ink);
  font-size: 19px; font-weight: 800; line-height: 1; cursor: pointer;
}
.pm18-tree-children { margin-left: 14px; border-left: 1px dotted var(--pm18-line); padding-left: 18px; }

/* ---- columns: widths in 15-character steps ----
   .pm18-cols is one row (or the heading row). Each cell takes a width class:
     .pm18-col-icon  44px picture or % column
     .pm18-col-1     min 15 characters  (grows 1fr)
     .pm18-col-2     min 30 characters  (grows 2fr)
     .pm18-col-3     min 45 characters  (grows 3fr)
   Set the template per table with .pm18-cols-t1 / -t2 variables, or pass an
   inline grid-template-columns built from the same minmax() values. */
.pm18-cols {
  display: grid; gap: var(--pm18-gap); align-items: flex-start;
  padding: 8px 0; border-bottom: 1px dotted var(--pm18-line);
  grid-template-columns: 44px minmax(var(--pm18-step), 1.5fr) minmax(calc(var(--pm18-step) * 2), 2fr) minmax(var(--pm18-step), 1.5fr) 44px;
}
.pm18-cols-head {
  padding: 6px 0; border-bottom: 2px solid var(--pm18-line); font-weight: 800; color: var(--pm18-muted);
  text-transform: uppercase; letter-spacing: .5px; font-size: var(--pm18-fs-col); align-items: flex-end;
}
.pm18-cols > * { min-width: 0; overflow-wrap: break-word; word-break: normal; line-height: 1.3; font-size: var(--pm18-fs-row); }
.pm18-cols .pm18-col-num { text-align: right; font-weight: 800; }
.pm18-cols .pm18-col-strong { font-weight: 600; }
.pm18-cols .pm18-col-muted { color: var(--pm18-muted); }
.pm18-cols img.pm18-pic, .pm18-pic {
  width: var(--pm18-icon); height: var(--pm18-icon); object-fit: cover; border-radius: 10px; border: 1px solid var(--pm18-line);
}
.pm18-pic-ph {
  width: var(--pm18-icon); height: var(--pm18-icon); border-radius: 10px; border: 1px solid var(--pm18-line);
  background: var(--pm18-paper-2); color: var(--pm18-muted); display: flex; align-items: center; justify-content: center; font-weight: 800;
}

/* ---- Card view: a beer is up to three lines: brewery, then (indented) picture + name + %, then beer type ---- */
.pm18-card-body { margin-left: var(--pm18-card-indent); padding-left: 12px; border-left: 2px dotted var(--hatch-widget-border, #d6cfc2); }
.pm18-card-flat { margin-left: 0; padding-left: 0; border-left: 0; }
.pm18-card-beer { display: flex; align-items: center; gap: 10px; }
.pm18-card-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.pm18-card-abv { flex: 0 0 auto; margin-left: auto; font-weight: 800; text-align: right; }
.pm18-card-type { margin-top: 6px; padding-left: calc(var(--pm18-icon) + 10px); } /* lines up with the beer name */

/* ---- Card view reference header: a sample card drawn as boxes, same lines as a real card ---- */
.pm18-cardref { border: 1px dashed var(--hatch-widget-border, #d6cfc2); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; background: transparent; }
.pm18-cardref-title { font-size: var(--pm18-fs-col); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--hatch-widget-muted, #777); margin-bottom: 6px; }
.pm18-cardref-line { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pm18-cardref-line.pm18-card-indent { margin-left: var(--pm18-card-indent); padding-left: 12px; border-left: 2px dotted var(--hatch-widget-border, #d6cfc2); }
.pm18-ref-pic { flex: 0 0 64px; text-align: center; padding-left: 0; padding-right: 0; }
.pm18-ref-under .pm18-ref-box { margin-left: 72px; } /* 64px picture box + 8px gap: lines up with the beer name box */
.pm18-ref-box { box-sizing: border-box; border: 1px solid var(--hatch-widget-border, #d6cfc2); border-radius: 8px; padding: 4px 8px; font-size: var(--pm18-fs-col); font-weight: 600; background: var(--hatch-widget-surface, #fff); }
.pm18-ref-grow { flex: 1 1 auto; }
.pm18-cardref-note { font-size: var(--pm18-fs-col); color: var(--hatch-widget-muted, #777); }

/* ---- Collections: structured data (Mongo documents, JSON, HTML lists) is shown with collection tags, never <table> ---- */
.pm18-collection { display: block; }  /* wrapper for one collection; data-collection="name" */
.pm18-item { display: grid; }          /* one document / record in a collection (rows use .pm18-cols) */
