/* Event Schedule — estilo Tibia / referência Calmera */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.page-eventos {
  min-height: 100vh;
  font-family: 'Outfit', system-ui, sans-serif;
  color: #d4d4d8;
  background: #0a0a0c url('../imgs/background.jpg') center top / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
}

body.page-eventos::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.88);
  pointer-events: none;
  z-index: 0;
}

.events-page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

/* ── Header ── */

.events-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.events-top__left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.events-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a1a1aa;
  text-decoration: none;
  border: 1px solid #3a3a44;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.events-back:hover {
  color: #fff;
  border-color: #8b1a1a;
}

.events-logo {
  height: 38px;
  width: auto;
}

.events-top__title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.events-ornament {
  color: #8b1a1a;
  font-size: 0.85rem;
  opacity: 0.7;
}

.events-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b91c1c;
  text-shadow:
    0 1px 0 #3f0000,
    0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(139, 26, 26, 0.25);
}

/* ── Calendar box ── */

.calendar {
  background: rgba(12, 12, 16, 0.95);
  border: 2px solid #8b1a1a;
  box-shadow:
    inset 0 0 0 1px rgba(139, 26, 26, 0.3),
    0 8px 40px rgba(0, 0, 0, 0.6);
  padding: 0;
}

.calendar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #2a2a32;
  background: rgba(0, 0, 0, 0.35);
}

.calendar__month {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #e4e4e7;
  min-width: 150px;
  text-align: center;
}

.calendar__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 0.75rem;
  border: 1px solid #3a3a44;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  transition: color 0.2s, border-color 0.2s;
}

.calendar__arrow:hover {
  color: #fff;
  border-color: #8b1a1a;
}

/* ── Grid ── */

.calendar__table {
  width: 100%;
}

.calendar__head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #2a2a32;
}

.calendar__head-cell {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ca3af;
  border-right: 1px solid #222228;
}

.calendar__head-cell:last-child {
  border-right: none;
}

.calendar__body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar__cell {
  min-height: 100px;
  padding: 4px;
  border-right: 1px solid #222228;
  border-bottom: 1px solid #222228;
  background: rgba(0, 0, 0, 0.2);
  vertical-align: top;
}

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

.calendar__cell--muted {
  background: rgba(0, 0, 0, 0.45);
}

.calendar__cell--muted .calendar__day-num {
  color: #52525b;
}

.calendar__cell--today {
  background: rgba(139, 26, 26, 0.08);
}

.calendar__cell-top {
  display: flex;
  align-items: flex-start;
  gap: 1px;
  min-height: 18px;
  margin-bottom: 3px;
}

.calendar__star {
  font-size: 0.7rem;
  font-weight: 700;
  color: #ef4444;
  line-height: 1;
}

.calendar__day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d4d4d8;
  line-height: 1;
}

/* ── Event pills (uma barra por dia, estilo Tibia) ── */

.calendar__events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar__event {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  font-size: 0.62rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  border-radius: 2px;
  min-height: 16px;
}

.calendar__event-icon {
  font-size: 0.6rem;
  flex-shrink: 0;
}

.calendar__event-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar__note {
  padding: 10px 14px;
  font-size: 0.72rem;
  font-style: italic;
  color: #ef4444;
  border-top: 1px solid #2a2a32;
  background: rgba(0, 0, 0, 0.3);
}

.events-foot {
  margin-top: 20px;
  text-align: center;
}

.events-foot p {
  font-size: 0.72rem;
  color: #6b7280;
}

.calendar.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .calendar__cell {
    min-height: 80px;
  }

  .calendar__event {
    font-size: 0.55rem;
    padding: 1px 3px;
  }

  .calendar__head-cell {
    font-size: 0.6rem;
    padding: 6px 2px;
  }
}

@media (max-width: 640px) {
  .events-top {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .events-top__left {
    justify-content: center;
    flex-wrap: wrap;
  }

  .events-ornament {
    display: none;
  }

  .calendar__head-cell {
    font-size: 0.58rem;
    padding: 6px 1px;
  }

  .calendar__cell {
    min-height: 64px;
    padding: 2px;
  }

  .calendar__event-name {
    display: none;
  }

  .calendar__event {
    min-height: 6px;
    padding: 0;
    border-radius: 1px;
  }

  .calendar__event-icon {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calendar.is-loading {
    opacity: 1;
  }
}
