/* ==========================================================================
   FeminaNG CMS — Docs template styles (OpenRouter-inspired)
   ========================================================================== */

:root {
    --color-bg: #ffffff;
    --color-bg-subtle: #f8f8fa;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;
    --color-text: #111827;
    --color-text-secondary: #4b5563;
    --color-text-muted: #9ca3af;
    --color-primary: #950009;
    --color-primary-hover: #710209;
    --color-primary-soft: #fde8e9;
    --color-primary-soft-hover: #fbd4d6;
    --color-success: #16a34a;
    --color-success-soft: #dcfce7;
    --color-warning: #d97706;
    --color-warning-soft: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-soft: #fee2e2;
    --color-info: #2563eb;
    --color-info-soft: #dbeafe;
    --color-code-bg: #1f2430;
    --color-code-text: #e6e9f0;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 0.16);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --topbar-h: 62px;
    --docsbar-h: 54px;
    --font-sans: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

[data-theme="dark"] {
    --color-bg: #0f1117;
    --color-bg-subtle: #171b27;
    --color-surface: #161a26;
    --color-border: #262b3b;
    --color-border-strong: #343b4f;
    --color-text: #f3f4f6;
    --color-text-secondary: #b6bccb;
    --color-text-muted: #6b7280;
    --color-primary: #f3b8bc;
    --color-primary-hover: #f6ccd0;
    --color-primary-soft: #3d1214;
    --color-primary-soft-hover: #4a171a;
    --color-success: #4ade80;
    --color-success-soft: #14351f;
    --color-warning: #fbbf24;
    --color-warning-soft: #3a2c0d;
    --color-danger: #f87171;
    --color-danger-soft: #3d1616;
    --color-info: #60a5fa;
    --color-info-soft: #14233f;
    --color-code-bg: #12141c;
    --color-code-text: #e6e9f0;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 0.6);
}

/* --------------------------------------------------------------------------
   Pace loading bar
   -------------------------------------------------------------------------- */

.pace-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pace-bar.is-active {
    opacity: 1;
}

.pace-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
    box-shadow: 0 0 8px var(--color-primary);
    transform: translateX(-100%);
    transition: transform 0.1s linear;
}

/* --------------------------------------------------------------------------
   Toast notifications
   -------------------------------------------------------------------------- */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toast-in 0.25s ease;
}

.toast.is-success {
    border-left: 3px solid var(--color-success);
}

.toast.is-error {
    border-left: 3px solid var(--color-danger);
}

.toast.is-leaving {
    animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* --------------------------------------------------------------------------
   Sticky table actions column
   -------------------------------------------------------------------------- */

.table-sticky-last th:last-child,
.table-sticky-last td:last-child {
    position: sticky;
    right: 0;
    background: var(--color-surface);
    box-shadow: -8px 0 12px -8px rgb(0 0 0 / 0.12);
    z-index: 2;
}

.table-sticky-last th:last-child {
    background: var(--color-bg-subtle);
}

.table-sticky-last tbody tr:hover td:last-child {
    background: var(--color-bg-subtle);
}

/* --------------------------------------------------------------------------
   Charts (bar + donut)
   -------------------------------------------------------------------------- */

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding: 8px 0 0;
}

.bar-chart-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}

.bar-chart-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bar-chart-bar {
    width: 100%;
    max-width: 28px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--color-primary), var(--color-primary-hover));
    transition: height 0.3s ease;
    min-height: 2px;
}

.bar-chart-label {
    font-size: 10px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 6px;
    flex-shrink: 0;
}

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pie-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.pie-hole {
    position: absolute;
    inset: 24%;
    border-radius: 50%;
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pie-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.donut-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.donut-legend-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-secondary);
}

.donut-legend-value {
    font-weight: 600;
    color: var(--color-text);
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.leaderboard-rank {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    background: var(--color-primary);
    color: #fff;
}

.leaderboard-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
}

.leaderboard-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--color-bg-subtle);
    flex: 2;
    min-width: 60px;
    overflow: hidden;
}

