/**
 * Widget: course|show-categories-courses
 * Card quadrate delle sottocategorie: icona in alto a destra, titolo in basso.
 */

.course-show-categories-courses.scc {
    padding: var(--website-padding-top-bottom) 0;
}

.course-show-categories-courses .scc-inner-title-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 200px;
    border-top: 2px solid var(--icotea-stroke-color);
    padding-top: 1rem;
}

.course-show-categories-courses .scc-title {
    margin: 0 0 32px;
    font-family: var(--icotea-font-heading);
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--icotea-brand-blue);
}

/* Desktop: righe esplicite centrate (distribuzione richiesta dalla grafica),
   card di dimensione fissa 220x220. */
.course-show-categories-courses .scc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;          /* card alte uguali per riga */
}

/* Card quadrata, bianca, arrotondata */
.course-show-categories-courses .scc-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 280px;
    height: 100%;                  /* riempie la cella: altezze uguali per riga */
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    text-decoration: none;
    transition: transform .15s ease;
}

#primary.bkgWhite .course-show-categories-courses .scc-card {
    background: var(--icotea-body-bg);
}

.course-show-categories-courses .scc-card:hover,
.course-show-categories-courses .scc-card:focus-visible {
    background: var(--icotea-brand-blue);
}

.course-show-categories-courses .scc-card:hover span.scc-card-title{
    color: #ffffff;
}

.course-show-categories-courses .scc-card-ico {
    display: inline-block;
    width: 48px;
    height: 48px;
    background-color: var(--icotea-brand-blue);               /* blu di base */
    -webkit-mask: var(--ico) center / contain no-repeat;
    mask: var(--ico) center / contain no-repeat;
    transition: background-color .2s;
}

.course-show-categories-courses .scc-card:hover .scc-card-ico {              /* hover su tutta la card */
    background-color: #ffffff;
}


/* Icona in alto a destra */
.course-show-categories-courses .scc-card-ico {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.course-show-categories-courses .scc-card-ico img,
.course-show-categories-courses .scc-card-ico .scc-card-ico-svg {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Titolo in basso */
.course-show-categories-courses .scc-card-title {
    margin-top: auto;
    font-family: var(--icotea-font-heading);
    /* font-family: Figtree;*/
    font-size: 1rem;
    line-height: 1.2;
    text-transform: uppercase;
    font-weight: 700;
    color: #1A2A6C;
    font-style: normal;
    letter-spacing: 0.1px;
    display: inline-block;
    max-width: 80%;
}
/* -----------------------------------------------------------------------
   Tablet/mobile: si ignora la distribuzione desktop e si torna alla griglia
   classica. Le righe (.scc-row) si dissolvono con display:contents così tutte
   le card diventano item della griglia.
----------------------------------------------------------------------- */
@media (max-width: 991px) {
    .course-show-categories-courses .scc-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        align-items: stretch;
    }
    .course-show-categories-courses .scc-row { display: contents; }
    .course-show-categories-courses .scc-card {
        width: auto;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}
@media (max-width: 767px) {
    .course-show-categories-courses.scc { padding: var(--website-padding-top-bottom-mini) 0; }
    .course-show-categories-courses .scc-grid { grid-template-columns: repeat(2, 1fr); }
    .course-show-categories-courses .scc-title { font-size: 1.75rem; }
}
@media (max-width: 400px) {
    .course-show-categories-courses .scc-grid { grid-template-columns: 1fr; }
}

/* =======================================================================
   CASO 2: soli corsi — titolo "Corsi" a sinistra + card corsi 4 per riga
   ======================================================================= */
.course-show-categories-courses.scc--courses .scc-title {
    text-align: left;
}

/* Descrizione breve categoria: allineata tutta a destra */
.course-show-categories-courses.scc--courses .scc-short-desc {
    text-align: right;
    margin: 0 0 48px;
    color: var(--icotea-dark-blue);
    font-family: var(--icotea-font-body);
    font-size: 1rem;
    line-height: 1.5;
}

.course-show-categories-courses.scc--courses .scc-short-desc :last-child {
    margin-bottom: 0;
}

.course-show-categories-courses .scc-courses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.course-show-categories-courses .scc-course-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    transition: transform .15s ease;
    height: 100%;
}

.course-show-categories-courses .scc-course-card:hover,
.course-show-categories-courses .scc-course-card:focus-visible {
    /*
    transform: translateY(-3px);
     */
}

.course-show-categories-courses .scc-course-media {
    display: block;
    aspect-ratio: 368 / 192;
    overflow: hidden;
    background-color: var(--icotea-jolly);
}
.course-show-categories-courses .scc-course-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-show-categories-courses .scc-course-media--placeholder {
    background: linear-gradient(135deg, #EEF1F1 0%, #D9E0E7 100%);
}

.course-show-categories-courses .scc-course-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    flex: 1 1 auto;
}

.course-show-categories-courses .scc-course-title {
    font-family: var(--icotea-font-heading);
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--icotea-dark-blue);
}

.course-show-categories-courses .scc-course-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.course-show-categories-courses .scc-course-meta-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--icotea-font-body);
    font-size: 1rem;
    line-height: 1.4;
    color: #576272;
}
.course-show-categories-courses .scc-course-meta-row svg {
    flex: none;
    stroke: var(--icotea-brand-blue)
}

