/*
Theme Name: Studio Sottocasa 2026
Theme URI: https://www.studiosottocasa.it
Author: Giacomo Sottocasa
Author URI: https://studiosottocasa.it
Description: Tema personalizzato per Studio Legale Sottocasa – design blu/beige, moderno e aggressivo.
Version: 1.0
License: GPL-2.0-or-later
Text Domain: studio-sottocasa-2026
*/

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'EB Garamond', 'Times New Roman', serif;
  background: #0a1929;
  color: #d4c5b0;
  line-height: 1.6;
  font-size: 1.1rem;
}

a { color: #c7a04a; text-decoration: none; transition: color 0.2s; }
a:hover { color: #e8d5b6; }

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
.main-header {
  background: #0a1929;
  border-bottom: 2px solid #c7a04a;
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-link {
  display: flex;
  flex-direction: row;          /* orizzontale */
  align-items: center;          /* centra verticalmente */
  gap: 1.2rem;
  text-decoration: none;
}

.logo-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #c7a04a;
  box-shadow: 0 0 15px rgba(199,160,74,0.3);
  flex-shrink: 0;               /* non si restringe */
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.logo-circle:hover {
  transform: scale(1.05);
}
.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-line1,
.brand-line2,
.brand-line3 {
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}
.brand-line1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}
.brand-line2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #c7a04a;
}
.brand-line3 {
  font-size: 2rem;
  font-weight: 900;
  color: #e8d5b6;
}

/* === HAMBURGER BUTTON === */
.menu-toggle {
  display: none;               /* nascosto su desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: #c7a04a;
  margin: 5px 0;
  transition: 0.3s;
}

/* === MENU PRINCIPALE === */
.main-nav > ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav > ul > li {
  position: relative;
  margin-right: 2rem;
  list-style: none;
}
.main-nav > ul > li:last-child {
  margin-right: 0;
}
.main-nav a {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #b8a58a;
  transition: color 0.2s;
  display: block;
  padding: 0.4rem 0;
  white-space: nowrap;
}
.main-nav a:hover {
  color: #c7a04a;
}

/* === SOTTOMENU COMPATTO === */
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #0a1929;
  border: 1px solid #c7a04a;
  border-top: 2px solid #c7a04a;
  min-width: 180px;
  z-index: 1000;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  flex-direction: column;
  padding: 0.15rem 0;
  margin: 0;
  list-style: none;
}
.main-nav .sub-menu li {
  width: 100%;
  margin: 0;
  list-style: none;
}
.main-nav .sub-menu a {
  padding: 0.25rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #b8a58a;
  border-bottom: 1px solid rgba(199,160,74,0.15);
  white-space: nowrap;
  display: block;
}
.main-nav .sub-menu a:hover {
  background: #112233;
  color: #e8d5b6;
}

/* Mostra al passaggio del mouse */
.main-nav li:hover > .sub-menu {
  display: flex;
}

/* Sottomenu di secondo livello (se presente) */
.main-nav .sub-menu .sub-menu {
  top: -2px;
  left: 100%;
  border-top: 1px solid #c7a04a;
}

/* ========== HERO ========== */
.hero {
  height: 35vh;
  display: flex;
  align-items: center;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,25,41,0.92) 0%, rgba(10,25,41,0.70) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}
