/* 
 * SOGGETTO PER DUE
 * Tema minimalista per Bludit
 */

/* ==================== RESET ==================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==================== VARIABILI ==================== */

:root {
    --bg: #222222;
    --fragment-bg: #2a2a2a;
    --text-dark: #222222;
    --text-light: #f5f5f5;
    --text-muted: #888888;
    
    --font-main: 'Hedvig Letters Sans', sans-serif;
    
    --space: 2rem;
    --gutter: 24px;
}

/* ==================== BASE ==================== */

html {
    font-size: 18px;
}

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--text-light);
    background: var(--bg);
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==================== HEADER ==================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space);
    background: var(--bg);
}

.logo {
    font-family: var(--font-main);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: -2px;
    color: var(--text-light);
    transition: color 0.2s;
}

.logo:hover {
    color: var(--text-muted);
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--text-light);
}

/* ==================== WALL / MASONRY ==================== */

.wall {
    margin: 0;
    padding: calc(120px + var(--space) + 15px) var(--space) var(--space);
}

.grid-sizer,
.fragment {
    width: calc(25% - 18px);
}

.gutter-sizer {
    width: var(--gutter);
}

/* ==================== FRAGMENT ==================== */

.fragment {
    margin-bottom: var(--gutter);
    background: var(--fragment-bg);
    padding: 15px;
   
}

.fragment-image {
    margin-bottom: 15px;
}

.fragment-image img {
    width: 100%;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

.fragment-image img:hover {
    filter: grayscale(0%);
}

.fragment-text {
    font-family: var(--font-main);
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-light);
}


.fragment-text p {
    margin-bottom: 0.8rem;
}

.fragment-text p:last-child {
    margin-bottom: 0;
}

/* Solo testo */
.fragment:not(:has(.fragment-image)) .fragment-text {
    font-size: 1rem;
}

/* Solo immagine */
.fragment:not(:has(.fragment-text)) .fragment-image {
    margin-bottom: 0;
}

/* Citazioni */
.fragment-text blockquote {
    margin: 1rem 0 !important;
    padding: 0 1rem !important;
    background: transparent !important;
    border-left: 3px solid #00ff88 !important;
    border-right: 3px solid #00ff88 !important;
}

.fragment-text blockquote p {
    margin: 0 !important;
    font-style: italic !important;
    color: var(--text-light) !important;
    line-height: 1.4 !important;
}

/* Data fragment */
.fragment-date {
    font-family: var(--font-main);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
    text-transform: lowercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

/* ==================== LOAD MORE ==================== */

.load-more {
    text-align: center;
    padding: var(--space) 0;
}

.load-more a {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.load-more a:hover {
    color: var(--text-light);
    border-bottom-color: var(--text-muted);
}

/* ==================== FOOTER ==================== */

.footer {
    text-align: center;
    padding: calc(var(--space) * 2) var(--space);
}

.footer p {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-muted);
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.footer a:hover {
    color: var(--text-light);
    border-bottom-color: var(--text-light);
}

/* ==================== ANIMAZIONI ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1200px) {
    .grid-sizer,
    .fragment {
        width: calc(33.333% - 16px);
    }
}

@media (max-width: 900px) {
    .grid-sizer,
    .fragment {
        width: calc(50% - 12px);
    }
}

@media (max-width: 600px) {
    :root {
        --space: 1rem;
        --gutter: 16px;
    }
    
    html {
        font-size: 16px;
    }
    
    .header {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .grid-sizer,
    .fragment {
        width: 100%;
    }
    
    .gutter-sizer {
        width: 0;
    }
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==================== SELEZIONE ==================== */

::selection {
    background: var(--text-light);
    color: var(--bg);
}