/*##############################################################################
# Script:        portals.css         (stylesheet, loaded by frontend/pages/portals.html and the /portals/<name> landing page)
# Created by:    Matthew Boucher
# Start date:    2026-10-01
# Location:      <project root>/frontend/css/portals.css   (main script: <project root>/aiacolyte.py; subscripts: <project root>/subscripts/aiacolyte/)
# Description:   The look of the Portals section on top of styles.css and admin.css: the home page's ambient
#                wizard backdrop on the Portals pages (body.portals-body, a fixed dimmed layer), the splash
#                page's grid of hosted-site cards (each a link to its /portals/<name> landing page, with a title,
#                a short description and its address), the small address chips, and the landing page itself (a
#                centred card with the title, description and a Visit button). Works with the main script, which
#                serves it as /static/css/portals.css; aiacolyte.py --checkup confirms it is in place.
# Reads:         the tokens and classes of styles.css and admin.css; ../assets/img/ambient.webp (the ambient backdrop)
# Writes:        nothing
# Sensitive:     none needed
# Arguments:     none (a stylesheet cannot take flags)
##############################################################################*/

/* the Portals pages carry the home page's ambient wizard backdrop (a fixed layer behind the content),
   dimmed by a dark overlay so the cards and text stay readable */
body.portals-body {
  background: var(--ink-0);
}

body.portals-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 8, 7, 0.82) 0%, rgba(10, 8, 7, 0.9) 55%, var(--ink-0) 100%),
    url("../assets/img/ambient.webp") center top / cover no-repeat;
}

/* a monospace chip for an address such as /portals/<name> */
.portals-path {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--gold-bright);
  white-space: nowrap;
}

/* ---------- the splash: a grid of hosted-site cards ---------- */
.portals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 18px 0 8px;
}

.portals-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(43, 39, 102, 0.2), transparent 60%), linear-gradient(180deg, #1b1612, #120f0c);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

.portals-card:hover {
  transform: translateY(-3px);
  border-color: rgba(246, 216, 139, 0.5);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(227, 176, 75, 0.12);
}

.portals-card__link {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 20px 20px 18px;
  color: var(--text);
  text-decoration: none;
}

.portals-card__thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, rgba(246, 216, 139, 0.14), rgba(0, 0, 0, 0.25));
  overflow: hidden;
}

.portals-card__thumb > * { grid-area: 1 / 1; }

.portals-card__icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}

.portals-card__thumb.has-icon { background: #f4ecd8; border-color: rgba(246, 216, 139, 0.5); }
.portals-card__thumb.has-icon .portals-card__icon { opacity: 1; }
.portals-card__thumb.has-icon .portals-card__glyph { display: none; }

.portals-card__glyph {
  font-size: 1.6rem;
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(227, 176, 75, 0.6);
}

.portals-card__title {
  font-size: 1.25rem;
  color: var(--parchment);
}

.portals-card__desc {
  color: var(--text-dim);
}

.portals-card__path {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--arcane);
  overflow-wrap: anywhere;
}

.portals-card__actions {
  padding: 0 20px 16px;
}

/* ---------- the landing page: /portals/<name> ---------- */
.portal-landing {
  text-align: center;
}

.portal-landing h1 {
  margin-top: 14px;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--parchment);
}

.portal-landing__desc {
  max-width: 52ch;
  margin: 14px auto 0;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.portal-landing__actions {
  margin-top: 28px;
}

.portal-landing__host {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.portal-landing .admin-note {
  margin-top: 26px;
}

.portal-landing .admin-note a {
  color: var(--gold);
  text-decoration: none;
}

.portal-landing .admin-note a:hover {
  color: var(--gold-bright);
}

/* ---------- a hosted site shown inside the page (/portals/<name>) ---------- */
.portal-frame-body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink, #110e0b);
}

.portal-framebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  background: #15110d;
  flex: 0 0 auto;
}

.portal-framebar .btn { padding: 6px 14px; font-size: 0.95rem; white-space: nowrap; }

.portal-framebar__title {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--parchment);
  font-family: var(--font-display, inherit);
}

.portal-framebar__eyebrow {
  margin-right: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.portal-frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #fff;
}

.portal-back { margin: 0 0 14px; }

@media (max-width: 600px) {
  .portal-framebar__eyebrow, .portal-framebar__open { display: none; }
}

/*##############################################################################
# End of portals.css
##############################################################################*/
