/*
 * The blog — home.php (index), single.php (article), template-parts/post-card.php.
 *
 * Loaded after shared-page.css (hero, breadcrumb, .page-content-3d) and
 * landing.css (.rn-landing__ctas, .rn-landing__block-title), whose components
 * the article reuses. The post card is also used on the service pages, which
 * load this file for that one section.
 */

/* ---- Index ------------------------------------------------------------ */

.rn-blog__head {
    max-width: 46rem;
    margin: 0 auto 2.5rem;
}

.rn-blog__lead {
    color: var(--ct-muted);
    font-size: 1.1rem;
    line-height: 1.9;
    margin: 0;
}

.rn-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1.5rem;
}

.rn-blog__empty {
    color: var(--ct-muted);
}

.rn-blog__pagination {
    margin-top: 2.5rem;
}

.rn-blog__pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.rn-blog__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(208, 177, 212, 0.28);
    color: var(--ct-text);
    text-decoration: none;
}

.rn-blog__pagination .page-numbers.current,
.rn-blog__pagination a.page-numbers:hover {
    border-color: var(--ct-accent);
    color: var(--ct-accent);
}

/* ---- Card ------------------------------------------------------------- */

.rn-post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1rem;
    background: linear-gradient(155deg, rgba(24, 24, 42, 0.92), rgba(6, 6, 14, 0.96));
    border: 1.5px solid rgba(208, 177, 212, 0.22);
    box-shadow: 0 12px 28px rgba(5, 5, 15, 0.45);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.rn-post-card:hover,
.rn-post-card:focus-within {
    border-color: rgba(208, 177, 212, 0.5);
    transform: translateY(-3px);
}

.rn-post-card__media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.rn-post-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rn-post-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    padding: 1.25rem 1.3rem 1.3rem;
    text-align: start;
}

/* position + z-index: on a card the chip sits above the stretched title
   link, and an article's chip is a link of its own. */
.rn-post-card__service {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: flex-start;
    min-height: 1.9rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: rgba(191, 171, 211, 0.1);
    border: 1px solid rgba(208, 177, 212, 0.3);
    color: var(--ct-accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

a.rn-post-card__service:hover {
    border-color: var(--ct-accent);
    color: var(--ct-accent-light);
}

.rn-post-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.6;
}

.rn-post-card__title a {
    color: var(--ct-text);
    text-decoration: none;
}

/* The whole card is the link target; the title's link carries the name. */
.rn-post-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.rn-post-card__title a:hover,
.rn-post-card__title a:focus-visible {
    color: var(--ct-accent);
}

.rn-post-card__excerpt {
    margin: 0;
    color: rgba(244, 244, 251, 0.78);
    line-height: 1.85;
    font-size: 0.95rem;
    flex: 1;
}

.rn-post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    color: var(--ct-muted);
    font-size: 0.82rem;
}

/* ---- Article ---------------------------------------------------------- */

.rn-article {
    max-width: 56rem;
    margin: 0 auto;
}

.rn-article__head {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.75rem;
}

.rn-article__title {
    margin: 0;
    color: var(--ct-text);
    font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
    font-weight: 800;
    line-height: 1.5;
}

.rn-article__lead {
    margin: 0;
    color: rgba(244, 244, 251, 0.85);
    font-size: 1.12rem;
    line-height: 1.95;
}

.rn-article__cover {
    margin: 0 0 2rem;
}

.rn-article__cover-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 32rem;
    object-fit: cover;
    border-radius: 1rem;
}

.rn-article__cover figcaption {
    margin-top: 0.5rem;
    color: var(--ct-muted);
    font-size: 0.82rem;
    text-align: center;
}

.rn-toc {
    margin: 0 0 2rem;
    padding: 1.1rem 1.3rem;
    border-radius: 1rem;
    background: rgba(191, 171, 211, 0.06);
    border: 1px solid rgba(208, 177, 212, 0.22);
}

.rn-toc__title {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ct-text);
}

.rn-toc ol {
    margin: 0;
    padding-inline-start: 1.3rem;
}

.rn-toc li {
    margin: 0.3rem 0;
    line-height: 1.7;
}

.rn-toc a {
    color: var(--ct-accent);
    text-decoration: none;
}

.rn-toc a:hover {
    text-decoration: underline;
}

/* Body copy: long-form Arabic wants a generous line height and a measure
   that does not run the full width of a desktop card. */
.rn-article__body {
    color: rgba(244, 244, 251, 0.9);
    font-size: 1.06rem;
    line-height: 2;
}

.rn-article__body > * + * {
    margin-top: 1.1rem;
}

.rn-article__body p,
.rn-article__body ul,
.rn-article__body ol {
    margin-bottom: 0;
}

.rn-article__body h2 {
    margin-top: 2.5rem;
    margin-bottom: 0;
    color: var(--ct-text);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.6;
    scroll-margin-top: 6rem;
}

.rn-article__body h3 {
    margin-top: 1.75rem;
    margin-bottom: 0;
    color: var(--ct-text);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.6;
}

.rn-article__body ul,
.rn-article__body ol {
    padding-inline-start: 1.4rem;
}

.rn-article__body li + li {
    margin-top: 0.4rem;
}

.rn-article__body strong {
    color: var(--ct-text);
}

.rn-article__body a {
    color: var(--ct-accent);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.rn-article__body a:hover {
    color: var(--ct-accent-light);
}

/* Comparison tables: scroll sideways on a phone instead of squeezing. */
.rn-article__body .rn-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rn-article__body table {
    width: 100%;
    min-width: 32rem;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.7;
}

.rn-article__body th,
.rn-article__body td {
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(208, 177, 212, 0.2);
    text-align: start;
    vertical-align: top;
}

.rn-article__body th {
    background: rgba(191, 171, 211, 0.1);
    color: var(--ct-text);
    font-weight: 700;
}

/* A highlighted note — the one thing to remember from a section. */
.rn-article__body .rn-note {
    padding: 1rem 1.2rem;
    border-radius: 0.9rem;
    border-inline-start: 4px solid var(--ct-accent);
    background: rgba(191, 171, 211, 0.08);
}

.rn-article__body .rn-note p {
    margin: 0;
}

.rn-article__body .rn-source {
    color: var(--ct-muted);
    font-size: 0.88rem;
}

.rn-article__next {
    margin-top: 3rem;
    padding: 1.6rem 1.5rem;
    border-radius: 1.1rem;
    background: linear-gradient(155deg, rgba(191, 171, 211, 0.12), rgba(6, 6, 14, 0.6));
    border: 1.5px solid rgba(208, 177, 212, 0.35);
    text-align: center;
}

.rn-article__next-kicker {
    margin: 0 0 0.4rem;
    color: var(--ct-accent);
    font-size: 0.85rem;
    font-weight: 700;
}

.rn-article__next-title {
    margin: 0 0 0.6rem;
    color: var(--ct-text);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.6;
}

.rn-article__next-title .bi {
    color: var(--ct-accent);
    margin-inline-end: 0.35rem;
}

.rn-article__next-text {
    max-width: 40rem;
    margin: 0 auto 1.2rem;
    color: rgba(244, 244, 251, 0.82);
    line-height: 1.9;
}

.rn-blog__related {
    max-width: 72rem;
    margin: 3rem auto 0;
}

@media (max-width: 767.98px) {
    .rn-article__body {
        font-size: 1rem;
        line-height: 1.95;
    }

    .rn-article__body h2 {
        font-size: 1.25rem;
    }

    .rn-article__next {
        padding: 1.3rem 1.1rem;
    }
}
