:root {
    --blog-surface: #ffffff;
    --blog-surface-muted: #f6fbf3;
    --blog-surface-soft: #fbfdf9;
    --blog-text-strong: #1d2a23;
    --blog-text: #33413a;
    --blog-text-muted: #5c6a63;
    --blog-border: rgba(52, 136, 56, 0.12);
    --blog-border-strong: rgba(52, 136, 56, 0.18);
    --blog-shadow: 0 24px 60px rgba(31, 42, 34, 0.08);
    --blog-shadow-soft: 0 14px 34px rgba(31, 42, 34, 0.05);
    --blog-radius-xl: 30px;
    --blog-radius-lg: 24px;
    --blog-radius-md: 18px;
    --blog-radius-sm: 14px;
    --blog-content-width: 760px;
    --blog-reading-width: 68ch;
}

.blog-show-page {
    position: relative;
    overflow-x: clip;
    padding-bottom: clamp(2.5rem, 4vw, 4.5rem);
    background:
        radial-gradient(circle at top left, rgba(76, 175, 80, 0.09), transparent 26%),
        linear-gradient(180deg, #f8fcf6 0%, #ffffff 18%, #ffffff 100%);
}

#banner.blog-detail-banner {
    position: relative;
    overflow: hidden;
    padding: clamp(1rem, 2vw, 1.75rem) 0 clamp(1.2rem, 3vw, 2.5rem);
    background: transparent;
}

#banner.blog-detail-banner .container,
.blog-main-image-wrap,
.blog-article-shell,
.related-section {
    position: relative;
    z-index: 2;
}

#banner.blog-detail-banner .deco {
    position: absolute;
    inset: 0;
    opacity: 0.6;
    pointer-events: none;
}

#banner .blog-detail-hero {
    position: relative;
    max-width: 980px;
    margin-inline: auto;
    padding: clamp(1.15rem, 2.4vw, 2rem);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 251, 243, 0.96) 100%);
    box-shadow: var(--blog-shadow-soft);
    backdrop-filter: blur(10px);
}

#banner .blog-detail-hero::before,
#banner .blog-detail-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

#banner .blog-detail-hero::before {
    inset-inline-start: clamp(-2rem, -1vw, -0.75rem);
    top: clamp(1rem, 3vw, 2.25rem);
    width: clamp(7rem, 14vw, 10rem);
    height: clamp(7rem, 14vw, 10rem);
    border: 1px solid rgba(52, 136, 56, 0.08);
}

#banner .blog-detail-hero::after {
    inset-inline-end: 1.5rem;
    bottom: 1.5rem;
    width: clamp(4rem, 8vw, 6rem);
    height: clamp(4rem, 8vw, 6rem);
    background: radial-gradient(circle, rgba(255, 160, 0, 0.08), transparent 70%);
}

#banner .blog-detail-hero > * {
    position: relative;
    z-index: 1;
    width: 100%;
}

#banner .blog-detail-hero .breadcrumb {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    width: auto;
    max-width: 100%;
    margin: 0 0 1rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--blog-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
}

#banner .blog-detail-hero .breadcrumb-item,
#banner .blog-detail-hero .breadcrumb-item a,
#banner .blog-detail-meta {
    color: var(--blog-text-muted);
}

#banner .blog-detail-hero .breadcrumb-item,
#banner .blog-detail-hero .breadcrumb-item a {
    font-size: clamp(0.66rem, 0.75vw, 0.78rem);
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

#banner .blog-detail-hero .breadcrumb-item + .breadcrumb-item::before {
    padding: 0 0.35rem;
    color: var(--blog-text-muted);
}

#banner .blog-detail-meta {
    margin: 0 0 0.75rem !important;
    font-size: clamp(0.78rem, 0.95vw, 0.92rem);
    line-height: 1.5;
    font-weight: 700;
}

#banner .blog-detail-heading {
    margin: 0;
    max-width: min(100%, 34ch);
    color: var(--blog-text-strong);
    font-size: clamp(1.2rem, 2.2vw, 1.85rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-wrap: normal;
}

#banner .blog-detail-subtitle {
    max-width: 64ch;
    margin: clamp(0.9rem, 1.8vw, 1.3rem) 0 0;
    color: var(--blog-text);
    font-size: clamp(1rem, 1.35vw, 1.16rem);
    line-height: 1.8;
    text-align: start;
}

.blog-main-image-section {
    margin-top: clamp(-0.8rem, -1vw, -0.3rem);
}

