/**
 * Idioms & Collocations Hub
 *
 * Loaded after core/_base.css, core/_hub-shared.css and hubs/hub-topic.css.
 *
 * The shell / sidebar / card / chip rules below are adapted from
 * hubs/biology-hub.css, which owns the same pattern for the biology hub. They
 * are duplicated rather than shared because extracting a common partial would
 * mean editing a live page's stylesheet; the intended cleanup is to promote
 * this block and biology's into core/_hub-cards.css once both are stable.
 *
 * Per the special-page background contract, this file sets no body background.
 */

body.idioms-collocations-hub-page {
    --idmhub-line: #ddd2c3;
    --idmhub-muted: #76675b;
    --idmhub-brown: #8b6244;
    --idmhub-orange: #d97816;
}

/* ---------- Shell ---------- */

body.idioms-collocations-hub-page main.idmhub-shell {
    display: grid;
    width: 100%;
    max-width: none;
    margin: 0;
    grid-template-columns: 250px minmax(0, 1fr) 300px;
    align-items: stretch;
    border: 1px solid var(--idmhub-line);
    background: #fff;
}

body.idioms-collocations-hub-page .idmhub-left,
body.idioms-collocations-hub-page .idmhub-right {
    padding: 18px 18px 28px;
    background: #fbf9f5;
}

body.idioms-collocations-hub-page .idmhub-left { border-right: 1px solid var(--idmhub-line); }
body.idioms-collocations-hub-page .idmhub-right { border-left: 1px solid var(--idmhub-line); }
body.idioms-collocations-hub-page .idmhub-main { min-width: 0; padding: 18px 22px 38px; }

body.idioms-collocations-hub-page .idmhub-sidebar-section + .idmhub-sidebar-section {
    margin-top: 1.55rem;
}

body.idioms-collocations-hub-page .idmhub-panel-title {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--idmhub-line);
    color: var(--idmhub-brown);
    font-size: 1.02rem;
    font-weight: 850;
}

/* ---------- Left sidebar: contents ---------- */

