/* ============================================================
   GEM — Contributor Portal (page-scoped: portal.html +
   portal-submit.html only). Stage-1 PREVIEW: no auth, no
   storage — these styles only dress the honest placeholder.
   Compat rules as everywhere: no :has(), no inset shorthand,
   no flex gap (margins instead).
   ============================================================ */

/* Login row: a visibly non-functional "coming soon" gate, mirroring the
   site's existing planned-item pattern (lang-switcher "Coming soon" pill). */
.portal-login {
  display: flex;
  align-items: center;
  margin: 1.75rem 0 0;
}
.portal-login__btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.portal-login__tag {
  display: inline-block;
  margin-left: 0.6rem;   /* margin, not flex gap */
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--purple-deep);
  background: var(--white);
  border: 1px solid var(--gold);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}
.portal-cta { margin: 1.5rem 0 0; }
.portal-cta .btn { min-height: 44px; }
.portal-notice { margin-top: 1.75rem; }

/* --- portal-submit.html: prototype form extras. The live YouTube
   thumbnail reuses the education-library media recipe (education.css
   is linked on that page): fixed 16:9 zone + play badge = no layout
   shift when the preview appears. --- */
.portal-yt-preview { max-width: 420px; margin-top: 0.75rem; }
.portal-yt-preview .edu-card__media { margin-bottom: 0.4rem; }
.portal-yt-preview__caption { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
/* REMOVED Aug 2026 at client request — served only the Example guidance block
   commented out in portal-submit.html; retained for restore.
.portal-example { margin-top: 2rem; }
*/


/* --- Input comfort pass (2026-08). ROOT CAUSE: the shared form rule styles
   input[type=text]/[email]/textarea/select but NOT [url] or [file], so the
   portal's URL boxes and file picker fell back to ~177x21px browser defaults.
   Page-scoped mirror of the shared recipe + an on-brand file control. --- */
#portal-form input[type="url"] {
  display: block;
  width: 100%;
  min-height: 46px;
  font-family: var(--font-body);
  font-size: 1rem;                       /* >=16px - no mobile zoom */
  color: var(--text);
  background: var(--white);
  border: 2px solid var(--text-muted);   /* same recipe as shared text inputs */
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
}
#portal-form input[type="url"]:focus { border-color: var(--purple); }

#portal-form input[type="file"] {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 0.5rem 0.6rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  border: 2px dashed rgba(58, 42, 102, 0.35);
  border-radius: var(--radius);
  cursor: pointer;
}
/* CUSTOM FILE PICKER (2026-08): the .portal-filebox rules MOVED to styles.css
   when the member story form adopted the same picker (that page does not load
   this sheet; same precedent as the .portal-tabs move - the class names keep
   their historical portal- prefix). Only the portal-specific Remove control
   stays here, further down. */

/* Generous, consistent breathing room between fields. */
#portal-form .field { margin-bottom: 1.75rem; }

/* --- Type hierarchy pass (2026-08), #portal-form scope only. Before: step
   legends 17px / labels 17px - indistinguishable. Now a clear 3-level scale:
   1) step/section headings dominant serif purple-deep,
   2) field labels medium purple,
   3) helper text small muted; input text stays >=16px. --- */
#portal-form .field__legend,
#portal-form .field-group__title {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 2.2vw, 1.45rem);   /* ~20-23px, clearly dominant */
  font-weight: 700;
  color: var(--purple-deep);
}
#portal-form .field-group__title { margin-bottom: 0.9rem; }
#portal-form .field > label {
  font-size: 1.02rem;                          /* medium tier */
  font-weight: 600;
  color: var(--purple);
}
#portal-form .field__hint {
  font-size: 0.88rem;                          /* smallest tier, warm grey */
  line-height: 1.5;
  color: var(--text-muted);
}

