/* GDS Resource Hub
   ----------------------------------------------------------------
   Tier 1 (depth 0) = white tile, dark text, orange underline on items
   Tier 2 (depth 1) = blue (#066ed0) + left sliver of white (tier 1)
   Tier 3 (depth 2) = orange (#fd8202) + left sliver of blue (tier 2)
   ---------------------------------------------------------------- */

.gds-hub {
    --gds-hub-tile-bg: #f1f3f3;
    --gds-hub-tile-border: rgba(0, 0, 0, 0.08);
    --gds-hub-accent: #066ed0;
    --gds-hub-accent-orange: #fd8202;
    --gds-hub-tier2-bg: #066ed0;
    --gds-hub-tier3-bg: #fd8202;
    --gds-hub-text: #1a1a1a;
    --gds-hub-text-muted: #6b6b6b;
    --gds-hub-hover-bg: rgba(0, 0, 0, 0.04);
    --gds-hub-radius: 12px;
    --gds-hub-tile-height: 360px;
    --gds-hub-gap: 16px;
    --gds-hub-sliver-width: 24px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gds-hub-gap);
    color: var(--gds-hub-text);
    box-sizing: border-box;
}

/* Responsive: 4 → 3 → 2 → 1 columns */
@media (max-width: 1200px) {
    .gds-hub { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .gds-hub { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .gds-hub { grid-template-columns: 1fr; }
}

/* Tile shell
   ---------------------------------------------------------------- */
.gds-hub__tile {
    background: var(--gds-hub-tile-bg);
    border-radius: var(--gds-hub-radius);
    overflow: hidden;
    height: var(--gds-hub-tile-height);
    transition: box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.gds-hub__tile:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.gds-hub__stage {
    position: relative;
    flex: 1;
    overflow: hidden;
}

/* Panes — stacked absolutely so they can slide in/out of the tile.
   The sliver effect is created by adding left padding equal to the
   sliver width, then placing a pseudo-element with the previous
   tier's color in that gap.
   ---------------------------------------------------------------- */
.gds-hub__pane {
    position: absolute;
    inset: 0;
    background: var(--gds-hub-tile-bg);
    color: var(--gds-hub-text);
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    box-sizing: border-box;
}

/* Tier 2 (depth 1) — blue with a white sliver on the left */
.gds-hub__pane[data-depth="1"] {
    background: var(--gds-hub-tier2-bg);
    color: #ffffff;
    padding-left: var(--gds-hub-sliver-width);
}

.gds-hub__pane[data-depth="1"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--gds-hub-sliver-width);
    background: var(--gds-hub-tile-bg);
    border-right: 1px solid var(--gds-hub-tile-border);
    z-index: 1;
}

/* Tier 3 (depth 2) — orange with a blue sliver on the left */
.gds-hub__pane[data-depth="2"] {
    background: var(--gds-hub-tier3-bg);
    color: #ffffff;
    padding-left: var(--gds-hub-sliver-width);
}

.gds-hub__pane[data-depth="2"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--gds-hub-sliver-width);
    background: var(--gds-hub-tier2-bg);
    z-index: 1;
}

/* Initial hidden state (panes to the right of the active one). */
.gds-hub__pane.is-hidden {
    transform: translateX(100%);
    pointer-events: none;
}

/* Pane that has been drilled past — slides off to the left. */
.gds-hub__pane.is-exited {
    transform: translateX(-100%);
    pointer-events: none;
}

/* Pane header
   ---------------------------------------------------------------- */
.gds-hub__pane-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gds-hub-tile-border);
    flex-shrink: 0;
}

/* On colored panes the header border becomes a translucent white */
.gds-hub__pane[data-depth="1"] .gds-hub__pane-header,
.gds-hub__pane[data-depth="2"] .gds-hub__pane-header {
    border-bottom-color: rgba(255, 255, 255, 0.22);
}

/* Back button — absolutely positioned inside the sliver at the top
   so the caret sits aligned with the pane header.
   ---------------------------------------------------------------- */
.gds-hub__back {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--gds-hub-sliver-width);
    height: 44px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}

/* Tier 2 back button: sits in the white sliver, blue caret */
.gds-hub__pane[data-depth="1"] .gds-hub__back {
    color: var(--gds-hub-accent);
}

.gds-hub__pane[data-depth="1"] .gds-hub__back:hover,
.gds-hub__pane[data-depth="1"] .gds-hub__back:focus-visible {
    background: rgba(6, 110, 208, 0.08);
    outline: none;
}

