
/* =========================================================
   THEME / GLOBAL
   ========================================================= */

:root{
    --bg:#fff;
    --text:#000;
    --muted:#878787;
    --line:#e7e7e7;
    --blue:#0033CC;
    --red:#FF0000;
    --hover:#FFFFDB;
    --input-bg:#fff;
}

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    max-width:100%;
    min-height:100%;
}

body{
    min-height:100vh;
    background:var(--bg);
    color:var(--text);
    font:17px/1.55 Arial,Helvetica,sans-serif;
}

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

a:hover,
a:focus-visible{
    color:var(--red);
    text-decoration:none;
}

button,
input{
    font:inherit;
}


/* =========================================================
   HEADER / BRAND / SEARCH
   ========================================================= */

.site-header{
    position:sticky;
    top:0;
    z-index:900;
    width:100%;
    background:var(--bg);
}

.header-inner{
    width:100%;
    max-width:1100px;
    margin:0 auto;
    padding:15px 20px 40px;
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    column-gap:24px;
    row-gap:10px;
}

.brand-wrap{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}

.brand-link{
    display:block;
    flex:0 0 auto;
}

.brand-logo{
    display:block;
    width:64px;
    height:64px;
    object-fit:contain;
    flex:0 0 auto;
}

.brand-title{
    margin:0;
    color:var(--red);
    font-size:46px;
    line-height:1;
    font-weight:700;
    letter-spacing:-.04em;
}

.header-search{
    min-width:0;
}

.search{
    width:100%;
    display:grid;
    grid-template-columns:minmax(0,1fr) 52px;
    align-items:center;
    gap:10px;
    margin:0;
}

.search input{
    width:100%;
    min-width:0;
    height:52px;
    padding:10px 12px;
    background:var(--input-bg);
    color:var(--text);
    border:1px solid var(--muted);
    border-radius:0;
    outline:0;
}

.search input::placeholder{
    color:var(--muted);
}

.search button{
    width:52px;
    height:52px;
    margin:0;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:transparent;
    border:0;
    cursor:pointer;
}

.search button img{
    display:block;
    width:21px;
    height:21px;
    border:0;
}


/* =========================================================
   SHARED PAGE LAYOUT / HEADINGS
   ========================================================= */

.page{
    width:100%;
    max-width:1100px;
    margin:0 auto;
    padding:8px 20px 26px;
    display:grid;
    grid-template-columns:minmax(0,1fr) 260px;
    gap:40px;
    align-items:start;
}

.main-content{
    min-width:0;
    text-align:left;
}

.sidebar{
    min-width:0;
    position:sticky;
    top:250px;
    align-self:start;
}

.content-heading{
    margin:0 0 20px;
    text-align:left;
}

.content-heading h1,
.content-heading h2{
    margin:0;
    color:var(--text);
    font-size:22px;
    line-height:1.2;
    font-weight:400;
}

.sort-row{
    display:inline;
    font-size:inherit;
    font-style:normal;
}

.content-heading h1 a,
.content-heading h2 a{
    margin-left:6px;
    font-size:inherit;
    font-weight:400;
    font-style:normal;
    white-space:nowrap;
}

.content-heading h1 a:hover,
.content-heading h1 a:focus-visible,
.content-heading h2 a:hover,
.content-heading h2 a:focus-visible{
    background:var(--hover);
    color:#000;
}

.sponsor-slot{
    width:100%;
    margin:0 0 14px;
    padding:0 0 10px;
    overflow:hidden;
    text-align:left;
}


/* =========================================================
   INDEX / CATEGORY THREADED LIST
   ========================================================= */

.list{
    width:100%;
    text-align:left;
}

.list,
.folder-item,
.row{
    min-width:0;
    max-width:100%;
}

.folder-item{
    position:relative;
    --thread-left:0px;
}

.folder-item.is-hidden{
    display:none;
}

.folder-item:nth-child(6n+1){--thread-left:0px}
.folder-item:nth-child(6n+2){--thread-left:26px}
.folder-item:nth-child(6n+3){--thread-left:52px}
.folder-item:nth-child(6n+4){--thread-left:52px}
.folder-item:nth-child(6n+5){--thread-left:26px}
.folder-item:nth-child(6n){--thread-left:0px}