.blog-main-image-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.blog-main-image-frame {
    margin: 0;
    overflow: hidden;
    border-radius: var(--blog-radius-xl);
    box-shadow: var(--blog-shadow);
    background: var(--blog-surface-soft);
}

#mainImage {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 7.6;
    object-fit: cover;
    background: #eef2ee;
}

.blog-article-shell {
    width: min(calc(100% - 32px), 900px);
    margin: clamp(1.2rem, 3vw, 2.5rem) auto 0;
    padding: clamp(1.1rem, 2.5vw, 2rem);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 253, 249, 0.98) 100%);
    box-shadow: var(--blog-shadow-soft);
}

.blog-topic-row {
    margin-top: 0;
    margin-bottom: clamp(1rem, 2vw, 1.5rem) !important;
    padding-top: clamp(0.35rem, 1vw, 0.6rem);
    padding-bottom: clamp(0.8rem, 1.6vw, 1.1rem);
    border-bottom: 1px solid rgba(52, 136, 56, 0.08);
}

.blog-tag-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--blog-border);
    border-radius: 999px;
    background: var(--blog-surface-muted);
    color: #348838;
    font-size: clamp(0.76rem, 1vw, 0.9rem);
    line-height: 1.25;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.blog-tag-pill:hover,
.blog-tag-pill:focus {
    color: #348838;
    background: #eef7ea;
    box-shadow: 0 10px 20px rgba(52, 136, 56, 0.08);
    transform: translateY(-1px);
    text-decoration: none;
}

.blog-article-body {
    max-width: var(--blog-reading-width);
    margin-inline: auto;
}

#content,
#content * {
    max-width: 100%;
}

#content > *:first-child,
.blog-article-body > *:first-child {
    margin-top: 0 !important;
}

#content p,
#content li,
#content td,
#content th {
    color: var(--blog-text);
    font-size: clamp(1rem, 1.2vw, 1.08rem);
    line-height: 1.9;
    overflow-wrap: anywhere;
    text-align: justify;
}

#content p {
    margin: 0 0 1.15rem;
    text-align-last: start;
}

#content h2,
#content h3,
#content h4,
#content h5,
#content h6 {
    color: var(--blog-text-strong);
    text-wrap: normal;
    overflow-wrap: anywhere;
}

#content h2 {
    margin: clamp(2rem, 4vw, 3rem) 0 0.9rem;
    font-size: clamp(1.65rem, 2.9vw, 2.45rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.025em;
}

#content h3 {
    margin: clamp(1.5rem, 3vw, 2.2rem) 0 0.8rem;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    line-height: 1.3;
    font-weight: 800;
}

#content h4,
#content h5,
#content h6,
#content strong {
    color: var(--blog-text-strong);
    font-weight: 700;
}

#content .blog-inline-heading {
    margin: clamp(1.7rem, 3vw, 2.25rem) 0 0.85rem;
    color: var(--blog-text-strong);
    font-size: clamp(1.28rem, 2.25vw, 1.9rem);
    line-height: 1.35;
    font-weight: 800 !important;
}

#content ul,
#content ol {
    margin: 0 0 1.25rem;
    padding-inline-start: 1.35rem;
}

#content ul li + li,
#content ol li + li {
    margin-top: 0.45rem;
}

#content a {
    color: #348838;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.14em;
    overflow-wrap: anywhere;
}

#content img,
#content figure img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: clamp(1.25rem, 2vw, 1.75rem) auto;
    border-radius: var(--blog-radius-md);
}

#content figure {
    width: 100%;
    max-width: 100%;
    margin: clamp(1.25rem, 2vw, 1.75rem) 0;
}

#content iframe,
#content video,
#content embed {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: var(--blog-radius-md);
}

#content table {
    display: block;
    width: 100%;
    margin: clamp(1.2rem, 2vw, 1.6rem) 0;
    overflow-x: auto;
    border-collapse: collapse;
    -webkit-overflow-scrolling: touch;
}

#content th,
#content td {
    min-width: 10rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--blog-border);
    background: var(--blog-surface);
    text-align: start;
    vertical-align: top;
}

#content blockquote {
    margin: clamp(1.3rem, 2vw, 1.8rem) 0;
    padding: 1rem 1.1rem 1rem 1.2rem;
    border-inline-start: 4px solid #348838;
    border-radius: 0 var(--blog-radius-md) var(--blog-radius-md) 0;
    background: var(--blog-surface-muted);
    color: #2c3933;
}

