/* ==========================================================================
   SocialHub — Base
   Reset, document defaults, typography, small layout primitives.
   Mobile-first: unprefixed rules are the phone layout.
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--sh-font);
    font-size: var(--sh-fs-base);
    line-height: var(--sh-lh-normal);
    color: var(--sh-text);
    background: var(--sh-page-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--sh-font-display);
    font-weight: var(--sh-fw-bold);
    line-height: var(--sh-lh-tight);
    color: var(--sh-text-strong);
    letter-spacing: -0.015em;
}

h1 { font-size: var(--sh-fs-3xl); }
h2 { font-size: var(--sh-fs-2xl); }
h3 { font-size: var(--sh-fs-xl); }
h4 { font-size: var(--sh-fs-lg); }
h5 { font-size: var(--sh-fs-md); }
h6 { font-size: var(--sh-fs-base); }

p {
    margin: 0 0 var(--sh-sp-3);
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--sh-link);
    text-decoration: none;
    transition: color var(--sh-dur-fast) var(--sh-ease);
}

a:hover {
    color: var(--sh-primary-700);
}

img,
svg,
video {
    max-width: 100%;
    display: block;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: 0;
    background: none;
    color: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid var(--sh-border);
    margin: var(--sh-sp-4) 0;
}

:focus-visible {
    outline: 2px solid var(--sh-primary-600);
    outline-offset: 2px;
}

::selection {
    background: var(--sh-primary-100);
    color: var(--sh-primary-800);
}

/* ---- Scrollbars ------------------------------------------------------- */
.sh-scroll-thin {
    scrollbar-width: thin;
    scrollbar-color: var(--sh-gray-300) transparent;
}

.sh-scroll-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.sh-scroll-thin::-webkit-scrollbar-thumb {
    background: var(--sh-gray-300);
    border-radius: var(--sh-radius-pill);
}

.sh-scroll-thin::-webkit-scrollbar-track {
    background: transparent;
}

/* Horizontal chip / story rails that scroll without a visible bar */
.sh-scroll-x {
    display: flex;
    gap: var(--sh-sp-2);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.sh-scroll-x::-webkit-scrollbar {
    display: none;
}

.sh-scroll-x > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.sh-container {
    width: 100%;
    max-width: var(--sh-shell-max);
    margin-inline: auto;
    padding-inline: var(--sh-gutter);
}

.sh-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sh-sp-4);
}

.sh-stack-sm { gap: var(--sh-sp-2); }
.sh-stack-lg { gap: var(--sh-sp-6); }

.sh-row {
    display: flex;
    align-items: center;
    gap: var(--sh-sp-3);
}

.sh-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sh-sp-3);
}

.sh-row-wrap {
    flex-wrap: wrap;
}

.sh-row-top {
    align-items: flex-start;
}

.sh-grow { flex: 1 1 auto; min-width: 0; }
.sh-shrink-0 { flex-shrink: 0; }

/* Grids default to one column on phones; page CSS widens them. */
.sh-grid {
    display: grid;
    gap: var(--sh-sp-4);
    grid-template-columns: 1fr;
}

/* A wide child (table, chart) must never blow the grid out sideways. */
.sh-grid > * {
    min-width: 0;
}

.sh-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ==========================================================================
   Utilities — intentionally small; anything reused becomes a component.
   ========================================================================== */

.sh-hidden { display: none !important; }

/* Set on <body> while a modal or drawer is open. */
.sh-no-scroll {
    overflow: hidden;
}

.sh-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sh-clamp-1,
.sh-clamp-2,
.sh-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sh-clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.sh-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.sh-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* The class is doubled on purpose. Element-plus-attribute rules such as
   `input[type="file"]` outrank a single class, so a visually-hidden file
   input kept its 100% width and pushed the page sideways. A utility whose
   only job is to hide something has to beat that. */
.sh-sr-only.sh-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Text tone + size helpers used across every surface */
.sh-muted { color: var(--sh-text-muted); }
.sh-subtle { color: var(--sh-text-subtle); }
.sh-strong { color: var(--sh-text-strong); font-weight: var(--sh-fw-semibold); }
.sh-success-text { color: var(--sh-success-600); }
.sh-danger-text { color: var(--sh-danger-600); }
.sh-warning-text { color: var(--sh-warning-600); }
.sh-primary-text { color: var(--sh-primary-600); }

.sh-t-2xs { font-size: var(--sh-fs-2xs); }
.sh-t-xs { font-size: var(--sh-fs-xs); }
.sh-t-sm { font-size: var(--sh-fs-sm); }
.sh-t-md { font-size: var(--sh-fs-md); }
.sh-t-lg { font-size: var(--sh-fs-lg); }
.sh-t-xl { font-size: var(--sh-fs-xl); }

.sh-fw-medium { font-weight: var(--sh-fw-medium); }
.sh-fw-semibold { font-weight: var(--sh-fw-semibold); }
.sh-fw-bold { font-weight: var(--sh-fw-bold); }

.sh-center { text-align: center; }
.sh-right { text-align: end; }

.sh-mt-0 { margin-top: 0; }
.sh-mt-2 { margin-top: var(--sh-sp-2); }
.sh-mt-3 { margin-top: var(--sh-sp-3); }
.sh-mt-4 { margin-top: var(--sh-sp-4); }
.sh-mt-6 { margin-top: var(--sh-sp-6); }
.sh-mb-0 { margin-bottom: 0; }
.sh-mb-2 { margin-bottom: var(--sh-sp-2); }
.sh-mb-3 { margin-bottom: var(--sh-sp-3); }
.sh-mb-4 { margin-bottom: var(--sh-sp-4); }
.sh-mb-6 { margin-bottom: var(--sh-sp-6); }

/* Gradient brand text — used for the "Hub" half of the wordmark and headings */
.sh-gradient-text {
    background: var(--sh-brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==========================================================================
   Responsive: tablet and up
   ========================================================================== */

@media (min-width: 768px) {
    :root {
        --sh-gutter: 20px;
    }

    h1 { font-size: var(--sh-fs-4xl); }
    h2 { font-size: var(--sh-fs-3xl); }

    .sh-grid-md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sh-grid-md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sh-grid-md-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sh-md-hidden { display: none !important; }
}

@media (min-width: 1024px) {
    :root {
        --sh-gutter: 24px;
        --sh-header-h: 64px;
    }

    .sh-grid-lg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sh-grid-lg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sh-grid-lg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sh-grid-lg-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .sh-lg-hidden { display: none !important; }
}

@media (min-width: 1280px) {
    .sh-grid-xl-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sh-grid-xl-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .sh-grid-xl-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Shown only from tablet up — the counterpart to .sh-md-hidden */
.sh-md-only,
.sh-lg-only {
    display: none;
}

@media (min-width: 768px) {
    .sh-md-only { display: block; }
    .sh-md-only-flex { display: flex; }
}

@media (min-width: 1024px) {
    .sh-lg-only { display: block; }
    .sh-lg-only-flex { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
