/* Everlit Documentation Shared Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Everlit brand palette — mirrors the marketing site's design tokens
       (website/src/index.css): deep navy primary, teal accent, cool surfaces. */
    --primary: #002E7A;
    --primary-light: #33C9CF;      /* teal accent, used for hover borders/rings */
    --primary-dark: #001F55;
    --primary-subtle: #EAF9FA;     /* teal tint */
    --accent: #33C9CF;
    --accent-deep: #117988;        /* AA-legible teal for text/icons on light */
    --secondary: #117988;
    --bg: #ffffff;
    --bg-secondary: #F5F6F8;       /* "surface" */
    --bg-tertiary: #EDEFF3;
    --text: #00174D;
    --text-secondary: #26407A;
    --text-muted: #5B6B8C;
    --border: #E4E6EB;
    --border-light: #EEF0F4;
    --success: #31A75F;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --info: #1F5FC9;
    --info-bg: #EEF3FC;
    --code-bg: #0B152D;
    --code-text: #E3F3F4;
    --code-key: #7FDCE0;
    --code-string: #F5D08A;
    --code-comment: #7F8AA6;
    --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --shadow-soft: 0 1px 2px rgba(0, 23, 77, 0.04), 0 10px 28px -14px rgba(0, 23, 77, 0.12);
    --shadow-soft-lg: 0 2px 6px rgba(0, 23, 77, 0.05), 0 28px 56px -20px rgba(0, 23, 77, 0.18);
    --sidebar-width: 260px;
    --header-height: 64px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo img {
    height: 24px;
    width: auto;
    filter: invert(1);
}

.logo-divider {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 18px;
    padding-left: 12px;
    margin-left: 12px;
    border-left: 1px solid var(--border);
}

.header-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.header-links a:hover {
    color: var(--primary);
}

/* Layout */
.layout {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    margin: 2px 0;
}

.sidebar nav a {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s;
}

.sidebar nav a:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.sidebar nav a.active {
    background: var(--primary-subtle);
    background: var(--primary-subtle);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    max-width: calc(100% - var(--sidebar-width));
}

.content-wrapper {
    max-width: min(1200px, calc(100% - 128px));
    margin: 0 auto;
    padding: 48px 64px;
}

/* Container for index page */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 32px;
}

/* Hero Section */
.hero {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: none;
    color: var(--accent-deep);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 20px;
}

.hero-badge::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--accent);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 400;
    color: var(--primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    line-height: 1.1;
    text-wrap: balance;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.7;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumbs .separator {
    color: var(--border);
}

.breadcrumbs .current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Sections */
section {
    margin-bottom: 64px;
    scroll-margin-top: calc(var(--header-height) + 32px);
}

h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--primary);
    margin-bottom: 16px;
    letter-spacing: -0.005em;
    padding-top: 8px;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 32px 0 12px 0;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 8px 0;
}

h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 20px 0 8px 0;
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    color: var(--text-secondary);
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 8px;
}

/* Feature Cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-soft);
}

.feature-card h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9375rem;
}

th {
    background: var(--bg-secondary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-secondary);
}

/* Code */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-tertiary);
    color: var(--text);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 20px 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
    position: relative;
    font-size: 0.875rem;
    line-height: 1.7;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

pre code {
    font-family: var(--font-mono);
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--code-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
    opacity: 0;
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
    opacity: 1;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    gap: 12px;
    font-size: 0.9375rem;
}

.alert::before {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.alert.info {
    background: var(--info-bg);
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert.info::before {
    content: 'i';
    background: var(--info);
    color: white;
}

.alert.warning {
    background: var(--warning-bg);
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert.warning::before {
    content: '!';
    background: var(--warning);
    color: white;
}

.alert.success {
    background: var(--success-bg);
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert.success::before {
    content: '\2713';
    background: var(--success);
    color: white;
}

.alert.error {
    background: var(--error-bg);
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert.error::before {
    content: '\00d7';
    background: var(--error);
    color: white;
}

/* Tabs */
.tab-container {
    margin: 24px 0;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.tab {
    padding: 12px 16px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
    font-family: inherit;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Doc Cards (for index page) */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 64px;
}

.doc-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.doc-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-soft-lg);
    transform: translateY(-2px);
}

.doc-card-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-subtle);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.doc-card-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.doc-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    padding: 0;
}

.doc-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
    flex: 1;
}

.doc-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.doc-card-tag {
    padding: 3px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.doc-card-arrow {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    margin-top: 16px;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.doc-card:hover .doc-card-arrow {
    opacity: 1;
}

.doc-card-arrow svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s;
}

.doc-card:hover .doc-card-arrow svg {
    transform: translateX(3px);
}

/* Resources Section (for index page) */
.resources-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 48px;
    margin-bottom: 80px;
}

.resources-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 32px;
    text-align: center;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.15s;
}

.resource-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0, 46, 122, 0.08);
}

