/* ==========================================================
   ws-elements.css
   Elements page. Template-scoped presentation only.
   Real components live in main.css. This file only
   frames and labels them. Nothing here ships elsewhere.
   ========================================================== */

/* === Page shell === */
/* main.css flexes .ws-page only. Own wrapper or footer floats up */
.ws-elements { flex: 1 0 auto; padding: 48px 0 96px; }
.ws-elements__inner { max-width: 900px; margin: 0 auto; padding: 0 24px; }


/* === Intro === */
.ws-sg-intro { margin: 0 0 8px; }
.ws-sg-intro h1 { margin: 0 0 20px; line-height: 1.15; }
.ws-sg-lead {
    max-width: 740px;
    margin: 0;
    color: var(--ws-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}


/* === Notes and sub labels === */

/* Sits under a section label. Negative top pulls to the rule */
.ws-sg-note {
    max-width: 740px;
    margin: -8px 0 32px;
    color: var(--ws-muted);
    line-height: 1.6;
}
.ws-sg-note code { font-size: 0.85em; }

.ws-sg-sub {
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ws-muted);
    margin: 40px 0 14px;
}


/* === Spec rows === */
/* Heading at true size, spec pinned right */

.ws-sg-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 32px;
    padding: 18px 0;
    border-bottom: 1px solid var(--ws-border);
}
.ws-sg-row:last-of-type { border-bottom: none; }

/* Margin stripped for tight rows */
.ws-sg-display h1, .ws-sg-display h2, .ws-sg-display h3,
.ws-sg-display h4, .ws-sg-display h5, .ws-sg-display h6 { margin: 0; }

/* auto margin pins spec right */
.ws-sg-specs {
    margin-left: auto;
    font-family: var(--ws-code);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--ws-grey);
    white-space: nowrap;
}


/* === Weight ladder === */
.ws-sg-weight {
    display: flex;
    align-items: baseline;
    gap: 24px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ws-border);
}
.ws-sg-weight:last-of-type { border-bottom: none; }
.ws-sg-weight__sample { font-size: 1.5rem; flex: 1; min-width: 0; }
.ws-sg-weight__spec {
    font-family: var(--ws-code);
    font-size: 0.75rem;
    color: var(--ws-grey);
    white-space: nowrap;
}


/* === Font specimens === */
/* Letterforms only, no dressing */

.ws-sg-face { padding: 28px 0; border-bottom: 1px solid var(--ws-border); }
.ws-sg-face:last-of-type { border-bottom: none; }

/* word-break stops glyph string forcing phone scrollbar */
.ws-sg-face__sample {
    margin: 0 0 10px;
    line-height: 1.35;
    color: var(--ws-text);
    word-break: break-word;
}
.ws-sg-face__sample--lg { font-size: clamp(1.6rem, 4vw, 2.25rem); }

.ws-sg-face__glyphs {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    color: var(--ws-muted);
    letter-spacing: 0.02em;
    word-break: break-word;
}

/* Only modifiers set family */
.ws-sg-face--serif .ws-sg-face__sample,
.ws-sg-face--serif .ws-sg-face__glyphs { font-family: var(--ws-serif); }
.ws-sg-face--code .ws-sg-face__sample,
.ws-sg-face--code .ws-sg-face__glyphs { font-family: var(--ws-code); }
.ws-sg-face--terminal .ws-sg-face__sample,
.ws-sg-face--terminal .ws-sg-face__glyphs { font-family: var(--ws-terminal); }

/* Note stays Lato. Specimen never describes itself in own face */
.ws-sg-face__note {
    font-family: var(--ws-font);
    font-size: 0.9rem;
    color: var(--ws-muted);
    margin: 12px 0 0;
    max-width: 660px;
    line-height: 1.6;
}


/* === Color cards === */
.ws-color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
/* Tier 1. Reference surface, goes nowhere.
   Filled not bordered, so it cannot be mistaken for a link card.
   Definition lived here and in main.css. Elements owns it now */