body.idioms-collocations-hub-page .idmhub-overview-link {
    display: block;
    margin: 0 0 1rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid var(--idmhub-line);
    color: #3d3028;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

body.idioms-collocations-hub-page .idmhub-overview-link::before {
    margin-right: 0.38rem;
    color: var(--idmhub-brown);
    content: "\2302";
}

body.idioms-collocations-hub-page .idmhub-toc { display: grid; gap: 1.15rem; }

body.idioms-collocations-hub-page .idmhub-toc-section__title {
    margin: 0 0 0.32rem;
    padding: 0 0 0.38rem;
    border-bottom: 1px solid var(--idmhub-line);
    color: var(--idmhub-accent, var(--idmhub-brown));
    font-size: 0.84rem;
    font-weight: 850;
    line-height: 1.35;
}

body.idioms-collocations-hub-page .idmhub-toc-list {
    display: grid;
    gap: 0.12rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.idioms-collocations-hub-page .idmhub-toc-link {
    display: block;
    padding: 0.34rem 0;
    color: #4f4339;
    font-size: 0.86rem;
    line-height: 1.45;
    text-decoration: none;
}

body.idioms-collocations-hub-page .idmhub-toc-link:hover,
body.idioms-collocations-hub-page .idmhub-toc-link:focus-visible,
body.idioms-collocations-hub-page .idmhub-overview-link:hover,
body.idioms-collocations-hub-page .idmhub-overview-link:focus-visible {
    color: var(--idmhub-brown);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

/* ---------- Main sections ---------- */

body.idioms-collocations-hub-page .idmhub-section { margin-top: 26px; }

body.idioms-collocations-hub-page .idmhub-section__head { margin-bottom: 12px; }

body.idioms-collocations-hub-page .idmhub-section__head h2 {
    margin: 0;
    color: #3c2d23;
    font-size: 1.32rem;
    line-height: 1.35;
}

body.idioms-collocations-hub-page .idmhub-section__head p {
    margin: 6px 0 0;
    color: var(--idmhub-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

/* Twelve cards need more than a fixed 2-column rule, and the shell already
   consumes 550px of chrome, so the grid tracks its CONTAINER via auto-fill
   rather than viewport media queries. */
body.idioms-collocations-hub-page .idmhub-grid--themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 12px;
}

body.idioms-collocations-hub-page .idmhub-grid--types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* ---------- Card ---------- */

body.idioms-collocations-hub-page .idmhub-card {
    min-width: 0;
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--idmhub-line);
    border-top: 6px solid var(--idmhub-accent, var(--idmhub-brown));
    border-radius: 12px;
    background: var(--idmhub-bg, #fbf9f5);
    color: inherit;
}

body.idioms-collocations-hub-page .idmhub-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

body.idioms-collocations-hub-page .idmhub-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border: 0;
    border-radius: 4px;
    background: #eee8e2;
    color: var(--idmhub-accent, var(--idmhub-brown));
    font-size: 0.7rem;
    font-weight: 800;
}

body.idioms-collocations-hub-page .idmhub-count {
    color: var(--idmhub-accent, var(--idmhub-brown));
    font-size: 0.78rem;
    font-weight: 850;
}

body.idioms-collocations-hub-page .idmhub-card h3 {
    margin: 0;
    color: #3c2d23;
    font-size: 1.08rem;
    line-height: 1.35;
}

body.idioms-collocations-hub-page .idmhub-card p {
    margin: 7px 0 0;
    color: var(--idmhub-muted);
    font-size: 0.87rem;
    line-height: 1.6;
}

/* ---------- Chips (deep links into the destination page) ---------- */

body.idioms-collocations-hub-page .idmhub-page-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

body.idioms-collocations-hub-page .idmhub-page-link {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid #ddcfc2;
    border-radius: 999px;
    background: #fff;
    color: #56463a;
    font-size: 0.77rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 1px 2px rgba(60, 45, 35, 0.12),
        0 2px 5px rgba(60, 45, 35, 0.08);
    font-weight: 750;
    line-height: 1.35;
    text-decoration: none;
}

body.idioms-collocations-hub-page .idmhub-page-link:hover,
body.idioms-collocations-hub-page .idmhub-page-link:focus-visible {
    border-color: var(--idmhub-accent, var(--idmhub-brown));
    background: var(--idmhub-accent, var(--idmhub-brown));
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 2px 4px rgba(60, 45, 35, 0.2),
        0 4px 9px rgba(60, 45, 35, 0.12);
    text-decoration: none;
}

body.idioms-collocations-hub-page .idmhub-chip-count {
    margin-left: 7px;
    padding-left: 7px;
    border-left: 1px solid currentColor;
    color: inherit;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ---------- Card action: the labelled "large button" ---------- */

body.idioms-collocations-hub-page .idmhub-card-action {
    display: inline-block;
    margin-top: 13px;
    color: var(--idmhub-accent, var(--idmhub-brown));
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

body.idioms-collocations-hub-page a.idmhub-card-action:hover,
body.idioms-collocations-hub-page a.idmhub-card-action:focus-visible {
    color: var(--idmhub-orange);
    text-decoration: underline;
}

/* ---------- Index band ---------- */

/* ---------- 共通 А–Я 表現索引 (preview band) ----------
 *
 * A preview of /idioms-collocations-index/, so the control band here must
 * look the same as the one that page renders. Those rules live in
 * glossaries/idioms-collocations-index.css under .idmx-* names and are
 * duplicated here for the same reason the card block above is: the two pages
 * never load each other's stylesheet. Keep the pair in step.
 */

body.idioms-collocations-hub-page .idmhub-shared-index {
    margin-top: 28px;
    padding: 18px;
    border: 1px solid #d7c9b9;
    border-radius: 12px;
    background: #fffdf9;
}

body.idioms-collocations-hub-page .idmhub-shared-index__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e4dbcf;
}

body.idioms-collocations-hub-page .idmhub-shared-index__head h2 {
    margin: 0;
    color: #3c2d23;
    font-size: 1.28rem;
    line-height: 1.35;
}

body.idioms-collocations-hub-page .idmhub-shared-index__head p {
    max-width: 720px;
    margin: 6px 0 0;
    color: var(--idmhub-muted);
    font-size: 0.86rem;
    line-height: 1.68;
}

body.idioms-collocations-hub-page .idmhub-index-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.62rem 0.9rem;
    border: 1px solid #9a7b5c;
    border-radius: 8px;
    background: #9a7b5c;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

body.idioms-collocations-hub-page .idmhub-index-action:hover,
body.idioms-collocations-hub-page .idmhub-index-action:focus-visible {
    border-color: #7d6048;
    background: #7d6048;
    color: #fff;
}

body.idioms-collocations-hub-page .idmhub-index-controls {
    display: grid;
    gap: 13px;
    padding: 15px 0 12px;
}

body.idioms-collocations-hub-page .idmhub-index-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

body.idioms-collocations-hub-page .idmhub-index-label {
    padding-top: 6px;
    color: #5d4d41;
    font-size: 0.76rem;
    font-weight: 850;
}

body.idioms-collocations-hub-page .idmhub-index-filters,
body.idioms-collocations-hub-page .idmhub-index-legend,
body.idioms-collocations-hub-page .idmhub-index-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.idioms-collocations-hub-page .idmhub-index-filter,
body.idioms-collocations-hub-page .idmhub-index-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid #d8cbbc;
    border-radius: 999px;
    background: #fff;
    color: #5a4a3e;
    font-size: 0.73rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

body.idioms-collocations-hub-page a.idmhub-index-filter:hover,
body.idioms-collocations-hub-page a.idmhub-index-filter:focus-visible,
body.idioms-collocations-hub-page a.idmhub-index-letter:hover,
body.idioms-collocations-hub-page a.idmhub-index-letter:focus-visible {
    border-color: #9a7b5c;
    background: #f7f1e9;
    color: #3c2d23;
}

body.idioms-collocations-hub-page .idmhub-index-filter.is-active,
body.idioms-collocations-hub-page .idmhub-index-letter.is-active {
    border-color: #5f7f78;
    background: #5f7f78;
    color: #fff;
}

body.idioms-collocations-hub-page a.idmhub-index-filter.is-active:hover,
body.idioms-collocations-hub-page a.idmhub-index-letter.is-active:hover {
    border-color: #4d6a64;
    background: #4d6a64;
    color: #fff;
}

body.idioms-collocations-hub-page .idmhub-index-filter__count {
    font-size: 0.68rem;
    font-weight: 750;
    opacity: 0.72;
}

body.idioms-collocations-hub-page .idmhub-index-filter.is-pending {
    border-style: dashed;
    color: #8a7a6e;
    pointer-events: none;
}

body.idioms-collocations-hub-page .idmhub-index-letter.is-disabled {
    opacity: 0.34;
    pointer-events: none;
}

body.idioms-collocations-hub-page .idmhub-index-key {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 27px;
    padding: 3px 7px;
    border: 1px solid #e1d7ca;
    border-radius: 6px;
    background: #fff;
    color: #65574c;
    font-size: 0.69rem;
    line-height: 1.2;
}

body.idioms-collocations-hub-page .idmhub-index-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--idmhub-marker, rgba(0, 0, 0, 0.18));
}

body.idioms-collocations-hub-page .idmhub-index-preview {
    padding-top: 13px;
    border-top: 1px solid #e4dbcf;
}

body.idioms-collocations-hub-page .idmhub-index-preview__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

body.idioms-collocations-hub-page .idmhub-index-preview__head h3 {
    margin: 0;
    color: var(--idmhub-orange);
    font-size: 1.04rem;
}

body.idioms-collocations-hub-page .idmhub-index-preview__head span {
    color: var(--idmhub-muted);
    font-size: 0.72rem;
}

body.idioms-collocations-hub-page .idmhub-index-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
}

body.idioms-collocations-hub-page .idmhub-index-entry {
    display: block;
    min-width: 0;
    padding: 8px 0 9px;
    border-bottom: 1px solid #ece5dc;
    color: inherit;
    text-decoration: none;
}

body.idioms-collocations-hub-page a.idmhub-index-entry:hover .idmhub-index-entry__mn,
body.idioms-collocations-hub-page a.idmhub-index-entry:focus-visible .idmhub-index-entry__mn {
    text-decoration: underline;
}

body.idioms-collocations-hub-page .idmhub-index-entry__top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    line-height: 1.45;
}

