/*
Theme Name: Silicon Valley Journals
Theme URI: https://siliconvalleyjournals.com
Template: generatepress
Author: Silicon Valley Journals
Author URI: https://siliconvalleyjournals.com
Description: GeneratePress child theme for Silicon Valley Journals - startup news, founder advice, and industry insights. Carries the SVJ design system (tokens, cards, carousel, CLS-safe ad slots) on top of the maintained GeneratePress parent.
Version: 2.1.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: svj-child
*/

/* ==========================================================================
   TABLE OF CONTENTS
   ==========================================================================
   1. Design Tokens (CSS Custom Properties)
   2. GeneratePress Overrides (colors, links, typography)
   3. Ad Slots (CLS-Safe)
   4. Article Cards & Section Grids
   5. Single Article (prose, labels, tags, social share, related)
   6. Sidebar Widgets
   7. Featured Carousel
   7b. Companies Table (/companies/ flagship page)
   8. Dark Mode
   9. Accessibility
   ==========================================================================

   ARCHITECTURE NOTE:
   GeneratePress (parent) owns: reset, layout containers, header, navigation,
   mobile menu, footer, comments, search. This child theme only skins those
   with tokens and adds SVJ-specific components. Keep it that way — structure
   belongs to the maintained parent, not to us.
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    /* Accent - Orange for CTAs, highlights, labels.
       accent-text is a darker shade for TEXT on light backgrounds:
       #ed8936 is only 2.55:1 on white (fails WCAG AA 4.5:1); #c2410c is 5.2:1. */
    --color-accent: #ed8936;
    --color-accent-hover: #dd6b20;
    --color-accent-text: #c2410c;
    --color-accent-text-hover: #9a3412;
    --color-accent-light: rgba(237, 137, 54, 0.1);

    /* Text hierarchy (muted is #64748b, 4.76:1 on white — #718096 fails at 4.01:1) */
    --color-text: #1a202c;
    --color-text-light: #4a5568;
    --color-text-muted: #64748b;

    /* Backgrounds */
    --color-background: #ffffff;
    --color-background-alt: #f7fafc;

    /* Borders */
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e0;

    /* Links */
    --color-link: #1a202c;
    --color-link-hover: #ed8936;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing - 4px grid */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Ad slot dimensions - reserved space prevents CLS when ads load late */
    --ad-leaderboard-width: 728px;
    --ad-leaderboard-height: 90px;
    --ad-mobile-leaderboard-width: 320px;
    --ad-mobile-leaderboard-height: 100px;
    --ad-rectangle-width: 300px;
    --ad-rectangle-height: 250px;
    --ad-sidebar-width: 300px;
    --ad-sidebar-height: 600px;

    /* Radius & shadows */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ==========================================================================
   2. GENERATEPRESS OVERRIDES
   Skin the parent's structure with our tokens. Loaded after GP's dynamic
   CSS (child stylesheet depends on generate-style), so these win.
   ========================================================================== */

/*
 * KEY BRIDGE: GeneratePress paints its chrome (site title, nav, header,
 * widgets, footer, forms, entry titles) through ITS OWN variables:
 * --contrast(-2,-3), --base(-2,-3), --accent — hardcoded to light values
 * in GP's dynamic CSS. Remapping them onto SVJ tokens here means every
 * GP-painted element follows our palette — including the dark-mode swap —
 * with no per-selector overrides.
 */
:root {
    --contrast: var(--color-text);
    --contrast-2: var(--color-text-light);
    --contrast-3: var(--color-text-muted);
    --base: var(--color-border);
    --base-2: var(--color-background-alt);
    --base-3: var(--color-background);
    --accent: var(--color-accent-text);
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-background);
    color: var(--color-text);
}

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

a:hover {
    color: var(--color-link-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    line-height: var(--line-height-tight);
    font-weight: var(--font-weight-bold);
    text-wrap: balance;
}

/* Header: white bar with subtle bottom border */
.site-header {
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}

/* Wordmark: last word of the site title in regular weight with the brand
   orange underline (svj_site_title_wordmark). The underline is decorative,
   so raw brand orange is fine here — the accent-as-TEXT token rule only
   applies to copy that must pass WCAG contrast. */
.svj-wordmark-accent {
    font-weight: var(--font-weight-normal, 400);
    position: relative;
}

.svj-wordmark-accent::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.15em;
    height: 3px;
    border-radius: 1.5px;
    background-color: var(--color-accent);
}

