/* =====================================================
   MAFIA-1989.CZ — style.css
   ===================================================== */

/* --- 1. VLASTNÍ FONT --- */
@font-face {
    font-family: 'MafiaFont';
    src: url('font.TTF') format('truetype');
    font-display: swap;
}

/* --- 2. CSS PROMĚNNÉ --- */
:root {
    --primary:       #e62e2e;
    --primary-hover: #ff3d3d;
    --bg-dark:       #0a0a0a;
    --card-bg:       #161616;
    --text-main:     #e0e0e0;
    --accent:        #ffb400;
    --border:        #222;
    --border-light:  #333;
}

/* --- 3. RESET & ZÁKLAD --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
}

img { max-width: 100%; display: block; }

/* --- 4. HEADER --- */
header {
    height: 40vh;
    min-height: 200px;
    background: linear-gradient(rgba(0,0,0,0.8), var(--bg-dark)),
                url('https://images.alphacoders.com/108/1083435.jpg') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-bottom: 3px solid var(--primary);
    padding: 1rem;
}

h1 {
    font-family: 'MafiaFont', 'Segoe UI', sans-serif;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 2px 2px 15px rgba(0,0,0,0.9);
    color: #fff;
}

header p {
    color: #aaa;
    margin-top: 0.5rem;
    font-size: clamp(0.85rem, 2vw, 1rem);
    letter-spacing: 1px;
}

h2 { font-family: 'Segoe UI', Roboto, sans-serif; }
h3 { font-family: 'Segoe UI', Roboto, sans-serif; }

/* --- 5. NAVIGACE --- */
nav {
    background: rgba(12, 12, 12, 0.97);
    position: sticky;
    top: 0;
    z-index: 500;
    border-bottom: 2px solid var(--primary);
    backdrop-filter: blur(10px);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    min-height: 52px;
}

.nav-links {
    display: flex;
    gap: 0;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links > a,
.nav-links > .dropdown > a {
    display: block;
    padding: 1rem 1.2rem;
    color: var(--text-main);
    text-decoration: none;
    font-family: 'MafiaFont', 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-links > a:hover,
.nav-links > a.active,
.dropdown:hover > a { color: var(--primary); background: rgba(230,46,46,0.07); }

.nav-links > a.active { border-bottom: 2px solid var(--primary); }

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.9rem 1rem;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown .dropbtn { cursor: pointer; }

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background: #0f0f0f;
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--primary);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
    z-index: 600;
    animation: fadeInMenu 0.2s ease;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content { display: block; }

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.88rem;
    text-transform: none;
    font-family: 'Segoe UI', sans-serif;
    border-bottom: 1px solid #1a1a1a;
    transition: background 0.2s, padding-left 0.2s, color 0.2s;
}

.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a i { color: var(--primary); width: 16px; text-align: center; }

.dropdown-content a:hover {
    background: #1c1c1c;
    color: var(--primary);
    padding-left: 24px;
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- 6. LAYOUT --- */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    transition: color 0.2s;
}

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

/* --- 7. ČLÁNEK --- */
article {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.article-meta {
    color: #555;
    font-size: 0.85rem;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.article-meta span { display: flex; align-items: center; gap: 6px; }

.article-main-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 25px;
    border: 2px solid var(--border);
}

.article-content { overflow: hidden; }

.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
}

.article-content h3 {
    color: #fff;
    margin: 2.5rem 0 1rem;
    border-left: 4px solid var(--primary);
    padding-left: 14px;
    clear: both;
    font-size: 1.15rem;
}

/* --- 8. SYSTÉM POZICOVÁNÍ OBRÁZKŮ --- */

/* Základní wrapper */
.img-wrap {
    overflow: hidden;
    margin-bottom: 4px;
}

.img-wrap figcaption {
    font-size: 0.76rem;
    color: #999999;
    text-align: center;
    padding: 5px 4px;
    font-style: italic;
    line-height: 1.4;
}

/* Galerie obrázek — vždy 1:1 */
.img-wrap .gallery-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: zoom-in;
    transition: border-color 0.25s, transform 0.25s;
    display: block;
}

.img-wrap .gallery-img:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

/* Vlevo */
.img-wrap.img-left {
    float: left;
    width: 240px;
    margin: 4px 24px 16px 0;
}