.course-show-categories-courses .scc-course-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.course-show-categories-courses .scc-course-price {
    font-family: var(--icotea-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--icotea-brand-blue);
}
.course-show-categories-courses .scc-course-btn {
    padding: 4px 20px;
    font-size: 14px;
    text-transform: uppercase;
    font-family: 'Urbanist', sans-serif;
}

@media (max-width: 991px) {
    .course-show-categories-courses .scc-courses-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .course-show-categories-courses .scc-courses-grid { grid-template-columns: 1fr; }
}

/* =======================================================================
   CASO 3: sottocategorie raggruppate — card gruppo 3 per riga
   ======================================================================= */
.course-show-categories-courses .scc-groups-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;      /* card alte uguali */
}

/* se ci sono anche categorie senza gruppo, stacca la griglia sotto */
.course-show-categories-courses .scc-groups-grid + .scc-grid {
    margin-top: 24px;
}

.course-show-categories-courses .scc-group-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
    border-radius: 22px;
    padding: 32px;
    height: 100%;
}

/* Icona in alto a sinistra */
.course-show-categories-courses .scc-group-ico {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}
.course-show-categories-courses .scc-group-ico img,
.course-show-categories-courses .scc-group-ico .scc-card-ico-svg {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.course-show-categories-courses .scc-group-title {
    margin: 0;
    font-family: var(--icotea-font-heading);
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--icotea-second-title);
}

.course-show-categories-courses .scc-group-desc {
    font-family: var(--icotea-font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--icotea-dark-blue);
}
.course-show-categories-courses .scc-group-desc :last-child { margin-bottom: 0; }

.course-show-categories-courses .scc-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.course-show-categories-courses .scc-group-list li {
    margin: 0;
    padding: 0 0 0 1rem;
    position: relative;
}
.course-show-categories-courses .scc-group-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 0.5rem;
    background-color: #BEDBFF;
    border-radius: 50%;
}


.course-show-categories-courses .scc-group-list a {
    font-family: var(--icotea-font-body);
    font-size: 1rem;
    line-height: 1.4;
    color: var(--icotea-brand-blue-dark);
    text-decoration: none;
    transition: color .2s ease;
}
.course-show-categories-courses .scc-group-list a:hover,
.course-show-categories-courses .scc-group-list a:focus-visible {
    color: var(--icotea-brand-blue);
    text-decoration: underline;
}

@media (max-width: 991px) {
    .course-show-categories-courses .scc-groups-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .course-show-categories-courses .scc-groups-grid { grid-template-columns: 1fr; }
}

/* =======================================================================
   CASO 2: tab-filtro corsi (attributo filtro-in-categoria)
   ======================================================================= */
.course-show-categories-courses .scc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}
.course-show-categories-courses .scc-tab {
    border: 1px solid var(--icotea-jolly);
    background: #fff;
    color: var(--icotea-dark-blue);
    font-family: var(--icotea-font-body);
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1;
    padding: 10px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.course-show-categories-courses .scc-tab:hover {
    border-color: var(--icotea-brand-blue);
    color: var(--icotea-brand-blue);
}
.course-show-categories-courses .scc-tab.is-active {
    background: var(--icotea-brand-blue);
    border-color: var(--icotea-brand-blue);
    color: #fff;
}
.course-show-categories-courses .scc-tab:focus-visible {
    outline: 2px solid var(--icotea-brand-blue);
    outline-offset: 2px;
}

/* Animazione di entrata delle card al cambio filtro */
.course-show-categories-courses .scc-course-card--enter {
    animation: scc-card-in .3s ease both;
}
@keyframes scc-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .course-show-categories-courses .scc-course-card--enter { animation: none; }
}

/* Card compatta sottocategoria (Visualizzazione compatta = SI) */
.course-show-categories-courses .scc-compact-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    outline: 1px solid #E5E7EB;
    outline-offset: -1px;
    overflow: hidden;
    height: 100%;
}
.course-show-categories-courses .scc-compact-head {
    padding: 20px 20px 12px;
    border-bottom: 1px solid #F3F4F6;
}
.course-show-categories-courses .scc-compact-title {
    margin: 0;
    color: var(--icotea-dark-blue, #002B56);
    font-family: var(--icotea-font-heading);
    font-size: 1rem;      /* 14px -> 1rem base */
    font-weight: 700;
    line-height: 1.375;
}
.course-show-categories-courses .scc-compact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
}
.course-show-categories-courses .scc-compact-item {
    padding: 16px 20px;
    border-bottom: 1px solid #F3F4F6;
}
.course-show-categories-courses .scc-compact-item:last-child {
    border-bottom: 0;
}
.course-show-categories-courses .scc-compact-item a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #1A4A8A;
    font-family: var(--icotea-font-heading);
    font-size: 1rem;      /* 14px -> 1rem base */
    font-weight: 500;
    line-height: 1.375;
    text-decoration: none;
}
.course-show-categories-courses .scc-compact-ico {
    flex: none;
    display: inline-flex;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}
.course-show-categories-courses .scc-compact-ico .scc-card-ico-svg {
    width: 18px;
    height: 18px;
}
.course-show-categories-courses .scc-compact-item a:hover .scc-compact-item-text,
.course-show-categories-courses .scc-compact-item a:focus .scc-compact-item-text {
    text-decoration: underline;
}