/* Primary nav links: match old theme's accent hover */
.main-navigation .main-nav ul li a {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
    color: var(--color-accent-text);
}

/* Footer: dark band like the original design */
.site-footer,
.footer-widgets {
    background-color: var(--color-text);
    color: rgba(255, 255, 255, 0.8);
}

.site-footer a,
.footer-widgets a {
    color: rgba(255, 255, 255, 0.8);
}

.site-footer a:hover,
.footer-widgets a:hover {
    color: #ffffff;
}

.site-info {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.6);
}

/* Reduce motion (accessibility) */
@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;
    }
}

/* ==========================================================================
   3. AD SLOTS (CLS-SAFE)
   Reserved min-height so content never shifts when ads load late.
   Widgets drop ad code inside these containers.
   ========================================================================== */

.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-background-alt);
    border: 1px dashed var(--color-border);
    overflow: hidden;
    contain: layout;
}

.ad-slot::before {
    content: 'Advertisement';
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ad-slot.is-loaded::before {
    display: none;
}

.ad-slot--leaderboard {
    width: 100%;
    max-width: var(--ad-leaderboard-width);
    min-height: var(--ad-leaderboard-height);
    margin-inline: auto;
}

@media (max-width: 767px) {
    .ad-slot--leaderboard {
        max-width: var(--ad-mobile-leaderboard-width);
        min-height: var(--ad-mobile-leaderboard-height);
    }
}

.ad-slot--rectangle {
    width: var(--ad-rectangle-width);
    max-width: 100%;
    min-height: var(--ad-rectangle-height);
    margin-inline: auto;
}

.ad-slot--skyscraper {
    width: var(--ad-sidebar-width);
    max-width: 100%;
    min-height: var(--ad-sidebar-height);
    margin-inline: auto;
}

.ad-slot--in-article {
    width: 100%;
    max-width: var(--ad-rectangle-width);
    min-height: var(--ad-rectangle-height);
    margin-block: var(--space-8);
    margin-inline: auto;
    flex-direction: column;
    gap: var(--space-2);
}

.ad-slot--in-article::before {
    display: none;
}

.ad-slot__label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Header leaderboard band below navigation */
.header-ad {
    background-color: var(--color-background-alt);
    padding-block: var(--space-3);
    text-align: center;
}

/* Sticky sidebar ad follows scroll */
.sidebar-sticky {
    position: sticky;
    top: var(--space-4);
}

/* ==========================================================================
   4. ARTICLE CARDS & SECTION GRIDS
   ========================================================================== */

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 640px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .articles-grid--homepage {
        grid-template-columns: repeat(4, 1fr);
    }
}

.article-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition-normal),
                transform var(--transition-normal);
}

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

.article-card__image-wrapper {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.article-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.article-card:hover .article-card__image {
    transform: scale(1.05);
}

.article-card__content {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card__type {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent-text);
    margin-bottom: var(--space-2);
}

.article-card__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-top: 0;
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card__title a {
    color: var(--color-text);
}

.article-card__title a:hover {
    color: var(--color-accent-text);
}

.article-card__excerpt {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    line-height: var(--line-height-normal);
    margin-bottom: var(--space-4);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card__meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    display: flex;
    gap: var(--space-3);
    margin-top: auto;
}

/* Homepage sections */
.section {
    padding-block: var(--space-8);
}

.section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.section__title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.section__link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-accent-text);
}

.section__link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   5. SINGLE ARTICLE
   GP renders h1.entry-title, .entry-meta, and .entry-content — we style them.
   ========================================================================== */

/* Category label above the title (printed by svj_single_category_label) */
.svj-post-label {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent-text);
    margin-bottom: var(--space-2);
}

.svj-post-label:hover {
    color: var(--color-accent-text-hover);
}

.single .entry-title {
    font-size: var(--font-size-4xl);
    line-height: var(--line-height-tight);
}

