:root {
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-footer: #f9fafb;
    --border-subtle: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #0A4CA6;
    --accent-soft: #d3e5ff;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-pill: 999px;
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
}

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

a:hover {
    text-decoration: underline;
}

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content {
    padding: 2.5rem 0 3.5rem;
}

/* Topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(209, 213, 219, 0.7);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.75rem 0;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.25rem;
}

.logo:hover {
    color: var(--accent);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.95rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.35rem 0.4rem;
    border-radius: 999px;
    transition: background 0.14s ease, color 0.14s ease, transform 0.08s ease;
}

.main-nav a:hover {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateY(-1px);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-toggle {
    display: none;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    background: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, border-color 0.1s ease;
}

.btn.primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

.btn.ghost {
    background: #ffffff;
    color: var(--text-main);
    border-color: var(--border-subtle);
}

.btn.ghost:hover {
    background: #f9fafb;
}

.btn.small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

.btn.full {
    width: 100%;
}

/* Hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem;
}

.hero-text h1 {
    font-size: clamp(2.1rem, 3vw, 2.6rem);
    margin-bottom: 0.6rem;
}

.hero-text p {
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-panels {
    display: grid;
    gap: 0.75rem;
}

.hero-panel {
    background: linear-gradient(135deg, #ffffff, #f3f4ff);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(209, 213, 219, 0.7);
    padding: 0.9rem 1.1rem;
    box-shadow: var(--shadow-soft);
}

.hero-panel h3 {
    margin: 0 0 0.25rem;
}

.hero-panel p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Cards & grids */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(209, 213, 219, 0.8);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

/* Blog layouts */

.page-header {
    margin-bottom: 1.8rem;
}

.page-header h1 {
    margin-bottom: 0.4rem;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
}

.layout-two {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
    gap: 1.5rem;
}

.layout-main {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.layout-side {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(209, 213, 219, 0.8);
}

.post-media {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.placeholder-img {
    background: linear-gradient(135deg, #e5e7eb, #cbd5f5);
    border-radius: var(--radius-md);
    min-height: 120px;
}

.post-content h2 {
    margin-top: 0;
    margin-bottom: 0.2rem;
}

.post-meta {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-excerpt {
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

/* Gallery */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.gallery-item {
    border-radius: var(--radius-md);
    aspect-ratio: 4 / 3;
}

/* Tags, pills */

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
}

.pill-soft {
    background: #e5e7eb;
    color: var(--text-main);
}

.tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.mini-list {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0 0;
    display: grid;
    gap: 0.4rem;
}

/* Music */

.music-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.7rem;
}

.music-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.music-cover {
    aspect-ratio: 2 / 3;
}

.music-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* 💣 přizpůsobí a ořízne */
    object-position: center;
    border-radius: inherit;
    display: block;
}

/* Movies */

.movie-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.movie-card {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0.5rem;
}

.movie-poster {
    aspect-ratio: 2 / 3;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* 💣 přizpůsobí a ořízne */
    object-position: center;
    border-radius: inherit;
    display: block;
}

.movie-body h3 {
    margin: 0 0 0.25rem;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

/* CV layout */

.cv-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.8fr);
    gap: 1.5rem;
}

.cv-side {
    position: sticky;
    top: 5rem;
    align-self: flex-start;
}

.cv-list {
    list-style: none;
    padding: 0;
    margin: 0.4rem 0 0;
    display: grid;
    gap: 0.25rem;
    font-size: 0.92rem;
}

.cv-main {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.timeline {
    display: grid;
    gap: 0.9rem;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 0.2rem;
    bottom: 0.2rem;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 0.6rem;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--accent);
    margin-top: 0.3rem;
}

/* Footer */

.footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-subtle);
    padding: 1.3rem 0 1.4rem;
    margin-top: 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-note {
    margin: 0;
}


/* Modal */

.modal[hidden],
.modal-backdrop[hidden] {
    display: none !important;
}



