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

html {
  scroll-behavior: smooth;
  width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: #1e1e1e;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
}

.wrapper {
  flex: 1;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

p {
  line-height: 1.8;
  text-align: justify;
}

a {
  text-decoration: none !important;
  border-bottom: none !important;
}

a:hover {
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ============================================
   HEADER FISSO - SOLUZIONE FINALE CON !IMPORTANT
   ============================================ */
#site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  transition: background 0.5s ease-in-out, box-shadow 0.5s ease-in-out !important;
  z-index: 1000 !important;
  padding: 15px 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

#site-header.transparent {
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05) !important;
  padding: 15px 0 !important;
  margin: 0 !important;
}

.header-container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.logo {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.logo a {
  display: inline-block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.logo img {
  max-height: 60px !important;
  width: auto !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ============================================
   NAVIGATION DESKTOP
   ============================================ */
@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }

  #site-navigation {
    display: flex !important;
    align-items: center;
  }

  .menu {
    display: flex !important;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
  }

  .menu li {
    margin: 0;
    padding: 0;
  }

  .menu a {
    color: #1e1e1e;
    font-size: 18px;
    padding: 10px 15px;
    display: block;
    transition: color 0.3s ease-in-out;
  }

  .menu a:hover {
    color: #a02a11;
  }

  /* Barra di ricerca desktop */
  .search-bar-container {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 15px auto 0 !important;
    padding: 0 20px !important;
    display: flex !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .search-bar {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 400px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 16px;
    border-radius: 4px;
  }

  .search-bar button {
    background: #a02a11;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: background 0.3s;
  }

  .search-bar button:hover {
    background: #831f0d;
  }
}

/* ============================================
   NAVIGATION MOBILE
   ============================================ */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #1e1e1e;
    padding: 5px;
  }

  #site-navigation {
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px 0;
    z-index: 999;
  }

  #site-navigation.open {
    display: block !important;
    animation: fadeSlideIn 0.3s ease-in-out;
  }

  .menu {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .menu li {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(160, 42, 17, 0.1);
  }

  .menu li:last-child {
    border-bottom: none;
  }

  .menu a {
    color: #1e1e1e;
    font-size: 18px;
    font-weight: 600;
    display: block;
    transition: color 0.3s ease-in-out;
  }

  .menu a:hover {
    color: #a02a11;
  }

  .menu-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #a02a11;
  }

  .search-bar {
    display: none;
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
#live-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
}

#live-search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#live-search-results li {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}

#live-search-results li:last-child {
  border-bottom: none;
}

#live-search-results li:hover {
  background: #f5f5f5;
}

#live-search-results li a {
  color: #1e1e1e;
  display: block;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a02a11 30%, #1087a0 70%);
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  margin-top: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5em;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.hero p {
  font-size: 1.2em;
  margin-bottom: 30px;
}

.hero .btn {
  display: inline-block;
  background-color: #ffe399;
  color: #1f515b;
  padding: 15px 30px;
  font-weight: bold;
  border-radius: 5px;
  transition: background 0.3s, transform 0.3s;
}

.hero .btn:hover {
  background-color: #ffffff;
  transform: scale(1.05);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  padding: 80px 2px;
  background-color: #ffffff;
  text-align: center;
}

.about .container {
  max-width: 800px;
  margin: 0 auto;
}

.about h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5em;
  color: #a02a11;
  margin-bottom: 20px;
}

.about p {
  font-size: 1.1em;
  margin-bottom: 20px;
}

.about .btn {
  background-color: #1087a0;
  color: #ffffff;
  padding: 10px 25px;
  border-radius: 5px;
  transition: background 0.3s;
}

.about .btn:hover {
  background-color: #1e1e1e;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio {
  padding: 80px 20px;
  background-color: #f5f5f5;
  text-align: center;
}

.portfolio .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.portfolio h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5em;
  color: #a02a11;
  margin-bottom: 40px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 0;
  margin: 0 auto;
  max-width: 100%;
}

.portfolio-item {
  background-color: #ffffff;
  border: 2px solid #ffe399;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  margin: 0 auto;
  width: 100%;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.portfolio-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.portfolio-item:hover img {
  transform: scale(1.03);
  opacity: 0.9;
}

.portfolio-item h3 {
  font-family: 'Montserrat', sans-serif;
  color: #a02a11;
  margin: 30px 0;
  text-align: center;
  padding: 0 15px;
}

.portfolio-item h3 a {
  color: #1e1e1e !important;
  font-weight: bold;
  transition: color 0.3s ease-in-out;
}

.portfolio-item h3 a:hover {
  color: #a02a11 !important;
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */
.testimonials {
  text-align: center;
  padding: 100px 50px;
  background-color: #f5f5f5;
}

.testimonials h2 {
  font-size: 2.5em;
  margin-bottom: 40px;
  color: #a02a11;
}

.testimonial-gallery {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  padding: 20px;
}

.testimonial-gallery img {
  width: 250px;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 1.2s ease-in-out, box-shadow 1.2s ease-in-out, opacity 1.2s ease-in-out;
  opacity: 1;
}

.testimonial-gallery img:hover {
  transform: scale(1.05) translateY(-5px);
  opacity: 0.9;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15);
}

/* ============================================
   MODAL
   ============================================ */
.modal,
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  position: relative;
}

