/* widgets.css V2.1 */
/* V2.1 - 2026-09-19, Jackie. `SYS-29` - 8 raw corners -> `var(--r-*)`.
   Of them: 4 pixel-identical, 3 moved 1px, 1 moved 2px.
   The map in `tools/css-radius.mjs` is now EMPTY, so a new raw corner here is
   no longer a number to raise - it is an unrecorded file. Mapped by that
   tool's own SCALE/NEAREST tables, never by eye; measured before and after on
   every visible element of all 26 pages. */
/*
   ============================================================================
   HOCKEY365 — EDITABLE HUB

   Zones, breakpoints and card anatomy carried from Shared/Widgets/Shared
   Widget CSS.txt. Colours are re-expressed in our tokens (the live app's
   --bg-elevated / --accent-primary / --text-muted are FileMaker-era names), so
   the hub themes correctly and passes contrast in BOTH themes.

   THE CONTRAST RULE APPLIES HERE: anything a member must read uses --muted or
   brighter. --faint is decoration only. The live app puts widget meta text on
   --text-muted at 11px, which measured 3.9:1 — it is --muted here.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   ZONES — a 2-column grid with a full-width hero and a full-width footer.
   Verbatim from the live grid-template-areas.
   ------------------------------------------------------------------------ */
.h-zones {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "hero hero"
    "left right"
    "footer footer";
  gap: 14px;
}
.h-zone { display: flex; flex-direction: column; gap: 14px; align-self: start; position: relative; min-height: 1px; }
.h-zone--hero   { grid-area: hero; }
.h-zone--left   { grid-area: left; }
.h-zone--right  { grid-area: right; }
.h-zone--footer { grid-area: footer; }

/* One column on a phone. The saved mobile config already puts everything in
   hero, but a member who drags on a tablet and then opens their phone must
   still see every card. */
@media (max-width: 640px) {
  .h-zones {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hero" "left" "right" "footer";
    gap: 10px;
  }
  .h-zone { gap: 10px; }
}

/* ---------------------------------------------------------------------------
   SECTION
   A "widget" on this surface is a SECTION of the prototype's Home, not a card.
   The prototype draws an uppercase label, an optional green action link, and
   then the component itself — which brings its own surface (.h-na is a tinted
   panel, .h-qact tiles are panels, .h-post is a card). So the default section
   has NO chrome of its own; wrapping those in a second panel would double
   every border. `--plain` is the normal case and the panel is the exception.
   ------------------------------------------------------------------------ */
.h-widget {
  display: flex; flex-direction: column; gap: 8px;
  position: relative; min-width: 0;
}
.h-widget > .h-wsec { margin: 0; }
.h-widget[hidden] { display: none !important; }

/* Sections that need their own panel (none today — kept because the moment a
   section has no self-surfacing component it will). */
.h-widget:not(.h-widget--plain):not(:has(.h-na)) {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px;
}

.h-widget__body { font-size: 14px; color: var(--ink); line-height: 1.45; min-width: 0; }

.h-widget__empty { color: var(--muted); font-size: 14px; padding: 10px 0 4px; }
.h-widget__empty-cta {
  display: inline-block; margin-top: 6px;
  color: var(--green); font-size: 13px; font-weight: 600;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.h-widget__empty-cta:hover { text-decoration: underline; }

/* The count beside a section label. */
.h-widget__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px; margin-left: 6px;
  border-radius: var(--r-sm);
  background: var(--warn-solid); color: var(--on-warn);
  font-size: 10px; font-weight: 800; letter-spacing: 0;
}

/* ---------------------------------------------------------------------------
   EDIT MODE
   ------------------------------------------------------------------------ */
/* No title of its own — the page already says "Hey Karl / your home" right
   above. The bar is the Edit home pill, pushed right, and it becomes the
   editing headline + actions once you are in edit mode. */
.h-hub__bar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap; margin: 2px 0 4px;
}
/* On a phone the editing headline and four buttons cannot share a row — the
   text collapses to one word per line. Give the headline a full row of its own
   and let the actions wrap underneath. */
.h-hub__bar-text { display: none; flex: 1 1 100%; min-width: 0; flex-direction: column; gap: 2px; }
.h-hub.is-editing .h-hub__bar { justify-content: flex-start; }
.h-hub.is-editing .h-hub__bar-actions { flex: 1 1 100%; justify-content: flex-end; }
.h-hub.is-editing .h-hub__bar-text { display: flex; }
.h-hub.is-editing .h-hub__bar-title { display: none; }
.h-hub__bar-primary   { font-size: 20px; font-weight: 700; color: var(--green); line-height: 1.1; }
.h-hub__bar-secondary { font-size: 12px; font-weight: 500; color: var(--muted); }
@media (max-width: 480px) {
  .h-hub__bar-primary { font-size: 17px; }
  .h-hub__bar-secondary { font-size: 11px; }
}