.hero h2 {
  font-family: 'EB Garamond', serif;
  font-size: 4rem;
  font-weight: 500;
  color: #e8d5b6;
  line-height: 1.15;
  margin-bottom: 1.8rem;
  letter-spacing: 0.5px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
.hero p {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  color: #c7b186;
  max-width: 650px;
  margin-bottom: 2rem;
}


/* ========== SECTIONS ========== */
.sezione-titolo {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  color: #c7a04a;
  text-align: center;
  margin: 4rem 0 2.5rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}
.sezione-titolo::after {
  content: '';
  display: block;
  width: 100px;
  height: 2px;
  background: #c7a04a;
  margin: 1rem auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.card {
  background: #112233;
  border-radius: 2px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  border-bottom: 3px solid transparent;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(199,160,74,0.25);
  border-bottom-color: #c7a04a;
}


/* ========== CARD IMMAGINI ========== */

/* Contenitore dell'immagine */
.card-img {
  height: 200px;                     /* altezza fissa */
  overflow: hidden;                  /* nasconde l'eventuale eccesso */
  position: relative;
  background-size: cover;            /* copre tutto il contenitore */
  background-position: 50% 0px;          /* allinea l'immagine in alto */
  background-repeat: no-repeat;
}

/* Immagini con tag <img> (es. Scèvola) */
.card-img img {
  width: 100%;                       /* si adatta alla larghezza della card */
  height: 100%;                      /* riempie l'altezza del contenitore */
  object-fit: cover;                 /* ritaglia mantenendo le proporzioni */
  object-position: 50% 0px              /* allinea in alto */
  display: block;
}

/* Placeholder per card senza immagine */
.placeholder-img {
  background: #1a2a3a;
  background-image: repeating-linear-gradient(
    45deg,
    #1a2a3a 0px,
    #1a2a3a 10px,
    #253545 10px,
    #253545 20px
  );
}
.card-img[style*="background-image"] {
  background-size: cover;
  background-position: 50% 0px
}

.card-body {
  padding: 1.8rem;
}
.category-badge,
.card .category-badge,
.card-body .category-badge {
  display: inline-block;
  background: #c7a04a;
  color: #ffffff !important;          /* testo bianco */
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.9rem;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.category-badge a,
.card .category-badge a,
.card-body .category-badge a {
  color: #ffffff !important;          /* link bianchi */
  font-weight: 700;
  text-decoration: none;
}

.category-badge a:hover,
.card .category-badge a:hover,
.card-body .category-badge a:hover {
  color: #0a1929 !important;          /* al passaggio del mouse, testo scuro per feedback visivo */
}
.card h3 {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.card h3 a { color: #e8d5b6; }
.card h3 a:hover { color: #c7a04a; }
.card .excerpt {
  color: #9a8c7a;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.card time {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  color: #8a7a65;
  display: block;
}

.btn {
  display: inline-block;
  background: #c7a04a;
  color: #0a1929;
  padding: 0.9rem 2.8rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: none;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: #e0b861; transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  border: 2px solid #c7a04a;
  color: #c7a04a;
  margin: 2rem auto;
  display: table;
}
.btn-outline:hover { background: #c7a04a; color: #0a1929; }

/* ========== FOOTER ========== */
.main-footer {
  background: #06121f;
  text-align: center;
  padding: 2.5rem 0;
  margin-top: 4rem;
  border-top: 1px solid #1a2a3a;
}
.main-footer p { color: #8a7a65; font-size: 0.95rem; }
.main-footer strong { color: #c7a04a; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {

  /* --- HEADER --- */
  .header-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }

  .brand-link {
    gap: 0.8rem;
  }

  .logo-circle {
    width: 60px;
    height: 60px;
  }

  .brand-line1 {
    font-size: 1rem;
  }
  .brand-line2 {
    font-size: 0.8rem;
  }
  .brand-line3 {
    font-size: 1.4rem;
  }

  /* Hamburger visibile */
  .menu-toggle {
    display: block;
  }

  /* Menu principale: nascosto di default, visibile quando .open */
  .main-nav ul {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .main-nav.open ul {
    display: flex;
  }

  .main-nav > ul > li {
    margin-right: 0;
    margin-bottom: 0.2rem;
  }

  .main-nav a {
    padding: 0.7rem 1rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(199,160,74,0.2);
  }

  /* Sottomenu mobile */
  .main-nav .sub-menu {
    position: static;
    background: #0a1929;
    border: none;
    border-top: 1px solid #c7a04a;
    box-shadow: none;
    display: none;
    width: 100%;
    min-width: unset;
    padding: 0.2rem 0;
    margin: 0;
  }

  .main-nav .sub-menu.open {
    display: flex;
  }

  .main-nav .sub-menu a {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
  }

  /* --- HERO --- */
  .hero {
    height: 40vh;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }
.hero-content {
    max-width: 100%;
    padding: 0 20px;
}

  /* --- SEZIONI E CARD --- */
  .sezione-titolo {
    font-size: 1.6rem;
    margin: 2.5rem 0 1.5rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;      /* una card per riga */
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .card-body {
    padding: 1.2rem;
  }

  .card h3 {
    font-size: 1.3rem;
  }

  .card .excerpt {
    font-size: 0.9rem;
  }

  /* --- BOTTONI --- */
  .btn {
    padding: 0.7rem 2rem;
    font-size: 0.8rem;
  }

  .btn-outline {
    margin: 1.5rem auto;
  }

  /* --- FOOTER --- */
  .main-footer {
    padding: 1.8rem 0;
    margin-top: 2rem;
  }

  /* --- PAGINAZIONE E LINK EDIT --- */
  .paginazione .page-numbers {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  .edit-link {
    text-align: center;
  }

  .edit-link a {
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
  }

  /* --- HERO PAGINE INTERNE (COMPETENZE, PROFESSIONISTI, CONTATTI) --- */
  .page-template-page-aree-competenza .hero,
  .page-template-page-professionisti .hero,
  .page-template-page-contatti .hero {
    height: 35vh;
  }
}


/** ALTRO --- */
/* Paginazione */
.paginazione .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    background: #112233;
    color: #b8a58a;
    border: 1px solid #1a2a3a;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    transition: 0.2s;
}
.paginazione .page-numbers:hover {
    background: #c7a04a;
    color: #0a1929;
}
.paginazione .page-numbers.current {
    background: #c7a04a;
    color: #0a1929;
    border-color: #c7a04a;
}

/* Link Modifica per admin */
.edit-link {
    margin: 0.5rem 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.edit-link a {
    display: inline-block;
    background: #c7a04a;
    color: #0a1929;
    padding: 0.3rem 1rem;
    border-radius: 2px;
    text-decoration: none;
    transition: background 0.2s;
}
.edit-link a:hover {
    background: #e0b861;
    color: #0a1929;
}
