/* ============================================================
   MHM Style v2.5 — MatureHomemade.com (SmartCJ slave, GD master, Linked ID 18)
   Created: 2026-05-02
   v1.8: Mobile 2-row header (search row + home btn) <768px
   v1.9: Slide-out menu icons + Categories accordion (GD-mintára)
   v2.0: Logo abszolút középre + slimmer mobile search bar
   v2.1: Slide-out menü a BAL oldalra nyílik (GrannySex.Tube mintára)
   v2.2: menu-close-btn + hm-cat-toggle + hm-categories CSAK <1100px-en
   v2.3: header z-index 100→250 (stacking context fix — menu below overlay bug)
   v2.4: Categories sorok kompaktabb (padding 9→5px)
   v2.5: Autocomplete dropdown sorok kompaktabb (padding 9→5px)
   Theme: light #f5f5f5 + accent red #e84448
   Responsive breakpoints: 1100px / 768px / 480px
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px; line-height: 1.5;
    color: #333; background: #f5f5f5;
}
img { max-width: 100%; height: auto; border: 0; vertical-align: middle; display: block; }
a { color: #e84448; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #e60000; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* === LAYOUT === */
.wrapper { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

/* === HEADER === */
header#main-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky; top: 0;
    z-index: 250;
    transition: transform 0.3s ease;
}
header#main-header.hidden { transform: translateY(-100%); }
.header-inner {
    display: flex; align-items: center; gap: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
    padding-left: 40px;
    padding-right: 40px;
}
.logo {
    display: flex; align-items: center;
    line-height: 0;
    transition: opacity 0.2s ease;
}
.logo:hover { opacity: 0.85; }
.logo-svg {
    height: 36px;
    width: auto;
    display: block;
}
.logo-svg text {
    font-family: 'Anton', 'Impact', 'Arial Black', sans-serif;
    font-weight: 400;
}

