/* =========================================================
   NEWS MODULE STYLES
   Изолированные стили для функционала NEWS
   ========================================================= */

/* =========================================================
   NEWS CARDS GRID (news.html)
   Гибкая адаптивная сетка для карточек новостей
   ========================================================= */

.news-api-grid {

    display: flex;

    gap: 22px;

    width: 100%;

    overflow-x: auto;

    scroll-behavior: smooth;

    padding-bottom: 15px;

    scrollbar-width: none;
-ms-overflow-style: none;
scroll-snap-type: x mandatory;

}
.news-api-grid::-webkit-scrollbar {
    display: none;
}


.news-api-card {
    flex: 0 0 320px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,241,222,.90));
    border: 1px solid rgba(201,170,90,.28);
    box-shadow: 0 15px 34px rgba(43,50,39,.09);
    transition: transform .3s ease, box-shadow .3s ease;
}

.news-api-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 42px rgba(43,50,39,.14);
}

.news-api-card-image {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: cover;
    object-position: center;
}

.news-api-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 28px 28px 30px;
}

.news-api-card-date {
    margin-bottom: 12px;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #8a7650;
}

.news-api-card-title {
    margin: 0 0 15px;
    font-family: "Playfair Display", serif;
    font-size: 23px;
    font-weight: 500;
    line-height: 1.3;
    color: #34422f;
}

.news-api-card-excerpt {
    margin: 0 0 25px;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 600;
    color: #394238;

    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-api-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 28px;
    border: 1px solid rgba(180, 145, 67, .65);
    border-radius: 30px;
    background: linear-gradient(135deg, #526246, #35432f);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(38, 48, 34, .18), inset 0 1px 0 rgba(255,255,255,.12);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
    margin-top: auto;
}

.news-api-card-link:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #687b51, #465a3c);
    box-shadow: 0 15px 32px rgba(48,55,43,.22);
}

/* =========================================================
   NEWS SINGLE PAGE (news-single.html)
   Страница отдельной новости
   ========================================================= */

.news-api-single {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 35px;
}

.news-api-single-header {
    margin-bottom: 30px;
}

.news-api-single-date {
    margin-bottom: 12px;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #8a7650;
}

.news-api-single-title {
    margin: 0 0 18px;
    font-family: "Playfair Display", serif;
    font-size: 42px;
    font-weight: 500;
    line-height: 1.2;
    color: #34422f;
}

.news-api-single-main-image {
    display: block;
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center 40%;
    border-radius: 28px;
    border: 1px solid rgba(201,170,90,.20);
    box-shadow: 0 20px 45px rgba(40,45,38,.16);
    margin-bottom: 30px;
}

.news-api-single-content {
    font-family: "Manrope", sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #2f352b;
    margin-bottom: 40px;
}

.news-api-single-content p {
    margin: 0 0 20px;
}

.news-api-single-content h2,
.news-api-single-content h3 {
    font-family: "Playfair Display", serif;
    font-weight: 500;
    color: #34422f;
    margin: 30px 0 15px;
}

.news-api-single-content h2 {
    font-size: 32px;
}

.news-api-single-content h3 {
    font-size: 26px;
}
/* =========================================================
   WORDPRESS CONTENT FORMATTING
   Полная поддержка стандартного форматирования Gutenberg
   ========================================================= */

/* Выравнивание */
.news-api-single-content .has-text-align-left {
    text-align: left;
}

.news-api-single-content .has-text-align-center {
    text-align: center;
}

.news-api-single-content .has-text-align-right {
    text-align: right;
}

/* Заголовки */
.news-api-single-content h2,
.news-api-single-content h3,
.news-api-single-content h4 {
    font-family: "Playfair Display", serif;
    font-weight: 500;
    color: #34422f;
    line-height: 1.3;
}

.news-api-single-content h2 {
    margin: 35px 0 18px;
    font-size: 32px;
}

.news-api-single-content h3 {
    margin: 30px 0 15px;
    font-size: 26px;
}

