/* ==========================================================================
   Chi sono (titoli.php): biography, approaches, training path, societies.
   Loaded after css/site.css; only tokens from site.css, classes prefixed .cs-.
   ========================================================================== */

/* Biography: readable text on the left, summary card on the right. */
.cs-bio__grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-7) clamp(2.5rem, 1rem + 5vw, 6rem);
    align-items: start;
}

.cs-bio__text .h2 {
    margin-bottom: var(--space-6);
}

/* Opening statement in the display face, marked by the clay leaf from the logo. */
.cs-bio__intro {
    position: relative;
    max-width: 34ch;
    padding-left: var(--space-6);
    font-family: var(--font-serif);
    font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
    line-height: 1.4;
    color: var(--c-ink);
    text-wrap: pretty;
}

.cs-bio__intro::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 0 50% 0 50%;
    background: var(--c-secondary);
}

.cs-bio__prose {
    margin-top: var(--space-6);
    padding-left: var(--space-6);
    border-left: 1px solid var(--c-line);
}

.cs-bio__prose p {
    line-height: 1.75;
}

.cs-summary {
    position: sticky;
    top: calc(var(--header-h-compact) + 1.5rem);
    padding: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.cs-summary__title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: var(--space-3);
}

.cs-summary__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-summary__list li {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    padding-block: var(--space-4);
}

.cs-summary__list li + li {
    border-top: 1px solid var(--c-line);
}

.cs-summary__list .icon-chip {
    width: 52px;
    height: 52px;
}

.cs-summary__list .icon-chip .icon {
    width: 28px;
    height: 28px;
}

.cs-summary__list strong {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}

.cs-summary__list p span {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-sm);
    line-height: 1.45;
    color: var(--c-ink-soft);
}

.cs-summary__register {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-top: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--c-mist-soft);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.4;
    color: var(--c-ink);
    text-wrap: pretty;
}

.cs-summary__register .icon {
    width: 24px;
    height: 24px;
    color: var(--c-teal);
}

/* Approaches on the slate panel: heading left, homepage .specialties grid right. */
.cs-approach__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7) clamp(2.5rem, 1rem + 5vw, 6rem);
    align-items: center;
}

.cs-approach__head .h2 {
    margin-bottom: var(--space-4);
}

.cs-approach__head .lead {
    margin-bottom: var(--space-5);
}

.cs-approach__list {
    margin: 0;
}

/* Training: sticky heading, grouped path with a connecting line between chips. */
.cs-training__grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-7) clamp(2.5rem, 1rem + 5vw, 6rem);
    align-items: start;
}

.cs-training__head {
    position: sticky;
    top: calc(var(--header-h-compact) + 1.5rem);
}

.cs-training__head .h2 {
    margin-bottom: var(--space-4);
}

.cs-path {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-path__group {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: var(--space-5);
    padding-bottom: var(--space-5);
}

.cs-path__group:last-child {
    padding-bottom: 0;
}

.cs-path__group:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 27px;
    top: 66px;
    bottom: 10px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(to bottom, var(--c-line-strong), var(--c-line));
}

.cs-path__card {
    padding: var(--space-5) clamp(1.25rem, 0.75rem + 1.5vw, 2rem) var(--space-3);
    background: var(--c-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.cs-path__card .h3 {
    margin: 0.3rem 0 var(--space-2);
}

.cs-path__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-path__items li {
    position: relative;
    padding: var(--space-3) 0 var(--space-3) 1.5rem;
    font-size: var(--fs-sm);
    line-height: 1.55;
    color: var(--c-ink-soft);
    text-wrap: pretty;
}

.cs-path__items li + li {
    border-top: 1px solid var(--c-line);
}

.cs-path__items li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: calc(var(--space-3) + 0.5em);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 0 50% 0 50%;
    background: var(--c-secondary);
}

.cs-path__items strong {
    font-weight: 600;
    color: var(--c-ink);
}

/* Societies and network on the clay panel: two surface cards. */
.cs-network__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
}

.cs-network__block {
    padding: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.cs-network__block .h3 {
    margin-bottom: var(--space-4);
}

.cs-network__block > .icon-chip {
    margin-bottom: var(--space-4);
}

.cs-network__block > p {
    color: var(--c-ink-soft);
    margin-bottom: var(--space-4);
}

.cs-societies {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Each society: official logo on a white plate, full name, membership, link to the official site. */
.cs-society__link {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr) auto;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-3);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    color: var(--c-ink);
    text-decoration: none;
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.cs-society__link:hover {
    border-color: var(--c-teal);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.cs-society__logo {
    display: grid;
    place-items: center;
    height: 4.5rem;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: inset 0 0 0 1px var(--c-line);
}

.cs-society__logo img {
    width: auto;
    max-width: 100%;
    max-height: var(--logo-max, 100%); /* optical balance between a compact and a wide logo */
    object-fit: contain;
}

.cs-society__text strong {
    display: block;
    font-weight: 600;
    line-height: 1.35;
}

.cs-society__acr {
    font-weight: 500;
    color: var(--c-ink-soft);
}

.cs-society__role {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    background: var(--c-secondary-soft);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-secondary-strong);
}

.cs-society__role .icon {
    width: 14px;
    height: 14px;
}

.cs-society__go {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--c-teal-strong);
    background: var(--c-mist-soft);
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.cs-society__go .icon {
    width: 16px;
    height: 16px;
}

.cs-society__link:hover .cs-society__go {
    background: var(--c-teal);
    color: var(--c-surface);
}

/* Professional network: six roles, each with its own icon (informative, not links). */
.cs-team {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-team__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    background: var(--c-bg);
    font-weight: 600;
    line-height: 1.3;
    color: var(--c-ink);
}

.cs-team__item .icon-chip {
    width: 44px;
    height: 44px;
}

.cs-team__item .icon-chip .icon {
    width: 24px;
    height: 24px;
}

/* The studio: intro on the left, gallery (one large photo, two stacked) on the right. */
.cs-studio__grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-6) clamp(2rem, 1rem + 4vw, 5rem);
    align-items: center;
}

