@import url('code/monokai.css');

/* ==========================================
   1. ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ (ТЕМА RADIATA)
   ========================================== */
:root {
    --sakura-red: #b71c1c;
    --higanbana-orange: #DA7D12;
    --higanbana-yellow: #F7B757;
    --higanbana-green: #95C27F;
    --light-green: #b1fc41;
    --higanbana-light-blue: #46BEFB;
    --mirai-blue: #005386;
    --nana-purple: #86669b;
    --nana-dark-purple: #432950;
}

* {
    scroll-behavior: smooth;
    box-sizing: border-box;
}

body {
    background-image: url('../images/bg.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-repeat: round;
    margin: 0;
    color: #222222;
    background-color: #ffffff;
}

h1, h2, h3, h4 {
    clear: both;
}

.center {
    text-align: center;
}


/* ==========================================
   2. СЕТКА И ОБОЛОЧКА (WRAPPER)
   ========================================== */
.wrapper {
    max-width: 1280px;
    margin: 1px auto;
    position: relative;
    border: 1px solid rgba(27, 30, 54, 0.5);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.97);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.wrapper pre {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border-radius: 5px;
}

.wrapper img, 
main img {
    max-width: 100%;
    height: auto;
    display: block;
}

body.collage-topster .wrapper {
    background-image: linear-gradient(rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.97)), url('../images/collages/topster.png');
    background-size: auto;
    background-repeat: repeat;
}


/* ==========================================
   3. НАВИГАЦИЯ (MENU)
   ========================================== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

nav div {
    text-align: center;
    flex: 1;
}


/* ==========================================
   4. ОСНОВНОЙ КОНТЕНТ (MAIN)
   ========================================== */
main {
    padding: 1em 5em;
}

main::after {
    content: "";
    display: table;
    clear: both;
}


/* ==========================================
   5. ССЫЛКИ
   ========================================== */
