/* ============================================================
   BROOKS PTA — CALENDAR PAGE STYLES
   Loaded only on page-calendar.php template.
   CSS vars --blue, --green, --mint defined in home.css (:root).
   We redefine them here since home.css is not loaded on this page.
   ============================================================ */

:root {
  --blue:        #064164;
  --blue-dark:   #032d47;
  --blue-xdark:  #021e30;
  --green:       #068D4D;
  --green-dark:  #056639;
  --green-xdark: #034d2a;
  --mint:        #5adba0;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ── CALENDAR PAGE HERO ── */
.cal-page-wrap {
  min-height: 100vh;
  background: #f4f7fa;
  display: flex;
  flex-direction: column;
}

.cal-page-hero { flex-shrink: 0; }

.cal-page-hero {
  background: var(--blue);
  background-image: var(--noise), linear-gradient(135deg, rgba(255,255,255,.05) 0%, transparent 60%);
  background-blend-mode: overlay, normal;
  padding: 52px 0 44px;
  position: relative;
  overflow: hidden;
}

.cal-page-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90,219,160,.3), transparent);
}

.cal-page-hero__inner {
  position: relative; z-index: 1;
}

.cal-page-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mint);
  margin: 0 0 10px;
  font-family: 'IBM Plex Sans', sans-serif;
}

.cal-page-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
  letter-spacing: -.01em;
}

.cal-subscribe-btn {
  display: inline-block;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border: 1.5px solid rgba(255,255,255,.25);
  padding: 8px 20px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  backdrop-filter: blur(4px);
}

.cal-subscribe-btn:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.5);
  color: #fff;
  text-decoration: none;
}

/* ── CALENDAR BODY ── */
.cal-page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 36px 28px 40px;
  width: 100%;
  box-sizing: border-box;
}

/* ── MONTH NAVIGATION ── */
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.cal-month-label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--blue);
  min-width: 220px;
  text-align: center;
  letter-spacing: -.01em;
}

.cal-nav-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .12s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(6,65,100,.25);
}

.cal-nav-btn:hover {
  background: var(--blue-dark);
  transform: scale(1.08);
}

.cal-nav-btn:active { transform: scale(.95); }

/* ── CALENDAR GRID ── */
.cal-grid-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dde4ec;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.04);
}

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--blue);
  background-image: var(--noise);
  background-blend-mode: overlay;
}

.cal-grid-header > div {
  text-align: center;
  padding: 12px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  font-family: 'IBM Plex Sans', sans-serif;
}

.cal-grid-header { flex-shrink: 0; }

.cal-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
}

/* ── DAY CELLS ── */
.cal-cell {
  min-height: 70px;
  padding: 8px 6px 6px;
  border-right: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  transition: background .12s;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell--empty {
  background: #f9fafb;
  min-height: 70px;
}

.cal-cell--has-events {
  background: rgba(6,141,77,.035);
}

.cal-cell--has-events:hover {
  background: rgba(6,141,77,.07);
}

.cal-cell__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 700;
  color: #5a6a78;
  border-radius: 50%;
  line-height: 1;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}

.cal-cell__day--today {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

/* ── EVENT PILLS ── */
.cal-pill {
  display: block;
  width: 100%;
  background: var(--green);
  color: #fff;
  font-size: clamp(9px, 0.85vw, 13px);
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Inter', sans-serif;
  letter-spacing: .01em;
  transition: background .12s, transform .1s;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.cal-pill:hover {
  background: var(--green-dark);
  transform: scale(1.02);
}

/* ── MODAL ── */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,30,48,.72);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cal-modal-overlay[hidden] { display: none; }

.cal-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  padding: 36px 36px 32px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.1);
  animation: modalIn .18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cal-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: #f0f3f6;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #5a6a78;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}

.cal-modal-close:hover { background: #e0e6ec; color: var(--blue); }

.cal-modal-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 12px;
  line-height: 1.3;
  padding-right: 28px;
}

.cal-modal-date {
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 10px;
  font-family: 'Inter', sans-serif;
}

