/* The homepage feed. One picture at a time, xkcd-style: title above, picture,
   caption, plain controls below. Paints only from design-system tokens so the
   theme switcher works; the pictures themselves are dark captures and sit in a
   dark frame in both themes. */

.feed {
    max-width: 880px;
    margin: 0 auto;
    padding: 96px 16px 48px;
    text-align: center;
}

.feed-head h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.feed-sub {
    margin: 0 0 20px;
    color: var(--text-secondary);
}

.feed-themes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.feed-chip {
    font: inherit;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: var(--surface-1);
    color: var(--text-secondary);
    cursor: pointer;
}

.feed-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }

.feed-chip[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent);
}

.feed-panel {
    border: 1px solid var(--border-default);
    background: var(--surface-1);
    border-radius: 14px;
    padding: 20px 20px 16px;
}

.feed-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--text-primary);
}

.feed-figure {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1014; /* the captures are dark; frame them the same in both themes */
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    touch-action: pan-y;
}

.feed-figure img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.feed-figure:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.feed-course-art { display: none; }

.feed-panel.is-course .feed-figure img { display: none; }

.feed-panel.is-course .feed-course-art {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #e8edf5;
}

.feed-course-num {
    font-size: clamp(5rem, 18vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: #3d8bff;
}

.feed-course-unit { font-size: 1.1rem; opacity: 0.8; }

.feed-caption {
    margin: 14px auto 12px;
    max-width: 60ch;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.feed-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.feed-controls button,
.feed-open {
    font: inherit;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--bg-base);
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
}

.feed-controls button:hover { border-color: var(--border-strong); }

.feed-open {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent);
}

.feed-open:hover { background: var(--accent-hover); }

.feed-count {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.feed-foot {
    margin-top: 28px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feed-foot p { margin: 6px 0; }

.feed-foot a { color: var(--text-accent); }

.feed-memory { font-size: 0.85rem; color: var(--text-tertiary); }

.feed-memory button {
    font: inherit;
    background: none;
    border: 0;
    padding: 0;
    color: var(--text-accent);
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 560px) {
    .feed { padding-top: 84px; }
    .feed-panel { padding: 14px 12px 12px; }
    .feed-controls button { padding: 8px 10px; }
    .feed-open { flex-basis: 100%; }
}