.resource-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-subtle);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.resource-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* Footer */
footer {
    margin-top: 80px;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 46, 122, 0.30);
    align-items: center;
    justify-content: center;
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
    }

    .content-wrapper {
        padding: 32px 24px;
    }

    .sidebar-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
    }

    .container {
        padding: 48px 16px;
    }

    .resources-section {
        padding: 32px 20px;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .docs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .header-links {
        display: none;
    }

    .content-wrapper {
        padding: 24px 16px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 10px 12px;
    }

    pre {
        padding: 16px;
        font-size: 0.8125rem;
        border-radius: 8px;
    }
}


/* ------------------------------------------------------------------ */
/* Docs landing page (views/docs/index.erb) — an API documentation index */
/* ------------------------------------------------------------------ */
.dx-page {
    padding-top: var(--header-height);
}

.dx-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.dx-eyebrow,
.dx-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-deep);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1;
}

.dx-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--accent);
}

/* Intro: title on the left, "start here" panel on the right */
.dx-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 48px;
    align-items: end;
    padding: 64px 0 40px;
    border-bottom: 1px solid var(--border);
}

.dx-intro h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--primary);
    margin: 18px 0 16px;
}

.dx-intro > div > p {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
    max-width: 560px;
}

.dx-start {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 14px;
    padding: 22px 24px;
}

.dx-start b {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin: 10px 0 6px;
}

.dx-start p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.dx-start code {
    font-size: 0.8em;
    background: #fff;
}

.dx-start-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
}

.dx-start-links a:not(.dx-btn) {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.dx-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    transition: background 0.2s;
}

.dx-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

/* Directory */
.dx-directory {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    column-gap: 64px;
    padding: 24px 0 0;
}

.dx-group {
    grid-column: 1;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px 40px;
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
    margin: 0;
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.dx-group:last-of-type {
    border-bottom: none;
}

.dx-group-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.dx-num {
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1;
    color: var(--accent);
    padding-top: 2px;
}

.dx-group-head h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.15;
    color: var(--primary);
    margin: 0 0 8px;
    padding: 0;
}

.dx-group-head p {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
}

.dx-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dx-rows > li + li {
    border-top: 1px dashed var(--border);
}

.dx-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title arrow"
        "desc  arrow"
        "meta  arrow";
    column-gap: 20px;
    padding: 18px 12px 18px 16px;
    margin: 0 -12px 0 -16px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.15s;
}

.dx-row:hover {
    background: var(--bg-secondary);
    text-decoration: none;
}

.dx-row-title {
    grid-area: title;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.dx-row-title em {
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-deep);
}

.dx-row-desc {
    grid-area: desc;
    margin-top: 4px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.dx-row-meta {
    grid-area: meta;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dx-row-meta span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
    background: #fff;
}

.dx-row-arrow {
    grid-area: arrow;
    align-self: center;
    font-size: 1.25rem;
    color: var(--primary);
    opacity: 0.35;
    transition: opacity 0.15s, transform 0.15s;
}

.dx-row:hover .dx-row-arrow {
    opacity: 1;
    transform: translateX(3px);
}

.dx-subrows {
    list-style: none;
    margin: 0 0 6px;
    padding: 0 0 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.dx-subrows li {
    margin: 0;
    position: relative;
    padding-left: 14px;
}

.dx-subrows li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 1px;
    background: var(--accent);
}

.dx-subrows a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.dx-subrows a:hover {
    color: var(--primary);
}

/* Sticky rail */
.dx-rail {
    grid-column: 2;
    grid-row: 1 / span 5;
    position: sticky;
    top: calc(var(--header-height) + 32px);
    align-self: start;
    padding: 36px 0 0 32px;
    border-left: 1px solid var(--border);
}

.dx-rail-block + .dx-rail-block {
    margin-top: 28px;
}

.dx-rail ul {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.dx-rail li {
    margin: 0 0 8px;
}

.dx-rail a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.dx-rail a:hover {
    color: var(--primary);
}

.dx-rail small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

/* Footer */
.dx-footer {
    margin-top: 64px;
    border-top: 1px solid var(--border);
    padding: 28px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.dx-footer .dx-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    justify-content: space-between;
}

.dx-footer p {
    margin: 0;
    color: var(--text-muted);
}

.dx-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.dx-footer a {
    color: var(--text-muted);
}

.dx-footer a:hover {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 1024px) {
    .dx-directory { grid-template-columns: 1fr; }
    .dx-rail {
        grid-column: 1;
        grid-row: auto;
        position: static;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 32px 0 0;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
    .dx-rail-block + .dx-rail-block { margin-top: 0; }
    .dx-intro { grid-template-columns: 1fr; gap: 28px; align-items: start; }
}

@media (max-width: 768px) {
    .dx-wrap { padding: 0 16px; }
    .dx-intro { padding: 44px 0 28px; }
    .dx-group { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }
    .dx-rail { grid-template-columns: 1fr; }
    .dx-row { grid-template-columns: 1fr; grid-template-areas: "title" "desc" "meta"; }
    .dx-row-arrow { display: none; }
    .dx-footer .dx-wrap { flex-direction: column; align-items: flex-start; }
}
