/*  
Template name: Grunge Superstar
Optimized & Fully Responsive Version 2026
*/

/* --------------------------------
   General
----------------------------------- */

html {
    height: 100%;
}

body {
    background: url('img/bbcodes.png');
    color: #444;
    font: normal 13px Verdana, Arial, sans-serif; /* Исправлено em на px против мигания */
    height: 100%;
    padding-bottom: 1px;
    padding-top: 64px;
}

small, .small { font-size: 11px; }

a {
    color: #fff;
    text-decoration: none;
}
a:hover {
    color: #FFA;
    text-decoration: underline;
}

p { padding: 0.2em 0 1.2em; }

blockquote, code {
    background: #4A4A4A;
    border: 1px solid #333;
    color: #BBB;
    display: block;
    margin-bottom: 12px;
}
code {
    font: normal 12px Verdana, sans-serif;
    line-height: 1.5em;
    padding: 8px 14px;
}
blockquote {
    background: #4A4A4A url('img/quote.gif') no-repeat left top;
    padding: 6px 14px 6px 44px;
}
blockquote p { padding: 0.5em 0; }


/* --------------------------------
   Headings, titles
----------------------------------- */

h1 { font: normal 20px Georgia, sans-serif; }
h2 { font: normal 16px Georgia, sans-serif; }
h3 { font: normal 14px Georgia, sans-serif; }
h4 { font: bold 12px Georgia, sans-serif; }

h1, h2, h3, h4 { margin-bottom: 5px; }


/* --------------------------------
   Main layout (Desktop)
----------------------------------- */

#paper_left {
    background: url('img/paper_left.gif') no-repeat left top;
    margin: 0 auto;
    padding-bottom: 34px;
    width: 778px;
    box-sizing: border-box;
}
#paper_right {
    background: url('img/paper_right.gif') no-repeat right bottom;
}

#layout_wrapper {
    background: #50504A url('img/grain_dark.gif');
    margin: 0 auto;
    width: 900px;
    box-sizing: border-box;
}
#layout_container { padding: 8px; box-sizing: border-box; }
#layout_content { border: 1px solid #333; }

#header_image {
    height: 160px;
    background: #222 url('img/header.jpg') no-repeat;
    border-bottom: 1px solid #222;
    border-top: 1px solid #111;
    max-width: 100%;
}


/* --------------------------------
   Site title
----------------------------------- */

#site_title {
    background: #222;
    padding: 12px 20px;
}
#site_title h1 {
    color: #EED;
    font: normal 20px Georgia, sans-serif;
    margin: 0 0 5px;
}
#site_title h2 {
    color: #BFBFB6;
    font: normal 11px sans-serif;
    margin: 0;
}
/* --------------------------------
   Navigation
----------------------------------- */

.navigation {
    background: #353535 url('img/navigation.jpg') repeat-x;
    border-bottom: 1px solid #222;
    border-top: 1px solid #555;
    box-sizing: border-box;
}
.navigation ul { display: inline; margin: 0; }
.navigation ul li {
    border-right: 1px solid #303030;
    float: left;
    list-style: none;
}
.navigation a {
    color: #AAA;
    display: block;
    font: bold 12px Verdana, sans-serif;
    padding: 12px 14px;
    text-decoration: none;
}
.navigation a:hover {
    background: #444;
    color: #E5E5D5;
    text-decoration: none;
}
.navigation li.current_page_item a {
    background: none;
    color: #EEE;
}

/* Sub navigation */
#subnav a {
    padding: 10px;
    font-size: 11px;
}


/* --------------------------------
   Main
----------------------------------- */

#main {
    background: #4A4A4A;
    color: #CCC;
    box-sizing: border-box;
}


/* --------------------------------
   Bottom
----------------------------------- */

#bottom {
    background: #222;
    border-bottom: 1px solid #1A1A1A;
    border-top: 1px solid #2A2A2A;
    color: #AAA;
    padding: 16px;
    box-sizing: border-box;
}
#bottom ul li {
    border-bottom: 1px solid #303030;
}
#bottom ul li a {
    color: #777;
    display: block;
    padding: 4px 6px;
}
#bottom ul li a:hover {
    background: #2A2A2A;
    color: #FFC;
    text-decoration: none;
}


/* Tag cloud */
#tag_cloud a { color: #777; }
#tag_cloud a:hover { color: #FFC; }


/* --------------------------------
   Footer (Template default)
----------------------------------- */

#footer {
    background: #2A2A2A;
    border-bottom: 1px solid #1A1A1A;
    border-top: 1px solid #333;
    color: #888;
    font-size: 11px;
    padding: 10px 12px;
    box-sizing: border-box;
}
#footer a { color: #AAA; }
#footer .right, #footer .right a { color: #555; }
#footer a:hover { color: #BBB; }


/* --------------------------------
   Floats
----------------------------------- */

.left { float: left; }
.right { float: right; }
.clear, .clearer { clear: both; }
.clearer, .block {
    display: block;
    line-height: 0;
    font-size: 0;
}
.clearer { height: 0; }


/* --------------------------------
   Misc
----------------------------------- */

/* Columns */
.col3, .col3last { width: 31%; margin-right: 3%; float: left; box-sizing: border-box; }
.col3last { margin-right: 0; }

