/* ==========================================================================
   AWOOGA — Events & calendar page
   Premium nautical calendar: appearances carry the logo, voyages a wake badge,
   multi-day stops render as spanning bars.
   ========================================================================== */

/* ---------- Hero --------------------------------------------------------- */
.ev-hero {
  background:
    radial-gradient(1200px 380px at 80% -10%, rgba(201,162,39,.18), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: var(--cream);
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  position: relative;
  overflow: hidden;
}
.ev-hero__inner { max-width: 62ch; }
.ev-hero .eyebrow { color: var(--brass-lt); }
.ev-hero .eyebrow::before { background: var(--brass-lt); }
.ev-hero h1 {
  color: var(--cream);
  font-size: clamp(2.3rem, 6vw, 4rem);
  margin-bottom: .5rem;
}
.ev-hero h1 em { color: var(--brass-lt); font-style: normal; }
.ev-hero .lead { color: rgba(247,241,227,.86); }
.ev-hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* ---------- "Coming up within a week" banner ----------------------------- */
.ev-soon {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  padding: .9rem 1.2rem;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--brass), var(--brass-lt));
  color: var(--navy-900);
  box-shadow: 0 16px 40px rgba(201,162,39,.34);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.ev-soon:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(201,162,39,.45); }
.ev-soon__pulse {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(184,71,63,.6);
  animation: ev-pulse 1.8s infinite;
}
@keyframes ev-pulse {
  0% { box-shadow: 0 0 0 0 rgba(184,71,63,.55); }
  70% { box-shadow: 0 0 0 12px rgba(184,71,63,0); }
  100% { box-shadow: 0 0 0 0 rgba(184,71,63,0); }
}
.ev-soon__body { font-weight: 600; line-height: 1.3; }
.ev-soon__body strong {
  display: inline-block; margin-right: .4rem;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 800;
}
.ev-soon__cta { margin-left: auto; font-weight: 700; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ev-soon__pulse { animation: none; } }

/* ---------- Section heads ------------------------------------------------ */
.ev-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.8rem;
}
.ev-head .section-title { margin-bottom: 0; }
.ev-head__note { max-width: 34ch; margin: 0; font-size: .92rem; }

/* ---------- Upcoming list ------------------------------------------------ */
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.ev-list__empty {
  padding: 2rem; text-align: center; border: 2px dashed var(--line);
  border-radius: var(--radius); background: var(--surface);
}
.ev-list__item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.ev-list__item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ev-list__item.is-featured { border-color: var(--brass); box-shadow: 0 8px 28px rgba(201,162,39,.18); }
.ev-list__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 64px; min-height: 64px; border-radius: 14px;
  background: var(--navy-900); color: var(--cream); padding: .4rem;
  line-height: 1;
}
.is-featured .ev-list__date { background: var(--brass); color: var(--navy-900); }
.ev-list__mon { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; opacity: .85; }
.ev-list__day { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.ev-list__multi { font-size: .8rem; opacity: .8; margin-top: .1rem; }
.ev-list__main h3 { margin: 0 0 .25rem; font-size: 1.2rem; }
.ev-list__meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: 0 0 .35rem; font-size: .9rem; color: var(--text-soft); }
.ev-list__when { font-weight: 600; color: var(--wood-dk); }
.ev-list__desc { margin: 0; font-size: .94rem; color: var(--text-soft); }
.ev-list__go { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.btn--sm { padding: .5rem 1rem; font-size: .85rem; }

@media (max-width: 640px) {
  .ev-list__item { grid-template-columns: auto 1fr; }
  .ev-list__go { grid-column: 1 / -1; flex-direction: row; }
}

/* ---------- Calendar shell ---------------------------------------------- */
.ev-cal-section { background: var(--paper); }
.ev-cal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.4vw, 1.8rem);
}
.ev-cal__toolbar { display: flex; align-items: center; gap: .8rem; margin-bottom: .4rem; }
.ev-cal__title {
  font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 1.9rem);
  margin: 0; min-width: 9ch;
}
.ev-cal__nav {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--cream);
  font-size: 1.4rem; line-height: 1; color: var(--navy-900);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s var(--ease);
}
.ev-cal__nav:hover { background: var(--brass); transform: translateY(-1px); }
.ev-cal__today { margin-left: auto; }

.ev-cal__legend { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: .2rem 0 1rem; font-size: .85rem; color: var(--text-soft); }
.ev-legend { display: inline-flex; align-items: center; gap: .45rem; }
.ev-legend__logo { width: 22px; height: 22px; vertical-align: middle; display: inline-block; }
.ev-legend__wake { color: var(--navy-600); font-size: 1.1rem; }

/* ---------- Calendar grid ----------------------------------------------- */
.ev-cal__weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 6px;
}
.ev-cal__weekdays span {
  text-align: center; font-size: .74rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-soft); padding: .3rem 0;
}
.ev-cal__week { position: relative; margin-bottom: 6px; }
.ev-cal__week:last-child { margin-bottom: 0; }
.ev-cal__days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
/* Event bars float over the day cells, starting below the date number.
   Both layers are 7-column grids with matching gaps so columns line up. */
