:root {
  --blue: #507db5;
  --deep-blue: #153f7a;
  --ink: #102f58;
  --muted: #4d6c93;
  --paper: #fff8dd;
  --paper-blue: #e8f4ff;
  --paper-green: #edf8e9;
  --paper-rose: #fff0e8;
  --line: rgba(29, 77, 137, 0.2);
  --white: #ffffff;
  --teal: #0ca8b7;
  --coral: #e87661;
  --gold: #f0b941;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(80, 125, 181, 0.92), rgba(232, 244, 255, 0.82) 460px, #f6fbff 760px),
    #f6fbff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  background-image: url("watermark-events.png");
  background-repeat: no-repeat;
  opacity: 0.18;
  filter: saturate(1.25) contrast(1.25);
}

body::before {
  inset: 0 auto auto 0;
  width: min(56vw, 660px);
  height: 820px;
  background-size: 820px auto;
  background-position: -140px -30px;
}

body::after {
  right: 0;
  bottom: 0;
  width: min(54vw, 620px);
  height: 760px;
  background-size: 860px auto;
  background-position: right -90px bottom -110px;
}

.site-header {
  min-height: 390px;
  padding: 54px 24px 44px;
  color: #fffaf0;
}

.header-inner,
main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  width: fit-content;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  background: rgba(35, 81, 139, 0.32);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.date-lockup {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-top: 44px;
  line-height: 0.82;
}

.range-days {
  display: block;
  font-size: clamp(82px, 12vw, 148px);
  font-weight: 900;
}

.range-month {
  display: block;
  max-width: 220px;
  padding: 0 0 11px 18px;
  border-left: 2px solid rgba(255, 255, 255, 0.52);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: end;
  margin-top: -64px;
  padding: 28px 0 44px;
}

.intro h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
}

.intro p {
  margin: 0;
  max-width: 680px;
  color: #24496f;
  font-size: 19px;
  line-height: 1.35;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 0 0 72px;
}

.event-card {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(20, 58, 105, 0.12);
  border-radius: 8px;
  background: var(--card-paper, var(--paper));
  box-shadow:
    0 18px 40px rgba(38, 82, 132, 0.18),
    inset 0 -18px 30px rgba(96, 93, 54, 0.06);
}

.event-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("watermark-events.png");
  background-repeat: no-repeat;
  background-size: 760px auto;
  background-position: var(--motif-x, right -170px) var(--motif-y, top -190px);
  opacity: 0.12;
  filter: saturate(1.2) contrast(1.25);
  pointer-events: none;
}

.event-card:nth-child(4n + 2) {
  --card-paper: var(--paper-blue);
}

.event-card:nth-child(4n + 3) {
  --card-paper: var(--paper-green);
}

.event-card:nth-child(4n + 4) {
  --card-paper: var(--paper-rose);
}

.event-card.motif-dinosauri {
  --motif-x: -210px;
  --motif-y: -86px;
}

.event-card.motif-mare,
.event-card.motif-regata {
  --motif-x: right -180px;
  --motif-y: -130px;
}

.event-card.motif-musica {
  --motif-x: right -180px;
  --motif-y: -370px;
}

.event-card.motif-chiesa,
.event-card.motif-egitto {
  --motif-x: right -180px;
  --motif-y: bottom -60px;
}

.event-card.motif-mostra {
  --motif-x: -170px;
  --motif-y: -310px;
}

.event-card.motif-natura {
  --motif-x: -130px;
  --motif-y: bottom -80px;
}

.event-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 520px;
  padding: 24px;
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(21, 64, 122, 0.18);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.pill-strong {
  border-color: transparent;
  background: var(--deep-blue);
  color: #fff;
}

.event-card h3 {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.02;
  letter-spacing: 0;
}

.event-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.meta-box {
  min-height: 66px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent, var(--teal));
  background: rgba(255, 255, 255, 0.56);
}

.meta-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-box strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.16;
}

.description {
  margin: 20px 0 0;
  color: #24496f;
  font-size: 17px;
  line-height: 1.42;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(21, 64, 122, 0.18);
  background: #fff;
  color: var(--deep-blue);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  border-color: transparent;
  background: var(--deep-blue);
  color: #fff;
}

.button-calendar {
  border-color: transparent;
  background: var(--accent, var(--teal));
  color: #fff;
}

.map-panel {
  position: relative;
  z-index: 1;
  margin: 0 24px 24px;
  overflow: hidden;
  border: 1px solid rgba(21, 64, 122, 0.18);
  border-radius: 6px;
  background: #d7e8f7;
}

.map-panel iframe {
  display: block;
  width: 100%;
  height: 210px;
  border: 0;
  filter: saturate(0.92) contrast(0.98);
}

.map-caption {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.map-caption a {
  color: var(--deep-blue);
  text-decoration: none;
}

.source-note {
  margin-top: 10px;
  color: rgba(16, 47, 88, 0.68);
  font-size: 12px;
  line-height: 1.25;
}

@media (max-width: 920px) {
  .intro,
  .event-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    margin-top: -32px;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 330px;
    padding-top: 34px;
  }

  .header-inner,
  main {
    width: min(100% - 24px, 1180px);
  }

  .date-lockup {
    display: block;
    margin-top: 34px;
  }

  .range-days {
    white-space: nowrap;
  }

  .range-month {
    max-width: none;
    margin-top: 14px;
    padding: 0;
    border-left: 0;
    font-size: 28px;
    line-height: 1;
  }

  .event-content {
    padding: 18px;
  }

  .event-meta {
    grid-template-columns: 1fr;
  }

  .map-panel {
    margin: 0 18px 18px;
  }
}
