/* ==========================================================================
   Blog details page: layout + sidebar (bd-*)
   ========================================================================== */

.bd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

@media (min-width: 1024px) {
    .bd-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 48px;
    }

    .bd-aside {
        position: sticky;
        top: 110px;
    }
}

/* sticky needs the page not to clip overflow */
body:has(.bd-aside) {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

.bd-main {
    min-width: 0;
}

.bd-aside {
    display: grid;
    gap: 22px;
    margin-bottom: 20px;
}

.bd-flip {
    display: inline-block;
}

[dir="rtl"] .bd-flip {
    transform: scaleX(-1);
}

/* ---------- latest articles card ---------- */

.bd-card {
    padding: 22px 18px 18px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid #ece3f1;
    box-shadow: 0 22px 44px -28px rgba(66, 31, 97, 0.35);
}

.bd-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f0e8f4;
}

.bd-card__head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #421f61;
}

.bd-card__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #8a4bab, #421f61);
}

.bd-latest {
    display: grid;
    gap: 4px;
}

.bd-post {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 6px;
    border-radius: 14px;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.bd-post:hover {
    background: #faf6fc;
}

/* covers come in many shapes: shown whole over a blurred copy */
.bd-post__thumb {
    position: relative;
    width: 96px;
    aspect-ratio: 16 / 10;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #4a1f6e, #2a1140);
    isolation: isolate;
}

.bd-post__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(10px) brightness(0.85);
    transform: scale(1.3);
    z-index: -1;
}

.bd-post__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bd-post__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.bd-post__date {
    font-size: 12.5px;
    color: #8b7a99;
}

.bd-post__date i {
    margin-inline-end: 4px;
    color: #c996d2;
}

.bd-post__title {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.6;
    color: #421f61;
    overflow-wrap: break-word;
    transition: color 0.2s ease;
}

.bd-post:hover .bd-post__title {
    color: #7a3f99;
}

.bd-card__more {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 800;
    color: #421f61 !important;
    background: #f7f2fa;
    transition: background 0.2s ease;
}

.bd-card__more:hover {
    background: #f0e6f5;
}

.bd-card__more i {
    font-size: 12px;
}

/* ---------- contact card ---------- */

.bd-contact {
    position: relative;
    overflow: hidden;
    padding: 26px 22px 22px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(120% 70% at 100% 0%, rgba(222, 168, 228, 0.25), rgba(222, 168, 228, 0) 60%),
        linear-gradient(160deg, #4a1f6e 0%, #2a1140 100%);
    box-shadow: 0 24px 50px -26px rgba(42, 17, 64, 0.7);
}

.bd-contact__title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.bd-contact__lead {
    margin: 0 0 18px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.bd-contact__list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: grid;
    gap: 6px;
}

.bd-contact__list a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    color: #fff !important;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.bd-contact__list a[href]:hover {
    background: rgba(255, 255, 255, 0.07);
}

.bd-contact__icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 16px;
    color: #dea8e4;
    background: rgba(222, 168, 228, 0.14);
}

.bd-contact__text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding-top: 1px;
    font-size: 14.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.bd-contact__text small {
    display: block;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
}

.bd-contact__text > span {
    color: rgba(255, 255, 255, 0.78);
    text-align: start;
}

.bd-contact__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    color: #fff !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #2fe07a, #25d366 45%, #128c4b);
    box-shadow: 0 12px 26px -12px rgba(18, 140, 75, 0.7);
    transition: transform 0.2s ease;
}

.bd-contact__cta i {
    font-size: 20px;
}

.bd-contact__cta:hover {
    transform: translateY(-2px);
}

/* ---------- article body (HTML from the dashboard editor) ---------- */
/* Pasted colours / fonts / backgrounds are normalised; links, lists, headings, tables keep their meaning. */

.bd-article {
    font-size: 17px;
    line-height: 2;
    color: #3d3347;
    overflow-wrap: break-word;
    word-break: break-word;
}

.bd-article * {
    max-width: 100%;
    font-family: inherit !important;
    background-color: transparent !important;
    color: inherit !important;
    line-height: inherit;
}

.bd-article p {
    margin: 0 0 18px;
}

.bd-article h1,
.bd-article h2,
.bd-article h3,
.bd-article h4,
.bd-article h5,
.bd-article h6 {
    margin: 32px 0 14px;
    font-weight: 800;
    line-height: 1.5;
    color: #421f61 !important;
}

.bd-article h1 { font-size: 32px; }
.bd-article h2 { font-size: 27px; }
.bd-article h3 { font-size: 22px; }
.bd-article h4 { font-size: 19px; }
.bd-article h5,
.bd-article h6 { font-size: 17px; }

.bd-article strong,
.bd-article b {
    font-weight: 800;
    color: #2a1140 !important;
}

.bd-article em,
.bd-article i:not([class]) {
    font-style: italic;
}

/* internal / external links inside the article */
.bd-article a,
.bd-article a * {
    color: #1a6fd6 !important;
}

.bd-article a {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
    text-decoration-color: rgba(26, 111, 214, 0.4);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.bd-article a:hover,
.bd-article a:hover * {
    color: #421f61 !important;
    text-decoration-color: currentColor;
}

.bd-article ul,
.bd-article ol {
    margin: 0 0 20px;
    padding-inline-start: 28px;
}

.bd-article ul {
    list-style: disc;
}

.bd-article ol {
    list-style: decimal;
}

.bd-article li {
    margin-bottom: 8px;
    padding-inline-start: 4px;
}

.bd-article li::marker {
    color: #7a3f99;
    font-weight: 800;
}

.bd-article ul ul,
.bd-article ol ol,
.bd-article ul ol,
.bd-article ol ul {
    margin: 8px 0 0;
}

.bd-article blockquote {
    margin: 24px 0;
    padding: 16px 22px;
    border-inline-start: 4px solid #dea8e4;
    border-radius: 0 14px 14px 0;
    background: #f7f2fa !important;
    font-weight: 600;
}

[dir="rtl"] .bd-article blockquote {
    border-radius: 14px 0 0 14px;
}

.bd-article img {
    display: block;
    max-width: 100%;
    height: auto !important;
    margin: 22px auto;
    border-radius: 16px;
}

.bd-article figure {
    margin: 22px 0;
}

.bd-article figcaption {
    margin-top: 8px;
    font-size: 14px;
    text-align: center;
    opacity: 0.75;
}

.bd-article hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #ece3f1;
}

.bd-article table {
    display: block;
    width: 100% !important;
    margin: 22px 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 15.5px;
}

.bd-article th,
.bd-article td {
    padding: 10px 14px;
    border: 1px solid #ece3f1;
    text-align: start;
}

.bd-article th {
    font-weight: 800;
    background: #f7f2fa !important;
}

.bd-article iframe,
.bd-article video {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 22px 0;
    border: 0;
    border-radius: 16px;
}

.bd-article iframe {
    aspect-ratio: 16 / 9;
    height: auto;
}

.bd-article pre,
.bd-article code {
    direction: ltr;
    font-family: monospace !important;
    font-size: 14.5px;
    background: #f7f2fa !important;
    border-radius: 8px;
}

.bd-article code {
    padding: 2px 6px;
}

.bd-article pre {
    padding: 14px 16px;
    overflow-x: auto;
}

@media (max-width: 575px) {
    .bd-article {
        font-size: 16px;
        line-height: 1.95;
    }

    .bd-article h1 { font-size: 26px; }
    .bd-article h2 { font-size: 23px; }
    .bd-article h3 { font-size: 20px; }
}