/* Vpravo */
.img-wrap.img-right {
    float: right;
    width: 240px;
    margin: 4px 0 16px 24px;
}

/* Na střed — vyčistí float */
.img-wrap.img-center {
    float: none;
    clear: both;
    width: 380px;
    max-width: 100%;
    margin: 0 auto 20px;
    display: block;
}

/* Dva vedle sebe */
.img-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    clear: both;
    margin-bottom: 20px;
}

.img-pair .img-wrap {
    float: none;
    width: 100%;
    margin: 0;
}

/* Tři vedle sebe */
.img-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    clear: both;
    margin-bottom: 20px;
}

.img-trio .img-wrap { float: none; width: 100%; margin: 0; }

.clearfix::after { content: ''; display: table; clear: both; }

/* --- 9. LIGHTBOX --- */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 70px 76px;
}

#lightbox.active { display: flex; }

#lb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    max-height: calc(100vh - 140px);
}

#lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 3px;
    transition: transform 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
}

#lb-footer {
    width: 100%;
    text-align: center;
    padding-top: 12px;
    flex-shrink: 0;
}

#lb-caption {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 6px;
    min-height: 1.3em;
}

#lb-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#lb-counter { color: #555; font-size: 0.82rem; min-width: 45px; }

.lb-zoom-btns { display: flex; gap: 7px; }

.lb-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.lb-btn:hover { background: rgba(230,46,46,0.5); }

#lb-close { position: fixed; top: 14px; right: 14px; }
#lb-prev  { position: fixed; left: 12px;  top: 50%; transform: translateY(-50%); font-size: 1.2rem; }
#lb-next  { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }

