/**
 * Hub Page Styles
 * Page-specific styles (base styles in _base.css)
 *
 * Reusable styles for domain/category hub pages in the Itako dictionary.
 * Hub pages aggregate related terms with thematic organization and navigation.
 */

/* ========================================
   Hub Page Headings
   ======================================== */

.hub-page .dict-main h2 {
    color: var(--ink-soft, #5a4943);
}

/* ========================================
   Hub Hero Section
   ======================================== */

.hub-hero {
    background: linear-gradient(120deg, rgba(224, 122, 0, 0.08), rgba(212, 175, 55, 0.12));
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 16px;
    padding: 2rem;
    display: grid;
    gap: 1rem;
}

.hub-hero__title {
    margin: 0;
    color: var(--text-dark, #3b2411);
}

.hub-eyebrow {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-novel, #d77b18);
    font-size: 0.85rem;
}

.hub-lead {
    margin: 0;
    color: var(--ink-soft, #5a4943);
    font-size: 1rem;
    line-height: 1.6;
}

.hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ========================================
   Featured Terms Grid
   ======================================== */

.feature-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-card {
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    background: #fffdf9;
    display: grid;
    gap: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    border-color: var(--wood-orange, #e07a00);
    box-shadow: 0 2px 8px rgba(224, 122, 0, 0.1);
}

.feature-card h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wood-dark, #6b4423);
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.feature-meta {
    font-size: 0.85rem;
    color: #777;
    font-style: italic;
}

.feature-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

/* ========================================
   Subcategory Accordion
   ======================================== */

.subcategory-accordion {
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    background: #fff;
    overflow: hidden;
}

.subcategory-label {
    list-style: none;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    background-color: #fbfbfb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--wood-dark, #6b4423);
    transition: background-color 0.2s ease;
}

.subcategory-label:hover {
    background-color: #f5f5f5;
}

.subcategory-label::after {
    content: '+';
    font-weight: 300;
    font-size: 1.5rem;
    color: #999;
    transition: transform 0.2s ease, color 0.2s ease;
}

.subcategory-accordion[open] .subcategory-label::after {
    content: '−';
    color: var(--wood-orange, #e07a00);
}

.subcategory-content {
    padding: 1.25rem;
    background: #fff;
}

/* Category Introduction Box */
.category-intro {
    margin: 0 0 1rem 0;
    padding: 0.75rem 1rem;
    background: #fffaf5;
    border-left: 3px solid var(--wood-orange, #e07a00);
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}

/* ========================================
   Theme List (Term Links)
   ======================================== */

.theme-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: grid;
    gap: 0.4rem;
}

.theme-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px dashed #eee;
}

.theme-list li:last-child {
    border-bottom: none;
}

.theme-list a {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark, #333);
    text-decoration: none;
    transition: color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.theme-list a:hover {
    color: var(--wood-orange, #e07a00);
    text-decoration: underline;
}

.theme-note {
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
    font-style: italic;
}

/* View All Link */
.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--wood-orange, #e07a00);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.view-all-link:hover {
    background: #c96900;
}

/* ========================================
   Sidebar Panels
   ======================================== */

.hub-page .dict-right {
    min-width: 0;
    overflow: hidden;
}

.hub-panel {
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.hub-panel h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
    color: var(--text-dark, #3b2411);
}

.hub-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.hub-panel li a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line-gray, #e0e0e0);
    color: var(--text-dark, #333);
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.hub-panel li a:hover {
    border-color: var(--wood-orange, #e07a00);
    background-color: #fffaf5;
}

/* Right Sidebar Cards */
.hub-right-card {
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
    margin-bottom: 1.5rem;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hub-right-card h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem 0;
    color: var(--text-dark, #3b2411);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hub-right-card p,
.hub-right-card .theme-note,
.hub-right-card div {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hub-right-card * {
    max-width: 100%;
    box-sizing: border-box;
}

.hub-right-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hub-right-card li {
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hub-right-card li:last-child {
    margin-bottom: 0;
}

.hub-right-card a {
    color: var(--wood-orange, #e07a00);
    text-decoration: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: inline-block;
    max-width: 100%;
}

.hub-right-card a:hover {
    text-decoration: underline;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 980px) {
    .hub-hero {
        padding: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .subcategory-label {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }

    .theme-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .theme-note {
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .hub-hero {
        padding: 1.25rem;
        gap: 0.75rem;
    }

    .hub-eyebrow {
        font-size: 0.8rem;
    }

    .hub-lead {
        font-size: 0.95rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .view-all-link {
        font-size: 0.85rem;
        padding: 0.45rem 0.875rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .hub-panel,
    .hub-right-card {
        break-inside: avoid;
    }

    .subcategory-accordion {
        border: 1px solid #ccc;
    }

    .subcategory-label::after {
        display: none;
    }

    .view-all-link {
        display: none;
    }
}