@media (max-width: 640px) {
    .single .entry-title {
        font-size: var(--font-size-3xl);
    }
}

.entry-meta,
.svj-reading-time {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.svj-reading-time {
    margin-top: var(--space-1);
}

/* Prose: larger type, relaxed leading, comfortable rhythm */
.single .entry-content {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

.single .entry-content > * + * {
    margin-top: var(--space-6);
}

.single .entry-content h2 {
    font-size: var(--font-size-3xl);
    margin-top: var(--space-12);
    margin-bottom: var(--space-4);
}

.single .entry-content h3 {
    font-size: var(--font-size-2xl);
    margin-top: var(--space-10);
    margin-bottom: var(--space-3);
}

.single .entry-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: var(--space-6);
    margin-left: 0;
    font-style: italic;
    color: var(--color-text-light);
}

.single .entry-content a {
    color: var(--color-accent-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.single .entry-content a:hover {
    color: var(--color-accent-text-hover);
}

.single .entry-content img {
    border-radius: var(--radius-md);
}

/* Featured image (GP prints it after the entry header) */
.single .post-image img,
.single .featured-image img {
    border-radius: var(--radius-md);
}

/* GP footer meta (categories/tags) styled as pills */
.entry-meta .cat-links a,
.entry-meta .tags-links a {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    background-color: var(--color-background-alt);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    margin-right: var(--space-1);
}

.entry-meta .cat-links a:hover,
.entry-meta .tags-links a:hover {
    background-color: var(--color-accent-light);
    color: var(--color-accent-text);
}

/* Social sharing */
.social-share {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
}

.social-share__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    margin-right: var(--space-2);
}

.social-share__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    background-color: var(--color-background-alt);
    color: var(--color-text);
    transition: background-color var(--transition-fast),
                color var(--transition-fast);
}

.social-share__button:hover {
    background-color: var(--color-accent-text);
    color: #ffffff;
}

.social-share__icon {
    width: 20px;
    height: 20px;
}

/* Related posts */
.related-posts {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border);
}

.related-posts__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-top: 0;
    margin-bottom: var(--space-6);
}

/* ==========================================================================
   6. SIDEBAR WIDGETS
   ========================================================================== */

.sidebar .widget {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.sidebar .widget-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-accent);
}

/* Ad widget areas have no card chrome */
.sidebar .svj-sidebar-ad {
    background: none;
    border: none;
    padding: 0;
}

/* ==========================================================================
   6b. FORMS (Contact Form 7)
   ========================================================================== */

.wpcf7 label {
    display: block;
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-4);
    color: var(--color-text);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 select,
.wpcf7 textarea {
    display: block;
    width: 100%;
    margin-top: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    background-color: var(--color-background);
    color: var(--color-text);
    transition: border-color var(--transition-fast);
}

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

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

.wpcf7 input[type="submit"] {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    background-color: var(--color-accent-text);
    color: #ffffff;
    font-weight: var(--font-weight-semibold);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.wpcf7 input[type="submit"]:hover {
    background-color: var(--color-accent-text-hover);
}

/* ==========================================================================
   7. FEATURED CAROUSEL
   ========================================================================== */

.featured-carousel {
    position: relative;
    max-width: 80%;
    margin-inline: auto;
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .featured-carousel {
        max-width: 100%;
        margin-top: var(--space-4);
        border-radius: var(--radius-lg);
    }
}

.featured-carousel__track {
    display: flex;
    transition: transform var(--transition-slow);
}

.featured-carousel__slide {
    flex: 0 0 100%;
    position: relative;
}

.featured-carousel__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.featured-carousel__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-8);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.featured-carousel__type {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    background-color: rgba(0, 0, 0, 0.5);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.featured-carousel__title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    margin: 0 0 var(--space-2);
    max-width: 600px;
    color: #ffffff; /* always white - sits on dark gradient */
}

@media (max-width: 768px) {
    .featured-carousel__title {
        font-size: var(--font-size-xl);
    }

    .featured-carousel__content {
        padding: var(--space-4);
    }
}

.featured-carousel__title a {
    color: inherit;
}

.featured-carousel__title a:hover {
    color: inherit;
    text-decoration: underline;
}

