/* ==========================================================================
   FT Grid 1 — Curriculum Vitae
   Technical-document layout: monospaced labels, numbered sections,
   grid-based entry list. Sibling of info.css (shares the sidebar layout).
   ========================================================================== */

.sk-cv-layout .sk-info-content {
    /* CV breathes wider than prose pages. */
    max-width: none;
    padding: var(--sk-padding-lg) var(--sk-padding-md) var(--sk-padding-xl);
}

.sk-cv {
    --cv-rule: 1px solid var(--sk-darker);
    --cv-rule-soft: 1px solid #dcdcdc;
    --cv-mono: var(--sk-font-mono);

    color: var(--sk-darker);
    font-family: var(--sk-font-body);
    font-size: 15px;
    line-height: 1.6;
}

.sk-cv .sk-page-content { display: none; } /* if inherited */

/* --- Masthead ----------------------------------------------------------- */

.sk-cv-masthead {
    border: var(--cv-rule);
    padding: var(--sk-padding-md);
    position: relative;
    background:
        linear-gradient(var(--sk-white), var(--sk-white)) padding-box,
        repeating-linear-gradient(
            135deg,
            transparent 0 6px,
            rgba(0, 0, 0, 0.04) 6px 7px
        ) border-box;
}

.sk-cv-name {
    font-family: var(--sk-font-body);
    font-weight: 300;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
    color: var(--sk-darker);
}

.sk-cv-role {
    margin: 0 0 var(--sk-padding-md) 0;
    font-family: var(--cv-mono);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--sk-dark);
}

.sk-cv-masthead .sk-line {
    margin-bottom: var(--sk-padding-md);
    background: var(--sk-darker);
}

.sk-cv-identity {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin: 0;
    background: var(--sk-darker);
    border: 1px solid var(--sk-darker);
}

.sk-cv-identity__item {
    background: var(--sk-white);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sk-cv-identity__item--wide {
    grid-column: span 4;
}

.sk-cv-identity dt {
    font-family: var(--cv-mono);
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sk-gray);
    margin: 0;
}

.sk-cv-identity dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sk-darker);
}

/* --- Section ------------------------------------------------------------ */

.sk-cv-section {
    margin-top: var(--sk-padding-lg);
    scroll-margin-top: calc(var(--sk-navbar-height) + 24px);
}

.sk-cv-section__header {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: baseline;
    gap: 14px;
    margin-bottom: var(--sk-padding-sm);
}

.sk-cv-section__num {
    font-family: var(--cv-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--sk-gray);
    line-height: 1;
    padding: 4px 6px;
    border: 1px solid var(--sk-darker);
    background: var(--sk-white);
    color: var(--sk-darker);
}

.sk-cv-section__title {
    font-family: var(--sk-font-body);
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0;
    color: var(--sk-darker);
}

.sk-cv-section__rule {
    align-self: center;
    height: 1px;
    background: var(--sk-darker);
    margin-left: 4px;
}

/* Collapsible sections: the header is the toggle (native <details>), marked by a small square. */
.sk-cv-section__header {
    grid-template-columns: auto auto 1fr auto auto;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.sk-cv-section__header::-webkit-details-marker {
    display: none;
}

.sk-cv-section__header::marker {
    content: '';
}

.sk-cv-section__details:not([open]) > .sk-cv-section__header {
    margin-bottom: 0;
}

.sk-cv-section:has(> .sk-cv-section__details:not([open])) {
    margin-top: var(--sk-padding-md);
}

.sk-cv-section__count {
    align-self: center;
    font-family: var(--cv-mono);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sk-gray);
    white-space: nowrap;
}

.sk-cv-section__toggle {
    position: relative;
    align-self: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--sk-darker);
    background: var(--sk-white);
    color: var(--sk-darker);
    transition: background 0.2s ease, color 0.2s ease;
}

.sk-cv-section__toggle::before,
.sk-cv-section__toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 1px;
    margin: -0.5px 0 0 -4px;
    background: currentColor;
}

.sk-cv-section__toggle::after {
    width: 1px;
    height: 8px;
    margin: -4px 0 0 -0.5px;
}

