:root {
  color-scheme: light;
  --ink: #0c1524;
  --muted: #596575;
  --line: #cdd8e8;
  --panel: #ffffff;
  --panel-strong: #eef6ff;
  --navy: #0d376d;
  --navy-deep: #071f3f;
  --light-blue: #d8ebff;
  --badge-red: #e62227;
  --gold: #c59a36;
  --shadow: 0 24px 60px rgba(5, 20, 42, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.84)),
    repeating-linear-gradient(
      90deg,
      rgba(13, 55, 109, 0.045) 0,
      rgba(13, 55, 109, 0.045) 1px,
      transparent 1px,
      transparent 78px
    ),
    radial-gradient(circle at 18% 8%, rgba(197, 154, 54, 0.2), transparent 28%),
    linear-gradient(135deg, #d7e8fb 0%, #ffffff 48%, #eef4fb 100%);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  width: min(1440px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

.home-shell {
  width: min(1120px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

.calendar-panel,
.details-panel,
.home-panel {
  border: 1px solid rgba(13, 55, 109, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(18px, 3vw, 32px);
  border-radius: 8px;
}

.home-panel {
  min-height: calc(100vh - 32px);
  padding: clamp(18px, 3vw, 32px);
  border-radius: 8px;
}

.brand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 12px 14px;
  border: 1px solid rgba(197, 154, 54, 0.52);
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(197, 154, 54, 0.2), transparent 44%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-crest {
  display: block;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(3, 12, 25, 0.22);
  object-fit: contain;
}

.brand-name,
.brand-line,
.brand-place,
.panel-label {
  margin: 0;
  letter-spacing: 0;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
  line-height: 1;
}

.brand-line,
.brand-place {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.brand-place {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px 0 24px;
}

.page-nav a {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.page-nav a[aria-current="page"],
.page-nav a:hover {
  border-color: rgba(230, 34, 39, 0.38);
  color: #ffffff;
  background: var(--navy);
}

.home-content {
  display: grid;
  gap: 22px;
  padding-top: clamp(18px, 4vw, 42px);
}

.explainer-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(13, 55, 109, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.explainer-box h1 {
  max-width: 660px;
}

.explainer-box p:last-child {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.62;
}

.calendar-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.calendar-link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
  border: 1px solid rgba(13, 55, 109, 0.18);
  border-radius: 8px;
  color: var(--navy-deep);
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(5, 20, 42, 0.14);
  text-decoration: none;
  text-align: center;
}

.calendar-link-card:hover {
  border-color: rgba(197, 154, 54, 0.7);
  transform: translateY(-2px);
}

.calendar-link-card img {
  width: 82px;
  height: 82px;
  margin-right: 18px;
  border-radius: 50%;
  object-fit: contain;
}

.calendar-link-card span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1;
}

.social-card,
.lodge-card {
  background:
    linear-gradient(135deg, rgba(216, 235, 255, 0.42), rgba(255, 255, 255, 0.96)),
    #ffffff;
}

.club-links-box {
  padding: 18px;
  border: 1px solid rgba(13, 55, 109, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.club-links-box h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1;
}

.club-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.club-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: #ffffff;
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.facebook-link {
  border-color: rgba(24, 119, 242, 0.34);
}

.facebook-link svg {
  color: #1877f2;
}

.instagram-link {
  border-color: rgba(225, 48, 108, 0.34);
}

.instagram-link svg {
  color: #e1306c;
}

.whatsapp-link {
  border-color: rgba(37, 211, 102, 0.38);
}

.whatsapp-link svg {
  color: #25d366;
}

.surrey-link {
  border-color: rgba(0, 75, 155, 0.28);
}

.club-links svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: currentColor;
}

.club-links .crest-icon {
  width: 22px;
  height: 22px;
  fill: none;
}

.crest-icon path:nth-child(1) {
  fill: #f3bf2c;
  stroke: #004b9b;
  stroke-width: 1.25;
}

.crest-icon path:nth-child(2) {
  fill: #b7192f;
}

.crest-icon path:nth-child(3),
.crest-icon path:nth-child(5) {
  fill: #004b9b;
}

.crest-icon path:nth-child(4) {
  fill: #111111;
}

.club-links a:hover {
  border-color: rgba(197, 154, 54, 0.7);
  background: var(--panel-strong);
}

.login-shell {
  display: grid;
  width: min(520px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  place-items: center;
}

.login-panel {
  display: grid;
  gap: 22px;
  width: 100%;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(13, 55, 109, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: contain;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  text-transform: none;
}

.login-form input:focus {
  border-color: var(--navy);
  outline: 3px solid rgba(13, 55, 109, 0.14);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--badge-red);
  font-size: 0.9rem;
  font-weight: 800;
}

.login-button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--navy);
  cursor: pointer;
  font-weight: 900;
}

.calendar-header,
.month-bar,
.calendar-actions,
.weekday-row,
.day-number,
dl div {
  display: flex;
  align-items: center;
}

.calendar-header,
.month-bar {
  justify-content: space-between;
  gap: 16px;
}

.kicker {
  margin: 0 0 4px;
  color: var(--badge-red);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 4.6vw, 4.9rem);
  font-weight: 700;
  line-height: 0.95;
}

.calendar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button,
.text-button {
  display: inline-grid;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  place-items: center;
}

.icon-button {
  width: 42px;
  font-size: 1.65rem;
  line-height: 1;
}

.text-button {
  padding: 0 18px;
  font-size: 0.9rem;
  font-weight: 800;
}

.icon-button:hover,
.text-button:hover,
.event-pill:hover {
  border-color: rgba(230, 34, 39, 0.48);
  background: #fff1f1;
}

.month-bar {
  margin: 30px 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.month-bar h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.month-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.weekday-row span {
  padding: 0 8px;
}

.calendar-grid {
  flex: 1;
  gap: 8px;
}

.day-cell {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.day-cell.outside {
  color: #9ca8b7;
  background: rgba(238, 246, 255, 0.54);
}

.day-cell.today {
  border-color: rgba(13, 55, 109, 0.68);
  box-shadow: inset 0 0 0 1px rgba(13, 55, 109, 0.18);
}

.day-number {
  justify-content: space-between;
  min-height: 22px;
  font-size: 0.86rem;
  font-weight: 850;
}

.today .day-number::after {
  content: "Today";
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-size: 0.64rem;
}

.event-list {
  display: grid;
  gap: 6px;
  flex: 1;
  margin-top: 8px;
}

.event-pill {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-left: 4px solid var(--badge-red);
  border-radius: 7px;
  color: var(--ink);
  background: #fff0f1;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.event-pill[data-type="social"] {
  border-left-color: var(--navy);
  background: #eef6ff;
}

.event-pill[data-type="talk"] {
  border-left-color: #6fa8dc;
  background: #f0f7ff;
}

.event-pill[data-type="dining"] {
  border-left-color: var(--gold);
  background: #fff7e2;
}

.event-pill[aria-pressed="true"] {
  outline: 2px solid rgba(230, 34, 39, 0.35);
  outline-offset: 1px;
}

.event-time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.details-panel {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  padding: 28px;
  border-radius: 8px;
  overflow: auto;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(197, 154, 54, 0.2), transparent 42%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
}

.club-mark {
  display: block;
  width: 132px;
  height: auto;
  margin-bottom: 34px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 16px 28px rgba(3, 12, 25, 0.32);
}

.panel-label {
  width: fit-content;
  margin-bottom: 28px;
  padding: 7px 10px;
  border: 1px solid rgba(197, 154, 54, 0.52);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.empty-state {
  margin-top: auto;
  margin-bottom: auto;
}

.empty-state h2,
.event-details h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1;
}

.empty-state .kicker,
.detail-date {
  color: #f5c84c;
}

.event-details {
  display: grid;
  gap: 22px;
}

.hidden {
  display: none;
}

.detail-date {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div {
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

dt {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-weight: 850;
  text-align: right;
}

#detailDescription {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  line-height: 1.55;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(197, 154, 54, 0.52);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.77rem;
  font-weight: 850;
}

.event-poster {
  width: 100%;
  max-height: 360px;
  border: 1px solid rgba(197, 154, 54, 0.52);
  border-radius: 8px;
  background: #05080d;
  box-shadow: 0 18px 32px rgba(3, 12, 25, 0.26);
  object-fit: contain;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .explainer-box {
    min-height: 240px;
  }

  .details-panel {
    position: static;
    min-height: auto;
  }

  .club-mark {
    width: 92px;
    height: auto;
    margin-bottom: 20px;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .home-shell {
    width: min(100vw - 20px, 640px);
    margin: 10px auto;
  }

  .calendar-header,
  .month-bar,
  .brand-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-place {
    display: none;
  }

  .home-panel {
    min-height: calc(100vh - 20px);
  }

  .calendar-link-card {
    flex-direction: column;
    min-height: 170px;
    gap: 12px;
  }

  .calendar-link-card img {
    margin-right: 0;
  }

  .calendar-actions {
    justify-content: flex-start;
  }

  .weekday-row {
    gap: 4px;
    font-size: 0.65rem;
  }

  .weekday-row span {
    padding: 0 2px;
    text-align: center;
  }

  .calendar-grid {
    gap: 4px;
  }

  .day-cell {
    min-height: 112px;
    padding: 5px;
  }

  .event-pill {
    min-height: 28px;
    padding: 6px;
    border-left-width: 3px;
    font-size: 0.68rem;
  }

  .event-time {
    display: none;
  }

  .today .day-number::after {
    content: "";
    width: 7px;
    height: 7px;
    padding: 0;
  }
}