.news-api-single-content h4 {
    margin: 25px 0 12px;
    font-size: 22px;
}

/* Обычный текст */
.news-api-single-content p {
    margin: 0 0 20px;
}

/* Жирный и курсив */
.news-api-single-content strong,
.news-api-single-content b {
    font-weight: 700;
}

.news-api-single-content em,
.news-api-single-content i {
    font-style: italic;
}

/* Ссылки */
.news-api-single-content a {
    color: #657b52;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.news-api-single-content a:hover {
    color: #b49143;
}

/* Маркированные и нумерованные списки */
.news-api-single-content ul,
.news-api-single-content ol {
    margin: 0 0 25px;
    padding-left: 28px;
}

.news-api-single-content ul {
    list-style: disc;
}

.news-api-single-content ol {
    list-style: decimal;
}

.news-api-single-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.news-api-single-content li:last-child {
    margin-bottom: 0;
}

/* Вложенные списки */
.news-api-single-content ul ul,
.news-api-single-content ol ol,
.news-api-single-content ul ol,
.news-api-single-content ol ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Цитаты */
.news-api-single-content blockquote {
    margin: 30px 0;
    padding: 20px 25px;
    border-left: 4px solid #b49143;
    background: rgba(247, 241, 222, 0.55);
    color: #4b5545;
    font-family: "Playfair Display", serif;
    font-size: 20px;
    line-height: 1.6;
    border-radius: 0 14px 14px 0;
}

.news-api-single-content blockquote p {
    margin: 0;
}

/* Изображения */
.news-api-single-content figure {
    margin: 30px 0;
}

.news-api-single-content figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 18px;
}

/* Подпись к изображению */
.news-api-single-content figcaption {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: #777c73;
}

/* Разделитель */
.news-api-single-content hr {
    margin: 35px 0;
    border: 0;
    border-top: 1px solid rgba(201, 170, 90, 0.35);
}

/* Таблицы */
.news-api-single-content table {
    width: 100%;
    margin: 30px 0;
    border-collapse: collapse;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
}

.news-api-single-content th,
.news-api-single-content td {
    padding: 12px 14px;
    border: 1px solid rgba(201, 170, 90, 0.3);
    text-align: left;
    vertical-align: top;
}

.news-api-single-content th {
    font-weight: 700;
    background: rgba(247, 241, 222, 0.7);
}

/* Поддержка Gutenberg: зачёркнутый, подчёркнутый и код */
.news-api-single-content s,
.news-api-single-content del {
    text-decoration: line-through;
}

.news-api-single-content u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.news-api-single-content code {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.05);
    font-family: monospace;
    font-size: 0.92em;
}

/* Горизонтальный overflow для широких таблиц */
.news-api-single-content .wp-block-table {
    overflow-x: auto;
}

/* Адаптация */
@media (max-width: 768px) {

    .news-api-single-content h2 {
        font-size: 28px;
        margin-top: 30px;
    }

    .news-api-single-content h3 {
        font-size: 23px;
    }

    .news-api-single-content h4 {
        font-size: 20px;
    }

    .news-api-single-content blockquote {
        padding: 16px 18px;
        font-size: 18px;
    }

    .news-api-single-content table {
        font-size: 14px;
    }

    .news-api-single-content th,
    .news-api-single-content td {
        padding: 10px 11px;
    }
}

@media (max-width: 480px) {

    .news-api-single-content h2 {
        font-size: 25px;
    }

    .news-api-single-content h3 {
        font-size: 21px;
    }

    .news-api-single-content h4 {
        font-size: 19px;
    }

    .news-api-single-content blockquote {
        font-size: 17px;
    }

    .news-api-single-content ul,
    .news-api-single-content ol {
        padding-left: 22px;
    }
}
/* =========================================================
   NEWS GALLERY
   Адаптивная галерея изображений
   ========================================================= */

.news-api-gallery {
    margin: 40px 0;
}

.news-api-gallery-title {
    font-family: "Playfair Display", serif;
    font-size: 28px;
    font-weight: 500;
    color: #34422f;
    margin: 0 0 25px;
}

