/* ============================================================
   Forum section (home page): one chamfered panel. On the left a faint
   looping clip (desktop only); on the right the categories, the latest topics and
   the buttons. Shares the Technology backdrop and tokens (css/tech.css).
   ============================================================ */

.fs-hero {
    --cut: 26px;
    padding: 1px;
    background: var(--tk-edge);
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    text-align: left;
}

.fs-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(0, 1.2fr);
    gap: 24px;
    /* As tall as its contents; the section (a viewport tall, newindex.css)
       keeps the next section below the fold. */
    background:
        radial-gradient(ellipse at 22% 70%, rgba(168, 85, 247, 0.16) 0%, rgba(0, 0, 0, 0) 55%),
        linear-gradient(160deg, var(--tk-card) 0%, var(--tk-card-2) 100%);
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    overflow: hidden;
}

/* Corner ticks, as on the Company panel. */
.fs-hero-inner::before,
.fs-hero-inner::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 0 solid rgba(160, 190, 255, 0.45);
    pointer-events: none;
    z-index: 3;
}

.fs-hero-inner::before {
    top: 10px;
    right: 10px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.fs-hero-inner::after {
    bottom: 10px;
    left: 10px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

/* The space left of the text column, filled by the clip. */
.fs-figure {
    position: relative;
    align-self: stretch;
    min-height: 440px;
    overflow: hidden;
    /* Reach across the 24px grid gap to the text column. */
    margin-right: -24px;
}

/* The clip, in full colour (no tint or blend). It covers the cell, so the
   sides of the 16:9 video are cropped; the speaker sits in the middle of
   the visible part. It fades out only on the right, where it reaches across
   the gap under the text. */
.fs-bgvid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 51% 50%;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 78%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 78%, rgba(0, 0, 0, 0) 100%);
}

.fs-copy {
    display: grid;
    align-content: center;
    gap: 18px;
    padding: 28px 40px 26px 0;
}

/* The categories: a two-column grid of tiles in each category's colour. */
.fs-cats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

/* Six categories in three rows, plus a fourth Latest topic (60.5px), fill
   the room ten categories and three topics took: each tile is
   (263.55px of old grid - 60.5px - two 8px gaps) / 3. On one column (below)
   six rows give up the same 60.5px. */
.fs-cat a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    height: 62.35px;
    box-sizing: border-box;
    padding: 9px 16px;
    border: 1px solid var(--tk-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--tk-text);
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.fs-cat a:hover,
.fs-cat a:focus-visible {
    border-color: color-mix(in srgb, var(--c) 55%, transparent);
    background: color-mix(in srgb, var(--c) 9%, transparent);
    color: var(--tk-text);
    text-decoration: none;
    transform: translateY(-1px);
}

.fs-cat-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    color: var(--c);
    /* A touch above centre: level with the name rather than halfway
       between the name and its blurb. Nudged, so the tile does not move. */
    position: relative;
    top: -3px;
}

.fs-cat-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fs-cat-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.fs-cat-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.fs-cat-blurb {
    font-size: 0.8rem;
    line-height: 1.3;
    color: var(--tk-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fs-cat-name {
    font-size: 1.02rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fs-cat-count {
    font-size: 0.76rem;
    color: var(--tk-muted);
    white-space: nowrap;
}


/* Light mode: no purple wash. */
html[data-theme="light"] .fs-hero-inner {
    background: linear-gradient(160deg, var(--tk-card) 0%, var(--tk-card-2) 100%);
}

html[data-theme="light"] .fs-cat a {
    background: rgba(40, 50, 120, 0.03);
}

/* The latest three topics. */
.fs-live {
    border-top: 1px solid var(--tk-line);
    padding-top: 12px;
}

.fs-live-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.fs-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tk-muted);
}

.fs-skel {
    height: 241.94px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
}

/* Placeholders only ever show on a first visit (after that the last answer
   is painted from localStorage). They are the exact size of what replaces
   them, so the panel does not change height when it arrives: three rows of
   category tiles, and four topics. */
.fs-skel.fs-skel--cats {
    height: 203.03px;
}

.fs-topics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
}

.fs-topic a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 6px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--tk-text);
}

.fs-topic a:hover {
    background: rgba(255, 255, 255, 0.04);
}

.fs-av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

.fs-av--letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--tk-text);
    background: linear-gradient(140deg, #6b5fc7, #3b82f6);
}

.fs-topic-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.fs-topic-title {
    font-size: 0.92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fs-topic-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: var(--tk-muted);
}

.fs-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--c, #6b5fc7);
}

.fs-solved {
    color: #22c55e;
    font-weight: 600;
}

.fs-side {
    display: grid;
    justify-items: end;
    font-size: 0.72rem;
    color: var(--tk-muted);
    line-height: 1.2;
}

.fs-side strong {
    color: var(--tk-text);
    font-size: 0.9rem;
}

.fs-empty {
    margin: 0;
    color: var(--tk-muted);
    font-size: 0.86rem;
}

.fs-actions {
    justify-content: flex-start;
    gap: 12px;
}

.fs-actions .tk-btn {
    padding: 13px 28px;
    font-size: 1.24rem;
    border-radius: 10px;
}

@media (max-width: 900px) {
    .fs-hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Stacked, the empty space and the clip are left out: the clip is
       desktop only. */
    .fs-figure,
    .fs-bgvid {
        display: none;
    }

    .fs-cats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fs-copy {
        padding: 28px 22px 26px;
    }

    .fs-actions .tk-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 560px) {
    .fs-cats {
        grid-template-columns: minmax(0, 1fr);
    }

    /* (535.1px of old column - 60.5px - five 8px gaps) / 6 */
    .fs-cat a {
        height: 72.43px;
    }

    /* Six tiles in one column. */
    .fs-skel.fs-skel--cats {
        height: 474.53px;
    }
}