/* Images */
img.bordered { padding: 3px; background: #666; }

/* Text */
.tleft { text-align: left; }
.tcenter { text-align: center; }
.tright { text-align: right; }
.vtop { vertical-align: top; }

/* Icons */
span.comment { background: url('img/icon_comment.gif') no-repeat left center; padding-left: 18px; }

/* Label */
.label {
    background: #222 url('img/post_top.gif') repeat-x left top;
    border-bottom: 2px solid #555;
    color: #BBB;
    margin: 0;
    padding: 6px 10px;
}

/* Margin, padding, width, height */
.ptb10 { padding: 10px 0; }


/* ----------------------------------------
  Forms & Search
------------------------------------------- */

form { margin: 0; padding: 0; }

input#s, textarea, input.styled {
    background: #DDD;
    border: 3px solid #555;
    font: normal 13px Verdana, sans-serif;
    padding: 3px;
    width: 160px;
    max-width: 100%;
    box-sizing: border-box;
}
textarea { 
    width: 440px; 
    max-width: 100%; 
    box-sizing: border-box; 
}

table.search {
    border-collapse: collapse;
    width: 250px;
    max-width: 100%;
}
table.search td { vertical-align: top; }


/* ----------------------------------------
   Comments (Template default)
------------------------------------------- */

.comment_gravatar { width: 48px; }
.comment_gravatar img {
    background: #666;
    border: 1px solid #444;
    padding: 2px;
}
.comment_author {
    color: #EEE;
    padding-top: 2px;
}


/* ----------------------------------------
   Lists
------------------------------------------- */

.nicelist { padding: 0; }
.nicelist ol { margin: 0; }
.nicelist ol li {
    border-bottom: 1px solid #333;
    border-top: 1px solid #505050;
    list-style: none;
    padding: 8px 10px 1px;
    box-sizing: border-box;
}
.nicelist ol li:first-child { border-top: none; }
.nicelist li.alt { background: #444; }
.nicelist .body { padding-top: 5px; }
.nicelist .date {
    color: #999;
    font-size: 11px;
    padding-top: 4px;
}
.nicelist .date a {
    color: #BBB;
    text-decoration: none;
}
.nicelist .date a:hover { text-decoration: underline; }


/* ----------------------------------------
   Archives
------------------------------------------- */

.archive_title { font: normal 14px sans-serif; }
.archive_title a { text-decoration: none; }
.archive_title a:hover { text-decoration: underline; }
.archive_postinfo { padding-bottom: 6px; }
/* --------------------------------
   Posts
----------------------------------- */

.post {
    background: #363636;
    border-bottom: 1px solid #111;
    box-sizing: border-box;
}
.post_top {
    background: #222 url('img/post_top.gif') repeat-x left top;
    border-bottom: 4px solid #777;
    border-top: 1px solid #3A3A3A;
    padding: 10px 16px 13px;
    box-sizing: border-box;
}
.post_title h2 {
    font-size: 22px;
    margin: 0;
    padding: 0;
}
.post_body {
    background: url('img/post_body.jpg') no-repeat left top;
    border-top: 1px solid #333;
    padding: 16px 16px 0;
    box-sizing: border-box;
}
.post_metadata { padding: 10px; }
.post_metadata .content {
    background: #424242;
    color: #999;
    font-size: 11px;
    padding: 10px 12px;
}
.post_metadata a { color: #BBB; }
.post_metadata a:hover { color: #DDD; }

.post_body ul, .post_body ol { margin: 0 0 1em 1.5em; }
.post_body ul { list-style: disc; }
.post_body ol { list-style: decimal; }


/* ----------------------------------------
   Pagination & Gallery Fix
------------------------------------------- */

.pagenavigation {
    background: #555;
    border-top: 1px solid #444;
    font-size: 11px;
    padding: 7px 8px 9px;
    box-sizing: border-box;
}
.pagenavigation a {
    color: #CCC;
    text-decoration: none;
}
.pagenavigation a:hover {
    color: #FFF;
    text-decoration: underline;
}

/* ЗАЩИТА ОТ МИГАНИЯ: Рамки теперь зафиксированы внутри картинок */
.gallery img, .gallery-responsive .photo img {
    margin: 5px;
    border: 3px solid #ffffff !important;
    box-sizing: border-box !important; /* Удерживает размер и предотвращает прыжки экрана */
    transition: border-color 0.2s ease, transform 0.2s ease !important;
}

a.photo:hover img {
    border: 3px solid #034F80 !important; /* Синяя рамка при наведении */
    transform: scale(1.03); /* Плавное безопасное увеличение */
}


/* ========================================================
   Итоговая мобильная адаптация (Для экранов до 960px)
   ======================================================== */
@media screen and (max-width: 960px) {
    body {
        padding-top: 15px !important;
    }
    
    /* Сжимаем обертки старой бумаги и убираем жесткие фоны */
    #paper_left, #layout_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        background: none !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    #header_image {
        height: auto !important;
        min-height: 100px !important;
        background-size: cover !important;
    }
    
    #site_title {
        text-align: center !important;
    }

    /* Адаптивное меню списком для смартфонов */
    .navigation ul li {
        float: none !important;
        border-right: none !important;
        border-bottom: 1px solid #303030 !important;
    }
    .navigation a {
        padding: 14px 20px !important;
        text-align: center !important;
    }
    
    #bottom {
        padding: 15px 5px !important;
        text-align: center !important;
    }

    /* Выстраиваем колонки темы вертикально */
    .col3, .col3last {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-bottom: 20px !important;
    }
    
    .post_top, .post_body {
        padding: 10px !important;
    }
    
    .post_title h2 {
        font-size: 18px !important;
        text-align: center !important;
    }

    textarea {
        width: 100% !important;
    }
    table.search {
        width: 100% !important;
    }

    /* Убираем лишние отступы картинок на телефоне */
    .gallery img, .gallery-responsive .photo img {
        margin: 0 !important;
    }
}

