/*
 * ============================================================================
 * Telex News Scraper — Frontend Stylesheet
 * ============================================================================
 *
 * Designed to blend with the Zox News theme (tvkocevje.si).
 *
 * Color palette:
 *   Blue accent   #347dc6  (category badges, hover, section headers)
 *   Black         #000000  (nav)
 *   Headline dark #111111  (Zox feature-card headlines)
 *   Dark gray     #555555  (meta text, dates)
 *   Light gray    #f5f5f5  (card bg on hover)
 *   White         #ffffff  (card background)
 *
 * Typography:
 *   Headings: 'Oswald', sans-serif  (700, Zox News headline style)
 *   Body:     'PT Serif', sans-serif  (300/400, Zox News excerpt style)
 *
 * CSS Custom Properties (set by admin color picker fallback):
 *   --tns-primary    Blue accent
 *   --tns-secondary  Card background
 *   --tns-text       Body text
 *   --tns-link       Link color
 *   --tns-font       Body font family
 *   --tns-size       Base font size
 *
 * ============================================================================
 */

/* ─── Google Fonts removed for privacy/performance ───
 * The original release imported Oswald + Roboto from fonts.googleapis.com.
 * That has been removed to avoid third-party requests from frontend pages
 * (relevant for EU/GDPR sites). The CSS below already has font fallbacks
 * (--tns-font defaults to 'PT Serif', sans-serif).
 * If you want Oswald/Roboto back, either:
 *   1. Have your theme enqueue them, or
 *   2. Self-host the .woff2 files and import them with a local @font-face.
 */

/* ─── Reset & Wrapper ─────────────────────────────────────────────── */
.tns-wrap {
    font-family: var(--tns-font, 'PT Serif', sans-serif);
    font-size: var(--tns-size, 15px);
    color: var(--tns-text, #000);
    line-height: 1.4;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.tns-wrap *,
.tns-wrap *::before,
.tns-wrap *::after {
    box-sizing: inherit;
}

/* ─── Grid Layout ─────────────────────────────────────────────────── */
.tns-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(var(--tns-cols, 1), minmax(0, 1fr));
}

/* Responsive: keep shortcode columns uncapped on wide screens, but prevent cramped cards on smaller screens. */
@media (max-width: 768px) {
    .tns-grid {
        grid-template-columns: 1fr;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .tns-grid {
        grid-template-columns: repeat(var(--tns-cols-tablet, 1), minmax(0, 1fr));
    }
}
@media (min-width: 1025px) and (max-width: 1400px) {
    .tns-grid {
        grid-template-columns: repeat(var(--tns-cols-small-desktop, 1), minmax(0, 1fr));
    }
}

/* ─── Card (Zox News article list style) ──────────────────────────── */
.tns-card {
    background: var(--tns-secondary, #fff);
    border-bottom: 1px solid #e8e8e8;
    padding: 1rem 0;
    transition: background-color 0.25s ease;
}

.tns-wrap:not(.tns-cols-1) .tns-card {
    padding: 1rem;
    border-bottom: none;
    border: 1px solid #e8e8e8;
}

.tns-card:hover {
    background-color: #f9f9f9;
}

.tns-card:last-child {
    border-bottom: none;
}

/* ─── Card Title (Oswald — Zox News headline style) ───────────────── */
.tns-card-title {
    font-family: 'Oswald', sans-serif;
    color: #222;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.45rem 0;
    line-height: 1.2;
}

.tns-card-title a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

.tns-card-title a:hover {
    opacity: 0.6;
}

/* ─── Card Snippet ────────────────────────────────────────────────── */
.tns-card-snippet {
    font-family: 'PT Serif', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #555;
    margin: 0 0 0.65rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Card Meta / Footer ──────────────────────────────────────────── */
.tns-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    align-items: center;
    font-size: 0.78em;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    color: #555;
    margin: 0;
    padding: 0;
    line-height: 1;
}

/* Source badge — Zox News category label style */
.tns-source {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--tns-primary, #347dc6);
    color: #fff;
    padding: 0.2em 0.6em;
    display: inline-block;
    line-height: 1.4;
}

/* Date — light weight */
.tns-date {
    font-weight: 300;
    color: #999;
}

/* Feed badge — black, subtle */
.tns-feed-badge {
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #000;
    color: #fff;
    padding: 0.15em 0.5em;
    display: inline-block;
    line-height: 1.4;
}

/* ─── Empty State ─────────────────────────────────────────────────── */
.tns-empty {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-style: italic;
    font-weight: 300;
}

/* ─── Card Image ─────────────────────────────────────────────────── */
.tns-card-image-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 0.75rem 0;
    overflow: hidden;
    background: #f2f2f2;
    text-decoration: none;
}

.tns-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.tns-card-image-link:hover .tns-card-image {
    transform: scale(1.03);
}
