/*
  Modern SmokeStyle Theme - Custom CSS
  Palette: main #276F4D, dark #181c1f, light #f8f9fa, smoke #e0e0e0
  Font: 'Manrope', 'Playfair', 'Montserrat'
*/
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&family=Playfair+Display:wght@700&display=swap');

/* === FONT & BASE === */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&family=Figtree:wght@400;700&display=swap');
body {
  font-family: 'Figtree', 'Outfit', Arial, sans-serif;
  background: #f6f7f8;
  color: #23272f;
  font-size: 1.08rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}
h1, h2, h3, h4, h5, h6, .card-title {
  font-family: 'Outfit', 'Figtree', Arial, sans-serif;
  color: #276F4D;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* === LINK === */
a {
  color: #276F4D;
  text-decoration: none;
  transition: color 0.18s, text-shadow 0.18s;
}
a:hover, a:focus {
  color: #1b4d36;
  text-shadow: 0 2px 8px #276F4D22;
  text-decoration: underline;
}

/* === NAVBAR === */
.navbar {
  background: #fff !important;
  box-shadow: 0 2px 16px 0 rgba(39,111,77,0.08);
  border-bottom: 1.5px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 1030;
  animation: fadeInDown 0.7s cubic-bezier(.4,0,.2,1);
}
.navbar .nav-link {
  color: #23272f !important;
  font-weight: 700;
  font-size: 1.13em;
  letter-spacing: 0.03em;
  padding: 0.7em 1.2em;
  border-radius: 0.7em;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.navbar .nav-link.active, .navbar .nav-link:hover {
  color: #fff !important;
  background: #276F4D;
  box-shadow: 0 2px 12px #276F4D33;
}
.navbar-brand img {
  height: 40px;
  filter: drop-shadow(0 2px 8px #276F4D22);
  transition: filter 0.2s, transform 0.2s;
}
.navbar-brand img:hover {
  filter: drop-shadow(0 4px 16px #276F4D44);
  transform: scale(1.07) rotate(-2deg);
}

/* === NAVBAR DROPDOWN === */
.navbar .dropdown-menu {
  border-radius: 0.7em;
  box-shadow: 0 2px 16px #276F4D22;
  background: #fff;
  padding: 0.5em 0.2em;
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
}
.navbar .dropdown-item {
  font-size: 1.08em;
  font-weight: 500;
  color: #276F4D;
  border-radius: 0.5em;
  padding: 0.7em 1.2em;
  transition: background 0.18s, color 0.18s;
}
.navbar .dropdown-item:hover, .navbar .dropdown-item:focus {
  background: #eaf6f3;
  color: #181c1f;
}
@media (max-width: 991.98px) {
  .navbar .navbar-collapse {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 1.2em 1.2em;
    box-shadow: 0 8px 32px #276F4D11;
    padding: 1.2em 0 0.7em 0;
    margin-top: 0.2em;
    z-index: 1099;
  }
  .navbar .navbar-collapse.show {
    display: block !important;
  }
  .navbar-nav.flex-row {
    display: none !important;
    flex-direction: column !important;
    gap: 0.2em;
    align-items: stretch;
    width: 100%;
  }
  .navbar-collapse.show .navbar-nav.flex-row {
    display: flex !important;
  }
  .navbar .nav-link {
    padding: 1em 1.2em;
    font-size: 1.13em;
    border-radius: 0.7em;
    text-align: left;
  }
  .navbar .dropdown-menu {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    margin-top: 0.2em;
    border-radius: 0.7em;
    box-shadow: 0 2px 16px #276F4D22;
  }
  .navbar .navbar-brand img {
    height: 32px;
  }
  .navbar form#searchForm {
    width: 100%;
    margin-top: 1em;
    margin-left: 0;
    margin-right: 0;
    display: none;
  }
  .navbar-collapse.show form#searchForm {
    display: flex;
  }
}

/* Hamburger icon custom (optional, for more visible icon) */
.navbar-toggler {
  border: none;
  background: transparent !important;
  padding: 0.5em 0.7em;
  font-size: 1.7em;
  box-shadow: none !important;
}
.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 2px #276F4D33;
}

/* === HERO/CAROUSEL === */
.hero-carousel {
  background: linear-gradient(120deg, #eaf6f3 60%, #f6f7f8 100%);
  padding: 2.2rem 0 1.5rem 0;
  text-align: center;
  border-radius: 1.2rem;
  margin-bottom: 2.2rem;
  box-shadow: 0 8px 40px 0 #276F4D11;
  position: relative;
  animation: fadeIn 1.2s cubic-bezier(.4,0,.2,1);
}
.hero-carousel .carousel-inner {
  border-radius: 1.2rem;
  box-shadow: 0 4px 32px 0 #276F4D11;
}
.hero-carousel .carousel-item img {
  max-height: 300px;
  object-fit: cover;
  width: 100%;
  border-radius: 1.2rem;
  transition: filter 0.3s;
}
.hero-carousel .carousel-item img:hover {
  filter: brightness(0.95) saturate(1.1) blur(1px);
}
.hero-carousel .carousel-caption {
  background: rgba(39,111,77,0.85);
  color: #fff;
  border-radius: 1em;
  padding: 1em 1.2em;
  left: 5%;
  right: 5%;
  bottom: 1.2em;
  font-family: 'Figtree', Arial, sans-serif;
  font-size: 1.08em;
  box-shadow: 0 2px 16px 0 #276F4D33;
  animation: fadeInUp 1.1s cubic-bezier(.4,0,.2,1);
}

/* === CARD ARTICOLO === */
.card {
  border: none;
  border-radius: 1.2rem;
  box-shadow: 0 4px 32px 0 #276F4D11;
  background: #fff;
  transition: transform 0.22s, box-shadow 0.22s;
  overflow: hidden;
  position: relative;
  animation: fadeInUp 0.7s cubic-bezier(.4,0,.2,1);
}
.card:hover {
  transform: translateY(-6px) scale(1.03) rotate(-1deg);
  box-shadow: 0 12px 48px 0 #276F4D22;
  border: 2px solid #276F4D33;
}
.card-img-top {
  border-top-left-radius: 1.2rem;
  border-top-right-radius: 1.2rem;
  object-fit: cover;
  min-height: 120px;
  max-height: 180px;
  background: #eaf6f3;
  transition: filter 0.22s;
}
.card:hover .card-img-top {
  filter: brightness(0.97) saturate(1.1);
}
.card-body {
  padding: 1.2rem 1rem 1rem 1rem;
}
.card-title {
  font-size: 1.18rem;
  margin-bottom: 0.6rem;
  color: #276F4D !important;
  font-family: 'Outfit', 'Figtree', Arial, sans-serif;
}
.card-footer {
  background: #f8f9fa;
  color: #4a5a6a;
  border-top: none;
}

/* === CARD ARTICOLO INTERAMENTE CLICCABILE === */
.article-card-hover {
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s;
  position: relative;
}
.article-card-hover .stretched-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: none;
  border: none;
  text-indent: -9999px;
  outline: none;
}
.article-card-hover:hover, .article-card-hover:focus-within {
  box-shadow: 0 12px 48px 0 #276F4D22, 0 0 0 2px #276F4D33;
  transform: translateY(-6px) scale(1.03) rotate(-1deg);
}
.article-card-hover .btn {
  position: relative;
  z-index: 3;
}

/* === BUTTONS === */
.btn-primary, .btn-outline-primary {
  font-family: 'Outfit', 'Figtree', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.08em;
  border-radius: 2em;
  padding: 0.55em 1.5em;
  letter-spacing: 0.01em;
  background: #276F4D !important;
  color: #fff !important;
  border: none;
  box-shadow: 0 2px 8px 0 #276F4D22;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
  animation: fadeIn 0.7s cubic-bezier(.4,0,.2,1);
}
.btn-outline-primary {
  background: #fff !important;
  color: #276F4D !important;
  border: 2px solid #276F4D !important;
}
.btn-primary:hover, .btn-outline-primary:hover {
  background: #1b4d36 !important;
  color: #fff !important;
  box-shadow: 0 4px 16px 0 #276F4D33;
  transform: scale(1.04);
}

/* === BREADCRUMB === */
.breadcrumb {
  background: #fff;
  border-radius: 1em;
  box-shadow: 0 2px 8px #276F4D11;
  padding: 0.7em 1.2em;
  margin-bottom: 2.2em;
  font-size: 1.08em;
  font-family: 'Figtree', Arial, sans-serif;
  animation: fadeInDown 0.7s cubic-bezier(.4,0,.2,1);
}
.breadcrumb-item + .breadcrumb-item::before {
  color: #b7e2c7;
}
.breadcrumb-item.active {
  color: #276F4D;
  font-weight: 700;
}

/* === SEARCH DROPDOWN - Migliorata per evitare overflow e copertura eccessiva */
.search-results-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  max-height: 340px;
  min-width: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid #eaf6f3;
  border-radius: 1em;
  box-shadow: 0 4px 24px 0 #276F4D22;
  font-family: 'Figtree', Arial, sans-serif;
  z-index: 1050;
  padding: 0.5em 0;
  margin-top: 0.2em;
  display: none;
}
.search-results-dropdown.active {
  display: block;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.7em;
  color: #23272f;
  font-size: 1em;
  border-bottom: 1px solid #f4f6f5;
  transition: background 0.15s, color 0.15s;
  border-radius: 0.7em;
  padding: 0.5em 1em;
  cursor: pointer;
  min-height: 48px;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 0.5em;
  box-shadow: 0 2px 8px #276F4D11;
  flex-shrink: 0;
}
.search-result-item:hover, .search-result-item:focus {
  background: #eaf6f3;
  color: #276F4D;
}
@media (max-width: 575px) {
  .search-results-dropdown {
    min-width: 140px;
    max-height: 220px;
    font-size: 0.95em;
    left: 0;
    right: 0;
  }
  .search-result-item img {
    width: 28px;
    height: 28px;
  }
}

