/* Отзивчив дизайн */
@media (max-width: 1200px) {
    body {
        padding: 2px;
        
    }
/* -----------------------------------
Главно меню
---------------------------------------*/
    
    nav ul {
        flex-direction: column;
        align-items: center;
        display: none;
        position: fixed;
        top:60px;
        right: 0;
        width: 50%;
        background: #fff;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    nav ul li {
        margin: 10px 0;
    }

    .menu-toggle {
        display: block;
    }

    nav ul.show {
        display: flex;
        z-index: 99999;
        min-width: 150px;
    }
    nav ul li:not(:last-child)::after {
        content: unset;
    }

    .header-container {
        flex-direction: column;
        align-items: center;
    }

    .logo {
        margin-bottom: 10px; /* Малко разстояние между логото и заглавието на мобилни устройства */
    }
    
    /* -----------------------------------
    Панел под менюто - начална страница
    ---------------------------------------*/
    .front-panel {
        flex-direction: column;
        gap: 10px;
    }
    /* -----------------------------------
    Регистрация
    ---------------------------------------*/
    .common-container {
        max-width: 100%;
        padding: 15px;
      }

    /* -----------------------------------
    Регистрация
    ---------------------------------------*/
    .register-container {
        max-width: 100%;
        padding: 15px;
      }

    /* -----------------------------------
    Админ и модератори
    ---------------------------------------*/
    .admin-cont {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #ddd;
        display: none;
        position: relative;
        z-index: 100;
        background: #f4f4f4;
    }

    .admin-sidebar.open {
        display: block;
    }

    .admin-work {
        width: 100%;
    }

    /* Бутон за показване на менюто */
    .menu-admin-toggle {
        display: block;
        width: 100%;
        text-align: left;
        background: #d63384;
        color: white;
        border: none;
        padding: 10px 15px;
        font-size: 16px;
        cursor: pointer;
    }

    /*редактор*/
    .editor-cont {
        max-width: 100%;
        padding: 10px;
    }

    /* ЧЕТЕЦ */
    .story-container {
        padding:0;
        margin:0;
    }

    .story-title {
        font-size: 24px;
    }

    .story-meta {
        font-size: 13px;
    }

    .story-content {
        font-size: 16px;
    }

    /* ЕКСПЕРТНИ СТАТИИ */
    .expert-public-article {
        width: 100%;
        max-width: 100%;
    }

    .expert-public-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .expert-public-card-body {
        padding: 14px;
    }

    .expert-article-hero {
        margin-top: 4px;
    }

    .expert-article-hero .expert-featured-image {
        width: 100%;
        height: auto;
        max-height: 320px;
        border-radius: 6px;
    }

    .expert-article-hero .profile-avatar {
        width: 120px;
        height: 120px;
        max-width: 120px;
    }

    .expert-article-content {
        margin-top: 18px;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .expert-article-content img,
    .expert-article-content video,
    .expert-article-content iframe {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .expert-article-content iframe {
        min-height: 220px;
        aspect-ratio: 16 / 9;
    }

    .expert-article-content table,
    .expert-article-content pre {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    .expert-bibliography {
        overflow-wrap: anywhere;
    }

    .expert-discussion {
        margin-top: 28px;
        padding-top: 18px;
    }

    .expert-qa-thread {
        padding-left: 6px;
        border-left-width: 3px;
    }

    .expert-qa-question,
    .expert-qa-answer,
    .expertQuestionModerationForm,
    .expertFollowupForm,
    .expert-question-box {
        padding-left: 10px;
        padding-right: 10px;
    }

    .expert-question-actions {
        flex-direction: column;
    }

    .expert-question-actions button,
    .expert-question-box button,
    .expertFollowupForm button {
        width: 100%;
        flex: none;
    }

    .expert-question-list-actions {
        justify-content: stretch;
    }

    .expert-question-list-actions .panel-btn {
        width: 100%;
        min-width: 0;
    }

    .expert-lifecycle-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .expert-lifecycle-panel button {
        width: 100%;
    }

    .expert-reopen-count {
        margin-left: 0;
        text-align: center;
    }

    /*списък начална странция*/
    .stories-list {
        padding: unset;
        
    }

    .stories-list__title a {
        font-size: 18px;
    }

    .stories-list__excerpt {
        font-size: 14px;
    }

    .stories-list__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .stories-list__word-count {
        margin-bottom: 5px;
    }

    .stories-list__read-more {
        display: inline-block;
        width: 100%;
        text-align: center;
        padding: 8px;
    }
    /* коментари */
    .comments-list {
        padding: 5px;
    }

    .comment {
        background: #ffe6f0;
        border-left: 3px solid #ff66a3;
        padding: 2px;
        margin-bottom: 4px;
        border-radius: 4px;
        font-size: 14px;
    }

    .comment-header {
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: 13px;
        color: #d14b7a;
    }

    .comment-user {
        font-weight: bold;
        color: #b30059;
    }

    .comment-date {
        font-size: 12px;
        color: #8c004d;
    }

    .comment-content {
        font-size: 15px;
        color: #660033;
        line-height: 1.3;
    }

    .comment-children {
        margin-left: 2px;
        padding-left: 2px;
        border-left: 2px dashed #ff99c2;
    }

    /* Минимални отстояния за вложени коментари */
    .depth-1 .comment-children { margin-left: 1px; padding-left: 5px; }
    .depth-2 .comment-children { margin-left: 2px; padding-left: 5px; }
    .depth-3 .comment-children { margin-left: 3px; padding-left: 4px; }
    .depth-4 .comment-children { margin-left: 4px; padding-left: 4px; }
    .depth-5 .comment-children { margin-left: 5px; padding-left: 3px; }
    
    .avatar-grid {
        
        max-width: 200px;
        
    }

    .profile-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /*Лични съобщения и чат*/
    .mail-container {
        grid-template-columns: 1fr;
    }
    .user-list {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100%;
        transition: left 0.3s;
        z-index: 10;
    }
    .user-list.show {
        left: 0;
    }

    .mail-list-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9;
        background: rgba(0, 0, 0, 0.38);
    }

    .message.message-incoming,
    .message.message-outgoing {
        min-width: min(220px, 90%);
        max-width: 90%;
    }
    .open-list {
        display: block;
        width: auto;
        min-width: 0;
        padding: 8px 12px;
        font-size: 15px;
    }
    .close-list {
        display: block;
    }

    /*.............................
        ВИДЕО ЗА ФОН
    ~~~~~~~~~~~~~~~~~~~~~~~~~~*/
    .story-video {
        flex-direction: column;
        align-items: stretch;
    }

    .story-video p {
        margin-bottom: 0.8em;
        text-align: center;
        justify-content: center;
    }

    /*-----------------------------------
            ЧАТ
    ---------------------------------*/
    
     /* Каналите да са скрити по подразбиране (скрито меню) */
    .chat-channels {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 250px;
        height: 100vh;
        background-color: #0b1a2f;
        padding: 20px;
        box-shadow: 2px 0 8px rgba(0,0,0,0.8);
        overflow-y: auto;
        z-index: 9999;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
    }

    /* Когато менюто е активно - показва се */
    .chat-channels.active {
        display: block;
        transform: translateX(0);
    }

    /* Бутон за отваряне/затваряне на каналите */
    .chat-toggle-btn {
        display: inline-block;
        position: fixed;
        top: 10px;
        right: 10px;
        background-color: #3b82f6;
        color: white;
        border: none;
        padding: 10px 15px;
        font-size: 1.2rem;
        border-radius: 5px;
        z-index: 10000;
        cursor: pointer;
    }

    /*USER RANKS*/
    .user-rank {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.user-rank span {
    display: inline-block;
}

}

@media (max-width: 768px) {
    .my-title-row {
        grid-template-columns: 30px 64px 1fr;
        gap: 6px;
    }

    .my-title-preview {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .mobile-quick-actions {
        display: flex;
        gap: 8px;
        position: absolute;
        top: 15px;
        left: 15px;
        z-index: 100000;
    }

    .mobile-quick-actions a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 8px 10px;
        border-radius: 999px;
        background: #fff;
        color: #d63384;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
        font-weight: bold;
        text-decoration: none;
    }

    .mobile-quick-actions span {
        margin-left: 2px;
        font-size: 0.85rem;
    }
}