#content pre {
    max-width: 100%;
    margin: clamp(1.2rem, 2vw, 1.6rem) 0;
    overflow-x: auto;
    padding: 1rem 1.05rem;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-md);
    background: var(--blog-surface-muted);
    color: #243129;
}

#content code {
    white-space: break-spaces;
    overflow-wrap: anywhere;
}

.blog-nav-row {
    gap: 0.9rem;
    margin-top: clamp(1.5rem, 3vw, 2rem) !important;
    padding-top: clamp(1rem, 2vw, 1.4rem);
    border-top: 1px solid rgba(52, 136, 56, 0.08);
}

.blog-nav-row .btn-flat {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 3.25rem;
    height: auto !important;
    padding: 0.9rem 1rem;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-sm);
    background: var(--blog-surface-muted);
    line-height: 1.55 !important;
    box-shadow: none;
}

.blog-nav-row .btn {
    min-width: min(21rem, 100%);
    margin: 0;
    color: var(--blog-text-strong);
    text-align: start;
    text-transform: none;
    white-space: normal;
}

.related-section {
    width: min(calc(100% - 32px), 1180px);
    margin: clamp(2rem, 4vw, 3.5rem) auto 0;
    padding: 0;
}

.related-section-heading {
    margin-bottom: clamp(1.1rem, 2vw, 1.5rem);
}

.related-section .title-main {
    margin-bottom: 0;
    padding-bottom: 1.1rem;
}

.related-section .title-main::after {
    bottom: 0;
}

.related-section .title-main h2 {
    margin: 0;
    color: var(--blog-text-strong);
    font-size: clamp(1.6rem, 2.6vw, 2.3rem);
    line-height: 1.18;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.3rem;
}

.related-card {
    min-width: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-lg);
    background: var(--blog-surface);
    box-shadow: var(--blog-shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 38px rgba(31, 42, 34, 0.1);
}

.related-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #eef2ee;
}

.related-card .body {
    padding: 1.15rem 1.15rem 1.25rem;
}

.related-card .title {
    display: block;
    margin: 0 0 0.7rem;
    color: var(--blog-text-strong);
    font-size: clamp(1rem, 1.5vw, 1.2rem) !important;
    line-height: 1.4;
    font-weight: 700;
    text-transform: none !important;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
}

.related-card .description {
    display: block;
    margin: 0;
    color: var(--blog-text-muted);
    font-size: clamp(0.92rem, 1.1vw, 1rem) !important;
    line-height: 1.75;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
}

[dir="rtl"] #banner .blog-detail-hero,
[dir="rtl"] #banner .blog-detail-heading,
[dir="rtl"] #banner .blog-detail-subtitle,
[dir="rtl"] #banner .blog-detail-meta,
[dir="rtl"] #content h2,
[dir="rtl"] #content h3,
[dir="rtl"] #content h4,
[dir="rtl"] #content h5,
[dir="rtl"] #content h6,
[dir="rtl"] #content blockquote,
[dir="rtl"] #content th,
[dir="rtl"] #content td,
[dir="rtl"] .blog-nav-row .btn,
[dir="rtl"] .related-section .title-main {
    text-align: right;
}

[dir="rtl"] #banner .blog-detail-hero .breadcrumb {
    justify-content: flex-start;
}

[dir="rtl"] #content {
    direction: rtl;
}

[dir="rtl"] #content p,
[dir="rtl"] #content li,
[dir="rtl"] #content td,
[dir="rtl"] #content th {
    text-align: justify;
    text-align-last: right;
}

[dir="rtl"] #content ul,
[dir="rtl"] #content ol {
    padding-right: 1.35rem;
    padding-left: 0;
}

[dir="rtl"] #content blockquote {
    border-inline-start: 0;
    border-inline-end: 4px solid #348838;
    border-radius: var(--blog-radius-md) 0 0 var(--blog-radius-md);
}

