/* About page — متوافق مع editorial-section */

.about-page {
    background: var(--color-cream);
    direction: rtl;
}

/* ── Hero ── */
.about-hero {
    position: relative;
    overflow: hidden;
}

.about-hero__inner {
    text-align: right;
}

.about-hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 3vw, 2rem);
    align-items: center;
    direction: ltr; /* صور يسار فعليًا */
}

.about-hero__content {
    min-width: 0;
    direction: rtl;
}

.about-hero__media {
    min-width: 0;
    justify-self: start;
}

@media (min-width: 900px) {
    .about-hero__grid {
        grid-template-columns: 520px minmax(0, 1fr);
        gap: clamp(1.5rem, 3vw, 2.5rem);
    }
}

.about-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--color-black-light);
    line-height: 1.3;
    margin: 0 0 var(--space-4);
}

.about-hero__lead,
.about-hero__naming {
    font-size: var(--font-size-large);
    line-height: 1.75;
    color: var(--color-ray);
    margin: 0 0 var(--space-4);
    text-align: justify;
}

.about-hero__naming {
    margin-bottom: var(--space-4);
}

.about-hero__cta {
    min-width: 200px;
}

/* ── Layout — نفس editorial-section ── */
.about-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 2.5rem);
}

.about-section {
    /* مثل إيقاع المدونة: أقسام أقرب لبعض */
    padding: clamp(0.9rem, 2.2vw, 1.35rem) 0;
}

.about-section:last-child {
    padding-bottom: 0;
}

.about-section__title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 600;
    color: var(--color-black-light);
    margin: 0 0 var(--space-3);
    line-height: 1.35;
}

.about-section__intro {
    font-size: var(--font-size-large);
    color: var(--color-ray);
    margin: 0 0 var(--space-3);
    line-height: 1.75;
}

.about-prose p {
    font-size: var(--font-size-large);
    line-height: 1.75;
    color: var(--color-black-light);
    margin: 0 0 var(--space-4);
    text-align: justify;
}

.about-prose p:last-child {
    margin-bottom: 0;
}

.about-link {
    display: inline-flex;
    align-items: center;
    margin-top: var(--space-3);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-author);
    text-decoration: none;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.about-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 1.5px;
    background: var(--color-author);
    transition: width 220ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

@media (hover: hover) and (pointer: fine) {
    .about-link:hover::after {
        width: 100%;
    }
}

.about-link--inline {
    margin-top: 0;
}

/* ── Gallery stack — قياسات المخطط ── */
.gallery-stack {
    position: relative;
    width: 520px;
    height: 375px;
    max-width: 100%;
}

.gallery-stack .photo-1,
.gallery-stack .photo-2,
.gallery-stack .photo-3,
.gallery-stack .photo-4 {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.gallery-stack .photo-1.section-animate-child,
.gallery-stack .photo-2.section-animate-child,
.gallery-stack .photo-3.section-animate-child,
.gallery-stack .photo-4.section-animate-child {
    transform: translateY(20px) scale(0.97);
    filter: blur(3px);
    transition-duration: 700ms;
}

.gallery-stack .photo-1.section-animate-child.slide-up,
.gallery-stack .photo-2.section-animate-child.slide-up,
.gallery-stack .photo-3.section-animate-child.slide-up,
.gallery-stack .photo-4.section-animate-child.slide-up {
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.gallery-stack picture,
.gallery-stack img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-1 {
    width: 177px;
    height: 109px;
    top: 5px;
    left: 21px;
    z-index: 4;
}

.photo-2 {
    width: 195px;
    height: 118px;
    top: 2px;
    right: 14px;
    z-index: 1;
}

.photo-3 {
    width: 419px;
    height: 271px;
    top: 50px;
    left: 80px;
    z-index: 2;
}

.photo-4 {
    width: 342px;
    height: 113px;
    /* لاصقة بأسفل photo-3 وفوقها — محاذاة يسار مع photo-1 */
    top: calc(50px + 271px - 73px);
    left: 21px;
    z-index: 5;
}

@media (max-width: 620px) {
    .gallery-stack {
        transform: scale(0.68);
        transform-origin: top left;
        margin-bottom: -95px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-stack .photo-1.section-animate-child,
    .gallery-stack .photo-2.section-animate-child,
    .gallery-stack .photo-3.section-animate-child,
    .gallery-stack .photo-4.section-animate-child {
        transform: none;
        filter: none;
    }
}

/* ── Nasab + Spread layout ── */
.nasab-spread-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    direction: rtl;
}

.nasab-spread-layout__text {
    min-width: 0;
}

.nasab-spread-layout__text .about-section__title {
    margin-bottom: var(--space-3);
}

.nasab-spread-layout__text .about-prose p:last-child {
    margin-bottom: var(--space-4);
}

.nasab-spread-layout__text .about-section__intro {
    margin-bottom: 0;
}

.nasab-spread-layout__map {
    min-width: 0;
}

@media (min-width: 900px) {
    .nasab-spread-layout {
        grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
        gap: clamp(2rem, 4vw, 3rem);
        align-items: start;
        direction: ltr;
    }

    .nasab-spread-layout__map {
        grid-column: 1;
        grid-row: 1;
    }

    .nasab-spread-layout__text {
        grid-column: 2;
        grid-row: 1;
        direction: rtl;
    }

    .nasab-spread-layout__map .ksa-map {
        margin: 0;
        max-width: none;
    }
}

/* ── Ancestors portrait list ── */
.ancestors-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.25rem, 3vw, 2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ancestors-list__item {
    margin: 0;
}

.ancestor-portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    user-select: none;
    transition: transform 280ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

@media (hover: hover) and (pointer: fine) {
    .ancestor-portrait:hover {
        transform: scale(1.02);
    }

    .ancestor-portrait:hover .ancestor-portrait__name {
        color: var(--color-author);
    }
}

.ancestor-portrait:active {
    transform: scale(0.98);
}

.ancestor-portrait__frame {
    display: block;
    width: clamp(88px, 18vw, 120px);
    height: clamp(88px, 18vw, 120px);
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.06);
    border: 2px solid rgba(232, 101, 26, 0.25);
    flex-shrink: 0;
}

.ancestor-portrait__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ancestor-portrait__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-ray);
    font-size: 2rem;
}

