:root {
  --red: #a62920;
  --red-dark: #7f1f19;
  --cream: #fff8ec;
  --paper: #fffdf8;
  --ink: #321f1b;
  --muted: #7b625c;
  --line: #ead8c5;
  --shadow: 0 14px 38px rgba(92, 38, 28, .12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(166, 41, 32, .08), transparent 28rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  padding: max(18px, env(safe-area-inset-top)) 18px 18px;
  background: var(--red);
  color: white;
  box-shadow: 0 5px 24px rgba(80, 18, 13, .22);
}

.brand {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-logo { width: 58px; height: 58px; flex: 0 0 auto; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.45rem, 5vw, 2.25rem); line-height: 1.05; }
.brand p { margin: 5px 0 0; opacity: .85; font-size: .92rem; }

.app-shell { width: min(1100px, 100%); margin: 0 auto; padding: 18px 12px 36px; }
.calendar-card {
  background: var(--paper);
  border: 1px solid rgba(166, 41, 32, .12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(12px, 3vw, 24px);
  overflow: hidden;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff0cd;
  border: 1px solid #e6c87d;
  font-size: .92rem;
}
.notice code { font-weight: 700; }

/* FullCalendar */
.fc { --fc-border-color: var(--line); --fc-page-bg-color: transparent; --fc-neutral-bg-color: #f8ecdd; --fc-today-bg-color: rgba(166, 41, 32, .07); }
.fc .fc-toolbar { gap: 10px; flex-wrap: wrap; }
.fc .fc-toolbar-title { font-family: Georgia, serif; color: var(--red-dark); font-size: clamp(1.25rem, 5vw, 1.8rem); text-transform: capitalize; }
.fc .fc-button-primary {
  background: var(--red);
  border-color: var(--red);
  border-radius: 11px;
  font-weight: 700;
  box-shadow: none;
}
.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--red-dark);
  border-color: var(--red-dark);
}
.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number { color: var(--ink); text-decoration: none; }
.fc .fc-col-header-cell-cushion { padding: 9px 3px; font-size: .78rem; text-transform: uppercase; }
.fc .fc-daygrid-day-number { padding: 7px; font-weight: 700; }
.fc .fc-event {
  background: var(--red);
  border-color: var(--red);
  border-radius: 7px;
  padding: 2px 4px;
  cursor: pointer;
  font-weight: 700;
}
.fc .fc-list { border-radius: 14px; overflow: hidden; }
.fc .fc-list-day-cushion { background: #f5e5d2; }
.fc .fc-list-event:hover td { background: #fff3e4; }
.fc .fc-list-event-dot { border-color: var(--red); }
.fc .fc-list-event-title a { color: var(--ink); text-decoration: none; font-weight: 800; }
.fc .fc-list-event-time { display: none; }
.fc .fc-daygrid-more-link { color: var(--red); font-weight: 800; }

footer {
  text-align: center;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .82rem;
}

footer p {
  margin: 0;
}

.footer-credit {
  margin-top: 6px;
  font-size: .9rem;
}

.footer-credit strong {
  color: var(--red);
  font-weight: 700;
}

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: end center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(35, 20, 17, .55); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 44px rgba(31, 15, 12, .25);
  animation: slide-up .2s ease-out;
}
.modal-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f2e4d6; color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.modal-kicker { margin: 0 0 5px; color: var(--red); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.modal h2 { margin: 0 44px 10px 0; font-family: Georgia, serif; font-size: 1.55rem; }
.modal-date { color: var(--muted); margin: 0 0 10px; text-transform: capitalize; }
.modal-location { margin: 0 0 20px; color: var(--ink); font-weight: 700; }
.primary-button { display: block; width: 100%; padding: 14px 18px; border-radius: 13px; background: var(--red); color: white; text-align: center; text-decoration: none; font-weight: 900; }
.modal-open { overflow: hidden; }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }

@media (max-width: 620px) {
  .app-header { position: sticky; top: 0; z-index: 10; padding-bottom: 14px; }
  .brand-logo { width: 48px; height: 48px; }
  .brand p { display: none; }
  .app-shell { padding: 12px 8px 28px; }
  .calendar-card { border-radius: 18px; padding: 10px; }
  .fc .fc-toolbar { align-items: center; }
  .fc .fc-toolbar-chunk:nth-child(2) { order: -1; width: 100%; text-align: center; }
  .fc .fc-toolbar-chunk:last-child .fc-dayGridMonth-button { display: none; }
  .fc .fc-list-event-title { font-size: 1rem; }
}

@media (min-width: 621px) {
  .modal { place-items: center; padding: 20px; }
  .modal-card { border-radius: 24px; }
}
