/* ============================================================
   BLOG (listing, category, tag, search, post detail, sidebar)
   Self-contained: Bootstrap and the Nest style.css are not loaded by this theme.
   ============================================================ */
.otech-blog {
    --blog-radius: 16px;
    --blog-muted: #77878F;
    --blog-border: #E4E7E9;
    --blog-shadow: 0 0 24px 0 rgba(0, 0, 0, .08);
    --primary-color: var(--main-color, #006BEA);
}

/* ---------- Page header ---------- */
.otech-blog-hero {
    margin: 0 auto 40px;
    text-align: left;
}
.otech-blog-hero__category {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 14px;
    border-radius: 50px;
    background: #fff;
    color: var(--main-color);
    font-size: 14px;
    font-weight: 600;
}
.otech-blog-hero__title {
    word-break: break-word;
}
.otech-blog-hero--post .otech-blog-hero__title {
    font-size: 34px;
    line-height: 1.35;
}
.otech-blog-hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-top: 16px;
    color: var(--blog-muted);
    font-size: 15px;
}
.otech-blog-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.otech-blog-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 0;
    margin-top: 16px;
    font-size: 15px;
}
.otech-blog-breadcrumb li {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    color: var(--blog-muted);
}
.otech-blog-breadcrumb li + li::before {
    content: "/";
    margin: 0 10px;
    color: var(--border-color, #ADB7BC);
}
.otech-blog-breadcrumb li span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 420px;
}
.otech-blog-breadcrumb a:hover {
    color: var(--main-color);
}

/* ---------- Layout ---------- */
.otech-blog__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}
.otech-blog__layout--with-sidebar {
    grid-template-columns: minmax(0, 1fr) 300px;
}
.otech-blog__layout--sidebar-left {
    grid-template-columns: 300px minmax(0, 1fr);
}
.otech-blog__layout--sidebar-left .otech-blog__sidebar {
    order: -1;
}
.otech-blog__layout--narrow {
    max-width: 900px;
    margin: 0 auto;
}
.otech-blog__sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------- Post list / grid ---------- */
.otech-blog-posts {
    display: grid;
    gap: 24px;
}
.otech-blog-posts--grid {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}
.otech-blog-posts--list {
    grid-template-columns: minmax(0, 1fr);
}
.otech-blog-empty {
    padding: 30px 15px;
    border-radius: var(--blog-radius);
    background: #fff;
    text-align: center;
}

.otech-post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--blog-radius);
    background: #fff;
    box-shadow: var(--blog-shadow);
    transition: transform .3s ease, box-shadow .3s ease;
}
.otech-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}
.otech-post-card__thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 5;
    background: #F2F4F5;
}
.otech-post-card__thumb img {
    width: 100%;
    height: auto;    
    transition: transform .5s ease;
}
.otech-post-card:hover .otech-post-card__thumb img {
    transform: scale(1.05);
}
.otech-post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}
.otech-post-card__category {
    align-self: flex-start;
    color: var(--main-color);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.otech-post-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
}
.otech-post-card__title a:hover {
    color: var(--main-color);
}
.otech-post-card__excerpt {
    color: #5F6C72;
    font-size: 15px;
    line-height: 1.6;
}
.otech-post-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--blog-border);
    font-size: 14px;
}
.otech-post-card__date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blog-muted);
}
.otech-post-card__read-more {
    color: var(--main-color);
    font-weight: 500;
}
.otech-post-card__read-more:hover {
    text-decoration: underline;
}

/* list: image left, content right */
.otech-post-card--list {
    flex-direction: row;
}
.otech-post-card--list .otech-post-card__thumb {
    flex: 0 0 42%;
    align-self: flex-start;
    aspect-ratio: auto;
    height: 300px;
}
.otech-post-card--list .otech-post-card__body {
    padding: 24px;
}
.otech-post-card--list .otech-post-card__title {
    font-size: 20px;
}

/* big: wide image on top */
.otech-post-card--big .otech-post-card__thumb {
    aspect-ratio: 16 / 4;
}
.otech-post-card--big .otech-post-card__body {
    padding: 28px 32px 32px;
}
.otech-post-card--big .otech-post-card__title {
    font-size: 24px;
}

/* ---------- Pagination ---------- */
.otech-blog-pagination {
    margin-top: 40px;
}
.otech-blog-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.otech-blog-pagination a,
.otech-blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--blog-border);
    border-radius: 50px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
}
.otech-blog-pagination a:hover,
.otech-blog-pagination .is-active {
    border-color: var(--main-color);
    background: var(--main-color);
    color: #fff;
}
.otech-blog-pagination .is-disabled {
    opacity: .4;
}
.otech-blog-pagination .is-dots {
    border-color: transparent;
    background: transparent;
}

/* ---------- Post detail ---------- */
.otech-post {
    padding: 40px;
    border-radius: var(--blog-radius);
    background: #fff;
    box-shadow: var(--blog-shadow);
}
.otech-post__thumbnail {
    margin-bottom: 32px;
    overflow: hidden;
    border-radius: 12px;
}
.otech-post__thumbnail img {
    width: 100%;
}

