/* ===========================================================
   C3D CALENDAR WIDGET
   All selectors are prefixed with "c3d-" so this won't collide
   with your site's existing CSS.
=========================================================== */
.c3d-root {
  --c3d-green-900: #590900;       /* Darkest brand crimson */
  --c3d-green-700: #a81b29;       /* Brand primary red */
  --c3d-green-600: #7e3751;       /* Brand dark plum */
  --c3d-green-500: #fe4c4c;       /* Brand bright red/accent */
  --c3d-cream: #faf5f3;            /* Site surface cream */
  --c3d-paper: #fff;               /* Pure white paper */
  --c3d-ink: #553232;              /* Site text color */
  --c3d-ink-soft: #8c7676;         /* Site muted text */
  --c3d-gold: #c9982f;
  --c3d-gold-dark: #a67a1f;
  --c3d-line: #e4ddc8;
  --c3d-shadow: rgba(89, 9, 0, 0.15); /* Crimson shadow */
  --c3d-w: 460px;
  width: min(var(--c3d-w), 100%);
  font-family: 'DM Sans', sans-serif;
  color: var(--c3d-ink);
  -webkit-font-smoothing: antialiased;
}

.c3d-stage {
  perspective: 1600px;
  padding: 34px 10px 46px;
}

.c3d-tilt {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(3deg) rotateY(-1.5deg);
  transition: transform .25s cubic-bezier(.2, .7, .3, 1);
  will-change: transform;
}

.c3d-easel {
  position: relative;
  display: flex;
  background: var(--c3d-paper);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .6) inset,
    0 30px 55px -18px var(--c3d-shadow),
    0 10px 18px -10px rgba(89, 9, 0, .08);
}

/* --- easel stand legs (the "tent" look) --- */
.c3d-tilt::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -26px;
  height: 34px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, 0));
  filter: blur(6px);
  border-radius: 50%;
  transform: translateZ(-40px) scale(1, .5);
  z-index: 0;
}

/* --- spiral coil binding --- */
.c3d-spiral {
  position: absolute;
  top: -10px;
  left: 22px;
  right: 22px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}
.c3d-spiral::before {
  content: "";
  position: absolute;
  left: 2px; right: 2px; top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #9a9c92 12%, #9a9c92 88%, transparent);
  transform: translateY(-50%);
}
.c3d-ring {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 2.5px solid #8b8d84;
  border-top-color: #f2f2ef;
  border-left-color: #f2f2ef;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.c3d-ring:nth-child(odd) { transform: translateY(-3px) rotate(-10deg); }
.c3d-ring:nth-child(even) { transform: translateY(3px) rotate(10deg); }

/* --- photo panel --- */
.c3d-photo {
  position: relative;
  width: 38%;
  min-width: 130px;
  border-radius: 14px 0 0 14px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  transition: background-image 0.8s ease-in-out;
}
.c3d-photo-label {
  position: relative;
  z-index: 2;
  background: var(--c3d-paper);
  border-radius: 0 26px 0 0;
  padding: 14px 22px 12px 16px;
  font-family: 'Fraunces', serif;
  line-height: 1.05;
}
.c3d-photo-label .c3d-month {
  display: block;
  font-size: clamp(15px, 4.4vw, 19px);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--c3d-green-900);
}
.c3d-photo-label .c3d-year {
  display: block;
  font-size: clamp(13px, 3.8vw, 16px);
  font-weight: 500;
  color: var(--c3d-ink-soft);
}
.c3d-photo-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(89, 9, 0, .45) 100%);
}

/* --- calendar panel --- */
.c3d-grid-panel {
  position: relative;
  flex: 1;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.c3d-tab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.c3d-tab {
  background: var(--c3d-green-600);
  color: #fff;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 15px;
  padding: 5px 12px;
  border-radius: 8px;
  letter-spacing: .03em;
}
.c3d-nav-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--c3d-line);
  background: var(--c3d-paper);
  color: var(--c3d-green-700);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, transform .15s;
}
.c3d-nav-btn:hover { background: var(--c3d-cream); transform: scale(1.08); }
.c3d-nav-btn:active { transform: scale(.94); }
.c3d-nav-spacer { flex: 1; }
.c3d-month-full {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--c3d-ink-soft);
}

.c3d-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(14px, 3.6vw, 17px);
  color: var(--c3d-green-700);
  text-align: center;
}

.c3d-daygrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  transition: opacity .18s ease, transform .18s ease;
}
.c3d-daygrid.c3d-anim { opacity: 0; transform: translateY(4px); }

.c3d-day {
  position: relative;
  aspect-ratio: 1/0.82;
  border: 1px solid var(--c3d-line);
  border-radius: 5px;
  background: var(--c3d-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 13px);
  color: var(--c3d-ink);
  transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.25s ease;
}
.c3d-day.c3d-blank { background: transparent; border-color: transparent; }
.c3d-day.c3d-today {
  background: var(--c3d-green-900);
  color: #fff;
  border-color: var(--c3d-green-900);
}

/* --- Transparent Bubble Highlight Encasing Active Event Days --- */
.c3d-day.c3d-has-event {
  position: relative;
  z-index: 2;
  font-weight: 800;
  color: var(--c3d-green-700);
  cursor: pointer;
}

