/*
Theme Name: Hello Child
Template: hello-elementor
*/

/* Fade normale sul front-end */
.fade-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 2.5s ease, transform 2.5s ease;
}

.fade-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Mostra gli elementi nell'editor di Elementor */
.elementor-editor .fade-section,
.elementor-editor-active .fade-section {
  opacity: 1 !important;
  transform: none !important;
}

/* ================================
   Flip Card
   ================================ */
.flip-card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.flip-card {
  background-color: transparent;
  width: 220px;
  height: 300px;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 10px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  text-align: center;
}

.flip-card-front {
  background-color: #fff;
}

.flip-card-front img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.flip-card-back {
  background-color: #f7f7f7;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================
   Card Villa
   ================================ */
.villa-front {
  background-color: #f8f7f3;
  color: #395018;
  padding: 0;
}

.villa-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.villa-front h3 {
  padding: 10px;
  font-size: 1.2rem;
  color: #395018;
}

.villa-back {
  background-color: #e7dcc9;
  color: #6c2a2c;
  padding: 20px;
}

.villa-back h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: #395018;
}

.villa-back p {
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.btn-villa {
  display: inline-block;
  padding: 10px 18px;
  background: #3ba8b6;
  color: #fff;
  border-radius: 30px;
  text-decoration: none;
  transition: background 0.3s;
}

.btn-villa:hover {
  background: #e7a93b;
}

/* ================================
   Kedungu Banner
   ================================ */
.kedungu-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 30px;
  color: #395018;
}

.kedungu-banner-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.kedungu-banner {
  position: relative;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.kedungu-banner:hover {
  transform: scale(1.03);
}

.banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
  transition: filter 0.3s ease;
}

.kedungu-banner:hover .banner-bg {
  filter: brightness(0.5);
}

.banner-content {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
}

.banner-content h3 {
  margin-bottom: 8px;
  font-size: 1.3rem;
  color: #fff;
}

.banner-content p {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: #f8f7f3;
}

.btn-banner {
  background: #3ba8b6;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  display: inline-block;
  transition: background 0.3s ease;
}

.kedungu-banner:hover .btn-banner {
  background: #e7a93b;
  color: #395018;
}

.cta-center {
  text-align: center;
  margin-top: 40px;
}

.btn-main {
  background: #3ba8b6;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.btn-main:hover {
  background: #e7a93b;
  color: #395018;
}

html, body {
  overflow-x: hidden;
}

/* ================================
   Card container responsive
   ================================ */

.category-container {
  --cols: 5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 40px 0;
}

@media (min-width: 1024px) {
  .category-container {
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  }
}

/* ================================
   Card singola
   ================================ */
.category-card {
  background: transparent;
  perspective: 1000px; /* per effetto 3D */
}

.category-inner {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: 20px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  will-change: transform;
}

.category-card:hover .category-inner {
  transform: rotateY(180deg);
}

/* ================================
   Front & Back card
   ================================ */
