/* ============================================================
   Shiru's Stuff — CSS 2.1 only (IE6 / WinXP safe), no JS
   ============================================================ */

/* ---------- page frame ---------- */
body {
    margin: 0;
    padding: 16px;
    background-color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #000000;
}

/* ---------- links ---------- */
a { text-decoration: none; }
a:link, a:visited, a:active { color: #0000af; }
a:hover { color: #ff0000; }

/* ---------- masthead ---------- */
#header {
    position: relative;
    padding: 8px 0;
    border-bottom: 1px solid #c0c0c0;
}
#header h1 {
    margin: 0 2%;
    font-family: 'Courier New', monospace;
    font-size: 60px;
    color: #c0c0c0;
}
#hosted1 {
    position: absolute;
    right: 0;
    top: 18px;
    width: 130px;
    margin: 0;
    text-align: center;
}
#hosted2 {
    position: absolute;
    right: 0;
    top: 24px;
    width: 300px;
    margin: 0;
    text-align: center;
}

/* ---------- menu ---------- */
#menu {
    overflow: hidden;
    margin: 8px 2%;
    padding: 0;
    list-style: none;
}
#menu li {
    float: left;
    margin: 0 13px 0 0;
}
#menu .current a {
    color: #ff0000;
    cursor: default;
}

/* ---------- text column ---------- */
.intro, .section {
    margin: 0 2%;
    padding: 0 3px;
}
.intro   { margin-top: 40px; margin-bottom: 60px; }
.section { margin-bottom: 60px; }

/* ---------- section header ---------- */
.section h1 {
    max-width: 600px;
    margin: 0 0 21px -1.042%;
    padding: 0 0 3px 1.042%;
    border-bottom: 1px solid #000000;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    font-size: 40px;
    color: #505050;
}

.section h2 {
    max-width: 300px;
    margin: 0 0 21px -1.042%;
    padding: 0 0 3px 1.042%;
    border-bottom: 1px solid #000000;
    white-space: nowrap;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #505050;
}

/* ---------- download items ---------- */
.section p { margin: 0 0 18px; }

/* ---------- legacy ---------- */
b { color: #505050; }

/* image popup */
.thumbnail { position: relative; z-index: 0; }
.thumbnail:hover { background-color: transparent; z-index: 50; }
.thumbnail span {
    position: absolute;
    background-color: lightyellow;
    padding: 5px;
    left: -1000px;
    border: 1px dashed gray;
    visibility: hidden;
    color: black;
    text-decoration: none;
}
.thumbnail span img { border-width: 0; padding: 2px; }
.thumbnail:hover span {
    visibility: visible;
    top: auto;
    left: 20px;
}

/* Subsection header */
.subsection {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #505050;
    margin: 0 0 18px 0;
}

/* Track list */
.tracklist {
    margin-bottom: 18px;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    overflow: hidden;
}
.tracklist dt {
    float: left;
    width: 40px;
    margin: 0;
    padding: 0;
}
.tracklist dd {
    margin-bottom: 0;
    margin-top: 0;
    margin-left: 100px;
    margin-right: 0;
    padding: 0;
}
p.archive-link {
    margin: 0 0 18px 100px;
}

/* ============================================================
   SHOWROOM — лента проектов на главной
   ============================================================ */

.js .projects-feed {
    display: block;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.js .feed-track {
    font-size: 0;
    white-space: nowrap;
    overflow-x: auto;
    cursor: grab;
    padding: 10px 60px;
}
.js .feed-track.is-dragging {
    cursor: grabbing;
}

.feed-track .card {
    display: inline-block;
    vertical-align: top;
    width: 250px;
    margin-right: 16px;
    font-size: 14px;
    white-space: normal;
    border: 1px solid #eee;
    text-decoration: none;
    color: #333;
    background: #fff;
}
.feed-track .card:hover {
    border-color: #666;
}

.feed-track .card-title {
    display: block;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
}

.feed-track .card img {
    margin-left: 5px;
    width: 240px;
    height: 160px;
    object-fit: cover;
    display: block;
}

.feed-track .card-desc {
    padding: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
}

.feed-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.projects-feed:hover .feed-btn {
    opacity: 0.3;
}
.feed-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}
.feed-btn-prev { left: 0; }
.feed-btn-next { right: 0; }

/* ============================================================
   PROJECTS GRID — статический список всех проектов
   ============================================================ */

.projects-grid {
    overflow: hidden;   /* clearfix */
    margin: 0 -7px;
}

.projects-grid .card {
    float: left;
    width: 340px;
    margin: 7px;
    font-size: 14px;
    border: 1px solid #eee;
    text-decoration: none;
    color: #333;
    background: #fff;
    overflow: hidden;   /* страховка от вылезания содержимого */
}
.projects-grid .card:hover {
    border-color: #666;
}

/* Название: ровно 2 строки (14px * 17px * 2 = 34px) */
.projects-grid .card-title {
    display: block;
    height: 24px;
    padding: 8px 10px 4px 10px;
    font-size: 14px;
    line-height: 17px;
    font-weight: bold;
    overflow: hidden;
}

/* Картинка: фиксированная высота, как и была */
.projects-grid .card img {
    padding: 10px;
    width: 320px;
    height: 240px;
    object-fit: cover;
    display: block;
}

/* Описание: ровно 4 строки (13px * 18px * 4 = 72px) */
.projects-grid .card-desc {
    height: 40px;
    padding: 8px 10px 10px 10px;
    font-size: 13px;
    line-height: 18px;
    color: #555;
    overflow: hidden;
}

/* ============================================================
   PROJECT PAGE — двухколоночная вёрстка страницы проекта
   ============================================================ */

.project-layout {
    overflow: hidden;
}

.project-text {
    float: left;
    width: 45%;
}

.project-gallery {
    float: right;
    width: 50%;
}

/* ============================================================
   GALLERY — галерея медиа на странице проекта
   ============================================================ */

.gallery-main {
    width: 100%;
    margin-bottom: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    box-sizing: border-box;
    overflow: hidden;
}

.gallery-main .media-item {
    width: 100%;
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
}

.gallery-main .media-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.gallery-main .media-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f0f0f0;
}