.news-api-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.news-api-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.news-api-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .4s ease;
}

.news-api-gallery-item:hover img {
    transform: scale(1.05);
}

/* =========================================================
   NEWS NAVIGATION
   Навигация между новостями
   ========================================================= */

.news-api-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(201,170,90,.25);
}

.news-api-nav-prev {
    justify-self: start;
}

.news-api-nav-all {
    justify-self: center;
}

.news-api-nav-next {
    justify-self: end;
}

.news-api-nav-link {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 12px 28px;

    border-radius: 30px;

    border: 1px solid rgba(201,170,90,.75);

    background:
        linear-gradient(
            135deg,
            #657b52,
            #3d4d35 55%,
            #b49143
        );

    color: #fff;

    font-family: "Manrope", sans-serif;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;
    white-space: nowrap;

    box-shadow:
        0 8px 22px rgba(38,48,34,.18),
        inset 0 1px 0 rgba(255,255,255,.18);

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        background .25s ease;
}


.news-api-nav-link:hover {

    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            #7c9364,
            #526246 55%,
            #c9aa5a
        );

    box-shadow:
        0 12px 28px rgba(38,48,34,.25);

}

.news-api-nav-link.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}


/* =========================================================
   RESPONSIVE BREAKPOINTS
   Использование существующих breakpoint проекта
   ========================================================= */

/* Tablet: 769px — 1100px */
@media (min-width: 769px) and (max-width: 1100px) {
    .news-api-grid {
        
        gap: 20px;
    }
    
    .news-api-card-image {
        height: 220px;
    }
    
    .news-api-card-content {
        padding: 24px 24px 26px;
    }
    
    .news-api-single {
        width: 94%;
        padding: 30px 30px;
    }
    
    .news-api-single-title {
        font-size: 38px;
    }
    
    .news-api-single-main-image {
        height: 350px;
    }
    
    .news-api-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 18px;
    }
}

/* Mobile: max-width: 768px */
@media (max-width: 768px) {
    .news-api-grid {
        
        gap: 18px;
    }
    
    .news-api-card-image {
        height: 280px;
    }
    
    .news-api-card-content {
        padding: 24px 22px 26px;
    }
    
    .news-api-card-title {
        font-size: 22px;
    }
    
    .news-api-single {
        width: 94%;
        padding: 25px 25px;
    }
    
    .news-api-single-title {
        font-size: 34px;
    }
    
    .news-api-single-main-image {
        height: 300px;
    }
    
    .news-api-single-content {
        font-size: 16px;
    }
    
    .news-api-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    

}

/* Small Mobile: max-width: 480px */
@media (max-width: 480px) {
    .news-api-grid {
        
        gap: 15px;
    }
    
    .news-api-card-image {
        height: 260px;
    }
    
    .news-api-card-content {
        padding: 20px 20px 22px;
    }
    
    .news-api-card-title {
        font-size: 20px;
    }
    
    .news-api-card-excerpt {
        font-size: 14px;
    }
    
    .news-api-single {
        width: 96%;
        padding: 20px 20px;
    }
    
    .news-api-single-title {
        font-size: 30px;
    }
    
    .news-api-single-main-image {
        height: 280px;
    }
    
    .news-api-single-content {
        font-size: 15px;
    }
    
    .news-api-gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .news-api-gallery-item {
        aspect-ratio: 16/9;
    }
    
    .news-api-nav-link {
        font-size: 13px;
        padding: 10px 20px;
    }
}

/* =========================================================
   LOADING STATE
   Индикатор загрузки
   ========================================================= */

.news-api-loading {
    text-align: center;
    padding: 40px 20px;
    font-family: "Manrope", sans-serif;
    font-size: 16px;
    color: #62685d;
}

.news-api-loading::after {
    content: "...";
    animation: news-api-loading-dots 1.5s infinite;
}

@keyframes news-api-loading-dots {
    0%, 20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%, 100% {
        content: "...";
    }
}

