/*
Theme Name: AG Minimal Grey Sidebar
Author: Custom AG
Description: Tema WordPress minimale con sidebar sinistra, dark/light mode e layout editoriale
Version: 1.9.7 --> Revisione finale: correzione chiusura parentesi e accorpamento variabili
*/

/* ==================================================
   1. VARIABILI E COLORI
   ================================================== */
:root {
  /* Dimensioni Layout */
  --sidebar-width: 260px;
  --social-width: 60px;

  /* DARK MODE (Default) */
  --navbar-bg:    #1A1D22;
  --navbar-text:  #BABFC5;
  --navbar-hover: #E5E5E5;
  --page-bg:      #2D323A;
  --page-text:    #CED4DA;
  --page-titles:  #FFFFFF;
  --text-muted:   #9AA0A6;
  --desc-it:      #eeeeee;
  --desc-en:      #aaaaaa;
  --desc-bold:    #ffffff;
}

:root.light {
  --navbar-bg:    #BABFC5;
  --navbar-text:  #383F49;
  --navbar-hover: #000000;
  --page-bg:      #E5E5E5;
  --page-text:    #383F49;
  --page-titles:  #222222;
  --text-muted:   #666666;
  --desc-it:      #222222;
  --desc-en:      #555555;
  --desc-bold:    #000000;
}

/* ==================================================
   2. RESET E BASE
   ================================================== */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden; /* Previene scroll orizzontali indesiderati */
  background-color: var(--page-bg); 
  color: var(--page-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.menu-toggle {
  display: none;
}

/* ==================================================
   3. STRUTTURA DESKTOP (>= 769px)
   ================================================== */
@media (min-width: 769px) {
  body {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 2.5rem 2rem;
    background: var(--navbar-bg);
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    z-index: 1000;
    overflow-y: auto;
  }

  .content {
    margin-left: var(--sidebar-width);
    /* Larghezza area utile: totale meno le due barre laterali */
    width: calc(100vw - var(--sidebar-width) - var(--social-width));
    padding: 4rem;
    box-sizing: border-box;
  }

  /* Centratura del contenuto nell'area disponibile */
  .content > * {
    max-width: 1400px;
    margin-inline: auto;
  }
}

/* ==================================================
   4. COMPONENTI SIDEBAR
   ================================================== */
.toggle {
  font-size: 4.5rem;
  color: var(--navbar-text);
  cursor: pointer;
  align-self: center;
  line-height: 1;
  margin-bottom: 1rem;
  transition: transform 0.3s ease, color 0.3s ease;
  position: relative;
  z-index: 2000;
}

.site-title a {
  color: var(--navbar-text);
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
}

.main-nav a {
  color: var(--navbar-text);
  font-size: clamp(1.1rem, 1.05rem + 0.3vw, 1.25rem);
  text-decoration: none;
  display: block; 
  padding: 4px 0;
}

.main-nav a:hover { color: var(--navbar-hover); }

/* ==================================================
   5. TESTI E LINGUE
   ================================================== */
.description-it {
  color: var(--desc-it);
  display: block;
  margin-bottom: 0.5rem;
}

.description-en {
  color: var(--desc-en);
  font-style: italic !important; /* Forza il corsivo per l'inglese */
  display: block;
}

.description-en strong, .description-it strong {
  color: var(--desc-bold);
  font-weight: bold;
}

/* ==================================================
   6. PORTFOLIO GRID
   ================================================== */
.home-galleries {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 20px !important;
  padding: 20px 0;
}

.home-galleries img {
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.home-galleries a:hover img { transform: scale(1.03); }

/* ==================================================
   7. SOCIAL BAR (Destra)
   ================================================== */
.social-icon {
  width: 24px;
  height: 24px;
  fill: var(--navbar-text);
  transition: all 0.3s ease;
}

@media (min-width: 769px) {
  .sidebar .social { display: none !important; }

  .social-sidebar-right {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--social-width);
    height: 100vh;
    background: var(--navbar-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 25px;
    z-index: 900;
    border-left: 1px solid rgba(255,255,255,0.05);
  }
} /* <--- Chiusura media query fissa destra */

/* ==================================================
   8. MOBILE (< 768px)
   ================================================== */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    padding: 2rem 1.5rem;
    height: auto;
  }

  .content {
    width: 100%;
    margin-left: 0;
    padding: clamp(1rem, 5vw, 2rem);
  }

  .menu-toggle {
    display: block;
    font-size: 2rem;
    color: var(--navbar-text);
    cursor: pointer;
  }

  .main-nav { display: none; }
  body.menu-open .main-nav { display: block; }

  .social-sidebar-right { display: none !important; }

  .sidebar .social {
    display: flex;
    gap: 20px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
} /* <--- Chiusura media query mobile */