a {
    color: var(--mirai-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:visited {
    color: var(--nana-purple);
}

a:hover {
    color: var(--sakura-red);
}


/* ==========================================
   6. МАКЕТЫ И СЕТКИ КОНТЕНТА
   ========================================== */
.split-grid {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin: 25px 0;
}

.split-grid.align-top {
    align-items: flex-start;
    margin-bottom: 40px;
}

.split-grid > figure {
    flex: 0 0 250px;
    margin: 0;
}

.split-grid > figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.split-grid > div {
    flex: 1;
    min-width: 0;
}

.split-grid li img {
    display: inline;
    vertical-align: middle;
}

.split-grid figure figcaption {
    font-size: 0.9em;
    font-style: italic;
    text-align: center;
    margin-top: 8px;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

/* Газетная верстка */
.gazette-medium {
    width: 300px !important;
    margin: 5px 30px 15px 0 !important;
}

.gazette-medium {
    width: 160px !important;
    margin: 5px 25px 25px 25px !important;
}

.gazette-small img {
    width: 100% !important;
    max-width: 160px !important;
    height: auto !important;
    display: block !important;
    border-radius: 4px;
}

.gazette-medium img {
    width: 100% !important;
    max-width: 300px !important;
    height: auto !important;
    display: block !important;
    border-radius: 4px;
}

.gazette-medium figcaption {
    font-size: 0.9em !important;
    font-style: italic;
    text-align: center;
    margin-top: 6px !important;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

.gazette-small {
    width: 160px !important;
    margin: 5px 25px 15px 25px !important;
}

.gazette-small img {
    width: 100% !important;
    max-width: 160px !important;
    height: auto !important;
    display: block !important;
    border-radius: 4px;
}

.gazette-small figcaption {
    font-size: 0.85em !important;
    font-style: italic;
    text-align: center;
    margin-top: 6px !important;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

.gazette-figure {
    margin: 10px 0 15px 20px;
    max-width: 320px;
    width: 100%;
    box-sizing: border-box;
}

.gazette-figure.right {
    float: right;
    margin-left: 20px;
    margin-right: 0;
}

.gazette-figure.left {
    float: left;
    margin-right: 20px;
    margin-left: 0;
}

.gazette-figure img {
    width: 100%;
    height: auto;
    display: block;
}

.gazette-figure figcaption {
    font-size: 0.9em;
    font-style: italic;
    text-align: center;
    margin-top: 6px;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

/* Заголовки с иконками */
.header-with-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
    gap: 20px;
}

.header-with-icon h1, 
.header-with-icon h2, 
.header-with-icon h3 {
    margin: 0;
    flex: 1;
}

.header-with-icon img {
    flex-shrink: 0;
    width: 80px;
    height: auto;
    display: block;
}

.header-with-icon.poster img {
    width: 250px;
}

.header-with-icon.poster.fade-left img {
    -webkit-mask-image: radial-gradient(circle at 80% 50%, black 40%, transparent 90%);
    mask-image: radial-gradient(circle at 80% 50%, black 40%, transparent 90%);
}


/* ==========================================
   7. КОМПОНЕНТЫ (КАЛЛАУТЫ, ГАЛЕРЕИ)
   ========================================== */
.callout {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 1.2em 1.5em;
    margin: 1.5em 0;
    border-left: 4px solid;
    border-radius: 4px;
}

.callout p,
.callout-content p {
    display: block !important;
    width: 100% !important;
    margin: 0 0 1em 0 !important;
}

.callout p:last-child,
.callout-content p:last-child {
    margin-bottom: 0 !important;
}

.callout .icon {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
}

.callout.note {
    background-color: rgba(221, 160, 221, 0.35);
    border-left-color: var(--nana-purple);
}

.callout.warn {
    background-color: rgba(205, 92, 92, 0.25);
    border-left-color: var(--sakura-red);
}

.callout.appendix {
    background-color: rgba(70, 190, 251, 0.15);
    border-left-color: var(--higanbana-light-blue);
}

.callout code {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 100%;
    overflow-x: auto;
}

.callout-content {
    flex: 1;
}

/* Галерея */
/* ==========================================
   ГАЛЕРЕЯ (Компактная и аккуратная)
   ========================================== */
.image-gallery {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 10px 5px 20px 5px;
    margin: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--nana-purple) rgba(0, 0, 0, 0.05);
}

.image-gallery::-webkit-scrollbar {
    height: 6px;
}

.image-gallery::-webkit-scrollbar-thumb {
    background: var(--nana-purple);
    border-radius: 3px;
}

.image-gallery figure {
    flex: 0 0 220px; /* Фиксированная ширина карточки в ленте */
    max-width: 220px;
    margin: 0;
    scroll-snap-align: start;
}

.image-gallery img {
    width: 100%;
    /* height: 220px;      Жестко фиксируем квадратную высоту для обложек альбомов */
    object-fit: cover;  /* Картинка заполнит блок без искажений и сжатия */
    display: block;
    border-radius: 6px;
    border: 1px solid rgba(27, 30, 54, 0.2);
}

.image-gallery figcaption {
    font-size: 0.9em;
    font-style: italic;
    text-align: center;
    margin-top: 6px;
    color: #555;
}

.buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.buttons-container a {
    display: inline-block;
}

.buttons-container img {
    width: 180px;
    height: auto;
    display: block;
    border-radius: 4px;
    transition: transform 0.2s ease;
}


/* ==========================================
   8. ЭФФЕКТЫ И ДИЗАЙН КАРТИНОК
   ========================================== */
.fade-right {
    display: inline-block;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1.0) 60%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1.0) 60%, rgba(0,0,0,0) 100%);
}

.fade-left {
    display: inline-block;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1.0) 40%, rgba(0,0,0,1.0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1.0) 40%, rgba(0,0,0,1.0) 100%);
}

.img-hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.img-hover-lift:hover {
    transform: translateY(-4px);
}