.category-front,
.category-back {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.category-front {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.category-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.category-front h3 {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  margin: 0;
  padding: 15px;
  font-size: 20px;
  text-align: center;
}

.category-back {
  background: #00796b;
  color: #fff;
  transform: rotateY(180deg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.category-back p {
  font-size: 16px;
  margin-bottom: 20px;
}

.category-back a {
  display: inline-block;
  background: #fff;
  color: #00796b;
  text-decoration: none;
  padding: 12px 25px;
  border-radius: 30px;
  font-weight: bold;
  transition: 0.3s;
}

.category-back a:hover {
  background: #004d40;
  color: #fff;
}


@media (prefers-reduced-motion: reduce) {
  .category-inner {
    transition: none;
  }
}


@media (max-width: 768px) {
  .photo-slider {
    height: 40vh;
  }
}



/* Carosello Swiper */
.swiper {
  width: 100%;
  padding: 20px 0;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
}

.swiper-slide img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border: 4px solid #f8f7f3; /* bordo bianco crema */
}

.swiper-button-next,
.swiper-button-prev {
  color: #3ba8b6; /* blu piscina */
  transition: 0.3s;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  color: #e7a93b; /* giallo-oro tropicale */
}

.swiper-pagination-bullet {
  background: #395018; /* verde foresta */
  opacity: 0.6;
}

.swiper-pagination-bullet-active {
  background: #e7a93b; /* giallo-oro tropicale */
  opacity: 1;
}


/* ================================
   Container per 4 card
   ================================ */
.category-container-4 {
  --cols: 4;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 40px 0;
}

@media (min-width: 1024px) {
  .category-container-4 {
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  }
}

/* ================================
   Card singola
   ================================ */
.category-container-4 .category-card {
  background: transparent;
  perspective: 1000px;
}

.category-container-4 .category-inner {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: 20px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  will-change: transform;
}

.category-container-4 .category-card:hover .category-inner {
  transform: rotateY(180deg);
}

/* ================================
   Front & Back card
   ================================ */
.category-container-4 .category-front,
.category-container-4 .category-back {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.category-container-4 .category-front {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.category-container-4 .category-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.category-container-4 .category-front h3 {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  margin: 0;
  padding: 15px;
  font-size: 20px;
  text-align: center;
}

.category-container-4 .category-back {
  background: #00796b;
  color: #fff;
  transform: rotateY(180deg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.category-container-4 .category-back p {
  font-size: 16px;
  margin-bottom: 20px;
}

.category-container-4 .category-back a {
  display: inline-block;
  background: #fff;
  color: #00796b;
  text-decoration: none;
  padding: 12px 25px;
  border-radius: 30px;
  font-weight: bold;
  transition: 0.3s;
}

.category-container-4 .category-back a:hover {
  background: #004d40;
  color: #fff;
}



/* ================================
   Articolo a due colonne
   ================================ */
.article-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

/* Colonna contenuto principale */
.article-content {
  flex: 1 0 70%;
  background-color: #f8f7f3; /* bianco crema */
  padding: 20px;
  border-radius: 8px;
  color: #6c2a2c; /* bordeaux testo */
  line-height: 1.6;
}

.article-content h2 {
  color: #395018; /* verde foresta */
  border-left: 5px solid #83a86f; /* verde foglia */
  padding-left: 10px;
  margin-top: 1em;
}

.article-content p {
  margin-bottom: 1em;
}

.article-content a {
  color: #3ba8b6; /* blu piscina */
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

.article-content .highlight {
  color: #3ba8b6; /* blu piscina */
  font-weight: bold;
}

/* Colonna sidebar */
.article-sidebar {
  flex: 1 0 30%;
  background-color: #e7dcc9; /* sabbia chiara */
  padding: 20px;
  border-radius: 8px;
}

.article-sidebar h3 {
  color: #395018; /* verde foresta */
  margin-top: 0;
  margin-bottom: 10px;
}

.article-sidebar ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

.article-sidebar ul li {
  margin-bottom: 8px;
}

/* ================================
   Pulsante CTA definitivo
   ================================ */
.cta-button {
  display: inline-block !important;
  background-color: #3ba8b6 !important; /* blu piscina di default */
  color: #ffffff !important; /* testo bianco */
  padding: 10px 15px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  margin-top: 10px;
  transition: background 0.3s, color 0.3s;
}

.cta-button:hover {
  background-color: #e7a93b !important; /* giallo tropicale al hover */
  color: #6c2a2c !important; /* testo bordeaux al hover */
}


/* Responsivo */
@media (max-width: 900px) {
  .article-container {
    flex-direction: column;
  }
  .article-content,
  .article-sidebar {
    flex: 1 0 100%;
    padding-right: 0;
  }
}

/* Hero section opzionale per articoli */
.article-hero {
  background-color: #bdcfdd; !important; /* azzurro polveroso */
  padding: 50px 20px;
  text-align: center;
  border-radius: 10px;
  margin-bottom: 30px;
}

.article-hero h1 {
  color: #395018; /* verde foresta */
  margin-bottom: 15px;
}

.article-hero p {
  color: #6c2a2c; /* bordeaux */
  font-size: 1.1rem;
}


#back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #3ba8b6; /* blu piscina */
  color: #f8f7f3;      /* bianco crema */
  font-size: 22px;
  padding: 12px 16px;
  border-radius: 50%;
  text-align: center;
  text-decoration: none;
  display: none; /* nascosto di default, lo mostra il JS */
  z-index: 9999;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transition: all 0.3s ease;
}

#back-to-top:hover {
  background: #e7a93b; /* giallo oro */
  color: #395018;      /* verde foresta */
}

/* versione mobile */
@media (max-width: 768px) {
  #back-to-top {
    bottom: 15px;
    right: 15px;
    font-size: 18px;
    padding: 10px 12px;
    display: block !important; /* forza la visibilità se lo script non lo mostra */
  }
}