.gallery-main .media-wrapper video,
.gallery-main .media-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.gallery-main .media-caption {
    padding: 8px 10px;
    font-size: 13px;
    color: #555;
    background: #fff;
    border-top: 1px solid #ddd;
}

.gallery-main .media-item {
    margin-bottom: 10px;
}

.js .gallery-main .media-item {
    display: none;
    margin-bottom: 0;
}
.js .gallery-main .media-item.active {
    display: block;
}

/* ---------- gallery navigation ---------- */
.gallery-nav {
    display: none;
    position: relative;
    margin-top: 10px;
}
.js .gallery-nav {
    display: block;
}

.gallery-thumbs {
    overflow: hidden;
    margin: 0 -4px;
}

.gallery-thumb {
    float: left;
    width: 70px;
    height: 50px;
    margin: 4px;
    padding: 0;
    border: 2px solid #ccc;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    box-sizing: content-box;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-thumb.active {
    border-color: #0000af;
}
.gallery-thumb:hover {
    border-color: #666;
}

.thumb-play, .thumb-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    text-shadow: 0 0 4px rgba(0,0,0,0.7);
}
.thumb-icon {
    background: rgba(0,0,0,0.4);
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
}

.gallery-arrow {
    display: none;
}

/* ============================================================
   LIGHTBOX — модальное окно для полноразмерного просмотра
   ============================================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: pointer;
}
.lightbox.active {
    display: block;
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}

.lightbox-content img,
.lightbox-content video,
.lightbox-content iframe {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 30px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   МОБИЛЬНАЯ ВЁРСТКА (ширина экрана <= 700px)
   ============================================================ */

@media screen and (max-width: 700px) {
    body {
        padding: 8px;
    }
    
    .section h1 {
        width: auto;
        font-size: 28px;
        margin: 0 0 15px 0;
        padding: 0 0 3px 0;
    }
    .section h2 {
        width: auto;
        margin: 0 0 15px 0;
        padding: 0 0 3px 0;
    }
    
    #header h1 {
        font-size: 32px;
    }
    #hosted1, #hosted2 {
        position: static;
        width: auto;
        text-align: left;
        margin: 5px 0;
    }
    
    #menu {
        margin: 8px 0;
    }
    #menu li {
        float: none;
        display: inline-block;
        margin: 0 10px 5px 0;
    }
    
    .project-layout {
        overflow: visible;
    }
    .project-text,
    .project-gallery {
        float: none;
        width: 100%;
        margin: 0;
    }
    .project-text {
        margin-bottom: 20px;
    }
    
    .gallery-main .media-item {
        height: auto;
    }
    .gallery-main .media-wrapper {
        padding-bottom: 56.25%;
    }
    
    .gallery-thumb {
        width: 60px;
        height: 45px;
        margin: 3px;
    }
    
    .js .feed-track {
        padding: 10px 5px;
    }
    .feed-btn {
        display: none;
    }
    
    .projects-grid {
        margin: 0;
    }
    .projects-grid .card {
        float: none;
        width: 100%;
        margin: 0 0 15px 0;
    }

    .projects-grid .card-title,
    .projects-grid .card-desc {
        height: auto;
    }
}

/* ============================================================
   AUDIO.JS PLAYER STYLES
   ============================================================ */
.audiojs { 
    height: 22px; 
    background: #404040;
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #444), color-stop(0.5, #555), color-stop(0.51, #444), color-stop(1, #444));
    background-image: -moz-linear-gradient(center top, #444 0%, #555 50%, #444 51%, #444 100%);
    -webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); 
    -moz-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);
    box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); 
}
.audiojs .play-pause { 
    width: 15px; 
    height: 20px; 
    padding: 0px 8px 0px 0px; 
}
.audiojs p { 
    width: 25px; 
    height: 20px; 
    margin: -3px 0px 0px -1px; 
}
.audiojs .scrubber { 
    background: #5a5a5a; 
    width: 310px; 
    height: 10px; 
    margin: 5px; 
}
.audiojs .progress { 
    height: 10px; 
    width: 0px; 
    background: #ccc;
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ccc), color-stop(0.5, #ddd), color-stop(0.51, #ccc), color-stop(1, #ccc));
    background-image: -moz-linear-gradient(center top, #ccc 0%, #ddd 50%, #ccc 51%, #ccc 100%); 
}
.audiojs .loaded { 
    height: 10px; 
    background: #000;
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.5, #333), color-stop(0.51, #222), color-stop(1, #222));
    background-image: -moz-linear-gradient(center top, #222 0%, #333 50%, #222 51%, #222 100%); 
}
.audiojs .time { 
    float: left; 
    height: 25px; 
    line-height: 25px; 
}
.audiojs .error-message { 
    height: 24px;
    line-height: 24px; 
}
/* Подсветка активного трека в плейлисте */
ol.audio-playlist li.playing a { 
    color: #f00; 
    font-weight: bold;
}