/*
Theme Name: I libri di Guido Rumici
Theme URI: https://rgstudiolab.it/
Author: RG Studio Lab
Author URI: https://rgstudiolab.it/
Description: Tema autore per il sito "I libri di Guido Rumici". Banner superiore, sfondo fotografico sfumato, colonna centrale con pannelli marroni e riquadri bianchi. Pensato per essere usato insieme al plugin "RG Libri & Recensioni".
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: guido-rumici
*/

/* ============================================================
   PALETTE
   --gr-dark   #4a3b30  marrone scuro (barra menu / pannello)
   --gr-mid    #5a493d  marrone medio (cornice contenuto)
   --gr-cream  #ecd2b6  crema (titoli, link)
   --gr-black  #000     bordi e testo
   --gr-white  #fff     riquadri
   ============================================================ */
:root{
    --gr-dark:#4a3b30;
    --gr-mid:#5a493d;
    --gr-cream:#ecd2b6;
    --gr-black:#000;
    --gr-white:#fff;
    --gr-wrap:760px;          /* larghezza colonna centrale */
    --gr-radius:10px;
}

/* -------- reset minimale -------- */
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}

body{
    font-family:"Segoe UI",Candara,"Trebuchet MS",Verdana,sans-serif;
    color:var(--gr-black);
    line-height:1.5;
    /* layout a colonna per il footer "sticky" in fondo alla pagina */
    display:flex;
    flex-direction:column;
    min-height:100vh;
    /* sfondo fotografico sfumato (schiaritura inclusa nel gradiente,
       così non serve nessun overlay che possa intercettare i click) */
    background:
        linear-gradient(rgba(245,245,243,.55), rgba(245,245,243,.55)),
        #ededed url(assets/img/sfondo.jpg) top center no-repeat fixed;
    background-size:cover, cover;
}

a{color:var(--gr-cream);text-decoration:none;}
a:hover{text-decoration:underline;}

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

/* ============================================================
   LAYOUT GENERALE — colonna centrale
   ============================================================ */
.gr-shell{
    position:relative;
    z-index:1;
    width:var(--gr-wrap);
    max-width:100%;
    margin:0 auto;
    padding-bottom:60px;
    /* cresce per spingere il footer in fondo (sticky footer) */
    flex:1 0 auto;
    /* colonna marrone continua: nessuno stacco bianco attorno a banner/menu */
    background:var(--gr-dark);
}

/* ---- Banner superiore ---- */
.gr-banner{
    position:relative;
    background:var(--gr-dark);
    line-height:0;
}
.gr-banner img{width:100%;height:auto;display:block;}

/* striscia di raccordo marrone con la sola riga crema sopra al menu
   (niente linguetta bianca, niente stacco) */
.gr-tab{
    height:16px;
    background:var(--gr-dark);
    border-bottom:3px solid var(--gr-cream);
}

/* ============================================================
   MENU DI NAVIGAZIONE
   ============================================================ */
