/* ==================================================
   SCRITTURA WORKSHOP — CONFIGURAZIONE STRUTTURALE
================================================== */

.sw-app {
    padding: 120px 5vw 80px;
    color: var(--text);
}

/* ================= HERO ================= */

.sw-hero {
    max-width: 900px;
    margin: 0 auto 60px;
    text-align: center;
}

.sw-hero h1 {
    font-family: var(--font1);
    font-size: 3.4rem;
    margin-bottom: 18px;
}

.sw-hero p {
    font-size: 1.05rem;
    line-height: 1.8;
    opacity: 0.85;
    max-width: 720px;
    margin: 0 auto;
}

/* ================= NAV PRINCIPALE (01 / 02 / 03) ================= */

.sw-nav {
    max-width: 900px;
    margin: 0 auto 60px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sw-nav-btn {
    all: unset;
    cursor: pointer;
    padding: 16px 18px;
    border-left: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    transition: 0.25s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sw-nav-btn:hover {
    border-left-color: var(--accent);
    transform: translateX(6px);
    background: rgba(200,169,110,0.08);
}

.sw-nav-btn.is-active {
    border-left-color: var(--accent);
    background: rgba(200,169,110,0.12);
    color: var(--accent);
}

/* ================= STRUTTURA SEZIONI ================= */

.sw-section {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
}

.sw-section.is-active {
    display: block;
}

/* ==================================================
   INTERFACCIA UNIFORMATA E CENTRATA (SEZIONI 1 E 2)
================================================== */

/* Contenitore dei tasti: allineati orizzontalmente e centrati */
.sw-prof-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 auto 40px;
    max-width: 1000px;
    justify-content: center; /* Centra i bottoni rispetto ai bordi dello schermo */
}

/* Il singolo pulsante: compatto, pulito e moderno per entrambe le sezioni */
.sw-prof-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.25s ease;
    user-select: none;
    text-align: center;
}

/* Rimuove permanentemente eventuali residui o icone vecchie */
.sw-prof-item i {
    display: none !important;
}

/* Hover sui pulsanti */
.sw-prof-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px); /* Delicato sollevamento al passaggio del mouse */
}

/* Stato Attivo (Selezionato con box aperto sotto) */
.sw-prof-item.is-active {
    background: rgba(200, 169, 110, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(0);
}

/* ================= CONTENUTI DINAMICI (BOX DI ATTERRAGGIO) ================= */

.sw-prof-content {
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 10px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Nasconde i margini o spazi vuoti quando nessuna scheda è attiva */
.sw-prof-content:empty {
    display: none;
}

/* Stile per i caricamenti o messaggi di errore */
.sw-loading {
    padding: 30px;
    text-align: center;
    opacity: 0.7;
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 12px;
}



/* ==================================================
   SEZIONE 3 — LIBRARY (APPROFONDIMENTI)
================================================== */

.sw-library {
    display: grid;
    /* Adatta automaticamente le colonne: min 240px, max 1fr per riga */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
    align-items: stretch;
}

.sw-book {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.sw-book:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Contenitore immagine con proporzione bloccata a 1.28:1 (o 4:3 / proporzione nativa) */
.sw-book-img-wrapper {
    width: 100%;
    aspect-ratio: 1.28 / 1; /* Garantisce la proporzione esatta senza flettere */
    background: rgba(0, 0, 0, 0.2); /* Sfondo neutro di riempimento se l'immagine varia di pochi px */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sw-book img {
    width: 100%;
    height: 100%;
    /* Mostra l'immagine INTERA, ridimensionandola senza MAI tagliarla */
    object-fit: contain; 
    display: block;
}

/* Testi della card coordinati */
.sw-book h3 {
    padding: 16px 16px 6px;
    font-family: var(--font1);
    font-size: 1.1rem;
    line-height: 1.3;
}

.sw-book p {
    padding: 0 16px 18px;
    opacity: 0.8;
    font-size: 0.92rem;
    line-height: 1.5;
    margin-top: auto; /* Mantiene la descrizione allineata in fondo */
}

/* ================= RESPONSIVE DESIGN GLOBALE ================= */

@media (max-width: 768px) {
    .sw-hero h1 {
        font-size: 2.4rem;
    }

    .sw-prof-list {
        gap: 8px;
        padding: 0 10px;
    }

    .sw-prof-item {
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    .sw-prof-content {
        padding-top: 0;
    }
}