/* --- Preview placeholders (2026-08): soft dashed frames, visible EMPTY from
   the moment a media type is chosen; states are explicit TEXT (never color
   alone) and fill in place with reserved space = no layout shift. The old
   .portal-yt-preview rules above are now inert (markup replaced). --- */
.portal-preview {
  /* Both states occupy the SAME grid cell; the hidden one keeps its box via
     visibility (not display) - the frame is always sized to the taller state,
     so empty <-> filled can never shift layout, at any width. */
  display: grid;
  align-items: center;
  min-height: 76px;
  margin-top: 0.5rem;
  border: 2px dashed rgba(58, 42, 102, 0.32);
  border-radius: var(--radius);
  background: rgba(247, 244, 251, 0.55);
}
.portal-preview > .portal-preview__empty,
.portal-preview > .portal-preview__ready { grid-row: 1; grid-column: 1; }
.portal-preview > .portal-preview__empty[hidden] { display: block; visibility: hidden; }
.portal-preview > .portal-preview__ready[hidden] { display: flex; visibility: hidden; }
.portal-preview.is-filled {
  border-style: solid;                   /* same 2px - zero shift */
  border-color: rgba(58, 42, 102, 0.18);
  background: var(--white);
}
.portal-preview__empty {
  flex: 1 1 auto;
  max-width: none;    /* defeats inherited prose width caps - full frame width */
  margin: 0;
  padding: 1rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.portal-preview__ready {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 1rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--purple-deep);
  word-break: break-word;
}
.portal-preview__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: 0.7rem;                  /* margin, not flex gap */
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--purple);
}
.portal-preview__icon svg { width: 18px; height: 18px; }
/* Cap the confirmed text at 2 lines (ellipsis) so a long filename/URL can
   never grow the frame past the placeholder height - the full value stays
   visible in the input itself. */
.portal-preview__ready > span:last-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.portal-preview__note { margin-top: 0.4rem; }

/* NOTE (2026-08): the TAB rules that used to live here moved to styles.css
   when the patient member page adopted the same tablist - styles.css is the
   stylesheet both pages already load, so there is one copy, not two. The
   class names keep their .portal-* prefix: renaming them would mean editing
   the contributor portal's markup, which the patient-page task's scope lock
   forbids. Worth a rename to a neutral prefix in a later pass. */

/* "Remove file" (2026-08): quiet 44px text control - words, not a symbol;
   same quiet-control recipe as the member views' text buttons. It sits
   INSIDE the picker box, right-aligned beside the file name (margin-left:
   auto), and wraps below the name at narrow widths - never leaving the box.
   Visible only while a file is chosen (never for a typed link). The
   explicit [hidden] rule is load-bearing: the display value below would
   otherwise override the UA's [hidden] { display: none }. */
.portal-remove-file {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;   /* rises above the custom picker's invisible input overlay */
  z-index: 1;
  min-height: 44px;
  padding: 0.2rem 0.3rem;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.portal-remove-file:hover { color: var(--purple-deep); }
.portal-remove-file:focus-visible {
  outline: 3px solid var(--purple-bright);
  outline-offset: 2px;
  border-radius: 6px;
}
.portal-remove-file[hidden] { display: none; }

/* YouTube frame: reserved 16:9 so the thumbnail fills IN PLACE. */
.portal-preview--media {
  display: block;
  position: relative;
  padding-top: 56.25%;
  min-height: 0;
  max-width: 480px;
  overflow: hidden;
}
.portal-preview--media .portal-preview__empty {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;  /* longhand, not inset */
  display: grid;
  place-items: center;
  text-align: center;
}
.portal-preview__media {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
}
.portal-preview__media .edu-card__thumb {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* REMOVED Aug 2026 - the portal sits behind real authentication now, so the
   "Preview / Demo" badge is retired from portal-submit's banner. Rule kept
   commented for restore (auth.css still carries its own copy for the login
   pages' commented-out pill).
.demo-pill {
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--purple-deep);
  background: var(--white);
  border: 1px dashed var(--gold);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}
*/
