/* ===== Base ===== */
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #111;
    background: #fff;
}

a {
  color: #0f0f0f; /* темно-сірий як у YouTube */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Front Page ===== */
.front-page {
    width: 100%;
}


/* ===== Main Content Wide Layout ===== */
.content-layout {
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 0 40px; /* відступи від країв екрана */
    box-sizing: border-box;
}

.content-block {
    width: 100%;
    max-width: 1600px; /* обмеження для великих моніторів */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.content-block h2 {
    font-size: 32px;
    margin-bottom: 16px;
}

.content-block p {
    font-size: 18px;
    color: #333;
    margin-bottom: 16px;
}

.content-block img {
    width: 100%;
    height: auto;
    margin-top: 20px;
    border-radius: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .hero {
        padding: 100px 30px 60px 30px;
    }

    .content-layout {
        padding: 0 30px;
    }
}

@media (max-width: 900px) {
    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 18px;
    }

    .content-layout {
        padding: 0 20px;
    }
}

/* ===== Header ===== */
.site-header {
    width: 100%;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.header-inner {
    display: flex;
    flex-wrap: wrap; /* головне */
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    
    max-width: 100%;
    padding: 15px 40px;
    box-sizing: border-box;
}

/* Брендинг */
.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-title-slogan {
    display: flex;
    flex-direction: column;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
}

.site-description {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* Меню */
.main-navigation {
    flex: 1;
    min-width: 300px;
}

.main-navigation .menu {
    display: flex;
    flex-wrap: wrap; /* перенос пунктів меню */
    justify-content: flex-end;
    gap: 10px 25px;

    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation .menu li {
    margin: 0;
}

.main-navigation .menu a {
    display: block;
    padding: 6px 0;
    text-decoration: none;
    color: #111;
    font-weight: 500;
}

/* Планшети */
@media (max-width: 900px) {

    .header-inner {
        padding: 15px 20px;
    }

    .main-navigation {
        width: 100%;
    }

    .main-navigation .menu {
        justify-content: flex-start;
    }
}

/* =========================
   FOOTER
========================= */

.site-footer {
    margin-top: 60px;
    padding: 40px 20px;
    background: #111;
    color: #fff;
}

.footer-inner {
    max-width: 1600px;
    margin: 0 auto;
}

/* Нижнє меню */

.footer-menu {
    margin-bottom: 20px;
}

.footer-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap; /* перенос на новий рядок */
    gap: 12px 24px;
}

.footer-menu li {
    margin: 0;
}

.footer-menu a {
    color: #ddd;
    text-decoration: none;
    font-size: 14px;
}

.footer-menu a:hover {
    color: #fff;
}

/* Копірайт */

.site-info {
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: 15px;
    font-size: 14px;
    color: #999;
}

/* =========================
   FRONT PAGE CONTENT
========================= */
.front-page-content {
    max-width: 1600px;       /* обмежує ширину великого контенту */
    margin: 0 auto;          /* центрування */
    padding: 0 30px;         /* відступи з боків */
    box-sizing: border-box;
}

.front-page-title {
    font-size: 2.5rem;
	margin-bottom: 0.8em;
	color:#0073e6;
}

.front-page-text p {
    line-height: 1.6;
    margin-bottom: 1.2em;
}

.front-page-content h3 a {
	font-size: 1.5rem;
    color: #d12c0b;
    text-decoration: underline;
}

.front-page-content h3 a:hover {
    color: #b12609;
    text-decoration: underline;
}

.front-page-content h4 a {
	font-size: 1.7rem;
	font-weight: normal;

    text-decoration: none;
}

.front-page-content h4 a:hover {
    color: #333333;
    text-decoration: underline;
}


.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #fff; /* важливо, щоб контент не просвічував */
  border-bottom: 1px solid #eaeaea;
}

.site-header {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

/* =========================
   SINGLE POST LAYOUT (FIXED)
========================= */

.single-layout {
  display: flex;
  justify-content: center;   /* центрує всю конструкцію */
  gap: 40px;
  align-items: flex-start;

  max-width: 1600px;         /* як у контент-блоках */
  margin: 0 auto;
  padding: 0 40px;           /* відступи від країв екрану */
  box-sizing: border-box;
}

/* основний контент */
.content-area {
  flex: 1;
  min-width: 0;

  /* ВАЖЛИВО: прибираємо конфліктні padding-и */
  padding: 0;
}

/* sidebar */
.sidebar {
  width: 320px;
  flex-shrink: 0;
  padding: 0;
}

/* =========================
   POST TYPOGRAPHY
========================= */

.post-header {
  margin-bottom: 30px;
}

.post-title {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 30px;
  font-weight: 700;
  color:#0073e6;
}

.post-meta {
  color: #666;
  font-size: 14px;
}

.post-content {
  font-size: 18px;
  line-height: 1.7;
  color: #111;
}

.post-content p {
  margin-bottom: 18px;
}

.post-content h2,
.post-content h3 {
  margin-top: 30px;
  margin-bottom: 15px;
}

/* =========================
   IMAGES FIX (ВАЖЛИВО)
========================= */

/* щоб не розтягувало маленькі картинки */
.post-content img {
  max-width: 100%;
  width: auto;        /* ключове — НЕ 100% */
  height: auto;
  display: inline-block;
}

/* якщо потрібно, щоб великі картинки були адаптивні */
.post-content img.aligncenter,
.post-content img.alignnone {
  max-width: 100%;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {
  .single-layout {
    flex-direction: column;
    padding: 0 20px;
  }

  .sidebar {
    width: 100%;
  }
}


/* =========================
   RESPONSIVE IFRAME FIX (YouTube / embeds)
========================= */

.post-content iframe {
  max-width: 100%;
}

/* універсальний контейнер для відео */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 20px 0; 
  overflow: hidden;
}

/* сам iframe всередині */
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-content iframe[src*="youtube.com"],
.post-content iframe[src*="youtu.be"] {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* =========================
   VIDEOS IN CONTENT AREA
========================= */
.content-area .video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 20px 0;
  overflow: hidden;
}

.content-area .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================
   VIDEOS IN SIDEBAR
========================= */
.sidebar iframe,
.sidebar .video-embed {
  width: 100%;
  height: auto; /* або, якщо хочеш фіксовану висоту, можна задавати aspect-ratio */
  max-width: 100%;
  display: block;
}

/* =========================
   POST TABLES (CLEAN MEDIA STYLE)
========================= */

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 16px;
  line-height: 1.5;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  overflow: hidden;
}

/* Заголовки таблиці */
.post-content th {
  text-align: left;
  background: #f5f5f5;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid #ddd;
  color: #111;
}

/* Клітинки */
.post-content td {
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  color: #333;
  vertical-align: top;
}

/* Чередування рядків */
.post-content tr:nth-child(even) {
  background: #fafafa;
}

/* Ховер як у сучасних медіа */
.post-content tr:hover {
  background: #f0f7ff;
}

/* Останній рядок без бордера */
.post-content tr:last-child td {
  border-bottom: none;
}

/* =========================
   MOBILE TABLE (IMPORTANT)
========================= */

@media (max-width: 768px) {
  .post-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Прибираємо дату і автора з постів */
.post-meta {
    display: none;
}

.page-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 40px; 
  box-sizing: border-box;
}

.page-layout .content-area {
  width: 100%;
  min-width: 0;
}

.sidebar .card img {
    display: block;
    max-width: 100%;  /* великі картинки не виходять за sidebar */
    height: auto;
    margin: 0 auto;
}

/* якщо картинка менша за sidebar — залишаємо оригінальний розмір */
.sidebar .card img[src] {
    width: auto;
}

/* нове */

/* YouTube з Gutenberg */

.wp-block-embed-youtube iframe,
.wp-block-embed__wrapper iframe {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
}


.sidebar img {
    max-width: 100%;
    height: auto;
    display: block;
}

.grid.three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* відстань між картками */
}

.card {
    background: #fff; /* або інший фон */
    border: 1px solid #ddd;
    padding: 15px;
    box-sizing: border-box;
}

.card img {
    max-width: 100%;
    height: auto;
    display: block;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    width: 100%;
    height: 100%;
}


.card video,
.card iframe {
    width: 100%;
    max-width: 100%;
    display: block;
}

.card .wp-block-embed,
.card .wp-block-embed__wrapper,
.card iframe {
    width: 100%;
    max-width: 100%;
}

.card .wp-block-embed {
    margin: 0 0 15px;
}

.card iframe {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    display: block;
}

.wp-block-gallery.has-nested-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.wp-block-gallery.has-nested-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ir-gallery {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:12px;
    margin:25px 0;
}

.ir-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

.ir-gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

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


/* LIGHTBOX */

.ir-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ir-lightbox.active {
    display: flex;
}

.ir-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}