/* Tier 3 back button: sits in the blue sliver, white caret */
.gds-hub__pane[data-depth="2"] .gds-hub__back {
    color: #ffffff;
}

.gds-hub__pane[data-depth="2"] .gds-hub__back:hover,
.gds-hub__pane[data-depth="2"] .gds-hub__back:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.gds-hub__pane-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: var(--gds-hub-accent);
    flex-shrink: 0;
}

.gds-hub__pane-icon:empty {
    display: none;
}

/* No icon space on tier 2/3 panes — title sits flush with the sliver. */
.gds-hub__pane[data-depth="1"] .gds-hub__pane-icon,
.gds-hub__pane[data-depth="2"] .gds-hub__pane-icon {
    display: none;
}

.gds-hub__pane-icon .gds-hub-icon {
    width: 100%;
    height: 100%;
}

.gds-hub__pane-title {
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    color: var(--gds-hub-accent);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tier 2/3 pane titles are white to stand out against the colored backgrounds. */
.gds-hub__pane[data-depth="1"] .gds-hub__pane-title,
.gds-hub__pane[data-depth="2"] .gds-hub__pane-title {
    color: #ffffff;
}

/* Pane body
   ---------------------------------------------------------------- */
.gds-hub__pane-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.gds-hub__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gds-hub__item-wrap {
    margin: 0;
    padding: 0;
}

.gds-hub__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 10px;
    border-radius: 0;
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    gap: 8px;
    transition: color 0.15s ease, opacity 0.15s ease;
}

/* Force links to inherit the pane's color — defeats theme link styling. */
a.gds-hub__item,
a.gds-hub__item:link,
a.gds-hub__item:visited,
a.gds-hub__item:hover,
a.gds-hub__item:focus,
a.gds-hub__item:active {
    color: inherit;
    text-decoration: none;
}

/* Tier 1 items get an orange underline that turns blue on hover.
   Tier 2/3 items get a translucent white underline. */
.gds-hub__pane[data-depth="0"] .gds-hub__item {
    border-bottom: 1px solid var(--gds-hub-accent-orange);
    transition: color 0.15s ease, opacity 0.15s ease, border-bottom-color 0.15s ease;
}

.gds-hub__pane[data-depth="0"] .gds-hub__item:hover,
.gds-hub__pane[data-depth="0"] .gds-hub__item:focus-visible {
    border-bottom-color: var(--gds-hub-accent);
}

.gds-hub__pane[data-depth="1"] .gds-hub__item,
.gds-hub__pane[data-depth="2"] .gds-hub__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

/* Tier 1 hover: text turns blue, no background change */
.gds-hub__pane[data-depth="0"] .gds-hub__item:hover,
.gds-hub__pane[data-depth="0"] .gds-hub__item:focus-visible {
    color: var(--gds-hub-accent);
    outline: none;
}

/* Tier 1 hover: drill chevron stays blue (already is) — no change needed.
   Default focus reset for tile root. */
.gds-hub__item:focus-visible {
    outline: none;
}

/* Tier 2/3 hover: drop opacity instead of background wash */
.gds-hub__pane[data-depth="1"] .gds-hub__item:hover,
.gds-hub__pane[data-depth="1"] .gds-hub__item:focus-visible,
.gds-hub__pane[data-depth="2"] .gds-hub__item:hover,
.gds-hub__pane[data-depth="2"] .gds-hub__item:focus-visible {
    opacity: 0.8;
    outline: none;
}

.gds-hub__item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Drill chevron (item has children) on tier 1 — blue */
.gds-hub__item-chev {
    color: var(--gds-hub-accent);
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

/* On colored panes the drill chevron is white */
.gds-hub__pane[data-depth="1"] .gds-hub__item-chev,
.gds-hub__pane[data-depth="2"] .gds-hub__item-chev {
    color: #ffffff;
}

/* Leaf links (no children) — no chevron at all */
a.gds-hub__item .gds-hub__item-chev {
    display: none;
}

.gds-hub__empty {
    padding: 12px 10px;
    margin: 0;
    font-size: 13px;
    color: var(--gds-hub-text-muted);
}

.gds-hub__pane[data-depth="1"] .gds-hub__empty,
.gds-hub__pane[data-depth="2"] .gds-hub__empty {
    color: rgba(255, 255, 255, 0.8);
}