.ev-cal__bars {
  position: absolute; left: 0; right: 0; top: 30px; bottom: 6px;
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 24px; gap: 4px 6px;
  pointer-events: none;
}

.ev-cal__day {
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  min-height: calc(34px + var(--lanes, 1) * 28px);
  position: relative;
}
.ev-cal__day.is-outside { background: transparent; border-color: transparent; }
.ev-cal__day.is-outside .ev-cal__num { opacity: .35; }
.ev-cal__day.is-today {
  background: #fff;
  border-color: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass);
}
.ev-cal__num {
  position: absolute; top: 4px; right: 8px;
  font-size: .85rem; font-weight: 600; color: var(--ink-soft);
  pointer-events: none;
}
.ev-cal__todaydot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem;
  background: var(--brass); color: var(--navy-900);
  border-radius: 999px; font-weight: 800;
}

/* ---------- Event bars --------------------------------------------------- */
.ev-cal__bar {
  align-self: center;
  display: inline-flex; align-items: center; gap: .35rem;
  height: 24px; margin: 0 1px; padding: 0 .45rem;
  border: 0; border-radius: 7px;
  font-size: .76rem; font-weight: 600; line-height: 1;
  color: #fff; cursor: pointer; overflow: hidden;
  text-align: left; pointer-events: auto;
  transition: transform .15s var(--ease), filter .15s var(--ease), box-shadow .15s var(--ease);
}
.ev-cal__bar:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 6px 16px rgba(12,32,52,.22); z-index: 3; }
.ev-cal__bar-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ev-cal__bar--appear {
  background: linear-gradient(100deg, var(--navy-700), var(--navy-600));
  box-shadow: inset 0 0 0 1px rgba(247,241,227,.12);
}
.ev-cal__bar--appear.is-featured { background: linear-gradient(100deg, var(--brass), var(--brass-lt)); color: var(--navy-900); }
.ev-cal__bar--trip {
  background: repeating-linear-gradient(45deg, var(--navy-600), var(--navy-600) 7px, #1a5586 7px, #1a5586 14px);
  color: var(--cream);
}
.ev-cal__bar-logo { width: 17px; height: 17px; flex: none; display: inline-flex; }
.ev-cal__bar-logo img { width: 100%; height: 100%; object-fit: contain; }
.ev-cal__bar-wake { flex: none; font-size: .95rem; line-height: 1; color: var(--brass-lt); }

/* continuation arrows for multi-week spans */
.ev-cal__bar.is-cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.ev-cal__bar.is-cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.ev-cal__bar.is-cont-l::before { content: "‹"; opacity: .7; margin-right: .1rem; }
.ev-cal__bar.is-cont-r::after { content: "›"; opacity: .7; margin-left: auto; padding-left: .15rem; }

.ev-cal__empty { text-align: center; margin: 1rem 0 0; }

/* ---------- Mobile: stack the calendar into a readable agenda ------------- */
@media (max-width: 560px) {
  .ev-cal { padding: .8rem; }
  .ev-cal__bar-label { font-size: .66rem; }
  .ev-cal__day { min-height: calc(28px + var(--lanes, 1) * 24px); }
  .ev-cal__bars { top: 26px; grid-auto-rows: 20px; gap: 3px 4px; }
  .ev-cal__bar { height: 20px; font-size: .68rem; padding: 0 .3rem; gap: .2rem; }
  .ev-cal__bar-logo { width: 14px; height: 14px; }
  .ev-cal__num { font-size: .78rem; top: 3px; right: 5px; }
  .ev-cal__days { gap: 4px; }
}

/* ---------- Detail modal ------------------------------------------------- */
.ev-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
}
.ev-modal[hidden] { display: none; }
.ev-modal__backdrop {
  position: absolute; inset: 0; background: rgba(8,18,30,.62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s ease;
}
.ev-modal.is-open .ev-modal__backdrop { opacity: 1; }
.ev-modal__card {
  position: relative; z-index: 1;
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(.98); opacity: 0;
  transition: transform .24s var(--ease), opacity .24s var(--ease);
}
.ev-modal.is-open .ev-modal__card { transform: none; opacity: 1; }
.ev-modal__x {
  position: absolute; top: .6rem; right: .7rem; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(12,32,52,.08); color: var(--navy-900);
  font-size: 1.5rem; line-height: 1;
}
.ev-modal__x:hover { background: rgba(12,32,52,.16); }
.ev-modal__media { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--navy-900); }
.ev-modal__media img { width: 100%; height: 100%; object-fit: cover; }
.ev-modal__body { padding: 1.6rem 1.7rem 1.8rem; }
.ev-modal__tag {
  display: inline-block; margin-bottom: .6rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--navy-900); background: var(--brass);
  padding: .28rem .7rem; border-radius: 999px;
}
.ev-modal__tag.is-trip { background: var(--navy-700); color: var(--cream); }
.ev-modal__body h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin: 0 0 .5rem; }
.ev-modal__when { font-weight: 600; color: var(--wood-dk); margin: 0 0 .3rem; }
.ev-modal__where { color: var(--text-soft); margin: 0 0 .9rem; }
.ev-modal__desc { color: var(--text); margin: 0 0 1.3rem; }
.ev-modal__actions { display: flex; gap: .7rem; flex-wrap: wrap; }
