/* =========================================
   1. LA BASE DARK E PROPAGAZIONE HOME (#ffffff Celestiale)
   ========================================= */
:root {
  --bg-color: #1a1614;       /* Marrone scurissimo/antracite */
  --text-color: #ffffff;     /* Bianco puro angelico */
  --accent-color: #ffffff;   /* Colore principale scritte della Home */
  --font-main: 'Georgia', serif;

  --glow-light: drop-shadow(0px 0px 15px rgba(255, 255, 255, 0.5));
}

/* =========================================
   2. VIBES E PROPAGAZIONE COLORE PER CATEGORIA
   ========================================= */

/* Home: (#ffffff) */
.theme-home {
  --accent-color: #ffffff;
  --glow-light: drop-shadow(0px 0px 15px rgba(255, 255, 255, 0.5));
}

/* Recipes: #bd5420 (Arancio ruggine/terra di siena spento) */
.theme-recipes { 
  --accent-color: #bd5420; 
  --glow-light: drop-shadow(0px 0px 14px rgba(224, 133, 83, 0.45));
}

/* Witches: #682d7a (Viola scuro desaturato) */
.theme-witches { 
  --accent-color: #682d7a; 
  --glow-light: drop-shadow(0px 0px 14px rgba(161, 97, 181, 0.45));
}

/* Routine: #40628a (Blu notte spento) */
.theme-routine { 
  --accent-color: #40628a; 
  --glow-light: drop-shadow(0px 0px 14px rgba(113, 147, 188, 0.45));
}

/* TV and Movies: #782832 (Bordeaux scuro) */
.theme-tv-and-movies { 
  --accent-color: #782832; 
  --glow-light: drop-shadow(0px 0px 14px rgba(173, 82, 94, 0.45));
}

/* Holidays: #6d7f5a */
.theme-holidays { 
  --accent-color: #6d7f5a; 
  --glow-light: drop-shadow(0px 0px 14px rgba(143, 168, 120, 0.45));
}

/* Diary: #f5ece1 (Avorio Lino) */
.theme-diary { 
  --accent-color: #f5ece1; 
  --glow-light: drop-shadow(0px 0px 14px rgba(245, 236, 225, 0.45));
}

/* =========================================
   3. STILI GENERALI E HEADER
   ========================================= */

h1, h2, h3, h4, .site-header h1, .site-header nav a {
  color: var(--accent-color);
  filter: var(--glow-light);
  font-weight: normal;
  transition: filter 0.3s ease, transform 0.3s ease, color 0.4s ease;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  transition: all 0.4s ease-in-out; 
}

.site-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px 0 20px 0;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  z-index: 10;
}

/* TITOLO HEADER CON ALI (#f9f8f5) */
.site-header h1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0px; 
  margin: 0 0 15px 0;
  font-size: 2.8em;
  letter-spacing: 2px;
}

.site-header h1::before,
.site-header h1::after {
  content: "";
  display: inline-block;
  width: 110px;
  height: 110px;
  background: #f9f8f5;
  -webkit-mask: url('../images/ali.png') no-repeat center / contain;
  mask: url('../images/ali.png') no-repeat center / contain;
  filter: drop-shadow(0px 0px 14px rgba(249, 248, 245, 0.35));
  flex-shrink: 0;
  position: relative;
  top: -12px;
}

.site-header h1::before {
  transform: none;
  margin-right: -15px;
}

.site-header h1::after {
  transform: scaleX(-1);
  margin-left: -15px;
}

.site-header nav a {
  display: inline-block;
  margin: 0 12px;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid transparent;
}

.site-header nav a:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0px 0px 18px rgba(255, 255, 255, 0.6));
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 40px 20px;
  position: relative;
  z-index: 10;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-bottom 0.3s, color 0.3s;
}

a:hover {
  border-bottom: 1px dashed var(--accent-color);
}

/* =========================================
   4. LAYOUT HOME & GRIGLIA POST
   ========================================= */

.section-title {
  font-size: 2em;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.post-card {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
}

.post-card-image-wrapper {
  display: block;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: #110e0d;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.05);
}

.post-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1614 0%, #280d08 100%);
}

.post-card-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-category {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.7;
  margin-bottom: 6px;
  display: block;
}

.post-card-title {
  margin: 0 0 10px 0;
  font-size: 1.2em;
  line-height: 1.3;
}

.post-card-date {
  margin-top: auto;
  font-size: 0.8em;
  opacity: 0.5;
}

/* =========================================
   5. DECORAZIONI DI SFONDO
   ========================================= */