.h-hub__bar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.h-hub.is-editing .h-hub__edit { display: none; }
.h-hub:not(.is-editing) .h-hub__editing-only { display: none; }

/* Cards become draggable objects. The dashed outline is the live app's. */
.h-hub.is-editing .h-widget {
  border: 2px dashed var(--green);
  border-radius: var(--r-lg);
  padding: 10px;
  cursor: grab;
  touch-action: none;              /* the pointer drag owns the gesture */
}
.h-hub.is-editing .h-widget:active { cursor: grabbing; }
.h-hub.is-editing .h-widget.is-hidden { opacity: 0.42; }

/* A hidden widget stays IN PLACE while editing so you can see where restoring
   puts it back. This is the visible half of the v3 fix. */
.h-widget.is-hidden .h-widget__body { display: none; }
.h-widget.is-hidden .h-wsec__link { display: none; }
.h-widget__hidden-note {
  display: none;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.h-hub.is-editing .h-widget.is-hidden .h-widget__hidden-note { display: block; }

.h-widget__tools {
  display: none;
  position: absolute; top: 8px; right: 8px;
  gap: 4px; align-items: center;
  background: var(--bg); border-radius: var(--r-sm); padding: 2px;
}
.h-hub.is-editing .h-widget__tools { display: flex; }
.h-widget__tool {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel); color: var(--ink);
  cursor: pointer; padding: 0;
}
.h-widget__tool:hover { border-color: var(--green); color: var(--green); }
.h-widget__tool .h-ic { width: 15px; height: 15px; }

/* Drag feedback. */
.h-widget.is-dragging { opacity: 0.35; }
.h-widget.is-placeholder {
  border: 2px dashed var(--green);
  background: color-mix(in srgb, var(--green) 8%, transparent);
  min-height: 56px;
}
.h-hub.is-dragging .h-zone::after {
  content: 'Drop here';
  display: flex; align-items: center; justify-content: center;
  min-height: 60px; margin-top: 4px;
  border: 2px dashed var(--green); border-radius: var(--r-md);
  color: var(--green);
  font-size: 12px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
  background: color-mix(in srgb, var(--green) 6%, transparent);
  pointer-events: none;
  opacity: 0.85;
}
@media (max-width: 480px) {
  .h-hub.is-dragging .h-zone::after { min-height: 48px; }
}

/* ---------------------------------------------------------------------------
   HIDDEN LIST
   The live app renders this from the DOM, so after a reload it shows raw keys.
   Ours is driven by the registry via the API, so the names are always real.
   It doubles as the "add a widget" panel the live app never had: with v3 a
   widget is either placed or hidden — it can no longer be simply missing.
   ------------------------------------------------------------------------ */
.h-hidden-panel {
  display: none;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px;
}
.h-hub.is-editing.is-showing-hidden .h-hidden-panel { display: block; }
.h-hidden-panel__title {
  font-size: 11px; text-transform: uppercase; font-weight: 700;
  letter-spacing: 1.2px; color: var(--muted); margin-bottom: 4px;
}
.h-hidden-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 0;
  border: 0; border-bottom: 1px solid var(--line); background: none;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.h-hidden-item:last-child { border-bottom: 0; }
.h-hidden-item:hover { color: var(--green); }
.h-hidden-item__restore { font-size: 12px; font-weight: 700; color: var(--green); flex: 0 0 auto; }

/* The pill on the live surface that says some cards are hidden. */
.h-hidden-pill {
  display: none; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 6px 12px;
  font-size: 12px; color: var(--ink); cursor: pointer; flex-shrink: 0;
}
.h-hidden-pill.has-hidden { display: inline-flex; }
.h-hub.is-editing .h-hidden-pill { display: none; }
.h-hidden-pill:hover { border-color: var(--green); }
.h-hidden-pill__count { color: var(--green); font-weight: 800; }
.h-hidden-pill__label { color: var(--muted); }

/* ---------------------------------------------------------------------------
   PRO TEASER — carried from the live upgrade-pro card.
   ------------------------------------------------------------------------ */
.h-pro { display: flex; flex-direction: column; gap: 8px; }
.h-pro__eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted);
}
.h-pro__line { font-size: 14px; color: var(--ink); }
.h-pro__cta { align-self: flex-start; }
.h-pro__joined { font-size: 13px; color: var(--green); font-weight: 600; }

/* ---------------------------------------------------------------------------
   MOTION — obeys the site switch (data-motion="off") and the OS setting.
   ------------------------------------------------------------------------ */
.h-widget { transition: border-color 0.15s ease, opacity 0.15s ease; }
@media (prefers-reduced-motion: reduce) {
  .h-widget { transition: none; }
}
html[data-motion="off"] .h-widget { transition: none; }