.folder-link{
    position:relative;
    display:block;
    max-width:100%;
    padding:10px 0 12px calc(46px + var(--thread-left));
    color:var(--blue);
    border-bottom:1px dashed var(--line);
}

.folder-link:hover,
.folder-link:focus-visible{
    background:var(--hover);
    color:var(--text);
}

.folder-link::before{
    content:"";
    position:absolute;
    left:calc(24px + var(--thread-left));
    top:-1px;
    bottom:-1px;
    width:1px;
    background:var(--line);
}

.folder-link::after{
    content:"";
    position:absolute;
    left:calc(24px + var(--thread-left));
    top:19px;
    width:15px;
    height:1px;
    background:var(--line);
}

.folder-item:nth-child(6n+1) .folder-link::before,
.folder-item:nth-child(6n) .folder-link::before{
    top:19px;
}

.row{
    display:flex;
    align-items:baseline;
    gap:10px;
    width:100%;
}

.folder-name{
    min-width:0;
    word-break:break-word;
}

.folder-mini-thumb{
    display:inline-block;
    width:20px;
    height:20px;
    flex:0 0 20px;
}

.folder-mini-thumb img{
    display:block;
    width:20px;
    height:20px;
    object-fit:cover;
    border:0;
}

.folder-category{
    flex:0 0 auto;
    color:var(--muted);
    font-size:14px;
    line-height:1;
}

.folder-meta{
    display:inline-flex;
    align-items:baseline;
    gap:8px;
    flex:0 0 auto;
    margin-left:8px;
}

.folder-date,
.folder-count{
    color:var(--muted);
    font-style:italic;
    font-size:14px;
    white-space:nowrap;
}

.folder-count{
    font-family:Georgia,"Times New Roman",serif;
    font-size:12px;
}

.folder-new{
    color:var(--red);
    font-size:12px;
    font-style:normal;
    font-weight:700;
    white-space:nowrap;
}

.thumb-preview{
    position:absolute;
    right:0;
    top:100%;
    z-index:100;
    display:none;
    width:auto;
    max-width:260px;
    margin-top:5px;
}

.thumb-preview img{
    display:block;
    width:auto;
    height:auto;
    max-width:220px;
    max-height:260px;
    object-fit:contain;
    background:#fff;
    border:1px solid var(--muted);
    box-shadow:0 6px 18px rgba(0,0,0,.18);
}

.folder-link:hover .thumb-preview,
.folder-link:focus .thumb-preview{
    display:inline-block;
}

.empty{
    padding:10px 0;
    color:var(--muted);
    border-bottom:1px dashed var(--line);
}

.load-more-wrap{
    width:100%;
    margin-top:20px;
    padding-top:12px;
    display:flex;
    justify-content:flex-start;
    align-items:center;
    gap:10px;
}

.load-more{
    padding:8px 12px;
    background:var(--line);
    color:#000;
    border:1px solid var(--line);
    border-radius:0;
    cursor:pointer;
}

.load-more:hover,
.load-more:focus-visible{
    background:var(--hover);
}


/* =========================================================
   IMAGE GALLERIES
   ========================================================= */

/*
 * Gallery pages now inherit the exact same header and page spacing as
 * every other page. Older gallery-specific header padding was making the
 * whole gallery grid (including the right column) begin higher.
 */

.gallery-heading{
    margin-bottom:18px;
}

.gallery-summary{
    margin:5px 0 0;
    color:var(--muted);
}

.gallery-thread{
    width:100%;
    max-width:100%;
    overflow:hidden;
}

.gallery-thread-item{
    position:relative;
    --gallery-thread-left:0px;
    min-width:0;
    max-width:100%;
}

.gallery-thread-item:nth-child(6n+1){--gallery-thread-left:0px}
.gallery-thread-item:nth-child(6n+2){--gallery-thread-left:18px}
.gallery-thread-item:nth-child(6n+3){--gallery-thread-left:36px}
.gallery-thread-item:nth-child(6n+4){--gallery-thread-left:36px}
.gallery-thread-item:nth-child(6n+5){--gallery-thread-left:18px}
.gallery-thread-item:nth-child(6n){--gallery-thread-left:0px}