.gr-nav{
    position:relative;
    z-index:2;                 /* sopra a tutto: i link restano cliccabili */
    background:var(--gr-dark);
    padding:14px 24px;
}
.gr-nav ul{
    list-style:none;
    margin:0;
    padding:0;
    display:flex;
    flex-wrap:wrap;
    gap:26px;
    justify-content:center;
}
.gr-nav li{margin:0;}
.gr-nav a{
    color:var(--gr-cream);
    font-size:18px;
    font-weight:600;
    letter-spacing:.3px;
}
.gr-nav a:hover{color:#fff;text-decoration:none;}
.gr-nav .current-menu-item > a{text-decoration:underline;}

/* ---- Pulsante hamburger (nascosto su desktop) ---- */
.gr-menu-wrap{display:block;}
.gr-nav-toggle{
    display:none;                 /* visibile solo su mobile via media query */
    align-items:center;
    gap:10px;
    margin:0 auto;
    background:transparent;
    border:1px solid var(--gr-cream);
    border-radius:6px;
    color:var(--gr-cream);
    font:inherit;
    font-weight:700;
    font-size:16px;
    padding:8px 16px;
    cursor:pointer;
}
.gr-nav-toggle:hover{background:rgba(236,210,182,.12);}
.gr-burger,
.gr-burger::before,
.gr-burger::after{
    display:block;
    width:24px;
    height:2px;
    background:var(--gr-cream);
    transition:transform .2s ease, top .2s ease, background .2s ease;
}
.gr-burger{position:relative;}
.gr-burger::before,
.gr-burger::after{content:"";position:absolute;left:0;}
.gr-burger::before{top:-7px;}
.gr-burger::after{top:7px;}
/* trasformazione in "X" a menu aperto */
.gr-nav.is-open .gr-burger{background:transparent;}
.gr-nav.is-open .gr-burger::before{top:0;transform:rotate(45deg);}
.gr-nav.is-open .gr-burger::after{top:0;transform:rotate(-45deg);}

/* ============================================================
   PANNELLO CONTENUTO
   ============================================================ */
.gr-content{
    background:var(--gr-dark);
    padding:22px 24px 34px;
}

.gr-page-title{
    color:var(--gr-cream);
    font-size:30px;
    font-weight:600;
    margin:6px 0 18px;
    padding-left:6px;
}

/* riquadro bianco standard */
.gr-card{
    background:var(--gr-white);
    color:var(--gr-black);
    border:1px solid var(--gr-black);
    border-radius:4px;
    padding:18px 20px;
    margin:0 0 18px;
}
.gr-card p{margin:0 0 .8em;}
.gr-card p:last-child{margin-bottom:0;}

/* ============================================================
   HOME — griglia "news" 2 colonne (Immagine 6)
   ============================================================ */
.gr-front-content{margin:0 0 22px;}

/* Immagine in evidenza nel single: a destra su desktop, piena su mobile */
.gr-feat-image{
    float:right;
    width:220px;
    max-width:42%;
    margin:4px 0 14px 18px;
}
.gr-feat-image img{
    display:block;
    width:100%;
    height:auto;
    border:1px solid #000;
    border-radius:4px;
}
@media (max-width:600px){
    .gr-feat-image{float:none;width:100%;max-width:100%;margin:0 0 14px;}
}

/* Pulsante "Torna alla descrizione del libro" in fondo a una recensione */
.gr-back-block{margin:26px 0 4px;}
.gr-back-btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:#4a3b30;
    color:#ecd2b6;
    padding:10px 20px;
    border:1px solid #000;
    border-radius:6px;
    text-decoration:none;
    font-weight:600;
    line-height:1.2;
    transition:background-color .2s ease,color .2s ease;
}
.gr-back-btn:hover,
.gr-back-btn:focus{background:#5a493d;color:#fff;}
.gr-back-arrow{font-size:1.25em;line-height:1;}

/* Link "Modifica contenuto" (solo owner/admin) sotto il titolo */
.gr-edit-link{margin:-6px 0 14px;}
.gr-edit-link a{
    display:inline-flex;
    align-items:center;
    gap:6px;
    background:#ecd2b6;
    color:#4a3b30;
    padding:5px 12px;
    border:1px solid #4a3b30;
    border-radius:5px;
    text-decoration:none;
    font-size:13px;
    font-weight:600;
}
.gr-edit-link a:hover,
.gr-edit-link a:focus{background:#4a3b30;color:#ecd2b6;}
.gr-edit-ico{font-size:1.05em;line-height:1;}
.gr-news-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}
.gr-news{
    display:flex;
    flex-direction:column;
}
.gr-news-label{
    background:var(--gr-cream);
    color:var(--gr-black);
    border:1px solid var(--gr-black);
    border-radius:14px;
    padding:3px 14px;
    font-size:13px;
    font-weight:600;
    margin-bottom:8px;
    width:100%;
}
.gr-news-body{
    background:var(--gr-white);
    border:2px solid var(--gr-black);
    border-radius:var(--gr-radius);
    padding:16px;
    flex:1;
    display:flex;
    flex-direction:column;
}
.gr-news-thumb{
    align-self:center;            /* centrata nella card */
    width:150px;
    height:210px;                 /* verticale, proporzione copertina libro */
    background:var(--gr-cream);
    border-radius:6px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    font-size:12px;
    color:#6c5742;
    overflow:hidden;
    margin-bottom:14px;
}
.gr-news-thumb img{width:100%;height:100%;object-fit:cover;}
.gr-news-date{font-size:11px;color:#555;margin-bottom:6px;}
.gr-news-text{font-size:13px;line-height:1.45;flex:1;}
.gr-btn{
    align-self:flex-end;
    margin-top:12px;
    background:var(--gr-cream);
    color:var(--gr-black);
    border:1px solid var(--gr-black);
    border-radius:16px;
    padding:6px 18px;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    display:inline-block;
}
.gr-btn:hover{background:#f4e2cd;text-decoration:none;}

/* ============================================================
   PAGINAZIONE (pallini)
   ============================================================ */
.gr-dots{
    display:flex;
    justify-content:center;
    gap:14px;
    margin-top:26px;
}
.gr-dots a,.gr-dots span{
    width:11px;
    height:11px;
    border-radius:50%;
    background:#c9b69d;
    display:block;
    text-indent:-9999px;
    overflow:hidden;
}
.gr-dots .current,.gr-dots a:hover{background:var(--gr-cream);}

/* ============================================================
   CONTENUTO GENERICO PAGINE/ARTICOLI
   ============================================================ */
.gr-prose h1,.gr-prose h2,.gr-prose h3{color:var(--gr-dark);}
.gr-prose a{color:var(--gr-mid);text-decoration:underline;}

/* ============================================================
   TABELLA RECENSIONI COLLEGATE (single.php)
   ============================================================ */
.gr-rev-block{margin:26px 0 10px;}
.gr-rev-search{
    width:100%;
    box-sizing:border-box;
    padding:11px 14px;
    margin:0 0 12px;
    border:1px solid #000;
    border-radius:8px;
    font-size:15px;
    background:var(--gr-white);
    color:#2b2118;
}
.gr-rev-search:focus{
    outline:none;
    border-color:var(--gr-cream);
    box-shadow:0 0 0 2px rgba(236,210,182,.45);
}
.gr-rev-search::placeholder{color:#8a7a66;}
.gr-rev-noresult td{
    text-align:center;
    color:#6c5742;
    font-style:italic;
}
.gr-rev-heading{
    color:var(--gr-cream);
    font-size:20px;
    font-weight:700;
    margin:0 0 12px;
    display:flex;
    align-items:center;
    gap:10px;
}
.gr-rev-count{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:26px;
    height:26px;
    padding:0 8px;
    border-radius:13px;
    background:var(--gr-cream);
    color:var(--gr-dark);
    font-size:14px;
    font-weight:700;
}
.gr-rev-wrap{
    border:1px solid #000;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 2px 8px rgba(0,0,0,.25);
}
.gr-rev-table{
    width:100%;
    border-collapse:collapse;
    background:var(--gr-white);
}
.gr-rev-table th{
    background:var(--gr-dark);
    color:var(--gr-cream);
    text-align:left;
    padding:12px 16px;
    font-size:14px;
    font-weight:700;
    letter-spacing:.02em;
    text-transform:uppercase;
}
.gr-rev-table td{
    padding:12px 16px;
    border-top:1px solid #e7dccb;
    font-size:15px;
}
.gr-rev-table tbody tr:nth-child(even){background:#fbf6ef;}
.gr-rev-table tbody tr:hover{background:#f3e7d4;}
.gr-rev-link a{
    color:var(--gr-dark);
    text-decoration:none;
    font-weight:600;
    display:inline-flex;
    align-items:center;
    gap:8px;
}
.gr-rev-link a:hover{color:var(--gr-mid);text-decoration:underline;}
.gr-rev-arrow{
    color:var(--gr-mid);
    font-size:20px;
    line-height:1;
    font-weight:700;
}
.gr-rev-date{white-space:nowrap;width:1%;color:#6c5742;font-size:14px;}

/* ============================================================
   FOOTER NERO (a tutta larghezza, ancorato in fondo)
   ============================================================ */
.gr-footer{
    flex-shrink:0;                 /* resta in fondo, non si comprime */
    width:100%;
    background:var(--gr-black);
    color:#d8c4ab;
    padding:26px 20px;
    z-index:3;
}
.gr-footer-inner{
    width:var(--gr-wrap);
    max-width:100%;
    margin:0 auto;
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
    gap:26px;
    align-items:start;
}
.gr-foot-col{font-size:14px;line-height:1.6;}
.gr-foot-col--left{text-align:left;}
.gr-foot-col--center{text-align:center;}
.gr-foot-col--right{text-align:right;}

.gr-foot-title{
    color:var(--gr-cream);
    font-size:15px;
    font-weight:700;
    margin:0 0 10px;
}
.gr-foot-widget{margin:0 0 16px;}
.gr-foot-widget:last-child{margin-bottom:0;}
.gr-footer a{color:var(--gr-cream);}
.gr-footer a:hover{color:#fff;}
.gr-footer ul{list-style:none;margin:0;padding:0;}
.gr-footer li{margin:0 0 6px;}
.gr-foot-hint{
    color:#6f6356;
    font-style:italic;
    font-size:13px;
    border:1px dashed #4a4136;
    padding:10px;
    border-radius:4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:800px){
    .gr-shell{width:100%;}
    body{background-attachment:scroll;}
    .gr-news-grid{grid-template-columns:1fr;}
    .gr-nav{text-align:center;}
    .gr-nav-toggle{display:inline-flex;}
    .gr-menu-wrap{display:none;margin-top:14px;}
    .gr-nav.is-open .gr-menu-wrap{display:block;}
    .gr-nav ul{flex-direction:column;align-items:center;gap:16px;}
    .gr-nav a{font-size:17px;}
    .gr-page-title{font-size:24px;}
    .gr-footer-inner{grid-template-columns:1fr;gap:18px;text-align:center;}
    .gr-foot-col--left,.gr-foot-col--right{text-align:center;}
}
