/* --- RESET E BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0d0d0d !important;
    color: #d1d1d1;
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
}

/* --- SFONDO IMMERSIVO --- */
.poetry-page {
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(circle at center, #141414 0%, #0d0d0d 100%);
    padding: 150px 10% 100px 12%;
    position: relative;
}

/* Texture Sottile */
.poetry-page::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url("https://www.transparenttextures.com/patterns/stardust.png");
    opacity: 0.02;
    pointer-events: none;
    z-index: 1;
}

/* Titolo Verticale Laterale */
.section-title {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
    font-family: 'Cormorant Garamond', serif;
    text-transform: uppercase;
    letter-spacing: 1.5rem;
    color: rgba(197, 160, 89, 0.15);
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 10;
}

/* --- HEADER POESIE --- */
.po-header {
    margin-bottom: 80px;
    position: relative;
    max-width: 800px;
}

.po-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-style: italic;
    color: #e5e5e5;
    font-weight: 400;
    margin-bottom: 10px;
}

/* Sottotitolo Curato */
.po-subtitle {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-style: italic;
    letter-spacing: 1px;
    color: rgba(209, 209, 209, 0.6);
    margin-top: 20px;
    padding: 5px 0 5px 25px;
    border-left: 1px solid rgba(197, 160, 89, 0.4); /* Linea Oro verticale */
    line-height: 1.5;
    max-width: fit-content;
}

/* Linea di separazione orizzontale sfumata */
.po-header::after {
    content: '';
    display: block;
    width: 200px;
    height: 1px;
    background: linear-gradient(to right, rgba(197, 160, 89, 0.3), transparent);
    margin-top: 30px;
}

/* --- GRIGLIA ANTOLOGIA --- */
.poetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 60px 50px;
    position: relative;
    z-index: 2;
}

.poetry-card {
    cursor: pointer;
    padding: 40px;
    border: 1px solid rgba(197, 160, 89, 0.05);
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.poetry-card:hover {
    border-color: rgba(197, 160, 89, 0.4);
    background: rgba(197, 160, 89, 0.04);
    transform: translateY(-8px);
}

.po-num {
    font-family: 'Playfair Display', serif;
    color: #c5a059;
    font-size: 0.7rem;
    letter-spacing: 5px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.5;
}

.po-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #e5e5e5;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.po-preview {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(209, 209, 209, 0.4);
    line-height: 1.7;
}

/* --- MODAL E MONOLITE DI LETTURA --- */
.poem-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10001;
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.poem-monolith {
    background: #0d0d0d;
    width: 100%;
    max-width: 500px;
    height: 80vh;
    border: 1px solid rgba(197, 160, 89, 0.25);
    padding: 80px 50px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.9);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c5a059 #0d0d0d;
}

/* Scrollbar Style */
.poem-monolith::-webkit-scrollbar { width: 3px; }
.poem-monolith::-webkit-scrollbar-thumb { background: #c5a059; }

#modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #f2f2f2;
    text-align: center;
    font-style: italic;
    font-weight: 400;
}

.monolith-line {
    width: 50px;
    height: 1px;
    background: #c5a059;
    margin: 40px auto;
    opacity: 0.6;
}

.poem-verses {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    line-height: 2.2;
    color: #d1d1d1;
    white-space: pre-line;
    text-align: center;
    padding-bottom: 40px;
}

.close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    color: #c5a059;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.3s;
    line-height: 1;
}

.close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* --- BREAKPOINTS RESPONSIVE --- */

/* Tablet (iPad) */
@media (max-width: 1024px) {
    .poetry-page { padding: 120px 5% 80px 5%; }
    .section-title { left: 20px; opacity: 0.1; } /* Più discreto */
}

/* Mobile (Smartphone) */
@media (max-width: 768px) {
    .poetry-page { padding: 100px 20px 60px 20px; }
    .poetry-grid { grid-template-columns: 1fr; gap: 30px; }
    
    .section-title { display: none; } /* Rimuoviamo il titolo verticale per pulizia */
    
    .po-header { margin-bottom: 50px; text-align: left; }
    
    .poem-monolith { 
        height: 90vh; /* Più spazio su mobile */
        padding: 60px 25px 40px 25px; 
    }

    .close-btn {
        top: 15px;
        right: 15px;
        font-size: 2.5rem; /* Più facile da cliccare con il pollice */
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .po-header h1 { font-size: 2rem; }
    .po-subtitle { padding-left: 15px; font-size: 1rem; }
    .poetry-card { padding: 25px; }
}