/* The global reset strips margins, paddings and list styles: restore them for editor content. */
.otech-post__content {
    font-size: 17px;
    line-height: 1.75;
    word-wrap: break-word;
}
.otech-post__content > * + * {
    margin-top: 1em;
}
.otech-post__content h1,
.otech-post__content h2,
.otech-post__content h3,
.otech-post__content h4,
.otech-post__content h5,
.otech-post__content h6 {
    margin-top: 1.6em;
    color: var(--title-color);
    font-weight: 700;
    line-height: 1.4;
}
.otech-post__content h2 { font-size: 26px; }
.otech-post__content h3 { font-size: 22px; }
.otech-post__content h4 { font-size: 19px; }
.otech-post__content a {
    color: var(--main-color);
    text-decoration: underline;
}
.otech-post__content ul,
.otech-post__content ol {
    padding-left: 1.5em;
}
.otech-post__content ul { list-style: disc; }
.otech-post__content ol { list-style: decimal; }
.otech-post__content li + li {
    margin-top: .4em;
}
.otech-post__content img {
    height: auto;
    border-radius: 8px;
}
.otech-post__content figure {
    margin-left: auto;
    margin-right: auto;
}
.otech-post__content figure img {
    margin: 0 auto;
}
.otech-post__content figcaption {
    margin-top: 8px;
    color: var(--blog-muted);
    font-size: 14px;
    text-align: center;
}
.otech-post__content blockquote {
    padding: 16px 24px;
    border-left: 4px solid var(--main-color);
    border-radius: 0 8px 8px 0;
    background: #F4F8FF;
    font-style: italic;
}
.otech-post__content table {
    width: 100%;
    border-collapse: collapse;
}
.otech-post__content th,
.otech-post__content td {
    padding: 10px 12px;
    border: 1px solid var(--blog-border);
}
.otech-post__content th {
    background: #F2F4F5;
}
.otech-post__content iframe {
    max-width: 100%;
}

.otech-post__footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--blog-border);
}
.otech-post__footer-label {
    font-weight: 600;
}
.otech-post__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.otech-post__tags a {
    padding: 6px 14px;
    border-radius: 50px;
    background: #F2F4F5;
    font-size: 14px;
}
.otech-post__tags a:hover {
    background: var(--main-color);
    color: #fff;
}

.otech-post-related {
    margin-top: 30px;
    padding: 32px 40px;
    border-radius: var(--blog-radius);
    background: #fff;
    box-shadow: var(--blog-shadow);
}
.otech-post-related__title {
    margin-bottom: 16px;
    font-size: 22px;
    font-weight: 700;
}
.otech-post-related__list {
    list-style: disc;
    padding-left: 1.25em;
}
.otech-post-related__list li {
    padding: 6px 0;
    line-height: 1.6;
}
.otech-post-related__list li::marker {
    color: var(--main-color);
}
.otech-post-related__list a:hover {
    color: var(--main-color);
    text-decoration: underline;
}

/* ---------- Sidebar widgets ---------- */
.otech-widget {
    padding: 24px;
    border-radius: var(--blog-radius);
    background: #fff;
    box-shadow: var(--blog-shadow);
}
.otech-widget__title {
    position: relative;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--blog-border);
    font-size: 18px;
    font-weight: 700;
}
.otech-widget__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 48px;
    height: 2px;
    background: var(--main-color);
}
.otech-widget__search {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--blog-border);
    border-radius: 50px;
}
.otech-widget__search input {
    flex: 1;
    min-width: 0;
    padding: 12px 18px;
    border: 0;
    outline: none;
    font-size: 15px;
}
.otech-widget__search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    border: 0;
    background: var(--main-color);
    color: #fff;
    cursor: pointer;
}
.otech-widget__categories li + li {
    border-top: 1px dashed var(--blog-border);
}
.otech-widget__categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    font-size: 15px;
}
.otech-widget__categories a:hover {
    color: var(--main-color);
}
.otech-widget__count {
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 50px;
    background: #F2F4F5;
    color: var(--blog-muted);
    font-size: 13px;
    text-align: center;
}
.otech-widget__posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.otech-widget__posts li {
    display: flex;
    gap: 12px;
}
.otech-widget__post-thumb {
    flex: 0 0 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 8px;
}
.otech-widget__post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.otech-widget__post-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.otech-widget__post-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.otech-widget__post-title:hover {
    color: var(--main-color);
}
.otech-widget__post-date {
    color: var(--blog-muted);
    font-size: 13px;
}
.otech-widget__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.otech-widget__tags a {
    padding: 6px 14px;
    border: 1px solid var(--blog-border);
    border-radius: 50px;
    font-size: 14px;
}
.otech-widget__tags a:hover {
    border-color: var(--main-color);
    background: var(--main-color);
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .otech-blog__layout--with-sidebar,
    .otech-blog__layout--sidebar-left {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
    .otech-blog__layout--sidebar-left {
        grid-template-columns: 260px minmax(0, 1fr);
    }
}
@media (max-width: 991px) {
    .otech-blog__layout--with-sidebar,
    .otech-blog__layout--sidebar-left {
        grid-template-columns: minmax(0, 1fr);
    }
    .otech-blog__layout--sidebar-left .otech-blog__sidebar {
        order: 0;
    }
    .otech-blog__sidebar {
        position: static;
    }
}
@media (max-width: 767px) {
    .otech-blog-hero {
        margin-bottom: 28px;
    }
    .otech-blog-hero--post .otech-blog-hero__title {
        font-size: 26px;
    }
    .otech-blog-breadcrumb li span {
        max-width: 200px;
    }
    .otech-post-card--list {
        flex-direction: column;
    }
    .otech-post-card--list .otech-post-card__thumb {
        flex-basis: auto;
        align-self: stretch;
        height: auto;
        aspect-ratio: 16 / 5;
    }
    .otech-post-card--list .otech-post-card__title,
    .otech-post-card--big .otech-post-card__title {
        font-size: 18px;
    }
    .otech-post-card--big .otech-post-card__body {
        padding: 20px;
    }
    .otech-post,
    .otech-post-related {
        padding: 20px;
    }
    .otech-post__content {
        font-size: 16px;
    }
    .otech-post__content h2 { font-size: 22px; }
    .otech-post__content h3 { font-size: 19px; }
}