@media (max-width: 1199.98px) {
    #banner .blog-detail-heading {
        max-width: min(100%, 30ch);
    }

    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    #banner.blog-detail-banner {
        padding-bottom: 1.4rem;
    }

    #banner .blog-detail-hero {
        border-radius: var(--blog-radius-lg);
    }

    #banner .blog-detail-hero::before {
        width: 7rem;
        height: 7rem;
    }

    .blog-main-image-wrap {
        padding: 0 18px;
    }

    .blog-main-image-frame,
    .blog-article-shell {
        border-radius: var(--blog-radius-lg);
    }

    #mainImage {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 767.98px) {
    .blog-show-page {
        padding-bottom: 2.5rem;
    }

    #banner.blog-detail-banner .container,
    .blog-main-image-wrap,
    .blog-article-shell,
    .related-section {
        width: min(calc(100% - 24px), 100%);
        padding-left: 0;
        padding-right: 0;
    }

    #banner .blog-detail-hero {
        padding: 1rem;
        border-radius: 20px;
    }

    #banner .blog-detail-hero::before,
    #banner .blog-detail-hero::after {
        display: none;
    }

    #banner .blog-detail-hero .breadcrumb {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        margin-bottom: 0.85rem;
        padding: 0.5rem 0.75rem;
        border-radius: 18px;
        gap: 0;
        justify-items: unset;
        align-items: center;
        overflow: hidden;
    }

    #banner .blog-detail-hero .breadcrumb-item,
    #banner .blog-detail-hero .breadcrumb-item a {
        display: inline;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
        line-height: 1.5;
    }

    #banner .blog-detail-hero .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 0.25rem;
    }

    #banner .blog-detail-hero .breadcrumb-item {
        min-width: 0;
        flex: 0 0 auto;
    }

    #banner .blog-detail-hero .breadcrumb-item:last-child {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #banner .blog-detail-heading {
        max-width: 100%;
        font-size: clamp(1.2rem, 5.4vw, 1.55rem);
        line-height: 1.16;
    }

    #banner .blog-detail-subtitle {
        max-width: 100%;
        font-size: 0.92rem;
        line-height: 1.68;
    }

    .blog-main-image-section {
        margin-top: 0;
    }

    .blog-main-image-frame {
        border-radius: 20px;
    }

    .blog-article-shell {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 20px;
    }

    .blog-article-body {
        max-width: 100%;
    }

    #content p,
    #content li,
    #content td,
    #content th {
        font-size: 0.98rem;
        line-height: 1.82;
    }

    #content h2 {
        font-size: clamp(1.22rem, 5vw, 1.5rem);
        line-height: 1.28;
    }

    #content h3 {
        font-size: clamp(1.08rem, 4.4vw, 1.28rem);
        line-height: 1.32;
    }

    #content .blog-inline-heading {
        font-size: clamp(1.14rem, 4.6vw, 1.42rem);
    }

    .blog-nav-row {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-nav-row .btn {
        width: 100%;
        min-width: 0;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 479.98px) {
    #banner.blog-detail-banner {
        padding-top: 0.75rem;
        padding-bottom: 1rem;
    }

    #banner .blog-detail-hero {
        padding: 0.88rem 0.85rem;
        border-radius: 18px;
    }

    #banner .blog-detail-hero .breadcrumb {
        row-gap: 0.25rem;
        padding: 0.45rem 0.65rem;
        border-radius: 14px;
    }

    #banner .blog-detail-hero .breadcrumb-item,
    #banner .blog-detail-hero .breadcrumb-item a {
        font-size: 0.62rem;
    }

    #banner .blog-detail-meta {
        font-size: 0.76rem;
        margin-bottom: 0.6rem !important;
    }

    #banner .blog-detail-heading {
        font-size: clamp(1.08rem, 5vw, 1.35rem);
        line-height: 1.18;
    }

    #content h2 {
        font-size: clamp(1.14rem, 4.8vw, 1.34rem);
        line-height: 1.3;
    }

    #content h3 {
        font-size: clamp(1rem, 4.1vw, 1.16rem);
        line-height: 1.34;
    }

    #banner .blog-detail-subtitle {
        font-size: 0.86rem;
    }

    #banner .blog-detail-meta {
        font-size: 0.72rem;
    }

    .blog-main-image-wrap,
    .blog-article-shell,
    .related-section {
        width: min(calc(100% - 16px), 100%);
    }

    .blog-main-image-frame,
    .blog-article-shell,
    .related-card {
        border-radius: 18px;
    }

    .blog-article-shell {
        padding: 0.9rem 0.82rem;
    }

    .blog-tag-pill {
        min-height: 2.2rem;
        padding: 0.5rem 0.8rem;
        font-size: 0.74rem;
    }

    #content p,
    #content li,
    #content td,
    #content th {
        font-size: 0.95rem;
        line-height: 1.8;
    }


    #content table {
        margin: 1rem 0;
    }

    #content th,
    #content td {
        min-width: 8.5rem;
        padding: 0.75rem 0.8rem;
    }

    .related-card .body {
        padding: 1rem;
    }
}