.sk-cv-section__details[open] > .sk-cv-section__header .sk-cv-section__toggle::after {
    display: none;
}

.sk-cv-section__header:hover .sk-cv-section__toggle,
.sk-cv-section__header:focus-visible .sk-cv-section__toggle {
    background: var(--sk-darker);
    color: var(--sk-white);
}

.sk-cv-section__header:focus-visible {
    outline: 1px solid var(--sk-darker);
    outline-offset: 4px;
}

.sk-cv-section__note {
    font-family: var(--cv-mono);
    font-size: 12px;
    color: var(--sk-gray);
    margin: 0 0 var(--sk-padding-sm) 0;
    padding: 10px 14px;
    border: 1px dashed #c7c7c7;
    background: #fafafa;
    max-width: 640px;
}

/* --- Group (sub-section) ------------------------------------------------ */

.sk-cv-group + .sk-cv-group {
    margin-top: var(--sk-padding-md);
}

.sk-cv-group__heading {
    font-family: var(--cv-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--sk-darker);
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #bcbcbc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sk-cv-group__heading::before {
    content: '›';
    color: var(--sk-gray);
    font-family: var(--sk-font-body);
    font-size: 14px;
}

/* --- Entries (year | body) --------------------------------------------- */

.sk-cv-entries {
    margin: 0;
    padding: 0;
    border-top: var(--cv-rule-soft);
}

.sk-cv-entry {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 24px;
    padding: 12px 0;
    border-bottom: var(--cv-rule-soft);
    align-items: start;
}

.sk-cv-entry__year {
    font-family: var(--cv-mono);
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--sk-darker);
    line-height: 1.5;
    padding-top: 2px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sk-cv-entry__body {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--sk-darker);
}

.sk-cv-entry__body em {
    font-style: italic;
}

.sk-cv-entry__body strong {
    font-weight: 600;
}

/* --- Plain list (for course lists etc) --------------------------------- */

.sk-cv-plain-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
    border-top: var(--cv-rule-soft);
}

.sk-cv-plain-list li {
    padding: 10px 14px 10px 24px;
    border-bottom: var(--cv-rule-soft);
    border-right: var(--cv-rule-soft);
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    background: var(--sk-white);
}

.sk-cv-plain-list li:last-child {
    border-right: var(--cv-rule-soft);
}

.sk-cv-plain-list li::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 16px;
    width: 6px;
    height: 1px;
    background: var(--sk-darker);
}

/* For groups that use list instead of entries, slightly different feel */

.sk-cv-group .sk-cv-plain-list {
    border-top: none;
    border: 1px solid var(--cv-rule-soft);
    border-color: #e5e5e5;
}

/* --- Links -------------------------------------------------------------- */
/* A small square icon after the text opens the related page; the line itself is never a link. */

.sk-cv-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    vertical-align: -2px;
    border: 1px solid var(--sk-darker);
    background: var(--sk-white);
    color: var(--sk-darker);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.sk-cv-link:hover,
.sk-cv-link:focus-visible {
    background: var(--sk-darker);
    color: var(--sk-white);
}

.sk-cv-link:focus-visible {
    outline: 1px solid var(--sk-darker);
    outline-offset: 2px;
}

.sk-cv-link svg {
    display: block;
}

/* Second line: a separate text in another language on the same work. */
.sk-cv-entry__also {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--sk-dark);
}

.sk-cv-entry__also-label {
    font-family: var(--cv-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--sk-gray);
}

/* Arabic titles quoted inside the English and French CV. */
html:not([dir="rtl"]) .sk-cv :lang(ar) {
    font-family: var(--sk-font-arabic);
    font-style: normal;
}

/* --- RTL ---------------------------------------------------------------- */

[dir="rtl"] .sk-cv-section__header {
    grid-template-columns: auto auto 1fr auto auto;
}

html[dir="rtl"] .sk-cv {
    --cv-mono: var(--sk-font-arabic);
    font-family: var(--sk-font-arabic);
    font-size: 16px;
}

html[dir="rtl"] .sk-cv-name {
    font-family: var(--sk-font-arabic);
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.3;
}

html[dir="rtl"] .sk-cv-section__title {
    font-family: var(--sk-font-arabic);
    font-size: 21px;
}

