/* ============================================================
   Тема „parvenec" — надграждащ слой върху оригиналните
   site.css + site-skin.css (от parvenec/style.css и parvenec/images/style.css).
   Тук са само нещата, които оригиналните файлове не покриват за генеричния
   CMS изход:
     - решетка на footer-а (замества нужния bootstrap ред)
     - оформление на блоковото съдържание (текст/изображение/галерия/
       файл/цитат/embed от includes/blocks.php)
     - листинг на категория, начална страница, lightbox
     - падащо подменю с чист CSS + мобилно меню
     - слайдер на началната страница, Facebook иконка, декоративна
       картинка долу вляво (специфично за дизайна от parvenec/)
   Цветовете следват оригиналната схема: синьо #40b4de / #0e85cd,
   червено #df2d2e, жълто #faca04, зелено #00a200, текст #252525.
   ============================================================ */

/* --- Footer: заместител на bootstrap .row / .col-md-4 --- */
.footer .row { display: flex; flex-wrap: wrap; margin: 20px 0; }
.footer .col-md-4 { flex: 1 1 33.333%; min-width: 200px; padding: 0 15px; box-sizing: border-box; }
.footer .col-md-4 a { color: #fff; text-decoration: underline; }
.footer .col-md-4 a:hover { color: #fff; }

/* --- Контейнер на съдържанието --- */
.txtcontainer { display: table; width: 100%; }
.text_table.full { display: block; width: 100%; }
.restxt { padding: 10px 25px 25px; line-height: 1.7; }
.restxt > :first-child { margin-top: 0; }
.restxt h3 { color: #df2d2e; font-weight: normal; font-size: 20px; margin: 18px 0 10px; }
.restxt a { color: #0e85cd; }
.restxt a:hover { text-decoration: underline; }
.restxt p { margin: 0 0 .85em; }
.restxt ul, .restxt ol { margin: 0 0 .85em; padding-left: 1.6em; }
.restxt img { max-width: 100%; height: auto; }

/* --- Падащо подменю: чист CSS (оригиналът ползваше jQuery .hover) --- */
.pages_menu_btn:hover > .pages_menu_div,
.pages_menu_btn:focus-within > .pages_menu_div { display: block; }
.pages_menu_div { padding: 0; margin: 0; list-style: none; min-width: 100%; }
.t_podmenu a { display: block; color: #fff; font-size: 15px; }
.t_podmenu a:hover { color: #fff; }

/* --- Блоково съдържание (includes/blocks.php → blocks_render) --- */
.page-content { margin-top: 1em; }
.page-content .block { margin: 0 0 1.4em; }
.page-content .block:last-child { margin-bottom: 0; }
.page-content .block-text > :first-child { margin-top: 0; }

.page-content .block-image { margin: 1.6em 0; text-align: center; }
.page-content .block-image img { border-radius: 5px; }
.page-content .block-image figcaption,
.block-gallery .gallery-item figcaption {
    margin-top: .4em; font-size: 13px; color: #807D7D; font-style: italic;
}

/* Снимки, отваряеми на цял екран (lightbox — theme.js). */
.media-link { display: inline-block; cursor: zoom-in; }
.media-link img { display: block; }

.block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin: 1.6em 0;
}
.block-gallery[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.block-gallery[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.block-gallery[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.block-gallery[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.block-gallery[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }
.block-gallery .gallery-item { margin: 0; }
.block-gallery .gallery-item img {
    display: block; width: 100%; height: 190px; object-fit: cover;
    border-radius: 5px; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.block-file { margin: 1.4em 0; }
.block-file a {
    display: inline-block; padding: 9px 16px;
    background: #0e85cd; color: #fff; font-size: 15px;
    border-top-left-radius: 0; border-top-right-radius: 7px;
    border-bottom-right-radius: 0; border-bottom-left-radius: 7px;
    text-decoration: none;
}
.block-file a:hover { background: #df2d2e; color: #fff; }
.block-file .file-ico { margin-right: 6px; }

.block-quote {
    margin: 1.6em 0; padding: 14px 20px;
    background: rgba(255, 255, 234, 0.83);
    border-left: 4px solid #df2d2e; border-radius: 4px;
}
.block-quote blockquote { margin: 0; font-style: italic; font-size: 16px; color: #252525; }
.block-quote figcaption { margin-top: .5em; font-size: 13px; color: #807D7D; }

.block-embed { margin: 1.6em 0; }
.embed-frame {
    position: relative; width: 100%; height: 0;
    padding-bottom: 56.25%; overflow: hidden; border-radius: 5px;
}
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.block-embed-maps .embed-frame { padding-bottom: 75%; }

.text_table_line { border-bottom: 1px solid rgba(77, 60, 128, 0.4); }

/* --- Начална страница: раздели --- */
.home-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 12px; }
.home-section {
    display: block; padding: 14px 16px; background: #df2d2e; color: #fff;
    text-decoration: none; border-top-right-radius: 7px; border-bottom-left-radius: 7px;
}
.home-section:hover { background: #0e85cd; text-decoration: none; }
.home-section-title { display: block; font-size: 16px; }
.home-section-desc { display: block; margin-top: 5px; font-size: 13px; color: #faf4da; }

/* --- Листинг на категория (новинарски карти) --- */
.alt_news_table {
    background: rgba(255, 255, 234, 0.83);
    border: 1px solid rgba(250, 202, 4, 0.4);
    border-radius: 5px; margin-bottom: 14px;
}
.alt_news_table .restxt { padding: 14px 18px; }
.alt_news_table .w130 { width: 130px; padding-right: 14px; }
.alt_news_table .w130 img { width: 130px; height: auto; border-radius: 4px; }
.alt_news_table h3 { margin: 0 0 6px; font-size: 19px; }
.alt_news_table h3 a { color: #0e85cd; }
.news_data, time.news_data {
    display: inline-block; margin: 0 0 8px; font-size: 13px;
    color: #df2d2e; font-weight: bold;
}
.news-summary { margin: 6px 0; color: #252525; }
.alt_news_table div[align="right"] a { font-size: 14px; color: #df2d2e; }

.pager { text-align: center; margin-top: 16px; }
.pager a {
    display: inline-block; min-width: 25px; margin: 5px; padding: 4px 12px;
    background: #df2d2e; color: #fff; border-radius: 4px; text-decoration: none;
}
.pager a:hover { background: #0e85cd; }
.pager-info { display: inline-block; margin: 0 8px; color: #807D7D; font-size: 13px; }

/* --- Седмично меню (т.14.8): прост списък заглавие = линк за сваляне --- */
.weekly-menu-list { list-style: none; margin: 0; padding: 0; }
.weekly-menu-list li { margin: 0 0 16px; }
.weekly-menu-list li:last-child { margin-bottom: 0; }
.weekly-menu-list a { color: #1a5fb4; font-size: 16px; text-decoration: none; }
.weekly-menu-list a:hover { text-decoration: underline; }
.weekly-menu-list .muted { font-size: 16px; }

/* --- Публикация --- */
.post-meta { font-size: 13px; margin: 0 0 12px; }
.post-meta a { color: #0e85cd; }
.post-meta .sep { color: #999; margin: 0 4px; }
.post-meta .news_data { margin-left: 8px; }
.post-cover { margin: 0 0 16px; text-align: center; }
.post-cover img { max-width: 100%; height: auto; border-radius: 6px; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.18); }
.post-summary { font-weight: bold; }

/* ============================================================
   Lightbox (theme.js)
   ============================================================ */
.lightbox {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem; background: rgba(0, 0, 0, .9);
}
.lightbox[hidden], .lightbox [hidden] { display: none; }
.lightbox-fig {
    margin: 0; max-width: 100%; max-height: 100%;
    display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.lightbox-img { max-width: 100%; max-height: 82vh; object-fit: contain; background: #fff; border-radius: 4px; }
.lightbox-cap { color: #fff; font-size: .95rem; text-align: center; max-width: 42rem; }
.lightbox-close, .lightbox-nav {
    position: absolute; background: rgba(255, 255, 255, .15); color: #fff; border: 0;
    cursor: pointer; width: 2.75rem; height: 2.75rem; border-radius: 999px;
    font-size: 1.5rem; line-height: 1;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .3); }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media screen and (max-width: 1170px) {
    .alt_news_table .w130,
    .alt_news_table .w130 img { width: 110px; }
}

@media screen and (max-width: 768px) {
    /* Мобилно меню: бутонът ☰ добавя клас .resp към #top-menu (както в оригинала). */
    #top-menu.resp {
        display: block !important; position: absolute; width: 100%;
        top: 45px; left: 0; z-index: 99999; background: #faca04;
    }
    #top-menu.resp .t_menu,
    #top-menu.resp .t_menu_act { display: block; width: 100%; text-align: left; height: auto; line-height: 2.6; border-top: 1px solid rgba(255,255,255,.15); }
    #top-menu.resp .pages_menu_div { display: block !important; position: relative; top: 0 !important; background: rgba(0,0,0,.12); }
    #top-menu.resp .t_podmenu { padding-left: 20px; }
    .restxt { padding: 12px 15px 18px; }
    .alt_news_table .w130, .alt_news_table .w130 img { width: 100%; }
    .alt_news_table #trw > #tdc { display: block; width: 100%; }
    .block-gallery .gallery-item img { height: 150px; }
    .block-gallery[data-cols="3"],
    .block-gallery[data-cols="4"],
    .block-gallery[data-cols="5"],
    .block-gallery[data-cols="6"] { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 640px) {
    .home-sections { grid-template-columns: 1fr; }
}

/* ============================================================
   Специфично за parvenec/
   ============================================================ */

/* Подменю: анимация „rubberBand" (от оригиналния animate.css). */
.animated { animation-duration: 1s; animation-fill-mode: both; }
@keyframes rubberBand {
    from { transform: scale3d(1, 1, 1); }
    30%  { transform: scale3d(1.25, 0.75, 1); }
    40%  { transform: scale3d(0.75, 1.25, 1); }
    50%  { transform: scale3d(1.15, 0.85, 1); }
    65%  { transform: scale3d(.95, 1.05, 1); }
    75%  { transform: scale3d(1.05, .95, 1); }
    to   { transform: scale3d(1, 1, 1); }
}
.rubberBand { animation-name: rubberBand; }

/* Facebook иконка в горната лента (#soc-div е позициониран в site-skin.css). */
#head-div { position: relative; }

/* Слайдер на началната страница (замества jquery.cslider — fade през theme.js).
   Височината идва от .da-slider в site-skin.css (437px / 137px на мобилно). */
.da-slider { position: relative; overflow: hidden; }
.da-slider .da-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease-in-out; }
.da-slider .da-slide.da-slide-current { opacity: 1; z-index: 1; }
.da-slider .da-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Декоративна картинка, закована долу вляво (24.png в оригинала). */
.corner-decor { position: fixed; bottom: 0; left: 0; z-index: 10000; width: 200px; pointer-events: none; }

@media screen and (max-width: 768px) {
    .corner-decor { width: 110px; }
}