.ancestor-portrait__name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-black-light);
    text-align: center;
    line-height: 1.5;
    transition: color 220ms cubic-bezier(0.34, 1.4, 0.64, 1);
}


/* ── KSA interactive map ── */
.ksa-map {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.ksa-map__svg {
    width: 100%;
    height: auto;
    display: block;
    background: transparent;
}

.ksa-region {
    fill: var(--color-satin-linen);
    stroke: none;
    transition: fill 220ms cubic-bezier(0.34, 1.4, 0.64, 1);
    pointer-events: none;
}

.ksa-region--highlight {
    fill: rgba(232, 101, 26, 0.55);
    cursor: pointer;
    pointer-events: auto;
}

.ksa-region--highlight.is-active,
.ksa-region--highlight:hover,
.ksa-region--highlight:focus-visible {
    fill: var(--color-author);
    outline: none;
}

.ksa-map__tooltip {
    position: absolute;
    z-index: 4;
    max-width: min(240px, 72vw);
    padding: var(--space-3) var(--space-4);
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    text-align: right;
    pointer-events: none;
    transform: translate(-50%, -100%);
    user-select: none;
}

.ksa-map__tooltip--below {
    transform: translate(-50%, 0);
}

.ksa-map__tooltip[hidden] {
    display: none;
}

.ksa-map__tooltip-name {
    margin: 0 0 4px;
    font-size: var(--font-size-large);
    font-weight: 600;
    color: var(--color-black-light);
    line-height: 1.35;
}

.ksa-map__tooltip-detail {
    margin: 0;
    font-size: var(--font-size-small);
    color: var(--color-ray);
    line-height: 1.6;
}


/* ── Historian ── */
.about-historian__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    direction: rtl;
}

.about-historian__title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 600;
    color: var(--color-black-light);
    margin: 0;
    line-height: 1.35;
}

.about-historian__name {
    font-size: var(--font-size-x-large);
    font-weight: 600;
    color: var(--color-cinnabar);
    margin: 0;
    line-height: 1.45;
}

.about-historian__intro,
.about-historian__thanks {
    font-size: var(--font-size-large);
    line-height: 1.75;
    margin: 0;
    text-align: justify;
}

.about-historian__intro {
    color: var(--color-ray);
}

.about-historian__thanks {
    color: var(--color-black-light);
}

.about-historian__figure {
    position: relative;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.about-historian__figure img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 280px;
    object-fit: cover;
}

.about-historian__quote {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    margin: 0;
    padding: var(--space-5) var(--space-4) var(--space-4);
    border: none;
    border-right: 3px solid var(--color-author);
    background: linear-gradient(
        180deg,
        rgba(253, 251, 247, 0) 0%,
        rgba(253, 251, 247, 0.92) 38%,
        rgba(253, 251, 247, 0.98) 100%
    );
    font-size: var(--font-size-base);
    line-height: 1.75;
    color: var(--color-black-light);
    font-style: normal;
    text-align: right;
}

.about-historian__action {
    margin-top: var(--space-2);
}

.about-historian__action .clean-button {
    min-width: 200px;
}

/* لابتوب وشاشات كبيرة: نص يسار — صورة يمين */
@media (min-width: 900px) {
    .about-historian__grid {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
        grid-template-rows: auto auto auto 1fr auto;
        column-gap: clamp(2rem, 4vw, 3rem);
        row-gap: var(--space-4);
        direction: ltr;
        align-items: start;
    }

    .about-historian__title {
        grid-column: 1;
        grid-row: 1;
        direction: rtl;
    }

    .about-historian__name {
        grid-column: 1;
        grid-row: 2;
        direction: rtl;
    }

    .about-historian__intro {
        grid-column: 1;
        grid-row: 3;
        direction: rtl;
    }

    .about-historian__thanks {
        grid-column: 1;
        grid-row: 4;
        direction: rtl;
    }

    .about-historian__figure {
        grid-column: 2;
        grid-row: 1 / 6;
        direction: rtl;
        align-self: start;
    }

    .about-historian__figure img {
        min-height: 420px;
    }

    .about-historian__action {
        grid-column: 1;
        grid-row: 5;
        direction: rtl;
        margin-top: var(--space-2);
    }
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .ancestors-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ancestor-portrait,
    .ksa-region,
    .about-link::after {
        transition: none;
    }

    .ancestor-portrait:hover {
        transform: none;
    }
}
