/* ============================================
 * Design-system tokens — shared across hub, packs, pack-card.
 * Values match the :root block in index.html.
 * ============================================ */
:root {
    /* Forest greens */
    --forest-800: #1a3a2a;
    --forest-700: #234d38;
    --forest-600: #2d5a3d;

    /* Cream / sand surfaces */
    --cream-50: #f5ede0;
    --cream-100: #fff8ec;
    --sand-100: #faf8f4;
    --sand-border: #e6d8bf;

    /* Accent */
    --ochre-600: #8c5a2b;

    /* Text */
    --text-secondary: #555;
    --text-muted: #666;
}

/* ============================================
 * Explorer Hub — landing view styles
 * Shown only when body.pack-hub-active
 * ============================================ */

.hub { display: none; }
body.pack-hub-active .hub { display: block; }

.hub-title {
    padding: 20px 20px 8px;
    max-width: 680px;
    margin: 0 auto;
}
.hub-title .greeting {
    font-size: 0.85rem;
    color: #6b6b6b;
    font-weight: 500;
}
.hub-pack-chip {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    background: var(--cream-100);
    border: 1px solid var(--sand-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--forest-700);
    letter-spacing: 0.01em;
}
.hub-pack-chip[hidden] { display: none; }
.hub-title h1 {
    font-family: 'Fraunces', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a3a2a;
    margin: 4px 0 0;
    line-height: 1.15;
}

/* Identify hero card */
.hub-identify {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #234d38, #3d7a5a);
    color: #fff;
    margin: 16px 20px 20px;
    max-width: 680px;
    padding: 20px;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(26,58,42,0.22);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
@media (min-width: 720px) { .hub-identify { margin: 16px auto 20px; } }
.hub-identify:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(26,58,42,0.28); }
.hub-identify:active { transform: translateY(0); }
.hub-identify .hub-camera {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.18);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}
.hub-identify .hub-identify-text { flex: 1; }
.hub-identify .hub-identify-title { font-weight: 700; font-size: 1.05rem; }
.hub-identify .hub-identify-sub { font-size: 0.85rem; opacity: 0.88; margin-top: 3px; }
.hub-identify .hub-chevron { font-size: 1.4rem; opacity: 0.65; }

/* Three moat chips */
.hub-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 20px 22px;
    max-width: 680px;
}
@media (min-width: 720px) { .hub-chips { margin: 0 auto 22px; } }
.hub-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e4e0d4;
    border-radius: 14px;
    padding: 14px 6px 12px;
    text-decoration: none;
    color: #1a3a2a;
    text-align: center;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.hub-chip:hover { background: #fafaf5; border-color: #c9c3b2; }
.hub-chip-icon { font-size: 1.5rem; margin-bottom: 6px; }
.hub-chip-title { font-weight: 600; font-size: 0.88rem; }
.hub-chip-sub { font-size: 0.72rem; color: #6b6b6b; margin-top: 2px; font-weight: 400; }

/* Community grid */
.hub-section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px 10px;
    max-width: 680px;
    margin: 0 auto;
}
.hub-section-label .hub-label-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #1a3a2a;
}
.hub-section-label .hub-see-all {
    font-size: 0.8rem;
    color: #6b6b6b;
    text-decoration: none;
    font-weight: 500;
}
.hub-see-all:hover { color: #1a3a2a; }
.hub-community-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 0 20px 8px;
    max-width: 680px;
    margin: 0 auto;
}
.hub-cell {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #e4e0d4;
    cursor: pointer;
    display: block;
    text-decoration: none;
    transition: transform 0.12s ease;
}
.hub-cell:hover { transform: scale(1.02); }
.hub-cell img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.hub-cell-pin {
    position: absolute;
    bottom: 4px; left: 4px; right: 4px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Media-type indicator (top-right) — ▶ for video, 🎵 for audio-only.
   Photo cells get no badge so the visual default stays clean. */
.hub-cell-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    pointer-events: none;
}

/* Verified tick (top-left) — community-IDs Phase 1. Forest green so it reads
   as "kagn-approved" and stays clear of the media-type badge on the right. */
.hub-cell-verified {
    position: absolute;
    top: 4px;
    left: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--forest-600, #2f7a52);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 2;
}
.hub-cell-loading {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #e8e3d5, #d6d0c0);
    animation: hub-shimmer 1.4s ease-in-out infinite;
}
/* Empty state retains the section's visual mass so a low-traffic pack
   doesn't look like a broken page. Spans the full grid and matches the
   cell aesthetic (sand background, 6px radius). */
.hub-empty {
    grid-column: 1/-1;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    text-align: center;
    color: #5a5345;
    font-size: 0.95rem;
    line-height: 1.4;
    background: #f4f0e6;
    border: 1px dashed #d0c8b4;
    border-radius: 6px;
}
@keyframes hub-shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Bottom nav */
.hub-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #e4e0d4;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}
.hub-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px;
    text-decoration: none;
    color: #888;
    font-size: 0.68rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.hub-tab.active { color: #1a3a2a; font-weight: 700; }
.hub-tab-icon { font-size: 1.25rem; line-height: 1; }

/* Narrow phones: keep labels readable when 5 tabs compete for width */
@media (max-width: 360px) {
    .hub-tab { font-size: 0.62rem; padding: 4px 2px; }
    .hub-tab-icon { font-size: 1.15rem; }
}

/* Mantis home button in header */
.hub-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    margin-right: 8px;
    cursor: pointer;
}
.hub-home-btn img {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: block;
}
body.pack-hub-active .hub-home-btn { display: none; }