/* Glassmorphic crystal/bubble sphere wrapped around the day */
.c3d-day.c3d-has-event::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9) 0%, rgba(168, 27, 41, 0.26) 45%, rgba(168, 27, 41, 0.08) 75%, rgba(255, 255, 255, 0.2) 100%);
  border: 1.5px solid rgba(168, 27, 41, 0.55);
  box-shadow: 
    0 4px 14px rgba(168, 27, 41, 0.3),
    inset 0 2px 6px rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(168, 27, 41, 0.35);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  animation: c3d-bubble-encase-float 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

/* Micro-reflection glare on the top left of the transparent bubble */
.c3d-day.c3d-has-event::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 18%;
  width: 45%;
  height: 25%;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  transform: rotate(-22deg);
  pointer-events: none;
  z-index: 3;
}

@keyframes c3d-bubble-encase-float {
  0%, 100% {
    transform: scale(1) translateY(0);
    box-shadow: 0 4px 14px rgba(168, 27, 41, 0.3), inset 0 2px 6px rgba(255, 255, 255, 0.9), inset 0 -2px 6px rgba(168, 27, 41, 0.35);
  }
  50% {
    transform: scale(1.07) translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(168, 27, 41, 0.45), inset 0 3px 8px rgba(255, 255, 255, 0.95), inset 0 -3px 8px rgba(168, 27, 41, 0.45);
  }
}

.c3d-day.c3d-has-event:hover {
  transform: translateY(-3px) scale(1.08);
  z-index: 10;
}

.c3d-bubble {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  border-radius: 50%;
  background: var(--c3d-gold);
  color: #2a1c02;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--c3d-paper);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  animation: c3d-pulse 2.4s ease-in-out infinite;
  z-index: 4;
}
@keyframes c3d-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 152, 47, .55), 0 1px 3px rgba(0, 0, 0, .35); }
  50% { box-shadow: 0 0 0 4px rgba(201, 152, 47, 0), 0 1px 3px rgba(0, 0, 0, .35); }
}

/* --- tooltip overrides for detailed events --- */
.c3d-tooltip {
  position: absolute;
  z-index: 20;
  background: var(--c3d-green-900);
  color: #fffdf8;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 11.5px;
  line-height: 1.4;
  width: 250px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
}
.c3d-tooltip strong { color: var(--c3d-gold); font-weight: 700; }
.c3d-tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px; left: 16px;
  width: 10px; height: 10px;
  background: var(--c3d-green-900);
  transform: rotate(45deg);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.c3d-tooltip-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.c3d-tooltip-title {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--c3d-gold);
  line-height: 1.25;
}
.c3d-tooltip-time, 
.c3d-tooltip-loc {
  font-size: 10.5px;
  color: #e4ddc8;
  display: flex;
  align-items: center;
  gap: 5px;
}
.c3d-tooltip-time i, 
.c3d-tooltip-loc i {
  font-size: 11px;
}
.c3d-tooltip-desc {
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.9;
  max-height: 60px;
  overflow-y: auto;
  line-height: 1.4;
}
.c3d-tooltip-btn {
  display: inline-block;
  margin-top: 8px;
  background: var(--c3d-gold);
  color: #2a1c02 !important;
  text-align: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}
.c3d-tooltip-btn:hover {
  background: #fff;
  color: var(--c3d-green-900) !important;
}
.c3d-tooltip-divider {
  border: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  margin: 8px 0;
}

/* --- brand footer bar --- */
.c3d-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(100deg, var(--c3d-green-700), var(--c3d-green-500));
  color: #fff;
  padding: 9px 14px;
  margin: 0 -16px -16px;
}
.c3d-brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.c3d-brand a {
  color: #eafbd8;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  border-bottom: 1px solid rgba(234, 251, 216, .5);
}
.c3d-brand a:hover { color: #fff; }

/* --- upcoming events list --- */
.c3d-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
}

.c3d-upcoming {
  width: min(var(--c3d-w), 100%);
  margin-top: 2px;
  background: var(--c3d-paper);
  border: 1px solid var(--c3d-line);
  border-radius: 12px;
  padding: 18px 20px 20px;
  box-shadow: 0 8px 18px -12px rgba(89, 9, 0, .12);
  text-align: left;
}
.c3d-upcoming h3 {
  margin: 0 0 12px;
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--c3d-green-900);
}
.c3d-upcoming ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.c3d-upcoming li {
  display: flex; align-items: baseline; gap: 9px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.c3d-upcoming li:hover { background: var(--c3d-cream); }
.c3d-upcoming .c3d-udate {
  font-weight: 700; font-size: 11px; color: #fff;
  background: var(--c3d-green-700);
  padding: 2px 7px; border-radius: 5px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.c3d-upcoming .c3d-utitle { font-size: 12.5px; color: var(--c3d-ink); font-weight: 500; }
.c3d-upcoming .c3d-uempty { font-size: 12px; color: var(--c3d-ink-soft); font-style: italic; }

@media (max-width: 420px) {
  .c3d-easel { flex-direction: column; }
  .c3d-photo { width: 100%; height: 120px; border-radius: 14px 14px 0 0; }
  .c3d-photo-label { border-radius: 0 26px 0 0; }
  .c3d-tilt { transform: rotateX(2deg) rotateY(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .c3d-tilt { transition: none; }
  .c3d-bubble { animation: none; }
}