.modal-content img,
.image-modal img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
}

.close-modal,
.image-modal .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  color: white;
  cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  background-color: #1087a0;
  color: #ffffff;
  padding: 20px 40px;
  border-radius: 8px;
  font-weight: bold;
  margin-top: 20px;
  transition: background-color 0.5s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.5s ease-in-out;
}

.btn:hover {
  background-color: #0c6e87;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn-large {
  font-size: 1.2em;
  padding: 20px 45px;
}

.pulsante-pacchetto {
  display: inline-block;
  background-color: #ffe399;
  color: white;
  padding: 10px 20px;
  text-align: center;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.pulsante-pacchetto:hover {
  background-color: #a02a11;
}

h3 a.pulsante-pacchetto {
  color: #0c6e87 !important;
}

h3 a.pulsante-pacchetto:hover {
  color: #ffffff !important;
}

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

/* ============================================
   FLOATING SOCIAL
   ============================================ */
.floating-social {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.floating-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #1e1e1e;
  color: white;
  border-radius: 50%;
  font-size: 16px;
  transition: background 0.3s, transform 0.2s;
}

.floating-social a:hover {
  background: #a02a11;
  transform: scale(1.1);
}

/* ============================================
   FOOTER
   ============================================ */
#site-footer {
  background-color: #1e1e1e;
  color: #ffffff;
  padding: 20px;
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.footer-links a {
  color: #ffe399;
  margin: 0 10px;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #1087a0;
}

.footer-copy {
  margin: 10px 0;
}

/* ============================================
   BLOG & POSTS
   ============================================ */
article {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 10px;
  padding: 20px; 5px!important;
  margin: 0 auto 40px !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out;
  max-width: 1200px;
}

/* Fix per pagine singole e pagine statiche */
.single article,
.page article,
.type-page article {
  padding: 0 !important;
  margin: 0 auto !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.post-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.post-thumbnail {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 200px auto 20px;
  width: 100%;
}

.post-thumbnail img {
  display: block;
  margin: 0 auto;
  width: 50%;
  height: auto;
}

.post-content {
  max-width: 900px;
  width: 95%;
  margin: 0 auto !important;
  padding: 30px 0 !important;
  line-height: 1.8;
  font-size: 18px;
}

/* Fix specifico per la pagina Contatti */
.page-id-43 article,
body.page article {
  margin: 0 !important;
  padding: 0 !important;
}

.page-id-43 .entry-content,
body.page .entry-content {
  max-width: 900px !important;
  margin: 30px!important; auto;
  padding: 25px; 10px!important;
}

article h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

article h2 a {
  color: #a02a11;
  transition: color 0.3s ease-in-out;
}

article h2 a:hover {
  color: #1087a0;
}

article p {
  font-size: 1rem;
  color: #333;
  line-height: 1.8;
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 15px;
  background: #1087a0;
  color: #fff;
  border-radius: 5px;
  font-weight: 600;
  transition: background 0.3s ease-in-out;
}

.read-more:hover {
  background: #1e1e1e;
}

.post-title {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #a02a11;
  text-align: center;
}

.post-meta {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 20px;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 50px auto;
  max-width: 900px;
  padding: 0 20px;
  font-size: 16px;
}

.post-navigation .prev-post,
.post-navigation .next-post {
  font-weight: bold;
  color: #1087a0;
}

.post-navigation .prev-post:hover,
.post-navigation .next-post:hover {
  color: #1e1e1e;
}

/* ============================================
   COMMENTS
   ============================================ */
.comments-area {
  display: none !important;
}

#submit {
  padding: 12px 24px;
  font-size: 18px;
  background-color: #8b0000;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

#submit:hover {
  background-color: #a00000;
}

.comment-reply-link {
  display: inline-block;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #333;
  color: white;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.comment-reply-link:hover {
  background-color: #555;
}

/* ============================================
   FORMS
   ============================================ */
.search-form {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #ccc;
  border-radius: 25px;
  padding: 5px 10px;
  background: #fff;
}

.search-field {
  border: none;
  outline: none;
  flex: 1;
  font-size: 16px;
}

.search-submit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #333;
}

.search-submit:hover {
  color: #000;
}

/* Contact Form 7 - Centratura e larghezza */
.wpcf7 {
  max-width: 600px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

.wpcf7-form {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wpcf7-form p {
  margin: 0 0 15px 0 !important;
  padding: 0 !important;
}

.wpcf7-form-control.wpcf7-text,
.wpcf7-form-control.wpcf7-email,
.wpcf7-form-control.wpcf7-textarea {
  max-width: 100% !important;
  width: 100% !important;
  padding: 10px !important;
  font-size: 16px !important;
  box-sizing: border-box !important;
  margin: 0 0 15px 0 !important;
  display: block !important;
}

.wpcf7-form-control.wpcf7-submit.has-spinner {
  width: 100px;
  height: 40px;
  margin: 20px 0;
  background-color: #a02a11;
  color: white;
  display: block;
}

input.wpcf7-form-control.wpcf7-text {
  width: 100% !important;
}

textarea.wpcf7-form-control.wpcf7-textarea {
  width: 100% !important;
}

.contact-form-wrapper {
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* ============================================
   MISC
   ============================================ */
p.vesna {
  color: #ffe399;
  font-size: 24px !important;
}

p.pacchetto {
  padding: 25px;
  font-size: 1.1em;
  text-align: justify;
}

p.cosa {
  padding: 10px 0 30px;
  line-height: 25px !important;
  font-size: 1.1em;
  color: #0c6e87;
  text-align: center !important;
}

.finale {
  padding: 40px 20px;
  background-color: #f5f5f5;
  text-align: center;
}

.finale .container {
  max-width: 1200px;
  margin: 0 auto;
}

.titolo {
  color: #ffe399;
}

.entry-title {
  display: none;
}

ul,
ol {
  padding-left: 30px;
  margin-left: 0;
}

li {
  line-height: 1.8;
}

.page-content,
.content-area {
  margin-top: 0 !important;
}

/* Padding-top già gestito sopra per le pagine non-home */

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
  /* Rimuove margin-top su mobile */
  body:not(.home):not(.front-page) article.page,
  body:not(.home):not(.front-page) article.type-page,
  body:not(.home):not(.front-page) article.single,
  body:not(.home):not(.front-page) .page,
  body:not(.home):not(.front-page) .single {
    margin-top: 0 !important;
    padding-top: 150px !important;
  }

  p.vesna {
    font-size: 20px !important;
    text-align: center;
  }

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .about p,
  .portfolio p,
  .testimonials p {
    margin-left: 15px;
    margin-right: 15px;
  }

  .hero h1,
  .hero p {
    margin-left: 20px;
    margin-right: 20px;
  }

  .btn {
    padding: 15px 30px;
  }

  /* FIX PORTFOLIO GRID SU MOBILE */
  .portfolio {
    padding: 80px 15px !important;
  }

  .portfolio .container {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
  }

  .portfolio-grid {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .portfolio-item {
    margin: 0 auto !important;
    max-width: 400px !important;
    width: 100% !important;
  }

  .post-thumbnail img {
    width: 50%;
  }

  .post-content {
    max-width: 95% !important;
    width: 95% !important;
    padding: 20px 0 !important;
    text-align: center;
  }

  .post-navigation {
    max-width: 95% !important;
    padding: 0 !important;
  }

  .nft {
    font-size: calc(100% - 2px);
  }

  .contact-form {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 15px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .wpcf7 {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }

  .wpcf7-form {
    padding: 0 !important;
  }

  .contact-form input,
  .contact-form textarea,
  .wpcf7-form-control.wpcf7-text,
  .wpcf7-form-control.wpcf7-email,
  .wpcf7-form-control.wpcf7-textarea {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px !important;
    padding: 12px !important;
    font-size: 16px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
  }

  .contact-form button,
  .wpcf7-form-control.wpcf7-submit {
    width: 100% !important;
    padding: 14px !important;
    font-size: 16px !important;
    background-color: #a02a11 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
  }

  .contact-form button:hover {
    background-color: #831f0d !important;
  }

  .contact-form-wrapper {
    max-width: 100% !important;
    padding: 0 15px !important;
  }

  body:not(.home):not(.front-page) {
    margin-top: 10px !important;
  }

  .wp-block-media-text__media img,
  .wp-block-media-text__media video {
    margin-bottom: 20px !important;
  }

  .wp-block-media-text > .wp-block-media-text__content {
    padding: 0 3%;
  }

  body {
    padding: 0 15px !important;
  }

  .container,
  .about .container,
  .page,
  .entry-content,
  .site-content {
    padding-left: 2px !important;
    padding-right: 2px !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }
}