/**
 * CSS del tema DAIMON - Replica esatta del sito WordPress
 * 
 * Stili copiati dal tema Twenty Twenty-Five e dai blocchi WordPress
 * per garantire coerenza visiva completa
 */

/* ============================================
   STILI BASE WORDPRESS
   ============================================ */

/* Reset base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    background: #ffffff;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 70px; /* Spazio ridotto per header più basso */
}

/* Link styles - da WordPress */
a {
    text-decoration-thickness: 1px !important;
    text-underline-offset: .1em;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* Focus styles - da WordPress */
:where(*:focus) {
    outline-width: 2px;
    outline-style: solid;
}

/* Progressive enhancement - da WordPress */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
    text-wrap: pretty;
}

/* ============================================
   TIPOGRAFIA - Font del tema daimon25
   ============================================ */

/* Font caricati da Google Fonts nell'header - non serve @font-face */

h1, h2, h3, h4, h5, h6 {
    font-family: "Kalam", cursive;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 1rem 0;
    color: #1a1a1a;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

.subtitle {
    font-family: "Modern Antiqua", Arial, Sans-serif;
    letter-spacing: 0.3rem;
}

.wp-block-latest-posts__post-title {
    font-family: "Kalam", Arial, Sans-serif;
    font-size: 1.8rem;
}

p {
    margin: 0 0 1.5rem 0;
}

strong, b {
    color: #1a1a1a;
    font-weight: 600;
}

em, i {
    font-style: italic;
}

/* ============================================
   WORDPRESS BLOCK STYLES
   ============================================ */

/* wp-block-group - da WordPress */
.wp-block-group {
    box-sizing: border-box;
}

:where(.wp-block-group.wp-block-group-is-layout-constrained) {
    position: relative;
}

/* Layout classes */
.is-layout-flex {
    display: flex;
}

.is-layout-flow {
    display: flow-root;
}

.is-layout-constrained {
    max-width: 100%;
}

/* Alignment classes - da WordPress */
.alignfull {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.aligncenter {
    clear: both;
    text-align: center;
}

.alignleft {
    float: left;
    margin: 0.5em 1em 0.5em 0;
}

.alignright {
    float: right;
    margin: 0.5em 0 0.5em 1em;
}

/* wp-block-site-logo - da WordPress */
.wp-block-site-logo {
    box-sizing: border-box;
    line-height: 0;
}

.wp-block-site-logo a {
    display: inline-block;
    line-height: 0;
}

.wp-block-site-logo.is-default-size img {
    height: auto;
    width: 120px;
}

.wp-block-site-logo img {
    height: auto;
    max-width: 100%;
}

.wp-block-site-logo a,
.wp-block-site-logo img {
    border-radius: inherit;
}

.wp-block-site-logo.aligncenter {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* wp-block-site-title - da WordPress */
.wp-block-site-title {
    box-sizing: border-box;
}

.wp-block-site-title :where(a) {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-style: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-decoration: inherit;
}

/* ============================================
   HEADER - Barra fissa con sfondo giallo oro
   ============================================ */

.daimon-header {
    background: #C29639; /* Giallo oro DAIMON */
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    transition: transform 0.3s ease;
}

.daimon-header .header-inner {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem; /* Ridotto da 1rem */
    padding-bottom: 0.5rem; /* Ridotto da 1rem */
    gap: 2rem;
}

.header-wide {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem; /* Ridotto da 2rem */
    padding-right: 2rem;
    margin-left: auto;
    margin-right: auto;
}

.site-branding {
    flex-shrink: 0;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo-link {
    display: inline-block;
    line-height: 0;
    flex-shrink: 0;
}

.site-logo-image {
    height: auto;
    max-height: 85px; /* Aumentato da 75px */
    width: auto;
    max-width: 250px; /* Aumentato da 220px */
    display: block;
}

.site-title-text {
    font-family: "Modern Antiqua", Arial, Sans-serif;
    font-size: clamp(0.939rem, 0.939rem + ((1vw - 0.2rem) * 0.88), 1.5rem); /* Ridotto di 0.1rem */
    margin: 0;
    color: #370F67; /* Viola DAIMON */
    line-height: 1.4;
}

.site-title-text strong {
    font-weight: 600;
    color: #370F67; /* Viola DAIMON */
}

.site-subtitle-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; /* Font di default, diverso da DAIMON */
    font-size: clamp(0.939rem, 0.939rem + ((1vw - 0.2rem) * 0.88), 1.5rem); /* Ridotto di 0.1rem */
    margin: 0;
    color: #370F67; /* Viola DAIMON */
    line-height: 1.4;
}

.site-subtitle-text strong {
    font-weight: 600;
    color: #370F67; /* Viola DAIMON */
}

/* Navigation */
.back-navigation {
    flex-shrink: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #1a1a1a;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
    text-decoration-thickness: 1px;
    text-underline-offset: .1em;
    font-weight: 500;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    color: #000;
}

.back-link i {
    font-size: 0.85rem;
}

/* ============================================
   FOOTER - Sfondo viola DAIMON
   ============================================ */

.daimon-footer {
    background: #370F67; /* Viola DAIMON */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0 1.5rem 0; /* Ridotto da 3rem 0 2rem 0 */
    margin-top: 3rem; /* Ridotto da 4rem */
    color: #ffffff;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

/* Logo footer */
.footer-logo {
    margin-bottom: 0;
}

.footer-logo-image {
    height: auto;
    max-width: 300px;
    width: 100%;
    display: block;
    margin: 0 auto;
}

/* Autore */
.footer-author {
    margin: 0 0 0.75rem 0; /* Equidistante e più vicino */
    font-size: 1rem;
    color: #C29639; /* Giallo oro DAIMON */
}

.footer-author strong em {
    font-style: italic;
    font-weight: 600;
    color: #C29639; /* Giallo oro DAIMON */
}

/* Tagline */
.footer-tagline {
    margin: 0 0 1.5rem 0; /* Mantiene spazio prima del footer-bottom */
    padding: 1rem 2rem; /* Padding maggiore */
    background: #CE0F69; /* Rosa DAIMON */
    border-radius: 4px;
    font-size: 1rem;
    color: #f8f8f8; /* Bianco */
    display: inline-block;
}

/* Footer bottom */
.footer-bottom {
    padding-top: 1.5rem; /* Ridotto da 2rem */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-copyright,
.footer-legal {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Link footer - nessuna sottolineatura di default */
.footer-link,
.footer-legal a {
    color: #ffffff;
    text-decoration: none !important;
    text-decoration-thickness: 0 !important;
    border-bottom: none;
    transition: border-bottom 0.2s ease;
}

.footer-link:hover,
.footer-legal a:hover {
    text-decoration: none !important;
    text-decoration-thickness: 0 !important;
    border-bottom: 1px dashed #CE0F69; /* Rosa DAIMON */
    color: #F8F8F2;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.content-container {
    background: #ffffff;
    padding: 2rem;
}

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

@media screen and (max-width: 768px) {
    body {
        padding-top: 50px; /* Ridotto ulteriormente per header più compatto */
        transition: padding-top 0.3s ease;
    }
    
    /* Header nascosto su mobile durante scroll down */
    .daimon-header.header-hidden {
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    /* Rimuovi padding-top quando header è nascosto */
    body.header-scrolled {
        padding-top: 0;
    }
    
    /* Assicura che il titolo h1 sia sempre visibile anche quando header è nascosto */
    main h1 {
        position: relative;
        z-index: 1;
        margin-top: 0;
    }
    
    .daimon-header .header-inner {
        flex-direction: row; /* Cambiato da column a row per sfruttare larghezza */
        flex-wrap: wrap; /* Permette wrap se necessario */
        gap: 0.5rem; /* Ridotto gap */
        padding-top: 0.4rem; /* Ridotto ulteriormente */
        padding-bottom: 0.4rem; /* Ridotto ulteriormente */
        align-items: center;
    }
    
    .site-branding {
        text-align: left;
        flex: 1 1 auto; /* Prende spazio disponibile */
        flex-direction: row; /* Logo e testo affiancati */
        align-items: center;
        gap: 0.5rem; /* Ridotto gap */
        min-width: 0; /* Permette shrink */
    }
    
    .site-logo-link {
        flex-shrink: 0;
    }
    
    .site-logo-image {
        max-height: 50px; /* Ridotto per compattezza */
        max-width: 50px; /* Quadrato compatto */
    }
    
    .site-title-text,
    .site-subtitle-text {
        font-size: 0.85rem; /* Ridotto ulteriormente */
        line-height: 1.2;
        white-space: nowrap; /* Evita wrap su più righe */
    }
    
    .site-title-text {
        margin-right: 0.25rem;
    }
    
    .site-subtitle-text {
        margin-left: 0.25rem;
    }
    
    .header-wide {
        padding-left: 0.75rem; /* Ridotto */
        padding-right: 0.75rem; /* Ridotto */
    }
    
    .back-navigation {
        flex: 0 0 auto; /* Non cresce, dimensione fissa */
        width: 100%; /* Su una riga separata */
        margin-top: 0.25rem;
    }
    
    .back-link {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.4rem 0.75rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .alignwide {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .footer-container {
        padding: 0 1rem;
    }
    
    .footer-logo-image {
        max-width: 250px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .footer-tagline {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}
