/* ============================================================
   SBLOB — Main Stylesheet
   Design ripreso dal progetto originale. Zero dipendenze esterne.
   ============================================================ */

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
    font-size: 14px; line-height: 1.4;
    font-family: 'Roboto Condensed', 'Segoe UI', Arial, sans-serif;
    font-weight: 400; margin: 0; padding: 0;
    min-height: 100vh; width: 100%;
    color: #444; background-color: #efefef;
}
img { border: 0; max-width: 100%; height: auto; }
a { color: #444; text-decoration: none; }
a:hover { color: #666; }
h1, h2, h3 { width: 100%; display: inline-block; color: #222; font-weight: 700; }
h1 { font-size: 2.3em; line-height: 1.6em; margin: 0; }
h2 { font-size: 1.3em; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 1.2em; line-height: 1; font-weight: 400; }
strong, b { font-weight: 700; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
::selection { color: #ffcc00; background: #000; }

/* --- LAYOUT --- */
.clearfix { overflow: auto; zoom: 1; }
.int { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.corpo { margin-top: 70px; padding: 20px 0; }

/* --- HEADER --- */
.header {
    position: fixed; top: 0; width: 100%; background: #fff;
    z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,.1);
    height: 56px;
}
.header .int {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%;
}
.logo img { height: 32px; width: auto; }
.logo a { display: flex; align-items: center; }

.header-search { flex: 0 0 300px; }
.header-search form { display: flex; }
.header-search input {
    flex: 1; padding: 8px 12px; border: 1px solid #ddd;
    border-radius: 20px; font-size: 0.9em; font-family: inherit;
    background: #f5f5f5; transition: all 0.3s ease;
}
.header-search input:focus {
    background: #fff; border-color: #007bff; outline: none;
}

/* --- SEARCH AUTOCOMPLETE --- */
.search-autocomplete {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #ddd; border-top: none;
    border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
    z-index: 1000; max-height: 360px; overflow-y: auto; display: none;
}
.search-autocomplete.visible { display: block; }
.search-autocomplete-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; cursor: pointer; border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em; transition: background .15s;
}
.search-autocomplete-item:last-child { border-bottom: none; }
.search-autocomplete-item:hover,
.search-autocomplete-item.active { background: #f0f7ff; }
.search-autocomplete-item .ac-icon {
    flex-shrink: 0; width: 28px; height: 28px;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 0.8em; font-weight: bold;
}
.search-autocomplete-item .ac-icon.tag { background: #e8f5e9; color: #2e7d32; }
.search-autocomplete-item .ac-icon.title { background: #e3f2fd; color: #1565c0; }
.search-autocomplete-item .ac-text { flex: 1; }
.search-autocomplete-item .ac-sub {
    font-size: 0.75em; color: #888; margin-top: 2px;
}
.search-autocomplete-item .ac-badge {
    font-size: 0.7em; color: #999; background: #f5f5f5;
    padding: 2px 8px; border-radius: 10px;
}
.header-search { position: relative; }

/* --- CARD TAGS --- */
.card-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin: 6px 0;
}
.card-tag {
    font-size: 0.72em; color: #666;
    background: #f0f0f0; padding: 2px 8px;
    border-radius: 12px; text-decoration: none;
    transition: background .2s, color .2s;
}
.card-tag:hover { background: #007bff; color: #fff; }

.card-date {
    font-size: 0.72em; color: #999;
    text-decoration: none; margin-left: 8px;
}
.card-date:hover { color: #007bff; text-decoration: underline; }

/* --- PAUSE TOGGLE --- */
.pause-toggle {
    cursor: pointer; opacity: 0.7; transition: opacity .2s;
}
.pause-toggle:hover { opacity: 1; }
.pause-toggle.active { color: #4CAF50; font-weight: bold; opacity: 1; }

/* --- CARD GRID --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 10px 0;
}
@media (max-width: 720px) {
    .card-grid { grid-template-columns: 1fr; }
}

.listato {
    background: #fff; border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.listato:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,.15);
}

.img-container { position: relative; }
.img {
    height: 200px; background-size: cover; background-position: center;
    background-repeat: no-repeat; background-color: #e0e0e0;
}
.img .type-badge {
    position: absolute; top: 10px; left: 10px;
    background: #007bff; color: #fff; padding: 3px 8px;
    border-radius: 4px; font-size: 0.75em; text-transform: uppercase;
}
.axis-badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,0.92); padding: 3px 6px;
    border-radius: 4px; font-size: 0.9em; opacity: 0.8;
    z-index: 2; line-height: 1;
}

.txt { padding: 15px 20px 20px; }
.txt h2 { font-size: 1.15em; line-height: 1.35; margin: 0 0 5px; }

.domain-link {
    display: inline-block; color: #007bff; font-size: 0.8em;
    margin-bottom: 10px; opacity: 0.8;
}
.domain-link:hover { opacity: 1; }

.abstract {
    color: #666; font-size: 0.9em; line-height: 1.4;
    margin: 10px 0; display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}

.leggi {
    display: inline-block; padding: 8px 15px;
    background: #007bff; color: #fff !important;
    border-radius: 4px; font-size: 0.9em;
    transition: background 0.3s ease;
}
.leggi:hover { background: #0056b3; }

.pulsantiera { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 35px; height: 35px; background: #f5f5f5;
    border-radius: 50%; font-size: 0.85em;
    transition: all 0.3s ease;
}
.icon:hover { background: #007bff; color: #fff; }

/* --- DETAIL PAGE --- */
.scheda { max-width: 800px; margin: 0 auto; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.scheda .img { height: 350px; }
.scheda .txt { padding: 30px; }
.scheda h1 { font-size: 1.8em; line-height: 1.3; margin-bottom: 10px; }
.scheda .abstract { font-size: 1.05em; -webkit-line-clamp: unset; margin: 15px 0; }
.scheda .meta { color: #999; font-size: 0.85em; margin-bottom: 15px; }

/* --- TAG PAGE --- */
.tag-header { margin-bottom: 25px; }
.tag-header h1 { font-size: 2em; }

/* --- SEARCH --- */
.search-header { margin-bottom: 25px; }
.search-header h1 { font-size: 1.5em; color: #666; }

/* --- 404 --- */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 h1 { font-size: 4em; color: #ddd; margin-bottom: 20px; }
.page-404 p { font-size: 1.2em; margin-bottom: 30px; }
.page-404 .leggi { font-size: 1em; padding: 12px 25px; }

/* --- FOOTER --- */
.footer {
    background: #222; color: #999; padding: 30px 0; margin-top: 40px;
    text-align: center; font-size: 0.85em;
}
.footer a { color: #ccc; }
.footer a:hover { color: #fff; }
.footer .f_links { margin-bottom: 10px; }
.footer .f_links a { margin: 0 8px; text-transform: uppercase; }

/* --- LAZY LOAD --- */
.lazy { opacity: 0; transition: opacity 0.4s ease; }
.lazy.loaded { opacity: 1; }

/* --- EMPTY STATE --- */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state h2 { font-size: 1.5em; color: #bbb; }

/* --- PAUSE OVERLAY (A.1) --- */
#sblob-pause {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
    background: rgba(0,0,0,0.65);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.5s ease;
}
#sblob-pause .pause-content {
    background: #fff; padding: 40px; border-radius: 12px;
    text-align: center; max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
#sblob-pause p { font-size: 1.3em; margin: 0 0 20px; color: #222; line-height: 1.4; }
#sblob-pause button {
    background: #007bff; color: #fff; padding: 10px 24px;
    border-radius: 6px; font-size: 1em; font-family: inherit;
    cursor: pointer;
}
#sblob-pause button:hover { background: #0056b3; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- EXIT MESSAGE (A.3) --- */
#sblob-exit-message {
    display: none;
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: #fff; padding: 20px 30px; border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 9000;
    max-width: 640px; width: 92%; text-align: center;
    animation: slideUp 0.4s ease;
}
#sblob-exit-message.visible { display: block; }
#sblob-exit-message p { margin: 0 0 6px; font-size: 1.1em; color: #333; }

.exit-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
    text-align: left;
}
.exit-cards .listato.mini { font-size: 0.85em; }
.exit-cards .listato.mini .img { height: 120px; }
.exit-cards .listato.mini .txt { padding: 10px; }
.exit-cards .listato.mini h2 { font-size: 1em; margin: 0; }

@media (max-width: 720px) {
    .exit-cards { grid-template-columns: 1fr; }
    #sblob-exit-message { padding: 15px 20px; }
}

@keyframes slideUp {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}