html[dir="rtl"] .sk-cv-section__count {
    font-size: 13px;
}

html[dir="rtl"] .sk-cv-role,
html[dir="rtl"] .sk-cv-section__count,
html[dir="rtl"] .sk-cv-identity dt,
html[dir="rtl"] .sk-cv-section__title,
html[dir="rtl"] .sk-cv-group__heading,
html[dir="rtl"] .sk-cv-entry__year,
html[dir="rtl"] .sk-cv-entry__also-label,
html[dir="rtl"] .sk-cv-section__note {
    letter-spacing: 0;
    text-transform: none;
}

html[dir="rtl"] .sk-cv-role,
html[dir="rtl"] .sk-cv-group__heading {
    font-size: 14px;
}

html[dir="rtl"] .sk-cv-identity dt {
    font-size: 12px;
}

html[dir="rtl"] .sk-cv-identity dd,
html[dir="rtl"] .sk-cv-entry__body {
    font-size: 16px;
    line-height: 1.8;
}

html[dir="rtl"] .sk-cv-entry__year {
    font-size: 13px;
}

html[dir="rtl"] .sk-cv-entry__also {
    font-size: 15px;
}

html[dir="rtl"] .sk-cv-entry__also-label {
    font-size: 13px;
}

html[dir="rtl"] .sk-cv-section__rule {
    margin-left: 0;
    margin-right: 4px;
}

html[dir="rtl"] .sk-cv-link svg {
    transform: scaleX(-1);
}

html[dir="rtl"] .sk-cv-plain-list li,
html[dir="rtl"] .sk-cv-plain-list li:last-child {
    border-right: none;
    border-left: var(--cv-rule-soft);
}

@media (min-width: 901px) {
    html[dir="rtl"] .sk-cv-entry {
        grid-template-columns: 150px 1fr;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    html[dir="rtl"] .sk-cv-entry {
        grid-template-columns: 120px 1fr;
    }
}

[dir="rtl"] .sk-cv-plain-list li::before {
    left: auto;
    right: 10px;
}

[dir="rtl"] .sk-cv-plain-list li {
    padding: 10px 24px 10px 14px;
}

[dir="rtl"] .sk-cv-group__heading::before {
    content: '‹';
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 900px) {
    .sk-cv-identity {
        grid-template-columns: repeat(2, 1fr);
    }
    .sk-cv-identity__item--wide {
        grid-column: span 2;
    }

    .sk-cv-entry {
        grid-template-columns: 100px 1fr;
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .sk-cv-section__header,
    [dir="rtl"] .sk-cv-section__header {
        grid-template-columns: auto 1fr auto;
    }

    .sk-cv-section__rule,
    .sk-cv-section__count {
        display: none;
    }

    .sk-cv-layout .sk-info-content {
        padding: var(--sk-padding-md) var(--sk-padding-sm) var(--sk-padding-lg);
    }

    .sk-cv-masthead {
        padding: var(--sk-padding-sm);
    }

    .sk-cv-identity {
        grid-template-columns: 1fr;
    }
    .sk-cv-identity__item--wide {
        grid-column: span 1;
    }

    .sk-cv-entry {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 14px 0;
    }

    .sk-cv-entry__year {
        font-size: 11px;
        color: var(--sk-gray);
        padding-top: 0;
        white-space: normal;
    }

    .sk-cv-entry__year br {
        display: none;
    }

    .sk-cv-plain-list {
        grid-template-columns: 1fr;
    }
}

/* --- Print -------------------------------------------------------------- */

@media print {
    .sk-cv-section__toggle,
    .sk-cv-section__count,
    .sk-info-sidebar,
    .sk-line-v,
    .site-header,
    .site-footer,
    header[role="banner"],
    footer[role="contentinfo"] {
        display: none !important;
    }

    .sk-info-layout {
        display: block;
    }

    .sk-cv {
        font-size: 11pt;
    }

    .sk-cv-masthead,
    .sk-cv-section,
    .sk-cv-entry {
        page-break-inside: avoid;
    }

    .sk-cv-name {
        font-size: 28pt;
    }

    .sk-cv-section__title {
        font-size: 13pt;
    }
}