.featured-carousel__meta {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.8);
}

.featured-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    z-index: 10;
    padding: 0;
}

.featured-carousel__nav:hover {
    background-color: #ffffff;
}

.featured-carousel__nav--prev {
    left: var(--space-4);
}

.featured-carousel__nav--next {
    right: var(--space-4);
}

.featured-carousel__nav-icon {
    width: 24px;
    height: 24px;
    color: #1a202c;
}

.featured-carousel__dots {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    display: flex;
    gap: var(--space-2);
    z-index: 10;
}

.featured-carousel__dot {
    /* 44x44 touch target for accessibility; visual dot drawn via ::after */
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    cursor: pointer;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-carousel__dot::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color var(--transition-fast),
                transform var(--transition-fast);
}

.featured-carousel__dot.is-active::after,
.featured-carousel__dot:hover::after {
    background-color: #ffffff;
    transform: scale(1.2);
}

/* ==========================================================================
   7b. COMPANIES TABLE (/companies/ flagship page)
   Table markup lives in page content (portable HTML). These styles and the
   sort/filter JS are enhancements — the table reads fine without them.
   ========================================================================== */

.svj-companies-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    margin: var(--space-4) 0;
}

.svj-companies-search {
    flex: 1 1 220px;
    max-width: 320px;
    padding: 0.5em 0.75em;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-background);
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.svj-companies-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.svj-companies-filter button {
    padding: 0.35em 0.8em;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background-color: var(--color-background);
    color: var(--color-text-light);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.svj-companies-filter button:hover {
    border-color: var(--color-accent);
    color: var(--color-accent-text);
}

.svj-companies-filter button.is-active {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

/* Horizontal scroll wrapper: wide table never forces body scroll */
.svj-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-4);
}

.svj-companies-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.svj-companies-table th,
.svj-companies-table td {
    padding: 0.55em 0.7em;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.svj-companies-table thead th {
    position: sticky;
    top: 0;
    background-color: var(--color-background-alt);
    color: var(--color-text);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.svj-companies-table thead th button {
    all: unset;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.svj-companies-table thead th button::after {
    content: " ↕";
    opacity: 0.4;
}

.svj-companies-table thead th[aria-sort="ascending"] button::after {
    content: " ↑";
    opacity: 1;
}

.svj-companies-table thead th[aria-sort="descending"] button::after {
    content: " ↓";
    opacity: 1;
}

.svj-companies-table tbody tr:hover {
    background-color: var(--color-background-alt);
}

.svj-companies-table .svj-co-name {
    font-weight: var(--font-weight-semibold, 600);
    white-space: nowrap;
}

.svj-companies-table .svj-co-name a {
    color: var(--color-text);
}

.svj-companies-table .svj-co-name a:hover {
    color: var(--color-accent-text);
}

.svj-companies-table .svj-co-desc {
    min-width: 220px;
    color: var(--color-text-light);
}

.svj-companies-table .svj-co-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.svj-companies-table .svj-co-status {
    white-space: nowrap;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.svj-companies-updated {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ==========================================================================
   8. DARK MODE (system preference)
   Token swap only - every component above updates automatically.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #1a202c;
        --color-background-alt: #2d3748;
        --color-text: #f7fafc;
        --color-text-light: #e2e8f0;
        --color-text-muted: #a0aec0;
        --color-border: #4a5568;
        --color-border-dark: #718096;
        --color-link: #f7fafc;
        --color-link-hover: #ed8936;
        /* On dark backgrounds the lighter oranges pass contrast, so
           accent-as-text can brighten back up. */
        --color-accent-text: #f6ad55;
        --color-accent-text-hover: #fbd38d;
        --color-accent-light: rgba(237, 137, 54, 0.2);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4),
                     0 2px 4px -1px rgba(0, 0, 0, 0.3);
    }

    .site-footer,
    .footer-widgets {
        background-color: #0d1117;
    }

    img {
        opacity: 0.95;
    }
}

/* ==========================================================================
   9. ACCESSIBILITY
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-contrast: high) {
    :root {
        --color-border: #000000;
        --color-text-muted: #4a5568;
    }

    .article-card,
    .sidebar .widget {
        border-width: 2px;
    }
}
