/* GuestTopics.css -- the Topic Map (TLP-1164).
 *
 * Every value from design-tokens.css. The band colours are the platform's THREE
 * sentiment colours and nothing else: the tint for the fill, the solid for the
 * outline, and the hover variant for the label -- which is what the token file
 * itself calls "text on tint". No fourth colour language for one tab, and both
 * themes work because all three are redefined under dark mode already.
 *
 * All class names are gtopic- prefixed. No panel-fill rule: the one-panel rule
 * already promotes this tab's single panel, and a module must never restate it. */

.gtopic-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* The two days sit side by side where there is room and stack where there is not.
   The parent owns the space between them; neither figure carries a margin. */
.gtopic-maps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.gtopic-map-figure {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;                 /* <figure> ships a browser margin; the grid owns the gap */
    min-width: 0;
}

.gtopic-map-caption {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

/* The aspect ratio is fixed to the viewBox, so the SVG scales uniformly and the
   labels never stretch. */
.gtopic-map {
    width: 100%;
    aspect-ratio: 100 / 70;
    display: block;
}

.gtopic-map-missing {
    display: grid;
    place-items: center;
    aspect-ratio: 100 / 70;
    padding: var(--space-4);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
    background: var(--bg-muted);
    border: var(--border-width-1) dashed var(--border-default);
    border-radius: var(--radius-md);
}

/* ---- the tiles ---------------------------------------------------------- */

.gtopic-tile {
    stroke-width: 0.25;
    transition: opacity var(--dur-fast) ease;
}

.gtopic-tile--positive { fill: var(--color-success-light); stroke: var(--color-success); }
.gtopic-tile--neutral  { fill: var(--color-info-light);    stroke: var(--color-info); }
.gtopic-tile--negative { fill: var(--color-error-light);   stroke: var(--color-error); }
.gtopic-tile--none     { fill: var(--bg-muted);            stroke: var(--border-default); }

.gtopic-tile-name,
.gtopic-tile-share {
    pointer-events: none;      /* the group under them is the click target */
    fill: var(--text-secondary);
}

.gtopic-tile-name {
    font-size: 3px;            /* viewBox units: scales with the map, not the screen */
    font-weight: var(--font-weight-semibold);
}

.gtopic-tile-share {
    font-size: 2.6px;          /* viewBox units */
    fill: var(--text-muted);
}

.gtopic-tile-group.is-clickable { cursor: pointer; }
.gtopic-tile-group.is-clickable:hover .gtopic-tile { opacity: 0.75; }
.gtopic-tile-group.is-clickable:focus-visible {
    outline: var(--border-width-2) solid var(--border-focus);
    outline-offset: 1px;
}

/* ---- the legend --------------------------------------------------------- */

.gtopic-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.gtopic-legend-label { color: var(--text-secondary); }

.gtopic-legend-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.gtopic-legend-swatch {
    width: var(--space-3);
    height: var(--space-3);
    border-radius: var(--radius-sm);
    border-style: solid;
    border-width: var(--border-width-1);
    /* The band classes carry fill/stroke for SVG; the swatch is HTML, so it takes
       the same two tokens through background and border instead. */
}

.gtopic-legend-swatch.gtopic-tile--positive { background: var(--color-success-light); border-color: var(--color-success); }
.gtopic-legend-swatch.gtopic-tile--neutral  { background: var(--color-info-light);    border-color: var(--color-info); }
.gtopic-legend-swatch.gtopic-tile--negative { background: var(--color-error-light);   border-color: var(--color-error); }
.gtopic-legend-swatch.gtopic-tile--none     { background: var(--bg-muted);            border-color: var(--border-default); }

/* ---- the table ---------------------------------------------------------- */

.gtopic-mood {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.gtopic-move {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* More conversations about a subject is not good news and fewer is not bad news,
   so movement is coloured by DIRECTION and never by the status dictionary. */
.gtopic-move--up { color: var(--text-primary); }
.gtopic-move--down { color: var(--text-muted); }
.gtopic-move--new { color: var(--text-secondary); font-style: italic; }

/* ---- the drill ---------------------------------------------------------- */

.gtopic-drill-note {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.gtopic-drill-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.gtopic-drill-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3);
    background: var(--bg-surface);
    border: var(--border-width-1) solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.gtopic-drill-who {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.gtopic-drill-room,
.gtopic-drill-time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.gtopic-drill-said {
    font-size: var(--text-sm);
    color: var(--text-body);
}

@media (max-width: 900px) {
    .gtopic-maps { grid-template-columns: 1fr; }
}