.ws-color-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    background: var(--ws-fill);
    border: 0;
    border-radius: var(--ws-radius);
    transition: background-color 0.2s var(--ws-ease);
}
/* Fill deepens. No travel, nothing to click */
@media (hover: hover) {
    .ws-color-card:hover { background: var(--ws-fill-hover); }
}
@media (prefers-reduced-motion: reduce) {
    .ws-color-card { transition: none; }
}
.ws-swatch {
    width: 56px; height: 56px; min-width: 56px;
    border-radius: var(--ws-radius-sm);
    border: 1px solid var(--ws-border);
}
.ws-color-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ws-color-label { font-size: 1rem; font-weight: 700; color: var(--ws-heading); margin: 0; }
.ws-color-hex {
    margin: 0;
    text-transform: uppercase;
    color: var(--ws-muted);
    font-family: var(--ws-code);
    font-size: 0.8rem;
}
.ws-color-role { margin: 0; color: var(--ws-muted); font-size: 0.8rem; line-height: 1.4; }


/* === Reference tables === */
.ws-sg-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
}
.ws-sg-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ws-muted);
    padding: 0 12px 10px 0;
    border-bottom: 1px solid var(--ws-border);
}
.ws-sg-table td {
    padding: 11px 12px 11px 0;
    border-bottom: 1px solid var(--ws-border);
    vertical-align: middle;
}
/* Token names read as plain text here. Chip carries the color */
.ws-sg-table code { background: none; padding: 0; color: var(--ws-text); }

.ws-sg-chip {
    display: inline-block;
    width: 16px; height: 16px;
    border-radius: var(--ws-radius-sm);
    border: 1px solid var(--ws-border);
    vertical-align: -3px;
    margin-right: 8px;
}
.ws-sg-ratio { font-family: var(--ws-code); font-size: 0.8rem; color: var(--ws-muted); }

/* Phones. Table would force horizontal scroll */
.ws-sg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }


/* === Logo lockups === */
.ws-sg-locks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0 8px;
}
.ws-sg-lock {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
}
.ws-sg-lock .ws-mark { width: 50%; height: 50%; }
.ws-sg-lock__cap {
    position: absolute;
    bottom: 8px; left: 0; right: 0;
    text-align: center;
    font-family: var(--ws-code);
    font-size: 0.68rem;
    color: var(--ws-grey);
}

/* Featured graphic. Wide, light backgrounds only */
.ws-sg-featured {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--ws-white);
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    margin: 20px 0;
}
.ws-sg-featured img { width: 100%; max-width: 380px; height: auto; display: block; }


/* === Radius and spacing specimens === */
.ws-sg-specimens { display: flex; flex-wrap: wrap; gap: 20px; margin: 20px 0; }
.ws-sg-specimen { text-align: center; }
.ws-sg-specimen__box {
    width: 96px; height: 72px;
    background: var(--ws-accent);
    border: 1px solid var(--ws-accent);
}
/* Single edge demo. Fill and border differ from siblings */
.ws-sg-specimen__box--edge {
    background: var(--ws-border);
    border: 0;
    border-left: 3px solid var(--ws-accent);
    border-radius: 0;
}
.ws-sg-specimen__cap {
    display: block;
    font-family: var(--ws-code);
    font-size: 0.75rem;
    color: var(--ws-muted);
    margin-top: 8px;
}

.ws-sg-space { display: flex; align-items: flex-end; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.ws-sg-space__item { text-align: center; }
.ws-sg-space__bar { display: block; width: 26px; background: var(--ws-slate); }
.ws-sg-space__cap {
    display: block;
    font-family: var(--ws-code);
    font-size: 0.7rem;
    color: var(--ws-muted);
    margin-top: 6px;
}


/* === Demo rows === */
.ws-sg-demo-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin: 20px 0; }
.ws-sg-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
/* Fields do not need full page width to be judged */
.ws-sg-form { max-width: 520px; }


/* === Responsive === */
@media (max-width: 520px) {
    .ws-sg-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .ws-sg-specs { margin-left: 0; }
    .ws-sg-weight { flex-direction: column; align-items: flex-start; gap: 2px; }
    .ws-sg-weight__sample { font-size: 1.25rem; }
}
