@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --crazier-red: #e11d2e;
  --crazier-red-dark: #b20d22;
  --crazier-dark: #18181b;
  --crazier-bg: #f8f9fa;
  --card-radius: 22px;
  --surface: #ffffff;
  --surface-soft: #f3f4f6;
  --surface-strong: #e5e7eb;
  --text: #18181b;
  --text-soft: #52525b;
  --shadow-soft: 0 12px 32px rgba(24, 24, 27, 0.08);
  --shadow-strong: 0 20px 48px rgba(24, 24, 27, 0.12);
  --border: rgba(24, 24, 27, 0.08);
}

:root[data-theme="dark"] {
  --crazier-red: #ff5a66;
  --crazier-bg: #0f172a;
  --surface: #111827;
  --surface-soft: #1f2937;
  --surface-strong: #374151;
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --shadow-soft: 0 16px 42px rgba(2, 6, 23, 0.45);
  --shadow-strong: 0 28px 60px rgba(2, 6, 23, 0.5);
  --border: rgba(148, 163, 184, 0.18);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, color-mix(in srgb, var(--crazier-bg) 92%, #ffffff 8%) 0%, var(--crazier-bg) 100%);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
}

body, h1, h2, h3, h4, h5, p, a, button, input, textarea, select {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Bottoni moderni */
.btn-main {
  background-color: var(--crazier-red) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 12px 28px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(204, 0, 0, 0.25);
  transition: all 0.25s ease !important;
}

.btn-main:hover {
  background-color: var(--crazier-red-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(204, 0, 0, 0.35);
}

/* Card Gite / Eventi / 3000 */
.modern-post-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.floating-tools {
  position: fixed;
  right: 20px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
}

.floating-share-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease;
}

.floating-share-group.is-collapsed {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.floating-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme="dark"] .floating-tool {
  background: rgba(17, 24, 39, 0.82);
}

.floating-tool:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.floating-tool svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  fill: currentColor;
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.theme-icon-sun {
  display: block;
}

.theme-icon-moon {
  display: none;
}

.modern-carousel-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
}

.modern-carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.25rem 0 1rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(24, 24, 27, 0.4) transparent;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}

.modern-carousel.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.modern-carousel::-webkit-scrollbar {
  height: 8px;
}

.modern-carousel::-webkit-scrollbar-thumb {
  background: rgba(24, 24, 27, 0.35);
  border-radius: 999px;
}

.modern-carousel-item {
  flex: 0 0 min(85%, 360px);
  scroll-snap-align: start;
}

.modern-carousel-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--crazier-red);
  box-shadow: 0 8px 24px rgba(24, 24, 27, 0.12);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.modern-carousel-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(24, 24, 27, 0.16);
}

.modern-carousel-button:active:not(:disabled) {
  transform: translateY(0);
}

.modern-carousel-button:disabled,
.modern-carousel-button.is-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.9;
}

.category-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.sort-control {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.sort-button {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.sort-button.active {
  background: var(--crazier-red);
  color: #fff;
  box-shadow: 0 10px 22px rgba(204, 0, 0, 0.22);
}

.modern-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  align-items: stretch;
}

.modern-category-item {
  width: 100%;
}

.modern-post-card-list {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.modern-post-card-list .modern-post-img-wrapper {
  width: 100%;
  height: 230px;
  min-height: 230px;
}

.modern-category-map-wrapper {
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.modern-category-map {
  width: 100%;
  height: 360px;
  min-height: 360px;
  background: var(--surface-soft);
}

@media (max-width: 767.98px) {
  html {
    scroll-padding-top: 88px;
  }

  .modern-carousel-shell {
    display: block;
  }

  .modern-carousel-button {
    display: none;
  }

  .modern-category-list {
    grid-template-columns: 1fr;
  }

  .article-hero-card {
    padding: 1rem !important;
  }

  .article-hero-card h1 {
    line-height: 1.12;
  }

  .floating-tools {
    right: 12px;
    bottom: 16px;
  }

  .floating-tool {
    min-height: 42px;
    padding: 0.6rem 0.8rem;
    font-size: 0.66rem;
  }
}

.modern-post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modern-post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.modern-post-img-wrapper {
  position: relative;
  height: 230px;
  width: 100%;
  overflow: hidden;
  background-color: var(--surface-soft);
  aspect-ratio: 16 / 10;
}

.modern-post-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.modern-post-card:hover .modern-post-img-wrapper img {
  transform: scale(1.06);
}

.modern-date-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 6px 14px;
  border-radius: 50px;
  text-transform: uppercase;
}

.modern-place-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--crazier-red);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modern-post-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.modern-post-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
}

.modern-post-card:hover .modern-post-title {
  color: var(--crazier-red);
}

.modern-post-excerpt {
  font-size: 0.94rem;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.modern-read-more {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--crazier-red);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Card Direttivo (Chi Siamo) */
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin-bottom: 24px;
}

.team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.09);
}

.team-card-img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 280px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 18px;
}

.team-role-badge {
  display: inline-block;
  background-color: rgba(204, 0, 0, 0.1);
  color: var(--crazier-red);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Box Info moderno */
.modern-info-box {
  background: var(--surface);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

/* Pagina Dettaglio Gita / Evento */
.article-hero-card {
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

.article-hero-card .badge {
  letter-spacing: 0.04em;
}

.article-hero-card h1 {
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.article-main-image {
  width: 100%;
  max-height: 520px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 20px;
}

.modern-map-card {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 4px solid var(--surface);
}

.modern-instagram-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.instagram-embed-wrapper {
  width: 100%;
  min-height: 440px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-soft);
}

.instagram-embed-wrapper iframe {
  width: 100%;
  min-height: 440px;
  height: 100%;
  border: 0;
  background: transparent;
}

/* Sezione Varese */
.varese-banner {
  background: linear-gradient(135deg, #CC0000 0%, #990000 100%);
  color: #ffffff;
  border-radius: 28px;
  margin: 0 16px;
  box-shadow: 0 18px 40px rgba(204, 0, 0, 0.22);
}

@media (max-width: 768px) {
  .varese-banner {
    margin: 0 8px;
    border-radius: 20px;
  }
  .modern-info-box {
    padding: 24px;
  }
}