.cal-modal-location {
  font-size: 12.5px;
  color: #6a7a88;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}

.cal-modal-location::before {
  content: '📍 ';
}

.cal-modal-desc {
  font-size: 13px;
  color: #3d4d5c;
  line-height: 1.65;
  white-space: pre-wrap;
  font-family: 'Inter', sans-serif;
}

/* ── INNER-PAGE HEADER OVERRIDE ── */
body.page-template-page-calendar-php .site-header {
  background: var(--blue);
  background-image: var(--noise), linear-gradient(135deg, rgba(255,255,255,.05) 0%, transparent 60%);
  background-blend-mode: overlay, normal;
  border-bottom: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 2px 10px rgba(0,0,0,.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

body.page-template-page-calendar-php .site-branding .site-title,
body.page-template-page-calendar-php .site-branding a.site-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  color: #fff;
}

body.page-template-page-calendar-php .site-header .custom-logo-link img {
  filter: brightness(0) invert(1);
}

body.page-template-page-calendar-php .nav-menu > li > a {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 500;
}

body.page-template-page-calendar-php .nav-menu > li > a:hover,
body.page-template-page-calendar-php .nav-menu > li.current-menu-item > a {
  color: #fff;
  text-decoration: none;
}

body.page-template-page-calendar-php .nav-toggle__bar { background: #fff; }

/* ── SUBSCRIBE / IMPORT INFO ── */
.cal-subscribe-info {
  flex-shrink: 0;
  margin-top: 20px;
  padding: 18px 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dde4ec;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.cal-subscribe-info-text {
  font-size: 13px; font-weight: 700; color: var(--blue);
  font-family: 'IBM Plex Sans', sans-serif; flex-shrink: 0;
}
.cal-subscribe-info-text small {
  display: block; font-size: 11px; font-weight: 400;
  color: #6a7a88; margin-top: 2px;
}
.cal-sub-btns {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.cal-sub-btn {
  display: inline-block; padding: 7px 16px; border-radius: 30px;
  font-size: 11.5px; font-weight: 700; text-decoration: none;
  font-family: 'IBM Plex Sans', sans-serif; letter-spacing: .03em;
  border: 1.5px solid currentColor;
  transition: background .15s, color .15s;
}
.cal-sub-btn--google { color: #4285f4; }
.cal-sub-btn--google:hover { background: #4285f4; color: #fff; text-decoration: none; }
.cal-sub-btn--apple  { color: var(--blue); }
.cal-sub-btn--apple:hover  { background: var(--blue); color: #fff; text-decoration: none; }
.cal-sub-btn--ics    { color: var(--green); }
.cal-sub-btn--ics:hover    { background: var(--green); color: #fff; text-decoration: none; }

/* ── MOBILE EVENT LIST ── */
.cal-list-wrap {
  display: none;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dde4ec;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.04);
  padding: 0 20px;
}

.cal-list-item {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #eef1f5;
  cursor: pointer;
  transition: background .12s;
  border-radius: 4px;
  margin: 0 -8px; padding-left: 8px; padding-right: 8px;
}
.cal-list-item:last-child { border-bottom: none; }
.cal-list-item:hover { background: rgba(6,65,100,.04); }

.cal-list-date {
  flex-shrink: 0; width: 54px;
  border-radius: 10px; overflow: hidden;
  text-align: center; line-height: 1;
  border: 1px solid rgba(6,65,100,.1);
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.cal-list-month {
  display: block; background: var(--green); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 0 3px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.cal-list-day {
  display: block; background: var(--blue); color: #fff;
  font-size: 22px; font-weight: 900; padding: 6px 0 7px;
  font-family: 'Inter', sans-serif;
}
.cal-list-name {
  font-size: 15px; font-weight: 800; color: var(--blue);
  line-height: 1.3; margin-bottom: 4px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.cal-list-meta {
  font-size: 12px; color: #6a7a88;
  font-family: 'Inter', sans-serif;
}
.cal-list-empty {
  text-align: center; color: #6a7a88;
  padding: 40px 0; font-family: 'Inter', sans-serif; font-size: 13px;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .cal-page-body { padding: 24px 16px 48px; }
  .cal-page-hero { padding: 32px 0 28px; }
  .cal-page-title { font-size: 26px; }
  .cal-month-label { font-size: 17px; min-width: 160px; }
  .cal-modal { padding: 28px 20px 24px; }
  .cal-modal-title { font-size: 18px; }

  /* swap grid for list */
  .cal-grid-wrap { display: none; }
  .cal-list-wrap { display: block; }
}
