/*
 * Jdunato Theme for neiki-cms
 * Version: 1.0.0
 * Author: Jindřich Stoklasa
 *
 * Light-only theme. Overrides the CMS CSS variables with the Jdunato brand
 * design tokens. Dark mode is disabled – all [data-theme="dark"] overrides
 * are intentionally reset to light values here.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@700;800&display=swap');

/* ── Design tokens (light-only) ──────────────────────────────── */
:root {
    /* Core palette */
    --bg-primary:    #ffffff;
    --bg-secondary:  #f8fafc;
    --bg-tertiary:   #f1f5f9;
    --text-primary:  #1f2937;
    --text-secondary:#475569;
    --text-muted:    #94a3b8;
    --border-color:  #e2e8f0;

    /* Accent – Jdunato indigo */
    --accent-color:       #4f46e5;
    --accent-hover:       #4338ca;
    --accent-light:       #eef2ff;

    /* Cards / surfaces */
    --card-bg:            #ffffff;
    --card-shadow:        0 1px 3px rgba(15,23,42,.05), 0 1px 2px rgba(15,23,42,.06);
    --card-shadow-hover:  0 10px 15px rgba(15,23,42,.06), 0 25px 50px rgba(15,23,42,.12),
                          0 0 20px rgba(79,70,229,.12);

    /* Header / footer */
    --header-bg:          rgba(255,255,255,.88);
    --header-shadow:      none;
    --footer-bg:          #f8fafc;
    --footer-text:        #475569;

    /* Side menu */
    --side-menu-bg:       #ffffff;
    --overlay-bg:         rgba(0,0,0,.35);

    /* Forms / inputs */
    --input-bg:           #ffffff;
    --input-border:       #e2e8f0;
    --input-focus-border: #4f46e5;

    /* Badges */
    --badge-bg:           #eef2ff;
    --badge-text:         #4338ca;

    /* Alerts */
    --alert-success-bg:   #ecfdf5;
    --alert-success-text: #065f46;
    --alert-error-bg:     #fef2f2;
    --alert-error-text:   #991b1b;
    --alert-info-bg:      #eff6ff;
    --alert-info-text:    #1e40af;

    /* Shape */
    --radius: 14px;
}

/* ── Force light mode – reset any dark-mode overrides ──────────
   The theme is light-only; [data-theme="dark"] is never applied
   when this theme is active (JS skips it), but we reset it here
   as a safety net in case a stale value is in localStorage.      */
[data-theme="dark"] {
    --bg-primary:    #ffffff;
    --bg-secondary:  #f8fafc;
    --bg-tertiary:   #f1f5f9;
    --text-primary:  #1f2937;
    --text-secondary:#475569;
    --text-muted:    #94a3b8;
    --border-color:  #e2e8f0;
    --accent-color:       #4f46e5;
    --accent-hover:       #4338ca;
    --accent-light:       #eef2ff;
    --card-bg:            #ffffff;
    --card-shadow:        0 1px 3px rgba(15,23,42,.05), 0 1px 2px rgba(15,23,42,.06);
    --card-shadow-hover:  0 10px 15px rgba(15,23,42,.06), 0 25px 50px rgba(15,23,42,.12);
    --header-bg:          rgba(255,255,255,.88);
    --header-shadow:      none;
    --footer-bg:          #f8fafc;
    --footer-text:        #475569;
    --side-menu-bg:       #ffffff;
    --overlay-bg:         rgba(0,0,0,.35);
    --input-bg:           #ffffff;
    --input-border:       #e2e8f0;
    --input-focus-border: #4f46e5;
    --badge-bg:           #eef2ff;
    --badge-text:         #4338ca;
    --alert-success-bg:   #ecfdf5;
    --alert-success-text: #065f46;
    --alert-error-bg:     #fef2f2;
    --alert-error-text:   #991b1b;
    --alert-info-bg:      #eff6ff;
    --alert-info-text:    #1e40af;
    --radius: 14px;
}

/* ── Typography ──────────────────────────────────────────────── */
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.header-nav .nav-link,
.side-menu-header h3,
.page-title,
.post-card-title,
.single-post-title,
.category-filter a,
.comments-title,
.btn {
    font-family: 'Manrope', 'Inter', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent;
    box-shadow: none;
    transition: border-color 200ms ease, background 200ms ease;
}

.site-header.is-scrolled {
    border-bottom-color: var(--border-color);
    background: rgba(255,255,255,.96);
}

/* Nav links – underline animation */
.header-nav .nav-link {
    position: relative;
    padding-bottom: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    background: none;
    border-radius: 0;
}

.header-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), #06b6d4);
    border-radius: 2px;
    transition: left 200ms ease, right 200ms ease;
}

.header-nav .nav-link:hover,
.header-nav .nav-link:focus-visible {
    color: var(--accent-color);
    background: none;
}

.header-nav .nav-link:hover::after {
    left: 0;
    right: 0;
}

/* Theme toggle – hidden for this theme (handled by PHP, but as safety) */
.theme-toggle {
    display: none !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    border-radius: 999px;
    font-weight: 600;
    transition: transform 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 1px 3px rgba(79,70,229,.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79,70,229,.35);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: var(--accent-light);
}

/* ── Hero image banner ───────────────────────────────────────── */
.hero-image {
    border-bottom: 1px solid var(--border-color);
}

/* ── Post cards ──────────────────────────────────────────────── */
.post-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: color-mix(in srgb, var(--accent-color) 30%, var(--border-color));
}

.post-card-category {
    background: var(--accent-light);
    color: var(--accent-color);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.post-card-title a {
    color: var(--text-primary);
}

.post-card-title a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* ── Category filter ─────────────────────────────────────────── */
.category-filter a {
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.category-filter a:hover,
.category-filter a.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* ── Single post ─────────────────────────────────────────────── */
.single-post-title {
    color: #0f172a;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.2;
}

.single-post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.single-post-content blockquote {
    border-left: 4px solid var(--accent-color);
    background: var(--accent-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
}

/* ── Comments ────────────────────────────────────────────────── */
.comment {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-container {
    border: 1px solid var(--border-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.comment-form textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid var(--border-color);
}

.site-footer .footer-social-link {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.site-footer .footer-social-link:hover {
    background: var(--accent-color);
    color: #fff;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination a {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-primary);
}

.pagination a:hover,
.pagination .current {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* ── Side menu ───────────────────────────────────────────────── */
.side-menu {
    border-left: 1px solid var(--border-color);
}

.side-menu-link {
    color: var(--text-primary);
    font-weight: 500;
}

.side-menu-link:hover {
    color: var(--accent-color);
}

/* ── Admin – keep neutral adjustments ───────────────────────── */
.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--accent-light);
    color: var(--accent-color);
}

.admin-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.admin-table tr:hover td {
    background: var(--accent-light);
}

/* ── Dashboard stat card accent icons ───────────────────────── */
.dashboard-stat-posts .dashboard-stat-icon  { background: rgba(79,70,229,.12); }
.dashboard-stat-pages .dashboard-stat-icon  { background: rgba(16,185,129,.12); }
.dashboard-stat-users .dashboard-stat-icon  { background: rgba(245,158,11,.12); }
.dashboard-stat-comments .dashboard-stat-icon { background: rgba(236,72,153,.12); }

/* ── Tag badges ──────────────────────────────────────────────── */
.tag-badge {
    border-radius: 999px;
}

/* ── Scrolled header class – applied by JS ───────────────────── */
/* JS adds .is-scrolled on scroll – handled in main.js addition below */

/* ── Accessibility: focus ring ───────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}