.leaderboard-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--color-primary);
}

.leaderboard-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Tags input (keywords)
   -------------------------------------------------------------------------- */

.tags-input {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tags-input:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.tags-input input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    background: none;
    font: inherit;
    font-size: 14px;
    color: var(--color-text);
    padding: 4px 0;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-radius: 999px;
}

.tag-pill button {
    display: inline-flex;
    padding: 0;
    color: inherit;
    opacity: 0.6;
}

.tag-pill button:hover {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Upload zone
   -------------------------------------------------------------------------- */

.upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 32px 20px;
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-bg-subtle);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-zone:hover,
.upload-zone.is-dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.upload-zone .icon {
    width: 32px;
    height: 32px;
    color: var(--color-text-muted);
}

.upload-zone-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.upload-zone-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-preview {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.upload-preview.is-visible {
    display: flex;
}

.upload-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.upload-preview-info {
    flex: 1;
    min-width: 0;
}

.upload-preview-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-preview-size {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

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

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

body.no-scroll {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

img {
    max-width: 100%;
}

kbd {
    display: inline-block;
    padding: 1px 6px;
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-bg-subtle);
}

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    color: #fff;
    background: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    color: var(--color-text);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-border-strong);
}

.btn-success {
    color: #fff;
    background: var(--color-success);
}

.btn-success:hover {
    filter: brightness(0.92);
}

.btn-warning {
    color: #fff;
    background: var(--color-warning);
}

.btn-warning:hover {
    filter: brightness(0.95);
}

.btn-danger {
    color: #fff;
    background: var(--color-danger);
}

.btn-danger:hover {
    filter: brightness(0.92);
}

.btn-outline {
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.btn-outline:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn-ghost {
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text);
}

.btn-link {
    color: var(--color-primary);
    padding: 8px 4px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    margin-left: 0;
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* loading spinner inside buttons */
.btn .spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgb(255 255 255 / 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* standalone spinner (e.g. modal loading states) */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border-strong);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.is-loading .spinner {
    display: inline-block;
}

/* Reload web cache result popup */
.reload-cache-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.reload-cache-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--color-text-secondary);
    background: var(--color-bg-subtle);
}

.reload-cache-icon .icon,
.reload-cache-icon svg {
    width: 18px;
    height: 18px;
}

#reloadCacheResult.is-success .reload-cache-icon {
    color: var(--color-success);
    background: var(--color-success-soft);
}

#reloadCacheResult.is-error .reload-cache-icon {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.reload-cache-title {
    margin: 4px 0 0;
    font-weight: 600;
    color: var(--color-text);
}

.reload-cache-message {
    margin: 4px 0 0;
    color: var(--color-text-secondary);
    font-size: 13px;
}

#reloadCacheResult.is-success .reload-cache-title {
    color: var(--color-success);
}

