.demo {
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 20px;
}

.demo-hero {
  margin-bottom: 80px;
  text-align: center;
}

.demo-hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.demo-hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.hero-visual {
  position: relative;
}

/* --- DEMO SECTIONS --- */

.demo-section {
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 100px;
}

.demo-section.reverse {
  direction: rtl;
}

.demo-section.reverse > * {
  direction: ltr;
}

.demo-text {
  max-width: 420px;
}

.demo-text h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.demo-text p {
  font-size: 1.1rem;
  color: var(--text-light);
}

.calendar-week {
  display: grid;
  position: relative;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 60px 1fr;
  height: 420px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

/* Header */
.calendar-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #777;
  border-bottom: 1px solid #eee;
  padding-top: 10px;
}
.calendar-header span {
  display: block;
  font-size: 1.1rem;
  color: #111;
  margin-top: 2px;
}

.overnight {
  border-radius: 6px;
}

.disruption {
  background: var(--google-yellow);
}

.below-cal {
  grid-area: 1 / 1;
}

.work {
  background: var(--google-green);
}

/* Popover overlay */
.event-popover {
  position: absolute; /* Keep absolute so it floats above the layout */
  top: 70px;

  right: calc(40% + 5px);
  width: 420px;
  max-width: calc(60% - 30px);

  /* Leave the rest of your original styles unchanged */
  background: #f3f6fb;
  border-radius: 24px;
  padding: 20px 22px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.popover-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.popover-header h3 {
  flex: 1;
  font-size: 1.35rem;
  font-weight: 500;
}

.popover-actions {
  font-size: 0.9rem;
  opacity: 0.7;
}

.popover-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.popover-row p {
  font-size: 0.9rem;
}

.x4 {
  top: 4%;
  height: 14%;
}

.x15 {
  top: 15%;
  height: 18%;
}

.x19 {
  top: 19%;
  height: 58%;
}

.x34 {
  top: 34%;
  height: 18%;
}

@media (max-width: 1000px) {
  .demo-section {
    gap: 1.5rem;
  }
}

@media (max-width: 805px) {
  .popover-header h3 {
    font-size: 0.95rem;
  }

  .popover-row {
    margin-top: 5px;
  }
}

@media (max-width: 768px) {
  .demo-text {
    text-align: center;
  }

  .event-popover {
    right: calc(33% + 5px);
    /* max-width: 220px; */
  }

  .demo-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .demo-text {
    max-width: 100%;
  }

  .demo-text p {
    max-width: 1000px;
  }

  /* Hide Monday column */
  .mobile-hide {
    display: none;
  }

  /* Calendar becomes 4 columns instead of 5 */
  .calendar-week {
    grid-template-columns: repeat(4, 1fr);
    height: 380px;
  }

  .top-cal {
    margin-left: -25px;
    margin-right: -25px;
  }

  .top-cal-text {
    font-size: 0.6rem;
  }

  .top-cal-text-time {
    font-size: 7px;
  }

  /* Stack section */
  .demo-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .popover-header h3 {
    font-size: 1rem;
  }

  .popover-row {
    grid-template-columns: 18px 1fr;
    gap: 8px;
    margin-top: 5px;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .popover-row p {
    font-size: 0.8rem;
  }

  .below-cal {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hide WED header */
  .below-cal-header:nth-child(1) {
    display: none;
  }

  /* Hide THU header */
  .below-cal-header:nth-child(2) {
    display: none;
  }

  /* Hide WED day column */
  .below-cal .below-cal-day:nth-child(8) {
    display: none;
  }

  /* Hide THU day column */
  .below-cal .below-cal-day:nth-child(9) {
    display: none;
  }
}

@media (max-width: 500px) {
  .event-popover {
    max-width: 220px;
  }

  .below-cal-day {
    font-size: 7px;
  }

  .x4 {
    height: 16%;
  }

  .x19 {
    top: 22%;
  }


}
