/* BLOG-UX-01: single blog posts, only loaded when option ocs_blog_ux = 1 (body.ocs-blog-ux). Loads after reading-post.css. */

/* ---- centred grid: the left column (Elementor 4413dde, first child) is always empty on posts. No :has() (HOTFIX). ---- */
@media (min-width: 1360px) {
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read.ocs-read-v2:not(.ocs-read-module) .ocsalya-reading-layout { grid-template-columns: minmax(0, 780px) 300px !important; justify-content: center !important; column-gap: 40px !important; }
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read.ocs-read-v2:not(.ocs-read-module) .ocsalya-reading-layout > article { grid-column: 1 !important; }
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read.ocs-read-v2:not(.ocs-read-module) .ocsalya-reading-layout > aside:last-child { grid-column: 2 !important; }
}
@media (min-width: 1024px) and (max-width: 1359px) {
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read.ocs-read-v2:not(.ocs-read-module) .ocsalya-reading-layout { grid-template-columns: minmax(0, 820px) !important; justify-content: center !important; }
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read.ocs-read-v2:not(.ocs-read-module) .ocsalya-reading-layout > article { grid-column: 1 !important; }
}
@media (min-width: 1024px) {
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read.ocs-read-v2:not(.ocs-read-module) .ocsalya-reading-layout > .ocsalya-reading-sidebar:first-child { display: none !important; }
}

/* ---- byline in the meta row ---- */
body.ocs-blog-ux .ocsalya-reading-meta .ocs-read-byline a { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
body.ocs-blog-ux .ocsalya-reading-meta .ocs-read-byline a:hover { text-decoration: underline; }
body.ocs-blog-ux .ocsalya-reading-meta img.ocs-read-byline__avatar { width: 24px !important; height: 24px !important; max-width: none !important; margin: 0 !important; border-radius: 50% !important; object-fit: cover; flex: 0 0 24px; }

/* ---- prev/next: titles wrap to two lines ---- */
body.ocs-blog-ux .ocsalya-reading-pagination strong { white-space: normal !important; overflow: hidden !important; text-overflow: ellipsis; display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }

/* ---- related cards: thumbnail on every card ---- */
body.ocs-blog-ux .ocsalya-reading-content .ocsaly-related img.ocs-read-rel-thumb { object-fit: cover; }
body.ocs-blog-ux .ocsalya-reading-content .ocsaly-related img.ocs-read-rel-thumb--logo { object-fit: contain !important; background: #0b1422; padding: 6px; box-sizing: border-box; }

/* ---- tables ---- */
body.ocs-blog-ux.ocsalya-reading-page .ocsalya-reading-content table td { font-size: 15px !important; padding: 10px 12px !important; }
body.ocs-blog-ux.ocsalya-reading-page .ocsalya-reading-content table th { padding: 10px 12px !important; }
body.ocs-blog-ux .ocsalya-reading-content .ocs-ux-table { position: relative; margin: 24px 0; }
body.ocs-blog-ux .ocsalya-reading-content .ocs-ux-table > .ocsalya-table-scroll { margin: 0 !important; }
@media (max-width: 767px) {
  body.ocs-blog-ux.ocsalya-reading-page .ocsalya-reading-content table td { font-size: 14px !important; }
}
@media (max-width: 639px) {
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] { min-width: 0 !important; width: 100% !important; border: 1px solid #2d3e55; border-collapse: separate; border-spacing: 0; border-radius: 8px; overflow: hidden; }
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] :is(thead, tbody, tfoot, tr, td) { display: block !important; width: 100% !important; box-sizing: border-box; }
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] thead,
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] tr:not(:has(> td)) { display: none !important; }
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] tr { padding: 10px 12px; border-bottom: 1px solid #2d3e55; }
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] tr:last-child { border-bottom: 0; }
  body.ocs-blog-ux.ocsalya-reading-page .ocsalya-reading-content table[data-ocs-cols="2"] td { padding: 0 !important; border: 0 !important; }
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] td + td { margin-top: 6px; }
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"] td[data-label]::before { content: attr(data-label); display: block; font-weight: 700; color: #edf5ff; font-size: 13px; line-height: 1.5; }
  body.ocs-blog-ux .ocsalya-reading-content table[data-ocs-cols="2"]:not(:has(td[data-label])) td:first-child { font-weight: 700; color: #edf5ff; }
  body.ocs-blog-ux .ocsalya-reading-content .ocs-ux-table::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 32px; pointer-events: none; background: linear-gradient(to right, rgba(13, 22, 36, 0), #0d1624); }
}

/* ---- mobile reading width: 16 px gutters, no card frame ---- */
@media (max-width: 767px) {
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read .ocsalya-reading-layout { padding-left: 16px !important; padding-right: 16px !important; }
  body.ocs-blog-ux.ocsalya-reading-page.ocs-read .ocsalya-reading-column { padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
  body.ocs-blog-ux .ocsalya-reading-content .ocs-ux-table::after { background: linear-gradient(to right, rgba(11, 18, 30, 0), #0b121e); }
}

/* ---- YouTube click-to-load ---- */
body.ocs-blog-ux .ocs-yt { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
body.ocs-blog-ux .wp-has-aspect-ratio .wp-block-embed__wrapper > .ocs-yt { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
body.ocs-blog-ux .ocs-yt__btn { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: #000; cursor: pointer; }
body.ocs-blog-ux .ocsalya-reading-content .ocs-yt__img { display: block; width: 100% !important; height: 100% !important; max-width: none !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; object-fit: cover; }
body.ocs-blog-ux .ocs-yt__play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: rgba(23, 23, 23, .85); transition: background .15s; }
body.ocs-blog-ux .ocs-yt__play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
body.ocs-blog-ux .ocs-yt__btn:hover .ocs-yt__play,
body.ocs-blog-ux .ocs-yt__btn:focus-visible .ocs-yt__play { background: #f00; }
body.ocs-blog-ux .ocs-yt__btn:focus-visible { outline: 2px solid #a3e635; outline-offset: -2px; }
body.ocs-blog-ux .ocs-yt__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