body.idioms-collocations-hub-page .idmhub-index-entry__mn {
    color: #34291f;
    font-size: 0.82rem;
    font-weight: 850;
}

body.idioms-collocations-hub-page .idmhub-index-entry__jp {
    color: #65574c;
    font-size: 0.75rem;
}

body.idioms-collocations-hub-page .idmhub-index-entry__markers {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

body.idioms-collocations-hub-page .idmhub-index-entry__en {
    display: block;
    margin-top: 3px;
    color: #9a8d82;
    font-size: 0.68rem;
    line-height: 1.42;
}

body.idioms-collocations-hub-page .idmhub-index-entry__type {
    display: inline-flex;
    margin-top: 5px;
    padding: 2px 6px;
    border: 1px solid #ddd2c5;
    border-radius: 999px;
    color: #77685c;
    font-size: 0.62rem;
    font-weight: 750;
}

/* ---------- Right sidebar ---------- */

body.idioms-collocations-hub-page .idmhub-side-list { display: grid; gap: 0.6rem; }

body.idioms-collocations-hub-page .idmhub-info-card,
body.idioms-collocations-hub-page .idmhub-side-link {
    display: block;
    padding: 0.7rem 0.72rem;
    border: 1px solid var(--idmhub-line);
    border-left: 3px solid var(--idmhub-brown);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

body.idioms-collocations-hub-page .idmhub-info-card strong,
body.idioms-collocations-hub-page .idmhub-side-link strong {
    display: block;
    color: #3d3028;
    font-size: 0.86rem;
    line-height: 1.4;
}

body.idioms-collocations-hub-page .idmhub-info-card small,
body.idioms-collocations-hub-page .idmhub-side-link small {
    display: block;
    margin-top: 0.16rem;
    color: var(--idmhub-muted);
    font-size: 0.73rem;
    line-height: 1.5;
}

body.idioms-collocations-hub-page .idmhub-side-link:hover strong,
body.idioms-collocations-hub-page .idmhub-side-link:focus-visible strong {
    color: var(--idmhub-brown);
    text-decoration: underline;
}

/* ---------- Focus ---------- */

body.idioms-collocations-hub-page .idmhub-page-link:focus-visible,
body.idioms-collocations-hub-page .idmhub-card-action:focus-visible,
body.idioms-collocations-hub-page .idmhub-toc-link:focus-visible,
body.idioms-collocations-hub-page .idmhub-side-link:focus-visible,
body.idioms-collocations-hub-page .idmhub-index-action:focus-visible {
    outline: 2px solid rgba(217, 120, 22, 0.55);
    outline-offset: 3px;
}

/* ---------- Responsive: same collapse order as the other topic hubs ---------- */

@media (max-width: 1180px) {
    body.idioms-collocations-hub-page main.idmhub-shell { grid-template-columns: 250px minmax(0, 1fr); }
    body.idioms-collocations-hub-page .idmhub-right {
        grid-column: 1 / -1;
        border-top: 1px solid var(--idmhub-line);
        border-left: 0;
    }
    body.idioms-collocations-hub-page .idmhub-index-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    body.idioms-collocations-hub-page main.idmhub-shell { grid-template-columns: 1fr; }
    body.idioms-collocations-hub-page .idmhub-main { order: 1; }
    body.idioms-collocations-hub-page .idmhub-left {
        order: 2;
        border-top: 1px solid var(--idmhub-line);
        border-right: 0;
    }
    body.idioms-collocations-hub-page .idmhub-right { order: 3; }
}

@media (max-width: 760px) {
    body.idioms-collocations-hub-page .idmhub-shared-index__head,
    body.idioms-collocations-hub-page .idmhub-index-row { grid-template-columns: 1fr; }
    body.idioms-collocations-hub-page .idmhub-index-label { padding-top: 0; }
    body.idioms-collocations-hub-page .idmhub-index-results { grid-template-columns: 1fr; }
    body.idioms-collocations-hub-page .idmhub-index-action { width: 100%; }
    body.idioms-collocations-hub-page .idmhub-left,
    body.idioms-collocations-hub-page .idmhub-right,
    body.idioms-collocations-hub-page .idmhub-main { padding-right: 14px; padding-left: 14px; }
}