.gallery-thread-link{
    position:relative;
    display:flex;
    align-items:center;
    gap:14px;
    width:100%;
    max-width:100%;
    min-height:140px;
    padding:10px 8px 10px calc(46px + var(--gallery-thread-left));
    border-bottom:1px dashed var(--line);
    color:var(--blue);
}

.gallery-thread-link:hover,
.gallery-thread-link:focus-visible{
    background:var(--hover);
    color:var(--text);
}

.gallery-thread-link::before{
    content:"";
    position:absolute;
    left:calc(24px + var(--gallery-thread-left));
    top:-1px;
    bottom:-1px;
    width:1px;
    background:var(--line);
}

.gallery-thread-link::after{
    content:"";
    position:absolute;
    left:calc(24px + var(--gallery-thread-left));
    top:70px;
    width:15px;
    height:1px;
    background:var(--line);
}

.gallery-thread-item:nth-child(6n+1) .gallery-thread-link::before,
.gallery-thread-item:nth-child(6n) .gallery-thread-link::before{
    top:70px;
}

.gallery-thread-thumb{
    display:flex;
    align-items:center;
    justify-content:center;
    width:140px;
    height:120px;
    flex:0 0 140px;
    overflow:hidden;
    background:transparent;
}

.gallery-thread-thumb img{
    display:block;
    width:auto;
    height:auto;
    max-width:140px;
    max-height:120px;
    object-fit:contain;
    border:0;
    background:transparent;
}

.gallery-thread-info{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
}

.gallery-thread-item:nth-child(even) .gallery-thread-link{
    flex-direction:row-reverse;
    padding-left:8px;
    padding-right:calc(46px + var(--gallery-thread-left));
}

.gallery-thread-item:nth-child(even) .gallery-thread-link::before{
    left:auto;
    right:calc(24px + var(--gallery-thread-left));
}

.gallery-thread-item:nth-child(even) .gallery-thread-link::after{
    left:auto;
    right:calc(24px + var(--gallery-thread-left));
}

.gallery-thread-item:nth-child(even) .gallery-thread-info{
    align-items:flex-end;
    text-align:right;
}

.gallery-thread-thumb,
.gallery-thread-link:hover .gallery-thread-thumb,
.gallery-thread-link:focus-visible .gallery-thread-thumb,
.gallery-thread-link:hover .gallery-thread-thumb img,
.gallery-thread-link:focus-visible .gallery-thread-thumb img{
    background:transparent;
}

.gallery-thread-number{
    color:var(--blue);
}

.gallery-thread-file{
    color:var(--muted);
    font-size:14px;
    font-style:italic;
    overflow-wrap:anywhere;
}

.gallery-source{
    width:100%;
    clear:both;
    margin:18px 0 24px;
    padding-top:14px;
    border-top:1px dashed var(--line);
    color:var(--muted);
}

.gallery-source a{
}

.gallery-source a:hover,
.gallery-source a:focus-visible{
    background:var(--hover);
    color:#000;
}


/* =========================================================
   SIDEBAR / REFERRERS
   ========================================================= */

.sidebar-section{
    width:100%;
    margin:0 0 24px;
    padding:0 0 18px;
}

.sidebar-text,
.sidebar-command{
    margin:0;
}

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

.sidebar-command{
    color:var(--muted);
    font-size:14px;
    font-style:italic;
    line-height:1.6;
}

.sidebar-command a{
    color:var(--blue);
    font-style:italic;
}

.sidebar-command a:hover,
.sidebar-command a:focus-visible{
    background:var(--hover);
    color:#000;
}

