/* ============================================
   CASI STUDIO - Stili condivisi
   ============================================ */

/* Stats summary */
.cases-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-5);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: 700px;
    margin: 0 auto;
}

.cases-stats__item { text-align: center; }
.cases-stats__value { font-size: var(--text-2xl); font-weight: 700; color: var(--color-primary-600); }
.cases-stats__label { font-size: var(--text-sm); color: var(--color-neutral-600); }

/* Subject grid (lista materie) */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.subject-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--color-white);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all 0.2s ease;
}

.subject-card:hover {
    border-color: var(--color-primary-300);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.subject-card__icon {
    width: 56px;
    height: 56px;
    background: var(--color-gray-100);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subject-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.subject-card:hover .subject-card__thumb {
    transform: scale(1.04);
}
.subject-card__content { flex: 1; }
.subject-card__name { font-size: var(--text-lg); font-weight: 600; color: var(--color-neutral-900); margin: 0; }
.subject-card__meta { font-size: var(--text-sm); color: var(--color-neutral-500); margin-top: 2px; }
.subject-card__stats { display: flex; gap: var(--space-3); font-size: var(--text-sm); color: var(--color-neutral-600); margin-top: var(--space-2); }
.subject-card__arrow { width: 24px; height: 24px; color: var(--color-neutral-400); flex-shrink: 0; }

/* Subject hero (pagina materia) */
.subject-hero { text-align: center; max-width: 600px; margin: 0 auto; }

.subject-hero--with-bg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: var(--space-8) var(--space-6);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-2xl);
    background: var(--color-white);
}

.hero--subject-cover-page {
    background: var(--bg-primary);
}

.subject-page-title {
    margin: 0 0 var(--space-5);
    text-align: center;
}

.hero--subject-cover-page .subject-page-title {
    margin-top: -1.5rem;
}

.subject-page-title--cover {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(2.35rem, 4.6vw, 3.4rem);
    font-weight: 700;
    letter-spacing: 0.005em;
    color: var(--color-primary-900);
}

.subject-hero--with-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center 40%;
}

.subject-hero--with-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.78) 0%,
        rgba(255, 255, 255, 0.66) 52%,
        rgba(239, 246, 255, 0.58) 100%
    );
}