.ir-lightbox-close {
    position:absolute;
    top:20px;
    right:30px;
    color:white;
    font-size:40px;
    cursor:pointer;
}


.ir-lightbox-prev,
.ir-lightbox-next {

    position:absolute;
    top:50%;
    color:white;
    font-size:50px;
    cursor:pointer;
    user-select:none;

}

.ir-lightbox-prev {
    left:30px;
}

.ir-lightbox-next {
    right:30px;
}

/* =========================
   MOBILE FINAL ADAPTATION
========================= */


@media (max-width: 768px) {


/* HEADER */

.header-inner {
    padding: 12px 15px;
    gap: 10px;
}

.site-branding {
    width:100%;
}

.site-title {
    font-size: 1.2rem;
}

.site-description {
    font-size: .75rem;
}


.main-navigation {
    min-width:0;
    width:100%;
}


.main-navigation .menu {
    justify-content:flex-start;
    gap:8px 15px;
}


.main-navigation .menu a {
    font-size:14px;
}



/* SINGLE */

.single-layout {

    display:flex;
    flex-direction:column;

    padding:0 15px;
    gap:30px;

}


.content-area {
    width:100%;
}


.sidebar {

    width:100%;

}


/* TITLE */

.post-title {

    font-size:32px;
    line-height:1.25;


}


/* TEXT */

.post-content {

    font-size:17px;
    line-height:1.65;

}


.post-content img {

    max-width:100%;
    height:auto;

}



/* FRONT */

.front-page-content {

    padding:0 15px;

}

.front-page-title {
    font-size:2rem;
}



/* CARDS GRID */

.grid.three-columns {

    grid-template-columns:1fr;

}


/* GALLERY */

.ir-gallery {

    grid-template-columns:repeat(2,1fr);
    gap:8px;

}


.ir-gallery-item img {

    height:160px;

}



/* LIGHTBOX */

.ir-lightbox img {

    max-width:95%;
    max-height:85%;

}


.ir-lightbox-close {

    top:10px;
    right:15px;

    font-size:32px;

}


.ir-lightbox-prev,
.ir-lightbox-next {

    font-size:35px;

}


.ir-lightbox-prev {

    left:10px;

}


.ir-lightbox-next {

    right:10px;

}




/* TABLES */

.post-content table {

    font-size:14px;

}



/* FOOTER */

.site-footer {

    padding:30px 15px;

}



}




/* маленькі телефони */

@media (max-width:420px) {


.ir-gallery {

    grid-template-columns:1fr;

}


.ir-gallery-item img {

    height:auto;

}


.post-title {

    font-size:27px;
}


.post-content {

    font-size:16px;

}


}

/* =========================
   PAGINATION
========================= */


.pagination {

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

    gap:8px;

    margin:50px 0 30px;

    flex-wrap:wrap;

}



.pagination a,
.pagination .current {

    min-width:42px;
    height:42px;

    display:flex;

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

    border:1px solid #ddd;

    border-radius:6px;

    text-decoration:none;

    font-size:16px;

    box-sizing:border-box;

}



.pagination a:hover {

    background:#f2f2f2;

}



.pagination .current {

    background:#111;

    color:#fff;

    border-color:#111;

}



.pagination .dots {

    padding:0 8px;

}



.pagination .page-prev,
.pagination .page-next {

    padding:0 16px;

}



@media(max-width:600px){


.pagination {

    gap:6px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;

}


.pagination a,
.pagination .current {

    min-width:36px;

    height:36px;

    font-size:14px;

}

.pagination .page-prev,
.pagination .page-next {

    width:100%;

    margin-bottom:5px;

}

}