/**
 * Hub Category Page Styles
 *
 * Used by: general-hub, stem-hub, humanities-hub, society-hub.
 * Renders page-directory-style hub pages: hero + featured + sectioned card grid.
 *
 * Sets --hub-cat accent via inline style on <main>.
 * Base layout provided by infographics/_base.css (.infographic-layout).
 */

/* =========================================================
   HUB HERO
   ========================================================= */

.hub-cat-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: end;
    padding: 2.75rem 0 2.25rem;
    border-bottom: 1px solid var(--line-gray, #dcd1c3);
    margin-bottom: 2.5rem;
}

.hub-cat-hero__eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--hub-cat, var(--wood-orange, #e07a00));
    margin-bottom: 0.9rem;
}

.hub-cat-hero__eyebrow::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    flex-shrink: 0;
    background: var(--hub-cat, var(--wood-orange, #e07a00));
}

.hub-cat-hero__title-jp {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark, #3b2411);
    line-height: 1.15;
}

.hub-cat-hero__title-mn {
    font-size: 1rem;
    color: var(--ink-soft, #5a4943);
    font-weight: 400;
    margin-top: 0.3rem;
}

.hub-cat-hero__desc {
    font-size: 0.875rem;
    color: var(--ink-soft, #5a4943);
    max-width: 560px;
    line-height: 1.75;
    margin-top: 0.9rem;
}

/* Stats panel */
.hub-cat-hero__stats {
    display: flex;
    gap: 1.75rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid var(--line-gray, #dcd1c3);
    border-radius: var(--radius-main, 12px);
    border-top: 3px solid var(--hub-cat, var(--wood-orange, #e07a00));
    align-self: start;
    flex-shrink: 0;
}

.hub-cat-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.hub-cat-stat__num {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--hub-cat, var(--wood-orange, #e07a00));
}

.hub-cat-stat__label {
    font-size: 0.62rem;
    color: var(--ink-soft, #5a4943);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    white-space: nowrap;
}

/* =========================================================
   MAIN CATEGORY NAV (4 buttons)
   ========================================================= */

.hub-cat-page {
    --hub-page-max: 1800px;
    --hub-content-max: 1500px;
    --hub-nav-max: 980px;
    max-width: var(--hub-page-max);
    width: min(100%, var(--hub-page-max));
}

.hub-cat-hero,
.hub-cat-section-heading,
.hub-cat-overview-grid,
.hub-cat-featured-grid,
.hub-cat-grid {
    max-width: var(--hub-content-max);
    margin-left: auto;
    margin-right: auto;
}

.hub-cat-nav {
    display: none !important;
    max-width: var(--hub-nav-max);
    margin: 0 auto 2rem;
}

.hub-cat-nav .category-grid {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0;
    grid-template-columns: 1fr;
}

.hub-cat-nav .hub-cat-tabs {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line-gray, #dcd1c3);
}

@media (min-width: 500px) {
    .hub-cat-nav .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 781px) {
    .hub-cat-nav .category-grid { grid-template-columns: repeat(4, 1fr); }
}

.hub-cat-nav .category-grid a {
    display: block;
    padding: 0.85rem 0.9rem;
    border-radius: 10px 10px 8px 8px;
    border: 1px solid var(--line-gray, #e0e0e0);
    border-bottom-width: 3px;
    background: #fdfcf9;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark, #333);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.hub-cat-nav .category-grid a:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    color: var(--text-dark, #333);
}

.hub-cat-nav .category-grid a:nth-child(1) { background-color: var(--cat-general-bg); border-color: var(--cat-general-border); }
.hub-cat-nav .category-grid a:nth-child(2) { background-color: var(--cat-stem-bg); border-color: var(--cat-stem-border); }
.hub-cat-nav .category-grid a:nth-child(3) { background-color: var(--cat-humanities-bg); border-color: var(--cat-humanities-border); }
.hub-cat-nav .category-grid a:nth-child(4) { background-color: var(--cat-society-bg); border-color: var(--cat-society-border); }

.hub-cat-nav .category-grid a.is-muted {
    opacity: 0.5;
    filter: grayscale(0.45) saturate(0.75);
}

.hub-cat-nav .category-grid a.is-muted:hover {
    opacity: 0.75;
}

.hub-cat-nav .category-grid a.is-active {
    opacity: 1;
    filter: none;
    border-bottom-color: var(--hub-cat, var(--wood-orange, #e07a00));
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   SECTION HEADING
   ========================================================= */

.hub-cat-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2.5rem 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--hub-cat, var(--wood-orange, #e07a00));
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dark, #3b2411);
}

.hub-cat-section-heading__icon { font-size: 1rem; }

/* =========================================================
   FEATURED CARDS (gradient)
   ========================================================= */

.hub-cat-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.hub-cat-feat {
    background: var(--hub-cat, var(--wood-orange, #e07a00));
    color: #fff;
    border-radius: var(--radius-main, 12px);
    padding: 20px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hub-cat-feat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    color: #fff;
}

/* Progressively darker tints for cards 2-4 */
.hub-cat-feat:nth-child(2) { filter: brightness(0.88); }
.hub-cat-feat:nth-child(3) { filter: brightness(0.76); }
.hub-cat-feat:nth-child(4) { filter: brightness(0.64); }

.hub-cat-feat__icon  { font-size: 2rem; }
.hub-cat-feat__jp    { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.hub-cat-feat__mn    { font-size: 0.75rem; opacity: 0.85; }

.hub-cat-feat__badge {
    align-self: flex-start;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.22);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================================
   PAGE CARD GRID
   ========================================================= */

.hub-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
}

/* =========================================================
   PAGE CARDS
   ========================================================= */

.hub-cat-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--line-gray, #dcd1c3);
    border-radius: var(--radius-main, 12px);
    border-top: 3px solid var(--hub-cat, var(--wood-orange, #e07a00));
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.hub-cat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 36, 17, 0.1);
    border-color: var(--hub-cat, var(--wood-orange, #e07a00));
    color: inherit;
}

.hub-cat-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.hub-cat-card__badges { display: flex; gap: 4px; flex-wrap: wrap; }

.hub-cat-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hub-cat-badge--glossary           { background: #e5f2e5; color: #2e7d32; }
.hub-cat-badge--card-infographic   { background: #e3ecf8; color: #1565c0; }
.hub-cat-badge--visual-infographic { background: #f0e5f8; color: #6a1b9a; }

.hub-cat-card__icon { font-size: 1.35rem; flex-shrink: 0; }

.hub-cat-card__jp {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark, #3b2411);
    margin-bottom: 3px;
    line-height: 1.3;
}

.hub-cat-card__mn {
    font-size: 0.78rem;
    color: var(--ink-soft, #5a4943);
    margin-bottom: 7px;
}

.hub-cat-card__desc {
    font-size: 0.76rem;
    color: var(--ink-soft, #5a4943);
    line-height: 1.55;
    flex: 1;
}

.hub-cat-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft, #e8e2d8);
}

.hub-cat-card__count {
    font-size: 0.7rem;
    color: var(--ink-soft, #5a4943);
}

.hub-cat-card__arrow {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--hub-cat, var(--wood-orange, #e07a00));
}

/* =========================================================
   OVERVIEW CARDS  (General hub: links to the 3 sub-hubs)
   ========================================================= */

.hub-cat-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hub-cat-overview-card {
    background: #fff;
    border: 1px solid var(--line-gray, #dcd1c3);
    border-left: 4px solid var(--ov-color, var(--wood-orange, #e07a00));
    border-radius: var(--radius-main, 12px);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hub-cat-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.hub-cat-overview-card__icon  { font-size: 1.75rem; margin-bottom: 8px; }
.hub-cat-overview-card__jp    { font-size: 0.95rem; font-weight: 700; color: var(--text-dark, #3b2411); margin-bottom: 2px; }
.hub-cat-overview-card__mn    { font-size: 0.75rem; color: var(--ink-soft, #5a4943); margin-bottom: 8px; }

.hub-cat-overview-card__count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ov-color, var(--wood-orange, #e07a00));
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    .hub-cat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .hub-cat-hero       { grid-template-columns: 1fr; }
    .hub-cat-hero__stats { justify-content: flex-start; align-self: auto; }
    .hub-cat-overview-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .hub-cat-grid         { grid-template-columns: 1fr; }
    .hub-cat-overview-grid { grid-template-columns: 1fr; }
    .hub-cat-featured-grid { grid-template-columns: repeat(2, 1fr); }
    .hub-cat-hero__title-jp { font-size: 1.5rem; }
    .hub-cat-hero__stats  { flex-wrap: wrap; gap: 1rem; }
    .hub-cat-stat__num    { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .hub-cat-featured-grid { grid-template-columns: 1fr; }
    .hub-cat-hero__stats   { padding: 1rem; }
}

/* =========================================================
   PRINT
   ========================================================= */

@media print {
    .hub-cat-card  { page-break-inside: avoid; break-inside: avoid; }
    .hub-cat-feat  { background: #f5f5f5 !important; color: var(--text-dark) !important; filter: none; }
    .hub-cat-feat__badge { background: #ddd !important; color: #333 !important; }
}