.subject-hero--meccanica-razionale {
    max-width: 920px;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: var(--space-4);
    background-image: url('../images/casi-studio/cover/meccanica-razionale.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center 40%;
}

.subject-hero--meccanica-dei-robot {
    max-width: 920px;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: var(--space-4);
    background-image: url('../images/casi-studio/cover/meccanica-dei-robot.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.subject-hero--fluidodinamica {
    max-width: 920px;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: var(--space-4);
    background-image: url('../images/casi-studio/cover/fluidodinamica.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.subject-hero--meccanica-razionale::before,
.subject-hero--meccanica-razionale::after,
.subject-hero--meccanica-dei-robot::before,
.subject-hero--meccanica-dei-robot::after,
.subject-hero--fluidodinamica::before,
.subject-hero--fluidodinamica::after {
    content: none;
}

.subject-hero__icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(37, 99, 235, 0.14));
    border: 1px solid var(--color-neutral-200);
    color: var(--color-primary-700);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
}

.subject-hero__icon svg { width: 40px; height: 40px; }
.subject-hero__title { font-size: var(--text-3xl); font-weight: 700; color: var(--color-neutral-900); margin: 0; }
.subject-hero__subtitle { font-size: var(--text-lg); color: var(--color-neutral-600); margin-top: var(--space-2); }
.subject-hero__stats { display: flex; justify-content: center; gap: var(--space-4); margin-top: var(--space-4); }
.subject-hero__stat { font-size: var(--text-sm); color: var(--color-neutral-500); padding: var(--space-2) var(--space-3); background: var(--color-neutral-100); border-radius: var(--radius-full); }

/* Students list */
.students-list { display: flex; flex-direction: column; gap: var(--space-3); }

.student-card-link {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--color-white);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.2s ease;
}

.student-card-link:hover {
    border-color: var(--color-primary-300);
    background: var(--color-primary-50);
    transform: translateX(4px);
}

.student-card-link__avatar {
    width: 52px;
    height: 52px;
    background: var(--color-primary-100);
    color: var(--color-primary-700);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.student-card-link__info { flex: 1; }
.student-card-link__name { font-size: var(--text-lg); font-weight: 600; color: var(--color-neutral-900); margin: 0; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.student-card-link__badge { display: inline-flex; padding: 2px 8px; background: var(--color-success-100); color: var(--color-success-700); font-size: var(--text-xs); font-weight: 600; border-radius: var(--radius-full); }
.student-card-link__desc { font-size: var(--text-sm); color: var(--color-neutral-500); margin-top: 2px; }
.student-card-link__stats { display: flex; gap: var(--space-3); font-size: var(--text-sm); color: var(--color-neutral-600); margin-top: var(--space-2); }
.student-card-link__arrow { width: 24px; height: 24px; color: var(--color-neutral-400); flex-shrink: 0; }

/* Breadcrumb */
.breadcrumb { font-size: var(--text-sm); display: flex; align-items: center; gap: var(--space-2); }
.breadcrumb a { color: var(--color-primary-600); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb__sep { color: var(--color-neutral-400); }

/* Case detail */
.case-detail__hero { text-align: center; max-width: 600px; margin: 0 auto; }
.case-detail__title { font-size: var(--text-3xl); font-weight: 700; color: var(--color-neutral-900); margin: var(--space-4) 0 var(--space-2); }
.case-detail__subtitle { font-size: var(--text-lg); color: var(--color-neutral-600); }

.case-detail__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    background: var(--color-white);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.case-detail__stat { text-align: center; }
.case-detail__stat-value { font-size: var(--text-2xl); font-weight: 700; color: var(--color-primary-600); }
.case-detail__stat-label { font-size: var(--text-sm); color: var(--color-neutral-600); margin-top: 2px; }
.case-detail__stat--highlight { background: var(--color-primary-50); padding: var(--space-3); border-radius: var(--radius-lg); }

/* Credits */
.case-detail__credits {
    background: var(--color-white);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-neutral-200);
    text-align: center;
}

.case-detail__credits h3 { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--space-3); }
.case-detail__credits-links { display: flex; justify-content: center; gap: var(--space-2); margin: var(--space-3) 0; }
.case-detail__credits-note { font-size: var(--text-sm); color: var(--color-neutral-500); margin-top: var(--space-3); }

.author-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-neutral-100);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-neutral-700);
    text-decoration: none;
    transition: all 0.2s ease;
}

.author-link:hover { background: var(--color-primary-100); color: var(--color-primary-700); }
.author-link svg { width: 18px; height: 18px; }

/* Responsive */
@media (max-width: 640px) {
    .cases-stats { flex-wrap: wrap; gap: var(--space-4); }
    .cases-stats__item { flex: 1 1 40%; }
    .subject-grid { grid-template-columns: 1fr; }
    .case-detail__stats { grid-template-columns: repeat(2, 1fr); }
    .student-card-link__stats { display: none; }
    .subject-hero__stats { flex-wrap: wrap; }
    .subject-hero--with-bg { padding: var(--space-6) var(--space-4); }
}
/* ============================================
   Student card con social links
   ============================================ */

.student-card {
    position: relative;
    background: var(--color-white);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.student-card:hover {
    border-color: var(--color-primary-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.student-card__main {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-lg);
}

.student-card:hover .student-card__main {
    background: var(--color-primary-50);
}

.student-card__social {
    display: flex;
    gap: var(--space-2);
    padding: 0 var(--space-4) var(--space-4);
}

.student-card__social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-neutral-100);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--color-neutral-600);
    text-decoration: none;
    transition: all 0.2s ease;
}

.student-card__social-link:hover {
    background: var(--color-primary-100);
    color: var(--color-primary-600);
}

.student-card__social-link svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 640px) {
    .student-card__social {
        flex-wrap: wrap;
    }
}
/* Freccia "apri" nelle student card (pagina materia) */
.student-card__arrow{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
  opacity: .85;
}

.student-card__arrow path{
  stroke-width: 2;
}

/* Centered variant used for "module" lists (e.g. Teoria 1/2/3 hub pages). */
.students-list--centered .student-card__main {
    justify-content: center;
}

.students-list--centered .student-card__avatar { display: none; }
.students-list--centered .student-card__arrow { display: none; }

.students-list--centered .student-card__info {
    width: 100%;
    text-align: center;
}

.students-list--centered .student-card__name {
    text-align: center;
}