.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 80;
}

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

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    padding: 1.2rem 1.3rem 1rem;
    width: 100%;
    max-width: 480px;
    position: relative;
}

.modal-lg {
    max-width: 720px;
}

.modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.7rem;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.8rem;
    border-radius: var(--radius-pill);
    background: #f3f4f6;
    padding: 0.15rem;
}

.modal-tab {
    flex: 1;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    padding: 0.35rem 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-tab.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 4px rgba(148, 163, 184, 0.6);
}

.modal-body {
    margin-top: 0.5rem;
}

.modal-footer {
    margin-top: 0.8rem;
}

/* Auth forms */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-form.hidden {
    display: none;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.9rem;
}

.auth-form input {
    padding: 0.5rem 0.6rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border-subtle);
    background: #f9fafb;
    font-size: 0.9rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* Utilities */

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

.small {
    font-size: 0.85rem;
}

.center {
    text-align: center;
}

/* Responsive */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }
    .cv-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .cv-side {
        position: static;
    }
}

@media (max-width: 800px) {
    .topbar-inner {
        padding: 0.5rem 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: absolute;
        inset: 52px 0 auto 0;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid rgba(209, 213, 219, 0.9);
        padding: 0.75rem 1.5rem 0.9rem;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .main-nav.open {
        display: flex;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .hero {
        margin-top: 0.5rem;
    }

    .grid-3,
    .movie-grid,
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .layout-two {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-card {
        grid-template-columns: minmax(0, 1fr);
    }
}



/* CV layout enhancements */
.cv-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 2rem;
    align-items: flex-start;
}

.cv-photo-wrap {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.cv-photo {
    width: 100%;
    max-width: 260px;
    border-radius: 1.25rem;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.18);
    object-fit: cover;
}

.cv-skills {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: grid;
    gap: 0.5rem;
}

.cv-skill-icon {
    margin-right: 0.5rem;
}

.cv-hobbies {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.25rem;
}

.cv-hobby-icon {
    margin-right: 0.5rem;
}

/* Music grid */
.music-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.music-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 1rem;
    /*background: #ffffff;*/
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.music-cover {
    border-radius: 0.75rem;
    aspect-ratio: 1 / 1;
}

/* Movie slider & grid */
.movie-slider {
    margin-bottom: 2.5rem;
}

.movie-slider-inner {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.movie-grid-section {
    margin-top: 1rem;
}

.movie-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.movie-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.movie-poster {
    width: 90px;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

.movie-body {
    flex: 1;
}

/* Blog feed */
.feed {
    display: grid;
    gap: 1.25rem;
}

.feed-item {
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
}

.feed-item-header h2 {
    margin: 0.25rem 0 0;
}

.feed-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.feed-text {
    margin: 0;
    color: var(--text-main);
}

.feed-footer {
    display: flex;
    justify-content: flex-end;
}


/* === Logo image in header === */
.logo-img {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
}

/* === Header actions (theme toggle + login) === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

/* === Theme toggle === */
.theme-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 1.1rem;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        transform 0.12s ease,
        box-shadow 0.16s ease;
}

.theme-toggle:hover {
    background: var(--accent-soft);
    border-color: rgba(148, 163, 184, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}

.sun-icon,
.moon-icon {
    display: inline-block;
    line-height: 1;
}

/* default: light mode => sun visible, moon hidden */
.moon-icon {
    display: none;
}

/* === Dark mode palette overrides === */
body.dark-mode {
    --bg-body: #020617;
    --bg-card: #020617;
    --bg-header: #020617;
    --bg-footer: #020617;
    --border-subtle: #1f2937;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.14);
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.7);
}

/* Header look in dark mode */
body.dark-mode .topbar {
    background: rgba(15, 23, 42, 0.96);
    border-bottom-color: #111827;
}

/* Mobile nav toggle in dark */
body.dark-mode .nav-toggle {
    background: #020617;
    border-color: #1f2937;
    color: var(--text-main);
}

/* Cards and text in dark mode (fallbacks in case nějaké barvy byly napevno) */
body.dark-mode .card,
body.dark-mode .hero-panel,
body.dark-mode .timeline-content,
body.dark-mode .cv-aside,
body.dark-mode .feed-item,
body.dark-mode .app-card {
    background: var(--bg-card);
    color: var(--text-main);
}

body.dark-mode .muted,
body.dark-mode .feed-date {
    color: var(--text-muted);
}


/* === DARK MODE FIXES (improved contrast) === */
body.dark-mode .main-nav a {
    color: var(--text-main) !important;
}
body.dark-mode .main-nav a:hover {
    background: rgba(255,255,255,0.05) !important;
    color: var(--accent) !important;
}

body.dark-mode .btn.ghost {
    background: #0f172a !important;
    color: var(--text-main) !important;
    border: 1px solid #1e293b !important;
}
body.dark-mode .btn.ghost:hover {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .modal {
    background: #0f172a !important;
    color: var(--text-main) !important;
    border: 1px solid #1f2937 !important;
}
body.dark-mode .modal input {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: var(--text-main) !important;
}
body.dark-mode .modal input::placeholder {
    color: #94a3b8 !important;
}

body.dark-mode .card,
body.dark-mode .app-card,
body.dark-mode .feed-item,
body.dark-mode .playlist-card,
body.dark-mode .movie-card {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: var(--text-main) !important;
}

body.dark-mode * {
    color-scheme: dark;
}

/* === DARK MODE – modal-box fix === */
body.dark-mode .modal-box {
    background: #0f172a !important;
    color: var(--text-main) !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.75) !important;
}

/* Tab lišta */
body.dark-mode .modal-tabs {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
}

body.dark-mode .modal-tab {
    background: #1e293b !important;
    color: var(--text-main) !important;
}
body.dark-mode .modal-tab.active {
    background: #334155 !important;
    color: var(--text-main) !important;
}

/* Inputy */
body.dark-mode .modal-box input {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: var(--text-main) !important;
}

body.dark-mode .modal-box input::placeholder {
    color: #94a3b8 !important;
}

/* X ikonka */
body.dark-mode .modal-close {
    color: var(--text-muted) !important;
}

body.dark-mode .modal-close:hover {
    color: var(--text-main) !important;
}

/* === DARK MODE – FINAL TEXT FIX (PLNĚ ČERNÝ TEXT) === */
body.dark-mode .modal-box,
body.dark-mode .modal-box * {
    color: #000000 !important;
}

/* Input placeholdery trochu světlejší než černá */
body.dark-mode .modal-box input::placeholder {
    color: #333333 !important;
}

/* search bar */
.search-bar{position:absolute;top:0;left:0;width:100%;height:60px;background:var(--bg-header);box-shadow:0 4px 20px rgba(0,0,0,.05);display:flex;align-items:center;padding:0 16px;gap:12px;transform:translateY(-100%);transition:transform .35s ease;z-index:2000;}
.search-bar.active{transform:translateY(0);} 
.search-bar input{flex:1;padding:10px 14px;border-radius:12px;border:1px solid var(--border-subtle);background:var(--bg-card);color:var(--text-main);font-size:16px;} .search-bar input:focus{outline:none;border-color:var(--accent);} .close-btn{background:none;border:none;font-size:22px;color:var(--text-main);cursor:pointer;} .dark-mode .search-bar{background:#111827;} .dark-mode .search-bar input{background:#1f2937;color:#f3f4f6;border-color:#374151;} .dark-mode .close-btn{color:#f3f4f6;} @media(max-width:768px){.search-bar{height:56px;} .search-bar input{font-size:14px;padding:8px 12px;}}

/* inline svg icon */
.header-icon svg{width:22px;height:22px;stroke:var(--text-main);} .dark-mode .header-icon svg{stroke:#f3f4f6;}

.header-icon svg{stroke:var(--text-main);} .dark-mode .header-icon svg{stroke:#f3f4f6;}