.lb-btn.lb-zoom {
    width: 36px;
    height: 36px;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* --- 10. KARTIČKY ČLÁNKŮ (index) --- */
.section-title {
    margin: 2.5rem 0 1.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1.2rem;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.article-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: #3a3a3a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.card-image { overflow: hidden; aspect-ratio: 16/9; }

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

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

.card-content { padding: 18px; }

.card-date { font-size: 0.76rem; color: #444; display: block; margin-bottom: 6px; }

.card-content h3 {
    font-size: 1.05rem;
    color: #eee;
    margin-bottom: 8px;
    clear: none;
    border: none;
    padding: 0;
    margin-top: 0;
}

.card-content p { font-size: 0.86rem; color: #777; margin-bottom: 14px; line-height: 1.6; }

.btn-more {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.84rem;
    font-weight: bold;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-more:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 12px rgba(230,46,46,0.4);
}

/* --- 11. DOWNLOAD FILTROVÁNÍ --- */
.dl-filter-bar {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
}

.dl-search-wrap { flex: 1; min-width: 200px; position: relative; }

.dl-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #444;
    pointer-events: none;
    font-size: 0.85rem;
}

#dlSearch {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 9px 12px 9px 34px;
    border-radius: 5px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

#dlSearch:focus { border-color: var(--primary); }
#dlSearch::placeholder { color: #333; }

.dl-tags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.tag-btn {
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #666;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover { border-color: #444; color: #999; }
.tag-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

#dlNoResults {
    display: none;
    text-align: center;
    padding: 3rem;
    color: #333;
    font-size: 1rem;
}

/* --- 12. DOWNLOAD POLOŽKY --- */
.download-item {
    background: #0d0d0d;
    display: flex;
    gap: 22px;
    padding: 22px;
    border-radius: 8px;
    border: 1px solid var(--border);
    align-items: flex-start;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.download-item:hover { border-color: #2e2e2e; }

.dl-img { flex-shrink: 0; }

.dl-img img {
    width: 160px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--border);
}

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

.dl-info h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 6px;
    clear: none;
    border: none;
    padding: 0;
    margin-top: 0;
}

.dl-info p { font-size: 0.86rem; color: #777; margin-bottom: 10px; }

.dl-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.92rem;
    color: #999;
    margin-bottom: 10px;
}

.dl-meta span { display: flex; align-items: center; gap: 5px; }

.dl-tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.dl-tag {
    background: rgba(230,46,46,0.08);
    border: 1px solid rgba(230,46,46,0.18);
    color: #903;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 0.73rem;
}

.dl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.86rem;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-download:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 12px rgba(230,46,46,0.4);
}

/* Video tlačítko — inactive stav */
.btn-video {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    color: #888;
    border: 1px solid #2e2e2e;
    padding: 9px 18px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.2s;
}

/* Video tlačítko — active stav (video je přehrávané) */
.btn-video:hover:not(.disabled) { border-color: var(--accent); color: var(--accent); }

.btn-video.active {
    background: rgba(255,180,0,0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* Video tlačítko — disabled (žádné video) */
.btn-video.disabled { opacity: 0.25; cursor: not-allowed; }

.video-embed {
    display: none;
    margin-top: 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.video-embed.visible { display: block; }

.video-embed iframe { width: 100%; height: 270px; display: block; }

/* Počítadlo stažení */
.dl-count {
    font-size: 0.78rem;
    color: #3a3a3a;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 4px;
}

/* Hvězdičkové hodnocení */
.star-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
}

.star-rating .star {
    font-size: 1.15rem;
    color: #252525;
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    line-height: 1;
}

.star-rating .star.filled,
.star-rating .star.hover { color: var(--accent); }

.star-rating[data-rated] .star { cursor: default; }

.rating-text { font-size: 0.76rem; color: #444; margin-left: 4px; }

/* --- 13. GRID KATEGORIÍ KE STAŽENÍ --- */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.download-category-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.download-category-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 10px 28px rgba(0,0,0,0.5);
}

.category-image { overflow: hidden; }

.category-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.4s;
    border-bottom: 2px solid var(--border);
}

.download-category-card:hover .category-image img { transform: scale(1.06); }

.card-download-content {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-download-content h3 {
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 1.1rem;
    clear: none;
    border: none;
    padding: 0;
    margin-top: 0;
}

.card-download-content p { font-size: 0.84rem; color: #666; margin-bottom: 16px; flex-grow: 1; }

.btn-category {
    display: block;
    text-align: center;
    background: transparent;
    color: #fff;
    text-decoration: none;
    padding: 9px 0;
    border: 2px solid var(--primary);
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.86rem;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-category:hover {
    background: var(--primary);
    box-shadow: 0 0 12px rgba(230,46,46,0.3);
}

/* --- 14. FOOTER --- */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: #282828;
    border-top: 1px solid #111;
    margin-top: 3rem;
    font-size: 0.84rem;
}

/* --- 15. RESPONZIVNÍ DESIGN --- */
@media (max-width: 900px) {
    .download-item { flex-direction: column; align-items: stretch; }
    .dl-img img    { width: 100%; max-width: 280px; margin: 0 auto; aspect-ratio: 16/9; }
}

@media (max-width: 768px) {
    /* Hamburger menu */
    .nav-toggle { display: flex; }
    .nav-inner  { justify-content: flex-end; }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        border-top: 1px solid var(--border);
        padding: 0.4rem 0;
        gap: 0;
    }

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

    .nav-links > a,
    .nav-links > .dropdown > a {
        padding: 0.85rem 1.5rem;
        border-bottom: 1px solid var(--border);
        width: 100%;
        font-size: 0.9rem;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: #0a0a0a;
        animation: none;
    }

    .dropdown-content a { padding-left: 2.8rem; }

    /* Obrázky */
    .img-wrap.img-left,
    .img-wrap.img-right { float: none; width: 100%; margin: 0 0 16px 0; }
    .img-wrap.img-center { width: 100%; }
    .img-pair { grid-template-columns: 1fr; }
    .img-trio { grid-template-columns: 1fr 1fr; }

    /* Lightbox */
    #lightbox  { padding: 50px 46px 68px; }
    #lb-prev   { left: 6px; }
    #lb-next   { right: 6px; }

    article { padding: 18px; }
    .dl-filter-bar { flex-direction: column; }
}

@media (max-width: 480px) {
    .article-grid  { grid-template-columns: 1fr; }
    .download-grid { grid-template-columns: 1fr; }
    .img-trio      { grid-template-columns: 1fr; }
    h1             { letter-spacing: 2px; }
    #lightbox      { padding: 48px 40px 68px; }
    .lb-btn        { width: 36px; height: 36px; font-size: 0.88rem; }
}