.decor-home, .decor-recipes, .decor-witches, .decor-routine, .decor-tv-and-movies, .decor-holidays, .decor-diary {
  display: none;
  position: fixed;
  pointer-events: none;
  z-index: -1;
  opacity: 0.7;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* Attivazione visibilità decorazioni di categoria */
body.theme-home .decor-home, .theme-home .decor-home { display: block; }
body.theme-recipes .decor-recipes, .theme-recipes .decor-recipes { display: block; }
body.theme-witches .decor-witches, .theme-witches .decor-witches { display: block; }
body.theme-routine .decor-routine, .theme-routine .decor-routine { display: block; }
body.theme-tv-and-movies .decor-tv-and-movies, .theme-tv-and-movies .decor-tv-and-movies { display: block; }
body.theme-holidays .decor-holidays, .theme-holidays .decor-holidays { display: block; }
body.theme-diary .decor-diary, .theme-diary .decor-diary { display: block; }

/* -----------------------------------------
   CORNER MARGINS (Bianco Puro Celestiale #ffffff)
   ----------------------------------------- */

.decor-margine1 {
  position: fixed;
  top: 0;
  left: 0;
  width: 180px;
  height: 180px;
  background-color: #ffffff;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
  z-index: -1;
  -webkit-mask: url('../images/margine1.png') no-repeat top left / contain;
  mask: url('../images/margine1.png') no-repeat top left / contain;
}

.decor-margine2 {
  position: fixed;
  top: 0;
  right: 0;
  width: 180px;
  height: 180px;
  background-color: #ffffff;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
  z-index: -1;
  -webkit-mask: url('../images/margine2.png') no-repeat top right / contain;
  mask: url('../images/margine2.png') no-repeat top right / contain;
}

.decor-margine3 {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 180px;
  height: 180px;
  background-color: #ffffff;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
  z-index: -1;
  -webkit-mask: url('../images/margine3.png') no-repeat bottom left / contain;
  mask: url('../images/margine3.png') no-repeat bottom left / contain;
}

/* -----------------------------------------
   ELEMENTI GRAFICI SPECIFICI DI CATEGORIA (IN BASSO A DESTRA)
   ----------------------------------------- */

.decor-luna {
  bottom: 0;
  right: 0;
  width: 220px;
  height: 280px;
  background-color: var(--accent-color);
  transition: background-color 0.4s ease;
  -webkit-mask: url('../images/luna.png') no-repeat bottom right / contain;
  mask: url('../images/luna.png') no-repeat bottom right / contain;
}

.decor-libri {
  bottom: 0;
  right: 0;
  width: 220px;
  height: 280px;
  background-color: var(--accent-color);
  transition: background-color 0.4s ease;
  -webkit-mask: url('../images/libri.png') no-repeat bottom right / contain;
  mask: url('../images/libri.png') no-repeat bottom right / contain;
}

.decor-magia1 {
  bottom: 25px;
  right: 30px;
  width: 210px;
  height: 270px;
  background-color: var(--accent-color);
  transition: background-color 0.4s ease;
  -webkit-mask: url('../images/magia1.png') no-repeat bottom right / contain;
  mask: url('../images/magia1.png') no-repeat bottom right / contain;
}

.decor-ventaglio {
  bottom: 25px;
  right: 30px;
  width: 160px;
  height: 205px;
  background-color: var(--accent-color);
  transition: background-color 0.4s ease;
  -webkit-mask: url('../images/ventaglio.png') no-repeat bottom right / contain;
  mask: url('../images/ventaglio.png') no-repeat bottom right / contain;
}

.decor-tv {
  bottom: 10px;
  right: 15px;
  width: 180px;
  height: 230px;
  background-color: var(--accent-color);
  transition: background-color 0.4s ease;
  -webkit-mask: url('../images/tv.png') no-repeat bottom right / contain;
  mask: url('../images/tv.png') no-repeat bottom right / contain;
}

.decor-finestra {
  bottom: 10px;
  right: 15px;
  width: 175px;
  height: 225px;
  background-color: var(--accent-color);
  transition: background-color 0.4s ease;
  -webkit-mask: url('../images/finestra.png') no-repeat bottom right / contain;
  mask: url('../images/finestra.png') no-repeat bottom right / contain;
}

.decor-lettera2 {
  bottom: 25px;
  right: 35px;
  width: 150px;
  height: 190px;
  background-color: var(--accent-color);
  transition: background-color 0.4s ease;
  -webkit-mask: url('../images/lettera2.png') no-repeat bottom right / contain;
  mask: url('../images/lettera2.png') no-repeat bottom right / contain;
}

/* =========================================
   6. RESPONSIVE / GESTIONE SOVRAPPOSIZIONI
   ========================================= */

@media (max-width: 1400px) {
  .decor-margine1, .decor-margine2, .decor-margine3 {
    width: 130px;
    height: 130px;
    opacity: 0.4;
  }
  
  .decor-luna, .decor-libri, .decor-magia1, .decor-tv, .decor-finestra {
    width: 150px;
    height: 190px;
    opacity: 0.4;
  }

  .decor-ventaglio, .decor-lettera2 {
    width: 120px;
    height: 150px;
    opacity: 0.4;
  }
}

@media (max-width: 1100px) {
  .decor-home, .decor-recipes, .decor-witches, .decor-routine, .decor-tv-and-movies, .decor-holidays, .decor-diary,
  .decor-margine1, .decor-margine2, .decor-margine3 {
    display: none !important;
  }

  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}