:root {
    --bg-primary:   #f6ead6;
    --bg-secondary: #ff9c1a;
    --bg-hover:     #fff8ec;
    --text-primary: #4a2600;
    --text-dark:    #000;
    --text-light:   #fff;
    --shadow:       rgba(74, 38, 0, .18);

    --surface:      #fffaf1;
    --surface-2:    #f0dfc4;
    --brand:        #ff9c1a;
    --brand-dark:   #e07d00;
    --ink-2:        #8a6237;
    --line:         #e4cfa8;

    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;

    --sh-1: 0 1px 2px rgba(74,38,0,.06), 0 2px 8px rgba(74,38,0,.06);
    --sh-2: 0 6px 22px rgba(74,38,0,.16);
    --sh-3: 0 12px 32px rgba(74,38,0,.22);
}

* { box-sizing: border-box; }

body {
    background:
        radial-gradient(1100px 480px at 50% -160px, #fff4e2 0%, transparent 70%),
        var(--bg-primary);
    color: var(--text-primary);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

ul, li { list-style: none; margin: 0; padding: 0; }

a { color: var(--text-primary); text-decoration: none; font-weight: 600; transition: color .2s ease; }
a:hover { color: var(--brand-dark); }

p { margin: 5px; padding: 5px; }
img { max-width: 100%; }
::selection { background: var(--brand); color: #fff; }

.top-menu {
    background: linear-gradient(180deg, #ffae3d 0%, var(--brand) 100%);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 8px 0;
    box-shadow: 0 2px 14px var(--shadow);
    border-bottom: 1px solid rgba(74,38,0,.12);
}

.content { max-width: 1400px; margin: 0 auto; padding: 0 12px; }

.header-flex { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.logo a {
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .5px;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.logo a:hover { color: var(--text-dark); }

.top-bar ul { display: flex; gap: 4px; }

.top-bar li a {
    display: block;
    padding: 9px 16px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    border-radius: 999px;
    transition: background .2s ease, color .2s ease;
    white-space: nowrap;
}
.top-bar li a:hover { background: var(--text-primary); color: #ffd9a1; }

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    font-size: 26px;
    color: var(--text-primary);
    background: rgba(255,255,255,.35);
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s ease;
}
.menu-toggle:hover { background: rgba(255,255,255,.7); }

.main-content { padding-top: 74px; }

.h1-bar {
    margin: 14px 0 18px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--brand);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
}

h1 { font-size: 24px; margin: 0; font-weight: 800; line-height: 1.25; }

.jopa-title {
    font-size: 20px;
    font-weight: 800;
    margin: 30px 0 12px;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--line);
}
.jopa-title::before {
    content: "";
    width: 6px; height: 22px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    flex: none;
}

.categoryes:has(a[target="_blank"]) {
    background: linear-gradient(180deg, var(--surface) 0%, #fdf1dd 100%);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    padding: 14px 16px 16px;
    margin: 18px 0;
}

.categoryes:has(a[target="_blank"])::before {
    content: "Рекомендуем";
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-bottom: 12px;
}

.categoryes:has(a[target="_blank"]) > ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.categoryes li:has(> a[target="_blank"]) { background: none; border: 0; border-radius: var(--r-md); }

.categoryes a[target="_blank"] {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.categoryes a[target="_blank"]::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px rgba(255,156,26,.25);
    flex: none;
}
.categoryes a[target="_blank"]::after {
    content: "\2197";
    margin-left: auto;
    font-size: 15px;
    color: var(--ink-2);
    transition: transform .18s ease, color .18s ease;
}
.categoryes a[target="_blank"]:hover {
    background: linear-gradient(135deg, #ffd9a6 0%, #ffc27a 100%);
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: var(--sh-2);
    color: var(--text-dark);
}
.categoryes a[target="_blank"]:hover::after { transform: translate(3px,-3px); color: var(--brand-dark); }

.categoryes { padding: 0; margin: 18px 0; }

.categoryes > ul { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.cat-info {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    padding: 14px 16px;
    margin: 20px 0;
}
.cat-info > ul { gap: 10px; }

.categoryes li.meta {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-2);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.categoryes li.meta b { color: var(--text-primary); font-weight: 800; }

.categoryes li.like-row { background: none; border: 0; padding: 0; }

.categoryes button {
    background: linear-gradient(135deg, #5c3005, var(--text-primary));
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 3px 10px rgba(74,38,0,.28);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.categoryes button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(74,38,0,.34); }
.categoryes button:active:not(:disabled) { transform: translateY(0); }
.categoryes button:disabled { background: #2b1600; cursor: not-allowed; opacity: .75; }
.categoryes button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.like { width: 22px; height: 22px; position: relative; }
.like::before { content: '\2665'; font-size: 20px; position: absolute; top: -3px; left: 0; transition: all .3s ease; }
button:not(:disabled) .like::before { content: '\2661'; }
button:disabled .like::before { content: '\2665'; color: #ff6b6b; }
button:hover:not(:disabled) .like::before { content: '\2665'; color: #ff6b6b; animation: heartBeat .6s ease; }

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(.95); }
    75% { transform: scale(1.15); }
}

.categoryes li.actor-row {
    background: none;
    border: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-weight: 700;
    color: var(--ink-2);
    padding: 2px 0;
}
.categoryes li.actor-row span {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-radius: 999px;
    padding: 5px 14px;
    box-shadow: var(--sh-1);
}
.categoryes li.actor-row span a { color: #fff; }
.categoryes li.actor-row span a:hover { color: #2b1600; }

.categoryes li.tags-head {
    background: none;
    border: 0;
    width: 100%;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin-top: 4px;
}

.categoryes li {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.categoryes li a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 999px;
}

.categoryes li:not(.meta):not(.tags-head):not(.actor-row):not(.like-row):not(:has(> a[target="_blank"])):hover {
    background: var(--brand);
    transform: translateY(-2px);
    box-shadow: var(--sh-2);
}
.categoryes li:not(.meta):not(.actor-row):not(:has(> a[target="_blank"])):hover > a { color: #fff; }

.categoryes ul.pager { justify-content: center; gap: 12px; margin: 22px 4px; }
.categoryes ul.pager li {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border: 0;
    box-shadow: var(--sh-1);
}
.categoryes ul.pager li a { color: #fff; padding: 12px 22px; font-weight: 700; }
.categoryes ul.pager li:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

.categoryes.align-right { text-align: right; }
.categoryes.align-center { text-align: center; }

.cont {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.jopa { position: relative; overflow: hidden; }

.thumbs {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    height: 100%;
    box-shadow: var(--sh-1);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.thumbs:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--sh-3); }

.thumbs > a { display: block; position: relative; overflow: hidden; border-radius: var(--r-md); }

.thumbs img {
    width: 100%;
    height: auto;
    aspect-ratio: 300 / 435;
    object-fit: cover;
    display: block;
    border-radius: var(--r-md);
    transition: transform .45s ease;
    background: var(--surface-2);
}
.thumbs:hover img { transform: scale(1.06); }

.gallery_title {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    margin: 0;
    padding: 26px 12px 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.78) 55%, rgba(0,0,0,.9) 100%);
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thumbs > a[data-fancybox]::after {
    content: "\2922";
    position: absolute;
    top: 8px; right: 8px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #fff;
    background: rgba(0,0,0,.45);
    border-radius: 50%;
    opacity: 0;
    transform: scale(.8);
    transition: opacity .2s ease, transform .2s ease;
}
.thumbs:hover > a[data-fancybox]::after { opacity: 1; transform: scale(1); }

#load-more {
    display: block;
    margin: 32px auto 16px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #5c3005 0%, var(--text-primary) 100%);
    color: #ffd9a1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(74,38,0,.3);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
#load-more:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(74,38,0,.38); }
#load-more:disabled { opacity: .5; cursor: not-allowed; transform: none; }
#load-more:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.footer {
    padding: 22px 12px;
    background: linear-gradient(180deg, var(--brand) 0%, #f08c00 100%);
    margin-top: 46px;
    border-top: 1px solid rgba(74,38,0,.15);
}
.foot {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-weight: 600;
}

@media (max-width: 768px) {
    body { font-size: 15px; }

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

    .top-bar {
        position: absolute;
        right: 8px;
        top: 62px;
        width: min(260px, 90vw);
        max-height: 70vh;
        background: linear-gradient(180deg, #ffb14a, var(--brand));
        border-radius: var(--r-md);
        box-shadow: var(--sh-3);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all .28s ease;
    }
    .top-bar.show { opacity: 1; visibility: visible; transform: translateY(0); }
    .top-bar ul { display: block; padding: 10px; }
    .top-bar li { margin-bottom: 4px; }
    .top-bar li a { text-align: right; }

    .logo a { font-size: 19px; }
    h1 { font-size: 19px; }
    .jopa-title { font-size: 17px; }

    .cont { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
    .gallery_title { font-size: 12px; padding: 20px 8px 8px; }

    .categoryes:has(a[target="_blank"]) { padding: 12px; border-radius: var(--r-md); }
    .categoryes:has(a[target="_blank"]) > ul { grid-template-columns: 1fr; gap: 8px; }
    .cat-info { padding: 12px; }
    .categoryes ul.pager li a { padding: 10px 16px; font-size: 14px; }
}

@media (max-width: 480px) {
    .header-flex { gap: 8px; }
    .content { padding: 0 8px; }
    .h1-bar { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}


.top-bar::-webkit-scrollbar { width: 8px; }
.top-bar::-webkit-scrollbar-track { background: rgba(0,0,0,.1); border-radius: 4px; }
.top-bar::-webkit-scrollbar-thumb { background: var(--text-primary); border-radius: 4px; }