.ref-links a{
    margin-right:5px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer{
    width:90%;
    max-width:1100px;
    margin:4px auto 0;
    padding:15px 20px 26px;
    border-top:1px solid var(--line);
    color:var(--muted);
}


/* =========================================================
   MOBILE - 760px AND BELOW
   ========================================================= */

@media(max-width:760px){

    /* Header / search */

    .header-inner{
        padding:12px 9px 5px;
        grid-template-columns:1fr;
        column-gap:0;
        row-gap:8px;
    }

    .brand-wrap,
    .header-search{
        grid-column:1;
        width:100%;
    }

    .search{
        grid-template-columns:minmax(0,1fr) 46px;
        gap:6px;
    }

    .search input{
        height:44px;
        padding:8px 9px;
    }

    .search button{
        width:46px;
        height:44px;
    }

    /* Shared page */

    .page{
        display:block;
        padding:10px 9px 22px;
    }

    .main-content{
        margin-bottom:28px;
    }

    .sidebar{
        position:static;
    }

    .sort-row{
        display:block;
        margin-top:4px;
        font-size:14px;
        font-style:italic;
        line-height:1.4;
    }

    .content-heading h1 .sort-row a,
    .content-heading h2 .sort-row a{
        margin-left:5px;
        font-size:14px;
        font-weight:400;
        font-style:italic;
    }

    /* Index / category list */

    .folder-item:nth-child(6n+1){--thread-left:0px}
    .folder-item:nth-child(6n+2){--thread-left:10px}
    .folder-item:nth-child(6n+3){--thread-left:20px}
    .folder-item:nth-child(6n+4){--thread-left:20px}
    .folder-item:nth-child(6n+5){--thread-left:10px}
    .folder-item:nth-child(6n){--thread-left:0px}

    .folder-link{
        padding-left:calc(30px + var(--thread-left));
    }

    .folder-link::before,
    .folder-link::after{
        left:calc(16px + var(--thread-left));
    }

    .row{
        flex-wrap:wrap;
        gap:4px 8px;
    }

    .folder-meta{
        width:calc(100% - 18px);
        flex:0 0 auto;
        margin:2px 0 0 18px;
        padding:0;
        gap:8px;
    }

    .folder-date,
    .folder-count{
        white-space:normal;
    }

    .thumb-preview{
        right:0;
        max-width:calc(100vw - 30px);
    }

    .thumb-preview img{
        max-width:calc(100vw - 30px);
        max-height:260px;
    }

    /* Gallery */

    .gallery-thread-item:nth-child(6n+1){--gallery-thread-left:0px}
    .gallery-thread-item:nth-child(6n+2){--gallery-thread-left:7px}
    .gallery-thread-item:nth-child(6n+3){--gallery-thread-left:14px}
    .gallery-thread-item:nth-child(6n+4){--gallery-thread-left:14px}
    .gallery-thread-item:nth-child(6n+5){--gallery-thread-left:7px}
    .gallery-thread-item:nth-child(6n){--gallery-thread-left:0px}

    .gallery-thread-link{
        gap:10px;
        min-height:110px;
        padding-left:calc(30px + var(--gallery-thread-left));
    }

    .gallery-thread-link::before,
    .gallery-thread-link::after{
        left:calc(16px + var(--gallery-thread-left));
    }

    .gallery-thread-link::after{
        top:55px;
        width:9px;
    }

    .gallery-thread-item:nth-child(even) .gallery-thread-link{
        padding-left:8px;
        padding-right:calc(30px + var(--gallery-thread-left));
    }

    .gallery-thread-item:nth-child(even) .gallery-thread-link::before,
    .gallery-thread-item:nth-child(even) .gallery-thread-link::after{
        left:auto;
        right:calc(16px + var(--gallery-thread-left));
    }

    .gallery-thread-item:nth-child(6n+1) .gallery-thread-link::before,
    .gallery-thread-item:nth-child(6n) .gallery-thread-link::before{
        top:55px;
    }

    .gallery-thread-thumb{
        width:105px;
        height:90px;
        flex-basis:105px;
    }

    .gallery-thread-thumb img{
        max-width:105px;
        max-height:90px;
    }

    .gallery-thread-file{
        font-size:13px;
    }

    /* Sidebar / footer */

    .sidebar-section{
        margin-bottom:16px;
        padding-bottom:0;
    }

    .sidebar-command br{
        display:none;
    }

    .footer{
        padding:11px 9px 21px;
    }
}


/* =========================================================
   VERY SMALL MOBILE - 480px AND BELOW
   ========================================================= */

@media(max-width:480px){

    .header-inner{
        row-gap:7px;
        padding-left:7px;
        padding-right:7px;
    }

    .page{
        padding-left:7px;
        padding-right:7px;
    }
}