/* Hamburger */
.hamburger-btn {
    display: none;
    width: 36px; height: 36px;
    flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    flex-shrink: 0;
}
.hamburger-btn span {
    width: 22px; height: 2px;
    background: #333; border-radius: 1px;
    transition: all 0.3s ease;
}
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav */
.main-nav { display: flex; align-items: center; gap: 24px; flex: 1; }
.nav-list { display: flex; gap: 8px; }
.nav-list a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    color: #333; font-weight: 500;
    border-radius: 999px;
    transition: all 0.2s ease;
}
.nav-list a svg {
    flex-shrink: 0;
    color: #e84448;
    display: block;
}
.nav-list a:hover { background: #ffe5e6; color: #e84448; }
.nav-list .active a { background: #e84448; color: #fff; }
.nav-list .active a svg { color: #fff; }

/* Categories accordion (slide-out menüben, mobil) — desktop-on rejtett */
.hm-cat-toggle { display: none; width: 100%; }
.hm-cat-toggle > a {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    color: #333; font-weight: 500;
    cursor: pointer;
    width: 100%;
    border-radius: 999px;
    transition: all 0.2s ease;
}
.hm-cat-toggle > a svg.cat-icon { color: #e84448; flex-shrink: 0; }
.hm-cat-toggle > a .cat-arrow {
    margin-left: auto;
    color: #e84448;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.hm-cat-toggle.expanded > a {
    background: #ffe5e6;
    color: #e84448;
}
.hm-cat-toggle.expanded > a .cat-arrow { transform: rotate(180deg); }

.hm-categories {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.hm-categories.expanded {
    max-height: 60vh;
    overflow-y: auto;
}
.hm-categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 4px 0;
}
.hm-categories-grid a {
    display: block;
    padding: 5px 12px;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
    text-transform: capitalize;
}
.hm-categories-grid a:hover {
    background: #fff5f5;
    color: #e84448;
}

/* Slide-out close X (bal felső sarokban — csak mobile slide-out menüben) */
.menu-close-btn {
    display: none;
    position: absolute;
    top: 14px; left: 14px;
    width: 32px; height: 32px;
    align-items: center; justify-content: center;
    color: #555;
    font-size: 28px; line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
    z-index: 1;
}
.menu-close-btn:hover { background: #f0f0f0; color: #333; }

/* Search */
.search-form {
    display: flex; align-items: center;
    background: #f5f5f5; border: 1px solid #e0e0e0;
    border-radius: 999px; padding: 4px 6px 4px 14px;
    flex: 1; max-width: 380px; margin-left: auto;
}
.search-form input {
    flex: 1; border: 0; outline: none; background: none;
    padding: 4px 6px; font-size: 14px;
}
.search-form button {
    background: #e84448; color: #fff;
    padding: 8px 16px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
}
.search-form button:hover { background: #e60000; }

/* === MAIN === */
main { padding: 24px 0; min-height: 60vh; }

.section-title {
    font-size: 20px; font-weight: 600;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e84448;
    color: #333;
}
.section-title:not(:first-child) { margin-top: 32px; }

/* === THUMB GRID (320×180) — explicit 4/3/2 columns at 1000/768 breakpoints (GD-mintára) === */
.thumbs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.thumb-card {
    display: block;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    color: #333;
}
.thumb-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: #e84448;
}
.thumb-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}
.thumb-img > img {
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 0.3s ease;
    -webkit-user-drag: none; user-drag: none;
}

/* Hover preview MP4 (mint GD v13) */
.thumb-img > .thumb-preview {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    background: #000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2;
}
.thumb-img.previewing > .thumb-preview { opacity: 1; }
.thumb-img.previewing > img { opacity: 0; }

/* Badges (duration, views) */
.thumb-img .badge {
    position: absolute; bottom: 6px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px; font-weight: 600;
    z-index: 3; pointer-events: none;
}
.thumb-img .badge.duration { right: 6px; }
.thumb-img .badge.views { left: 6px; }

.thumb-info { padding: 8px 10px; }
.thumb-title {
    font-size: 13px; font-weight: 500; line-height: 1.35;
    color: inherit; margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Disable hover transform (no movement bug) */
.thumb-card:hover .thumb-img > img { transform: none; }
.thumb-img { touch-action: manipulation; }

/* === CATEGORIES PILL LIST (compact, alphabetic) === */
.text-categories {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}
.text-categories-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600;
    margin-bottom: 12px;
    color: #555;
}
.text-categories-list {
    display: flex; flex-wrap: wrap; gap: 8px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.text-categories-list.collapsed {
    max-height: 100px;
    position: relative;
}
.text-categories-list.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
}
.category-pill {
    display: inline-block;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 6px 14px;
    color: #333;
    font-size: 13px; font-weight: 500;
    transition: all 0.2s ease;
}
.category-pill:hover {
    background: #e84448;
    border-color: #e84448;
    color: #fff;
}
.show-all-toggle {
    display: block;
    text-align: center;
    color: #e84448;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    padding: 8px;
}
.show-all-toggle:hover { color: #e60000; }
.show-all-toggle::after {
    content: " \25BC";
    font-size: 10px;
}
.show-all-toggle.expanded::after { content: " \25B2"; }

/* === DESCRIPTION BLOCK (welcome + read more) === */
.description-block {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}
.description-block .read-more-content {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}
/* p margin "lopja" a sor-helyet -> első/utolsó margin nullra a content-en belül */
.description-block .read-more-content > p:first-child { margin-top: 0; }
.description-block .read-more-content > p { margin-top: 0.6em; margin-bottom: 0; }
.description-block .read-more-content.collapsed {
    max-height: 6.5em;     /* ~3 teljes sor + kis tartalék */
}
.description-block .read-more-content.collapsed::after {
    background: linear-gradient(to bottom, transparent, #fff 90%);
    height: 2.4em;
}
.description-block .read-more-toggle {
    display: block;
    text-align: center;
    margin-top: 12px;
}
.description-block .read-more-toggle::after {
    content: " \25BC";
    font-size: 10px;
}
.description-block .read-more-toggle.expanded::after { content: " \25B2"; }

/* === POPULAR SEARCHES === */
.popular-searches {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.popular-searches-label {
    font-size: 13px; font-weight: 600;
    color: #555;
    margin-right: 4px;
}

/* === READ MORE / LESS === */
.read-more-container { margin: 16px 0; }
.read-more-content {
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.read-more-content.collapsed {
    max-height: 5em;       /* 3 sor szöveg (line-height 1.6 × 14px = ~67px = 4.8em, kerekítve 5em) */
    position: relative;
}
.read-more-content.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2.4em;         /* erősebb fade hogy az utolsó sor szépen halványuljon */
    background: linear-gradient(to bottom, transparent, #fff 90%);
    pointer-events: none;
}
.read-more-toggle {
    color: #e84448;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    display: block;        /* középre — JS is így állítja, de CSS-ben is alapból */
    text-align: center;
}
.read-more-toggle:hover { color: #e60000; }

/* === FOOTER === */
footer#main-footer {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 32px 0 24px;
    margin-top: 48px;
}
.footer-inner {
    display: flex; flex-direction: column; gap: 16px;
    align-items: center; text-align: center;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: #666; font-size: 13px; }
.footer-links a:hover { color: #e84448; }
.footer-disclaimer {
    color: #999;
    font-size: 12px;
    line-height: 1.5;
    max-width: 700px;
    margin: 0;
}

/* === AUTOCOMPLETE DROPDOWN === */
#autocomplete-dropdown .ac-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.15s ease;
}
#autocomplete-dropdown .ac-item:hover {
    background: #fff5f5;
}
#autocomplete-dropdown .ac-item:last-child { border-bottom: none; }
#autocomplete-dropdown .ac-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#autocomplete-dropdown .ac-text strong { color: #000; font-weight: 500; }
#autocomplete-dropdown .ac-count {
    color: #999;
    font-size: 12px;
    margin-left: 12px;
    flex-shrink: 0;
}
#autocomplete-dropdown .ac-flame { font-size: 12px; margin-left: 4px; }

/* === MENU OVERLAY === */
.menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.menu-overlay.active { opacity: 1; pointer-events: auto; }

/* === MOBILE SEARCH ROW (csak 768px alatt látszik) === */
.mobile-search-row {
    display: none;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}
.mobile-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
}
.home-btn {
    flex-shrink: 0;
    width: 34px; height: 34px;
    border: 1px solid #c0c0c0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #555;
    transition: all 0.2s ease;
}
.home-btn svg { display: block; width: 16px; height: 16px; }
.home-btn:hover {
    background: #ececec;
    border-color: #999;
    color: #333;
}
.mobile-search-row .search-form {
    flex: 1;
    margin: 0;
    max-width: none;
    padding: 2px 3px 2px 12px;
}
.mobile-search-row .search-form input {
    padding: 3px 6px;
    font-size: 13px;
}
.mobile-search-row .search-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    width: 30px; height: 30px;
}
.mobile-search-row .search-form button svg { display: block; width: 15px; height: 15px; }

/* ====================================================
   RESPONSIVE
   ==================================================== */

/* Tablet/laptop (1100px alatt) — hamburger megjelenik */
@media (max-width: 1100px) {
    .hamburger-btn { display: flex; order: -1; }
    .main-nav {
        position: fixed;
        top: 0; left: -100%;
        width: 80%; max-width: 320px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 60px 16px 24px;
        box-shadow: 4px 0 16px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 200;
        overflow-y: auto;
    }
    .main-nav.active { left: 0; }
    .nav-list { flex-direction: column; gap: 4px; width: 100%; }
    .nav-list a { padding: 12px 16px; border-radius: 8px; }
    /* Mobile-only nav elemek visszaállítása */
    .menu-close-btn { display: flex; }
    .hm-cat-toggle { display: block; }
    .hm-categories { display: block; }
    .search-form { margin: 16px 0 0; max-width: 100%; }
    .header-inner {
        position: relative;
        gap: 12px;
        min-height: 48px;
    }
    /* Logo abszolút középre (oldal közepe, hamburger nem tolja el) */
    .logo {
        position: absolute;
        left: 50%; top: 50%;
        transform: translate(-50%, -50%);
        flex: none;
    }
}

/* Tablet (1000px alatt) — 4 → 3 oszlop */
@media (max-width: 1000px) {
    .thumbs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* Tablet/mobile (768px alatt) — 3 → 2 oszlop */
@media (max-width: 768px) {
    .thumbs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .thumb-info { padding: 6px 8px; }
    .thumb-title { font-size: 12px; line-height: 1.3; }
    .section-title { font-size: 17px; }
    .wrapper { padding: 0 10px; }
    main { padding: 16px 0; }
    .logo-svg { height: 30px; }
    .description-block, .text-categories, .popular-searches { padding: 14px; }
    .description-block .read-more-content { font-size: 13px; }

    /* Mobile search row aktiválás + slide-out search elrejtés */
    .mobile-search-row { display: block; }
    .main-nav .search-form { display: none; }
}

/* Mobile (480px alatt) */
@media (max-width: 480px) {
    .logo-svg { height: 26px; }
    .thumbs-grid { gap: 6px; }
    .thumb-title { font-size: 11px; }
    .thumb-info { padding: 5px 7px; }
    .category-pill { padding: 5px 10px; font-size: 12px; }
    .footer-links { gap: 10px; }
    .footer-links a { font-size: 12px; }
}
