@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

:root {
  --blue: #282f7f;
  --light-blue: #4279bc;
  --grey: #eaeaea;
}

/* =============================
   GLOBAL
============================= */
body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  color: #2c3e50;
  background: white;
}

/* =============================
   HERO SECTION
============================= */
.events-hero {
  position: relative;
  width: 100%;
  height: 300px;
  background: url("/images/Prayer.jpg") no-repeat center/cover;
  display: flex;
  justify-content: center;
  align-items: center;
}

.events-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 42, 87, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
}

.events-overlay h1 {
  color: white;
  font-size: 50px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
}

/* =============================
   MAIN CONTAINER
============================= */
.events-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* =============================
   EVENT ROW LAYOUT
============================= */
.event-row {
  display: flex;
  width: 100%;
  align-items: stretch;
}

/* =============================
   TEXT + IMAGE ITEMS
============================= */
.grid-item {
  flex: 1 1 50%;
  width: 50%;
}

/* ✅ DOUBLE the size of the grey + white boxes (already what you wanted) */
.grid-item.grey {
  background: var(--grey);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  min-height: 400px;
  padding-bottom: 20px;
}

/* Image container */
.grid-item.white {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

/* =============================
   IMAGE BEHAVIOR
============================= */
.event-img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

/* =============================
   TITLE + DATE
============================= */
.event-header {
  width: 100%;
  text-align: center;
  border-bottom: 3px solid #000;
  padding-top: 15px;
}

/* ✅ KEEP TITLE BLACK */
.event-header h2 {
  color: #000;
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.event-header .event-date {
  color: #444;
  font-size: 0.95rem;
  margin-top: 4px;
}

/* =============================
   TEXT BOX
============================= */
.text-box {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  padding: 0;
  flex-grow: 1;
}

.text-box p {
  color: #333;
  font-size: 15px;
  line-height: 1.6;
  margin: 10px 25px;
}

/* =============================
   ADMIN / NOTES
============================= */
.event-admin-section {
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ✅ Make editable notes black AND preserve spacing/newlines */
.admin-display-text {
  color: #000;
  white-space: pre-wrap;   /* keeps line breaks + multiple spaces */
  word-break: break-word;
}

/* ✅ Small spacing between the edit buttons */
.event-admin-section button {
  margin: 6px 0;  /* little vertical spacing */
}

/* your button */
.save-notes-btn {
  margin-top: 4px;
  background: var(--light-blue);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

/* =============================
   MOBILE
============================= */
@media (max-width: 950px) {
  .event-row {
    flex-direction: column;
  }

  .grid-item {
    width: 100%;
  }

  .event-img {
    max-height: 440px;
  }

  .events-overlay h1 {
    font-size: 38px;
  }
}

/* =============================
   IMAGE EDIT OVERLAY
============================= */
.image-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(66, 121, 188, 0.85);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.grid-item.white:hover .image-edit-overlay {
  opacity: 1;
}

@media (hover: none) {
  .image-edit-overlay {
    opacity: 1;
  }
}
@media (max-width: 950px) {
  .event-row {
    flex-direction: column;
  }

  .grid-item {
    width: 100%;
    flex: 1 1 100%;
  }

  /* ✅ FORCE: always Text then Image on mobile */
  .event-row .grid-item.grey {
    order: 1;
  }
  .event-row .grid-item.white {
    order: 2;
  }

  .event-img {
    max-height: 440px;
  }

  .events-overlay h1 {
    font-size: 38px;
  }
}