/* === SLIDER CATEGORIE === */
.category-slider-wrapper {
  position: relative;
  margin-bottom: 2.5rem;
}
.category-slider {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 1.2rem;
  padding-bottom: 1.5rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
.category-slider::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.category-card {
  scroll-snap-align: start;
  transition: box-shadow 0.22s, transform 0.22s;
  border-radius: 1.2rem;
  box-shadow: 0 4px 32px 0 #276F4D11;
  background: #fff;
  min-width: 280px;
  max-width: 95vw;
  border: none;
  position: relative;
}
.category-card:hover {
  box-shadow: 0 12px 48px 0 #276F4D33;
  transform: translateY(-6px) scale(1.04) rotate(-1deg);
  border: 2px solid #276F4D33;
  z-index: 2;
}
.category-card .badge {
  background: #276F4D;
  color: #fff;
  font-size: 0.98em;
  border-radius: 0.7em;
  padding: 0.4em 1em;
  margin-bottom: 0.5em;
}
.category-placeholder {
  background: #eaf6f3;
  color: #276F4D;
  font-size: 2.5em;
  border-top-left-radius: 1.2rem;
  border-top-right-radius: 1.2rem;
}
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 2px solid #276F4D;
  color: #276F4D;
  border-radius: 50%;
  width: 2.5em;
  height: 2.5em;
  font-size: 1.5em;
  box-shadow: 0 2px 8px #276F4D22;
  cursor: pointer;
  z-index: 10;
  transition: background 0.18s, color 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.slider-arrow.left { left: -1.2em; }
.slider-arrow.right { right: -1.2em; }
.slider-arrow:hover { background: #276F4D; color: #fff; }
@media (max-width: 991px) {
  .category-card { min-width: 220px; }
  .slider-arrow { width: 2em; height: 2em; font-size: 1.2em; }
  .slider-arrow.left { left: 0; }
  .slider-arrow.right { right: 0; }
}
@media (max-width: 575px) {
  .category-card { min-width: 160px; }
  .slider-arrow { display: none; }
}

/* === ADMIN BACKEND MODERN === */
.admin-bg {
  background: linear-gradient(120deg, #eaf6f3 60%, #f6f7f8 100%) !important;
  min-height: 100vh;
}
.admin-navbar {
  background: #23272f !important;
  color: #fff !important;
  border-bottom: 3px solid #276F4D;
  box-shadow: 0 2px 16px 0 #276F4D22;
  font-family: 'Outfit', 'Figtree', Arial, sans-serif;
}
.admin-navbar .navbar-brand {
  font-weight: 900;
  font-size: 1.3em;
  letter-spacing: 0.04em;
  color: #b7e2c7 !important;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.admin-navbar .navbar-brand::before {
  content: '🛠️';
  font-size: 1.2em;
}
.admin-navbar .nav-link {
  color: #eaf6f3 !important;
  font-weight: 700;
  font-size: 1.08em;
  border-radius: 0.7em;
  margin-left: 0.2em;
  margin-right: 0.2em;
  transition: background 0.18s, color 0.18s;
}
.admin-navbar .nav-link.active, .admin-navbar .nav-link:hover {
  background: #276F4D;
  color: #fff !important;
}
.admin-navbar .nav-link.text-danger {
  color: #ff6b6b !important;
}
.admin-card {
  border-radius: 1.2rem;
  box-shadow: 0 4px 32px 0 #276F4D11;
  background: #fff;
  border: none;
  margin-bottom: 2rem;
  animation: fadeInUp 0.7s cubic-bezier(.4,0,.2,1);
}
.admin-table {
  background: #fff;
  border-radius: 1em;
  box-shadow: 0 2px 16px #276F4D11;
  overflow-x: auto;
  font-size: 1.04em;
}
.admin-table th {
  background: #276F4D;
  color: #fff;
  font-weight: 700;
  border: none;
}
.admin-table td, .admin-table th {
  padding: 0.7em 1em;
  vertical-align: middle;
}
.admin-table tr {
  border-bottom: 1.5px solid #eaf6f3;
}
.admin-table tr:last-child {
  border-bottom: none;
}
.admin-table .btn {
  font-size: 0.98em;
  border-radius: 2em;
  padding: 0.4em 1.1em;
}
.admin-table .btn-outline-primary {
  border: 2px solid #276F4D !important;
  color: #276F4D !important;
  background: #fff !important;
}
.admin-table .btn-outline-primary:hover {
  background: #276F4D !important;
  color: #fff !important;
}
.admin-table .btn-outline-warning {
  border: 2px solid #f7b731 !important;
  color: #f7b731 !important;
  background: #fff !important;
}
.admin-table .btn-outline-warning:hover {
  background: #f7b731 !important;
  color: #fff !important;
}
.admin-table .btn-outline-danger {
  border: 2px solid #ff6b6b !important;
  color: #ff6b6b !important;
  background: #fff !important;
}
.admin-table .btn-outline-danger:hover {
  background: #ff6b6b !important;
  color: #fff !important;
}
.admin-table .badge {
  font-size: 1em;
  border-radius: 0.7em;
  padding: 0.4em 1em;
}
.admin-table .badge.bg-success {
  background: #276F4D;
  color: #fff;
}
.admin-table .badge.bg-warning {
  background: #f7b731;
  color: #23272f;
}
.admin-table .badge.bg-secondary {
  background: #b7e2c7;
  color: #23272f;
}
.admin-table .badge.bg-danger {
  background: #ff6b6b;
  color: #fff;
}
.admin-table .badge.bg-info {
  background: #4fc3f7;
  color: #23272f;
}
.admin-table .badge.bg-dark {
  background: #23272f;
  color: #fff;
}
.admin-table .badge.bg-primary {
  background: #276F4D;
  color: #fff;
}
.admin-table .badge.bg-light {
  background: #eaf6f3;
  color: #276F4D;
}
.admin-table .badge.bg-muted {
  background: #e0e0e0;
  color: #23272f;
}
.admin-table .badge {
  font-size: 1em;
  border-radius: 0.7em;
  padding: 0.4em 1em;
}
@media (max-width: 991px) {
  .admin-table th, .admin-table td { font-size: 0.98em; padding: 0.5em 0.5em; }
  .admin-card { border-radius: 1em; }
}
@media (max-width: 575px) {
  .admin-table th, .admin-table td { font-size: 0.95em; padding: 0.4em 0.3em; }
  .admin-card { border-radius: 0.7em; }
}

/* === ANIMAZIONI === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: none; }
}

/* === MOBILE FIRST & RESPONSIVE === */
@media (max-width: 991px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .row.g-4 { gap: 1.2rem 0.7rem; }
  .navbar .nav-link { font-size: 1em; padding: 0.6em 0.8em; }
  .card { border-radius: 1rem; }
  .card-img-top { min-height: 80px; max-height: 120px; }
  .card-title { font-size: 1.08em; }
}
@media (max-width: 575px) {
  .breadcrumb { font-size: 0.98em; padding: 0.5em 0.7em; }
  .row.g-4 { gap: 0.7rem 0.3rem; }
  .navbar .nav-link { font-size: 0.98em; padding: 0.5em 0.6em; }
  .card { border-radius: 0.7rem; }
  .card-img-top { min-height: 50px; max-height: 80px; }
  .card-title { font-size: 1em; }
  .btn-primary, .btn-outline-primary { font-size: 1em; padding: 0.45em 1em; }
}

/* === FOOTER MODERNO === */
footer {
  background: #fff;
  border-top: 1.5px solid #e0e0e0;
  font-size: 1.05em;
  color: #23272f;
  box-shadow: 0 -2px 16px 0 #276F4D11;
}
footer a {
  color: #276F4D;
  font-weight: 600;
  text-decoration: none;
  margin: 0 0.5em;
  transition: color 0.18s;
}
footer a:hover, footer a:focus {
  color: #1b4d36;
  text-decoration: underline;
}
@media (max-width: 600px) {
  footer .container {
    font-size: 0.98em;
    padding-left: 0.5em;
    padding-right: 0.5em;
  }
  .navbar .nav-link {
    font-size: 1em;
    padding: 0.6em 0.7em;
  }
}