/* =========================================================
   ERROR STATE
   Сообщение об ошибке
   ========================================================= */

.news-api-error {
    text-align: center;
    padding: 40px 20px;
    font-family: "Manrope", sans-serif;
    font-size: 16px;
    color: #8b3a3a;
    background: rgba(255,235,235,.90);
    border: 1px solid rgba(200,100,100,.30);
    border-radius: 16px;
    margin: 20px 0;
}

/* =========================================================
   HIDDEN STATE
   Скрытие элементов
   ========================================================= */

.news-api-hidden {
    display: none !important;
}
/* =========================================================
СКРОЛЛ КАРТОЧЕК ВЛЕВО ВПРАВО
   ========================================================= */
@media (max-width: 768px) {

    .news-api-card {
        flex: 0 0 300px;
    }

}

@media (max-width:768px){

    .news-api-navigation {

        display:flex;
        flex-direction:column;
        align-items:center;
        gap:18px;

    }

    .news-api-nav-link {

        width:auto;
        min-width:220px;

    }

}
.news-slider {
    position: relative;
    display: flex;
    align-items: center;
}


.news-arrow {

    position: absolute;

    top: 50%;
    transform: translateY(-50%);

    width: 46px;
    height: 46px;

    border-radius: 50%;

    border: 1px solid rgba(201,170,90,.55);

    background:
    linear-gradient(
        135deg,
        #657b52,
        #3d4d35 55%,
        #b49143
    );

    color:white;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;

    z-index:5;

    box-shadow:
    0 8px 20px rgba(38,48,34,.25);

    transition:.25s ease;
}


.news-arrow:hover {

    transform:translateY(-50%) scale(1.08);

}


.news-arrow-prev {
    left:-25px;
}


.news-arrow-next {
    right:-25px;
}
/* =========================================================
Увеличение Уменьшение фото 
   ========================================================= */
.news-api-single-content img {

    max-width:100%;
    height:auto;
    border-radius:18px;
    cursor:pointer;

}


.news-content-lightbox {

    position:fixed;
    inset:0;

    background:rgba(20,25,18,.92);

    display:flex;
    align-items:center;
    justify-content:center;

    opacity:0;
    visibility:hidden;

    transition:.3s ease;

    z-index:20000;

}


.news-content-lightbox.active {

    opacity:1;
    visibility:visible;

}


.news-content-lightbox-inner {

    position:relative;

    max-width:90%;
    max-height:90%;

}


.news-content-image {

    max-width:90vw;
    max-height:85vh;

    object-fit:contain;

    border-radius:12px;

}


.news-content-close {

    position:absolute;

    top:-50px;
    right:0;

    width:40px;
    height:40px;

    border-radius:50%;
    border:none;

    font-size:28px;

    cursor:pointer;

}


.news-content-prev,
.news-content-next {

    position:absolute;

    top:50%;

    width:45px;
    height:45px;

    border-radius:50%;

    border:none;

    cursor:pointer;

}


.news-content-prev {
    left:-70px;
}


.news-content-next {
    right:-70px;
}



@media(max-width:768px){

    .news-content-prev {
        left:10px;
    }


    .news-content-next {
        right:10px;
    }


    .news-content-image {

        max-width:95vw;
        max-height:80vh;

    }

}
/* =========================================================
   NEWS CARDS — STABLE CONTENT
   ========================================================= */

.news-api-card {

    min-height: 520px;

    height: auto;

    max-height: none;

    box-sizing: border-box;

}


.news-api-card-content {

    display: flex;

    flex-direction: column;

    flex: 1 1 auto;

    min-height: 0;

    height: auto;

    box-sizing: border-box;

    padding: 28px 28px 30px;

    overflow: hidden;

}


.news-api-card-title {

    margin: 0 0 15px;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;

    overflow: hidden;

}


.news-api-card-excerpt {

    margin: 0 0 25px;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 4;

    overflow: hidden;

}


.news-api-card-link {

    margin-top: auto;

    flex: 0 0 auto;

}