.cs-studio__intro .h2 {
    margin-bottom: var(--space-4);
}

.cs-studio__intro .lead {
    margin-bottom: var(--space-5);
}

.cs-studio__gallery {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.cs-studio__photo {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--c-mist-soft);
    box-shadow: var(--shadow-sm);
}

.cs-studio__photo--main {
    grid-row: span 2;
}

.cs-studio__photo img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 700ms var(--ease-out);
}

.cs-studio__photo:hover img {
    transform: scale(1.03);
}

/* Responsive (desktop >= 1200px untouched) */
@media (max-width: 1199px) {
    /* Heading above the list: the 6 cards get two comfortable columns instead of narrow ones. */
    .cs-approach__grid,
    .cs-network__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-approach__head,
    .cs-training__head {
        max-width: 40rem;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    /* Societies and team stacked full width: the six roles fit in two rows of three. */
    .cs-team {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .cs-bio__grid,
    .cs-studio__grid,
    .cs-training__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cs-summary,
    .cs-training__head {
        position: static;
    }

    .cs-summary {
        max-width: 560px;
    }

    /* Keep the biography at a readable line length on wide single-column layouts. */
    .cs-bio__prose {
        max-width: 40rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Summary as a full-width strip of three, instead of a half-empty row. */
    .cs-summary {
        max-width: none;
    }

    .cs-summary__list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-block: var(--space-2);
    }

    .cs-summary__list li {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        padding: var(--space-2) var(--space-5);
    }

    .cs-summary__list li:first-child {
        padding-left: 0;
    }

    .cs-summary__list li + li {
        border-top: 0;
        border-left: 1px solid var(--c-line);
    }
}

@media (max-width: 767px) {
    .cs-studio__gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
    }

    .cs-studio__photo--main {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .cs-studio__photo {
        border-radius: var(--radius);
    }

    .cs-bio__intro,
    .cs-bio__prose {
        padding-left: var(--space-5);
    }

    /* Training: chip beside the title inside each card, no connecting line, 16px items. */
    .cs-path__group {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-bottom: var(--space-4);
    }

    .cs-path__group:not(:last-child)::before {
        display: none;
    }

    .cs-path__group > .icon-chip {
        position: absolute;
        z-index: 1;
        top: var(--space-5);
        left: var(--space-5);
        width: 44px;
        height: 44px;
    }

    .cs-path__group > .icon-chip .icon {
        width: 24px;
        height: 24px;
    }

    .cs-path__card {
        padding: var(--space-5) var(--space-5) var(--space-2);
    }

    .cs-path__card .h3 {
        display: flex;
        align-items: center;
        min-height: 44px;
        margin: 0 0 var(--space-3);
        padding: 0 0 var(--space-4) calc(44px + var(--space-4));
        border-bottom: 1px solid var(--c-line-strong);
        font-size: 1.25rem;
    }

    .cs-path__items li {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Network cards: chip beside the title. */
    .cs-network__block {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: var(--space-4);
        align-items: center;
    }

    .cs-network__block > * {
        grid-column: 1 / -1;
    }

    .cs-network__block > .icon-chip {
        grid-column: 1;
        width: 48px;
        height: 48px;
        margin: 0;
    }

    .cs-network__block > .icon-chip .icon {
        width: 26px;
        height: 26px;
    }

    .cs-network__block > .h3 {
        grid-column: 2;
        margin: 0;
    }

    .cs-network__block > .h3 + * {
        margin-top: var(--space-5);
    }

    /* Society: logo and external-link cue on top, full-width name below. */
    .cs-society__link {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--space-3) var(--space-4);
        padding: var(--space-4);
    }

    .cs-society__logo {
        justify-self: start;
        width: 9rem;
        height: 4rem;
    }

    .cs-society__logo img {
        max-height: 2.5rem; /* the compact logo would otherwise fill the plate width and overflow */
    }

    .cs-society__text {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .cs-society__go {
        grid-column: 2;
        grid-row: 1;
    }

    .cs-team {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-2);
    }

    .cs-team__item {
        padding: var(--space-2) var(--space-3);
    }

    .cs-team__item .icon-chip {
        width: 40px;
        height: 40px;
    }

    .cs-team__item .icon-chip .icon {
        width: 22px;
        height: 22px;
    }
}