.img-tilt-left {
    transform: rotate(-2deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.img-tilt-left:hover {
    transform: rotate(0deg) scale(1.02);
}

.img-tilt-right {
    transform: rotate(2deg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.img-tilt-right:hover {
    transform: rotate(0deg) scale(1.02);
}

.img-card {
    background: #ffffff;
    padding: 8px 8px 28px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.img-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.img-glow {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.img-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(134, 102, 155, 0.45);
}

.img-pop-left {
    transform: rotate(-5deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}
.img-pop-left:hover {
    transform: rotate(0deg) scale(1.08) translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.img-pop-right {
    transform: rotate(5deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}
.img-pop-right:hover {
    transform: rotate(0deg) scale(1.08) translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.img-sticker-pop {
    border-radius: 6px;
    border: 3px solid #ffffff;
    box-shadow: 7px 7px 0px var(--nana-purple), 0 10px 20px rgba(0, 0, 0, 0.15);
    transform: rotate(2deg);
}

.img-vintage-film {
    filter: sepia(0.3) contrast(1.1) brightness(0.95);
    border-radius: 4px;
    border: 4px solid #f4f1ea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}





/* ==========================================
   10. АДАПТИВНОСТЬ
   ========================================== */
@media (max-width: 1450px) {
    .background-character {
        display: none;
    }
}

@media (max-width: 768px) {
    .gazette-figure.right,
    .gazette-figure.left {
        float: none;
        max-width: 100%;
        margin: 20px auto;
    }

    .gazette-large {
        float: none !important;
        width: 100% !important;
        max-width: 300px !important;
        margin: 20px auto !important;
    }

    .gazette-medium {
        float: none !important;
        width: 100% !important;
        max-width: 250px !important;
        margin: 20px auto !important;
    }

    .gazette-small {
        float: none !important;
        width: 100% !important;
        max-width: 220px !important;
        margin: 20px auto !important;
    }

    .split-grid {
        flex-direction: column;
        gap: 20px;
    }
    
    .split-grid > figure {
        flex: 1;
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    .header-with-icon,
    .header-with-icon.poster {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-with-icon img,
    .header-with-icon.poster img {
        width: 100%;
        max-width: 280px;
        margin-top: 5px;
    }

    .callout {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ==========================================
   ЭФФЕКТЫ КАРТОЧЕК И ПОЛАРОИДОВ (ДОП.)
   ========================================== */

/* Эффект красивой карточки */
.img-card {
    background: #ffffff;
    padding: 8px 8px 28px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.img-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Драматичный наклон влево */
.img-pop-left {
    transform: rotate(-5deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}
.img-pop-left:hover {
    transform: rotate(0deg) scale(1.08) translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

/* Драматичный наклон вправо */
.img-pop-right {
    transform: rotate(5deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}
.img-pop-right:hover {
    transform: rotate(0deg) scale(1.08) translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

/* Жирный интерактивный полароид / стикер */
/* ==========================================
   ПОЛАРОИДЫ (С компактным низом)
   ========================================== */

/* Жирный интерактивный полароид / стикер */
.img-polaroid-bold {
    background: #ffffff;
    padding: 8px 8px 4px 8px; /* Уменьшили нижний отступ с 35px до 16px */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    transform: rotate(-3deg);
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.img-polaroid-bold:hover {
    transform: rotate(0deg) scale(1.06) translateY(-10px);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.32);
}

/* Статический Полароид (базовый каркас) */
.img-static-polaroid {
    background: #ffffff;
    padding: 8px 8px 16px 8px; /* Компактный отступ снизу вместо 32px */
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: inline-block;
}
/* Естественные пропорции для фото внутри полароида без сплющивания */
.img-static-polaroid img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;     /* Сохраняет оригинальные пропорции портрета */
    object-fit: initial !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 2px;
}

/* Направления для статического полароида */
.img-static-polaroid.left,
.img-static-polaroid:not(.right) {
    transform: rotate(-2.5deg);
}

.img-static-polaroid.right {
    transform: rotate(2.5deg);
}

/* Статический Полароид (базовый каркас) */
.img-static-polaroid {
    background: #ffffff;
    padding: 8px 8px 16px 8px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: inline-block;
}

/* Направления для статического полароида */
.img-static-polaroid.left,
.img-static-polaroid:not(.right) {
    transform: rotate(-2.5deg);
    float: left;
    margin-right: 20px;
    margin-bottom: 15px;
}

.img-static-polaroid.right {
    transform: rotate(2.5deg);
    float: right;      /* Прижимает к правому краю */
    margin-left: 20px; /* Отступ слева, чтобы текст не лип */
    margin-bottom: 15px;
}

/* Подпись внутри статического полароида */
.img-static-polaroid figcaption {
    margin-top: 8px !important;
    font-size: 0.85em !important;
    font-style: italic;
    text-align: center;
    color: #444 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Стикер с цветной смещенной тенью */
.img-sticker-pop {
    border-radius: 6px;
    border: 3px solid #ffffff;
    box-shadow: 7px 7px 0px var(--nana-purple), 0 10px 20px rgba(0, 0, 0, 0.15);
    transform: rotate(2deg);
}

/* Винтажный пленочный вид */
.img-vintage-film {
    filter: sepia(0.3) contrast(1.1) brightness(0.95);
    border-radius: 4px;
    border: 4px solid #f4f1ea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

/* Рамка с внутренним тиснением */
.img-framed-deep {
    padding: 6px;
    background: #ffffff;
    border: 1px solid #dcd6d0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}