#reloadCacheResult.is-error .reload-cache-title {
    color: var(--color-danger);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--topbar-h);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: inline-flex;
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.topbar-nav {
    display: none;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    margin-right: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.topbar-nav a:hover {
    color: var(--color-text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (min-width: 1100px) {
    .topbar-nav {
        display: flex;
    }
}

/* --------------------------------------------------------------------------
   Hamburger (mobile only)
   -------------------------------------------------------------------------- */

.hamburger {
    display: none;
}

@media (max-width: 1023.98px) {
    .hamburger {
        display: inline-flex;
    }
}

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

.shell {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 1024px) {
    .shell {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 48px;
    }
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: 290px;
    padding: 16px;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgb(0 0 0 / 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sidebar.is-open ~ .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        top: var(--topbar-h);
        z-index: auto;
        height: calc(100vh - var(--topbar-h));
        width: auto;
        padding: 24px 0;
        background: none;
        border-right: none;
        transform: none;
    }

    .sidebar-close,
    .sidebar-backdrop {
        display: none;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-section {
    margin: 16px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 12px 0;
    font-size: 11px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    color: var(--color-text);
    background: var(--color-bg-subtle);
}

.sidebar-link.is-active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

/* --------------------------------------------------------------------------
   Main document
   -------------------------------------------------------------------------- */

.main {
    padding: 32px 0 80px;
    min-width: 0;
}

.doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.doc-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
}

.doc-eyebrow:hover {
    text-decoration: underline;
}

.doc-title {
    margin: 0 0 8px;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.doc-subtitle {
    margin: 0;
    font-size: 17px;
    color: var(--color-text-secondary);
}

.doc-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.doc-body {
    max-width: 760px;
    font-size: 15px;
    color: var(--color-text);
}

.doc-body > p {
    margin: 0 0 16px;
    color: var(--color-text-secondary);
    font-size: 16px;
}

.doc-body h2 {
    margin: 40px 0 16px;
    padding-top: 24px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    border-top: 1px solid var(--color-border);
    scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.doc-body h3 {
    margin: 24px 0 8px;
    font-size: 17px;
    font-weight: 600;
}

.doc-body code:not(pre code) {
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--color-text);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: 5px;
}

/* --------------------------------------------------------------------------
   Demo / preview blocks
   -------------------------------------------------------------------------- */

.preview {
    margin: 20px 0;
    padding: 28px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.preview-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.preview-dark {
    background: var(--color-code-bg);
}

.code-block {
    margin: 0 0 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.code-lang {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #9aa3b5;
}

.code-copy {
    width: 30px;
    height: 30px;
    color: #9aa3b5;
}

.code-copy:hover {
    background: rgb(255 255 255 / 0.08);
    color: #fff;
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-code-text);
    white-space: pre;
}

/* --------------------------------------------------------------------------
   Form components
   -------------------------------------------------------------------------- */

.field {
    margin-bottom: 18px;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.field-error {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-danger);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--color-text-muted);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.input.is-invalid {
    border-color: var(--color-danger);
}

.input.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--color-danger-soft);
}

.input:disabled {
    background: var(--color-bg-subtle);
    cursor: not-allowed;
}

.input-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.input-lg {
    padding: 12px 16px;
    font-size: 15px;
}

.input-group {
    display: flex;
}

.input-group .input {
    border-radius: 0;
    margin-left: -1px;
}

.input-group .input:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    margin-left: 0;
}

.input-group .input:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group .btn,
.input-group .select {
    border-radius: 0;
}

.input-group .btn:first-child,
.input-group .select:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn:last-child,
.input-group .select:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.textarea {
    min-height: 96px;
    resize: vertical;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 34px;
}

/* checkbox + radio */
.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
}

.choice input {
    width: 17px;
    height: 17px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.choice.is-disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.choice-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* toggle switch */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: var(--color-border-strong);
    transition: background 0.18s ease;
    flex-shrink: 0;
}

.switch-thumb {
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease;
}

.switch input:checked ~ .switch-track {
    background: var(--color-primary);
}

.switch input:checked ~ .switch-track .switch-thumb {
    transform: translate(18px, -50%);
}

.switch input:focus-visible ~ .switch-track {
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.switch input:disabled ~ .switch-track {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch-label {
    margin-left: 10px;
    font-size: 14px;
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Dropdown
   -------------------------------------------------------------------------- */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 190px;
    padding: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
}

.dropdown.is-open .dropdown-menu {
    display: block;
}

.dropdown-menu.align-right {
    left: auto;
    right: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--color-bg-subtle);
}

.dropdown-item.is-danger {
    color: var(--color-danger);
}

.dropdown-item.is-danger:hover {
    background: var(--color-danger-soft);
}

.dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--color-border);
}

.dropdown-header {
    padding: 6px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-body {
    padding: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
}

.card-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.card-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.card-hover {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

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

.card-media {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--color-primary-soft), var(--color-info-soft));
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

/* stat card (dashboard) */
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-delta {
    font-size: 12px;
    font-weight: 500;
}

.stat-delta.is-up {
    color: var(--color-success);
}

.stat-delta.is-down {
    color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin: 20px 0;
    font-size: 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.alert strong {
    display: block;
    margin-bottom: 2px;
}

.alert p {
    margin: 0;
}

.alert .icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.alert-close {
    margin-left: auto;
    color: inherit;
    opacity: 0.6;
    padding: 2px;
}

.alert-close:hover {
    opacity: 1;
}

.alert-info {
    color: var(--color-info);
    background: var(--color-info-soft);
    border-color: color-mix(in srgb, var(--color-info) 30%, transparent);
}

.alert-success {
    color: var(--color-success);
    background: var(--color-success-soft);
    border-color: color-mix(in srgb, var(--color-success) 30%, transparent);
}

.alert-warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
    border-color: color-mix(in srgb, var(--color-warning) 30%, transparent);
}

.alert-danger {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: color-mix(in srgb, var(--color-danger) 30%, transparent);
}

.alert-info,
.alert-success,
.alert-warning,
.alert-danger {
    --alert-text: currentColor;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.5);
    backdrop-filter: blur(2px);
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.18s ease;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   YouTube embed dialog
   -------------------------------------------------------------------------- */

.video-size-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 8px;
}

.video-size-cell {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.video-size-cell .field-hint {
    margin: 0;
}

.video-size-lock {
    height: 38px;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.video-size-lock.is-locked {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.video-size-lock .icon {
    width: 14px;
    height: 14px;
}

.video-preview {
    margin-top: 16px;
}

.video-preview[hidden] {
    display: none;
}

.video-preview-frame {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
}

.video-preview-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview-meta {
    margin: 8px 0 0;
    color: var(--color-text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
    .video-size-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .video-size-lock {
        grid-column: 1 / -1;
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   Symbol / emoji picker
   -------------------------------------------------------------------------- */

.symbol-panel {
    max-width: 620px;
}

.symbol-tab {
    border: 0;
    background: none;
    cursor: pointer;
    font: inherit;
}

.symbol-search {
    margin-bottom: 12px;
}

.symbol-scroll {
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 4px;
}

.symbol-group + .symbol-group {
    margin-top: 14px;
}

.symbol-group[hidden] {
    display: none;
}

.symbol-group-label {
    margin: 0 0 6px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
}

.symbol-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.symbol-item:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.symbol-item:active {
    transform: scale(0.94);
}

.symbol-item[hidden] {
    display: none;
}

.symbol-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

.symbol-hint {
    margin: 12px 0 0;
    color: var(--color-text-muted);
    font-size: 12px;
}

@media (max-width: 520px) {
    .symbol-grid {
        grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    }

    .symbol-item {
        height: 36px;
        font-size: 18px;
    }

    .symbol-scroll {
        max-height: 42vh;
    }
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
    margin: 20px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.table th {
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-bg-subtle);
}

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

.table tbody tr:hover {
    background: var(--color-bg-subtle);
}

.categories-table th,
.categories-table td {
    padding: 7px 12px;
    font-size: 13px;
}

.categories-table .btn.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.categories-table .pill {
    padding: 1px 8px;
    font-size: 11px;
}

.table-link {
    font-weight: 600;
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-color: var(--color-border-strong);
    text-underline-offset: 3px;
}

.table-link:hover {
    color: var(--color-primary);
}

.table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* status pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
}

.pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-success {
    color: var(--color-success);
    background: var(--color-success-soft);
}

.pill-warning {
    color: var(--color-warning);
    background: var(--color-warning-soft);
}

.pill-danger {
    color: var(--color-danger);
    background: var(--color-danger-soft);
}

.pill-muted {
    color: var(--color-text-muted);
    background: var(--color-bg-subtle);
}

/* Compact "New" marker shown next to article titles created today. */
.badge-new {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border-radius: 999px;
}

/* Small inline indicators shown after an article title. */
.title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    vertical-align: middle;
    color: var(--color-text-muted);
}

.title-icon svg {
    width: 15px;
    height: 15px;
    display: block;
}

.title-icon.is-hot {
    color: var(--color-danger);
}

/* Clickable status pill in the articles list. */
.pill-button {
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pill-button:hover {
    border-color: currentColor;
}

.pill-button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

/* pagination */
.pagination {
    display: flex;
    gap: 4px;
    margin: 20px 0 0;
    overflow: auto;
}

.page-btn {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.page-btn:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.page-btn.is-active {
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */

.tabs-nav {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
}

[data-tab] {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

[data-tab]:hover {
    color: var(--color-text);
}

[data-tab].is-active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

[data-tab-panel] {
    display: none;
}

[data-tab-panel].is-active {
    display: block;
}

/* --------------------------------------------------------------------------
   Auth pages (login / forgot password / profile)
   -------------------------------------------------------------------------- */

.auth-wrap {
    min-height: calc(100vh - var(--topbar-h));
    display: grid;
    place-items: center;
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 32px;
}

.auth-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--color-text-secondary);
    text-align: center;
}

.auth-footer {
    margin-top: 20px;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 500;
}

/* profile */
.profile-head {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-info));
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

/* hero */
.hero {
    padding: 72px 24px;
    text-align: center;
    background:
        radial-gradient(600px 200px at 50% 0%, var(--color-primary-soft), transparent),
        var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.hero h1 {
    margin: 0 0 12px;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero p {
    max-width: 560px;
    margin: 0 auto 24px;
    font-size: 17px;
    color: var(--color-text-secondary);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Search modal
   -------------------------------------------------------------------------- */

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    padding: 12vh 16px 0;
}

.search-modal[hidden] {
    display: none;
}

.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
    backdrop-filter: blur(2px);
}

.search-modal-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: fit-content;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.search-modal-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.search-modal-input input {
    flex: 1;
    font: inherit;
    color: var(--color-text);
    background: none;
    border: none;
    outline: none;
}

.search-modal-results {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
}

.search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
}

.search-result:hover {
    background: var(--color-bg-subtle);
}

.search-result-label {
    font-size: 14px;
    font-weight: 500;
}

.search-result-section {
    font-size: 12px;
    color: var(--color-text-muted);
}

.search-hint {
    margin: 0;
    padding: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Theme toggle
   -------------------------------------------------------------------------- */

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 780px) {
    .hamburger {
        display: none;
    }
}

@media (max-width: 1023.98px) {
    .doc-header {
        flex-direction: column;
    }

    .doc-title {
        font-size: 32px;
    }

    /* Stats: 2x2 on mobile */
    .card-grid[style*="repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --------------------------------------------------------------------------
   Modal open state
   -------------------------------------------------------------------------- */

.modal.is-open {
    animation: modal-fade 0.15s ease;
}

@keyframes modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Compact table
   -------------------------------------------------------------------------- */

.table.table-compact th,
.table.table-compact td {
    padding: 6px 10px;
    font-size: 13px;
}

.table.table-compact .avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.table.table-compact .pill {
    padding: 1px 8px;
    font-size: 11px;
}

/* --------------------------------------------------------------------------
   Form layout helpers
   -------------------------------------------------------------------------- */

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 16px;
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-grid .field {
    margin-bottom: 16px;
}

.form-grid .field-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Rich text output
   -------------------------------------------------------------------------- */

/*
 * Blank-line marker written when an empty Quill paragraph is saved. It renders
 * as a small fixed-height spacer instead of a bare <br>.
 */
p.newline {
    height: 5px;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.ql-editor p{
    margin-bottom: 1em !important;
    margin-block-start: 1em !important;
    margin-block-end: 1em !important;
    margin-top: 1em !important;
}

.article-preview a {
    color: #e53e3e; /* Rich red theme color */
    text-decoration: none;
    font-weight: 500;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

/* Animated underline effect on hover */
.article-preview a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 1px;
    left: 0;
    background-color: #ff4d4d; /* Bright red hover highlight */
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.86, 0, 0.07, 1);
}

.article-preview a:hover {
    color: #ff1a1a; /* Slightly brighter red on hover */
}

.article-preview a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}