:root {
  --bg: #f6f1e7;
  --bg-soft: #fdf9f1;
  --paper: rgba(255, 252, 246, 0.88);
  --ink: #1f2a22;
  --muted: #4d5b51;
  --line: rgba(31, 42, 34, 0.12);
  --accent: #ca5a2e;
  --accent-dark: #9d3f1d;
  --sage: #597056;
  --gold: #d8a34f;
  --shadow: 0 18px 48px rgba(31, 42, 34, 0.12);
  --radius: 24px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 163, 79, 0.22), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(89, 112, 86, 0.2), transparent 24%),
    linear-gradient(180deg, #f7f2e8 0%, #f3ecdf 52%, #efe5d7 100%);
  line-height: 1.6;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

a {
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent);
}

.site-header,
.section,
.site-footer {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  margin-top: 0.5rem;
  background: rgba(255, 252, 246, 0.85);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 24px rgba(31, 42, 34, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 2.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
}

/* Hamburger Menu */
.menu-toggle {
  display: none !important;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--ink);
  position: relative;
  transition: background-color 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: var(--ink);
  left: 0;
  transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

.menu-toggle[aria-expanded="true"] .hamburger {
  background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

.section {
  padding: 4.5rem 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 8rem);
  padding-top: 2rem;
}

.hero-logo {
  margin: 0 0 1.25rem;
  padding: 1rem 1.2rem;
  width: fit-content;
  max-width: min(100%, 360px);
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.72);
  border: 1px solid rgba(31, 42, 34, 0.1);
  box-shadow: var(--shadow);
}

.hero-logo img {
  width: 100%;
  height: auto;
}

.eyebrow,
.card-label {
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-dark);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 1rem;
  font-family: "Fraunces", serif;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--ink);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.2rem;
}

.lead,
.section-intro,
.panel p,
.contact-card p,
.event-notes,
.site-footer p {
  color: var(--muted);
}

.lead {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(202, 90, 46, 0.2);
}

.button-primary {
  background: var(--accent);
  color: #fff9f3;
  border: 1px solid transparent;
}

.button-primary:hover {
  background: var(--accent-dark);
  color: #fff9f3;
}

.button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.button-secondary:hover {
  background: #fff;
}

.button-donate {
  background: var(--gold);
  color: #fff;
  padding: 0.6rem 1.2rem;
  min-height: 2.5rem;
}

.button-donate:hover {
  background: #c38c35;
  color: #fff;
}

.hero-badges,
.list,
.values-strip,
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-badges li,
.values-strip span {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-panel,
.grid,
.pillars,
.hero-stats,
.media-band,
.calendar-container,
.three-cols {
  display: grid;
  gap: 1.5rem;
}

.hero-panel {
  position: relative;
}

.panel,
.next-event-card,
.media-card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover,
.next-event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(31, 42, 34, 0.15);
}

.next-event-card,
.panel {
  padding: 2rem;
}

.accent {
  background:
    linear-gradient(135deg, rgba(202, 90, 46, 0.08), rgba(216, 163, 79, 0.1)),
    var(--paper);
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-stats article {
  padding: 1.2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  text-align: center;
}

.hero-stats strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
  display: block;
}

.photo-gallery {
  padding-top: 0;
}

.media-band {
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.media-card {
  overflow: hidden;
  border-radius: var(--radius);
  margin: 0;
  display: flex;
}

.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.media-card:hover img {
  transform: scale(1.05);
}

.section-heading {
  margin-bottom: 2rem;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-cols,
.pillars {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 3rem;
}

.pillars article {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.values-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
  justify-content: center;
}

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

.featured-panel {
  background:
    linear-gradient(180deg, rgba(89, 112, 86, 0.05), rgba(202, 90, 46, 0.05)),
    var(--paper);
}

.events-list {
  display: grid;
  gap: 1rem;
}

.event-item {
  display: grid;
  gap: 0.25rem;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  border: 1px solid var(--line);
  transition: background-color 0.2s ease;
}

.event-item:hover {
  background: #fff;
}

.event-item.is-next {
  border-color: var(--accent);
  background: rgba(202, 90, 46, 0.05);
}

.event-item time {
  font-weight: 800;
  color: var(--ink);
}

#next-event-title,
.event-date {
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

#next-event-title {
  color: var(--ink);
  font-family: "Manrope", sans-serif; /* Per renderlo meno 'pesante' dell'H2 standard se necessario, o lasciamo Fraunces */
}

.event-date {
  color: var(--accent);
}

.list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

.icon-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.icon-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.icon-item p {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.icon-wrapper {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(202, 90, 46, 0.1);
  color: var(--accent);
  border-radius: 12px;
  border: 1px solid rgba(202, 90, 46, 0.15);
}

.icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.map-container {
  margin-top: 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.map-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

/* Specific Layout Adjustments */
.mission-layout {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
  gap: 2rem;
}

.mission-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mission-photo {
  height: 100%;
  min-height: 300px;
}

.repair-grid {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 3rem;
  margin-bottom: 3rem;
}

.repair-photo {
  height: 100%;
  min-height: 400px;
}

.repair-grid article.panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 4rem 2rem 2rem;
  border-radius: 32px 32px 0 0;
  margin-top: 4rem;
  width: 100%;
}

.footer-container {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.footer-col a:hover {
  color: #fff;
}

.footer-brand img {
  filter: brightness(0) invert(1);
  height: 3rem;
  margin-bottom: 1rem;
}

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-soft);
  padding: 3rem;
  border-radius: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 32px 64px rgba(31, 42, 34, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(31, 42, 34, 0.05);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(31, 42, 34, 0.1);
}

.modal-body h3 {
  margin-top: 1.5rem;
  color: var(--sage);
  font-size: 1.1rem;
}

.modal-body p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Skeleton Loader */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.skeleton-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.skeleton {
  background: linear-gradient(90deg, var(--line) 25%, rgba(31, 42, 34, 0.05) 50%, var(--line) 75%);
  background-size: 800px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 4px;
}

.skeleton-title {
  height: 2rem;
  width: 80%;
  margin-bottom: 0.5rem;
}

.skeleton-text {
  height: 1.2rem;
  width: 100%;
}

.skeleton-text.short {
  width: 60%;
}

/* Past Events */
.event-item.past-event {
  opacity: 0.5;
  filter: grayscale(100%);
  background: transparent;
  border-color: transparent;
}

.event-item.past-event::before {
  display: none;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero,
  .mission-layout {
    grid-template-columns: 1fr;
  }
  
  .hero {
    min-height: auto;
  }

  .mission-photo {
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  .site-header {
    border-radius: 0;
    width: 100%;
    margin: 0;
    padding: 1rem;
  }

  .menu-toggle {
    display: block !important;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 252, 246, 0.98);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--line);
    transform: translateY(-150%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 99;
  }

  .site-nav.open {
    transform: translateY(0);
    opacity: 1;
  }

  .two-cols,
  .three-cols,
  .pillars,
  .hero-stats,
  .repair-grid {
    grid-template-columns: 1fr;
  }

  .media-band {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .media-card {
    min-height: 250px;
  }

  .reverse-mobile {
    display: flex;
    flex-direction: column-reverse;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  h1 {
    font-size: 2.5rem;
    max-width: none;
  }

  .hero-logo {
    max-width: 250px;
  }
}

