:root {
  color-scheme: light;
  --bg: #f6f5ff;
  --panel: #ffffff;
  --accent: #9ad0ec;
  --accent-strong: #ffb5c4;
  --text: #2e2b2b;
  --muted: #666070;
  --border: rgba(76, 63, 104, 0.12);
  font-family: "IBM Plex Sans Thai", "Kanit", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
}

.layout {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto 64px;
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 32px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  background: linear-gradient(135deg, #fef3f8, #e7f5ff, #fdf7d9);
  border-radius: 32px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 35px rgba(153, 134, 182, 0.18);
}

.hero-copy h1 {
  font-family: "Kanit", "IBM Plex Sans Thai";
  margin: 12px 0 16px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--text);
}

.eyebrow {
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.hero-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.primary,
.secondary {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary {
  background: var(--accent-strong);
  color: #3c2433;
  box-shadow: 0 10px 20px rgba(255, 181, 196, 0.45);
}

.secondary {
  background: rgba(154, 208, 236, 0.3);
  color: #263047;
}

.primary:active,
.secondary:active {
  transform: translateY(1px);
}

.hero-panel {
  background: rgba(255, 255, 255, 0.9);
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(57, 48, 71, 0.1);
}

.panel-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-panel h3 {
  margin: 4px 0 12px;
  font-size: 1.5rem;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(154, 208, 236, 0.3);
  font-size: 0.85rem;
  color: #32445a;
}

/* Calendar Section */
.calendar-section {
  margin: 0;
  max-width: 100%;
  width: 100%;
  padding: 28px;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(206, 63, 75, 0.12), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(50, 68, 90, 0.08), transparent 35%),
    #faf8f5;
  border-radius: 28px;
  box-shadow: 0 20px 35px rgba(166, 156, 190, 0.15);
  border: 1px solid #e8e1d8;
}

.nav-buttons {
  display: flex;
  gap: 0.5rem;
}

.nav-buttons button {
  padding: 0.45rem 0.85rem;
  background: #fff;
  border: 1px solid #d4c5b9;
  border-radius: 999px;
  color: #5d4e37;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 6px 18px rgba(93, 78, 55, 0.08);
}

.nav-buttons button:hover {
  background: linear-gradient(135deg, #ce3f4b, #d98f74);
  color: white;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(206, 63, 75, 0.25);
}

.day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
  color: #5d4e37;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.calendar-mobile-note {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  background: #fffaf5;
  border: 1px dashed #d4c5b9;
  border-radius: 12px;
  color: #5d4e37;
}

.calendar-mobile-link {
  display: inline-block;
  margin-top: 6px;
  color: #ce3f4b;
  text-decoration: none;
  font-weight: 600;
}

.calendar-mobile-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .calendar-section {
    display: none;
  }
  .section-header {
    align-items: center;
    gap: 12px;
  }
  .nav-buttons {
    width: 100%;
    justify-content: flex-end;
  }
  .nav-buttons button {
    padding: 0.45rem 0.7rem;
  }
  .day-labels {
    gap: 4px;
    font-size: 0.82rem;
  }
  .calendar-grid {
    display: none;
  }
  .day-labels,
  .nav-buttons,
  .calendar-mobile-note {
    display: none;
  }
}

.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), #fdfcfa);
  border-radius: 12px;
  padding: 0.6rem;
  min-height: 68px;
  position: relative;
  border: 1px solid #e8e3dd;
  transition: all 0.2s ease;
}

.calendar-cell:hover:not(.empty) {
  background: #fff9f0;
  border-color: #ce3f4b;
  box-shadow: 0 12px 24px rgba(206, 63, 75, 0.12);
  transform: translateY(-2px);
  cursor: pointer;
}

.calendar-cell.empty {
  background: transparent;
  border: none;
  pointer-events: none;
}

.calendar-cell span:first-child {
  font-size: 1rem;
  font-weight: 500;
  color: #5d4e37;
}

.calendar-cell.has-events {
  border-color: rgba(206, 63, 75, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), #fff5f2);
}

.calendar-cell.today {
  outline: 2px solid rgba(206, 63, 75, 0.6);
  outline-offset: 2px;
  box-shadow: 0 10px 20px rgba(206, 63, 75, 0.12);
}

.event-dot {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.event-dot span {
  width: 7px;
  height: 7px;
  background: #ce3f4b;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(206, 63, 75, 0.12);
}

.event-chip {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(206, 63, 75, 0.12);
  color: #4a352e;
  font-size: 0.78rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.section-header h2 {
  margin: 6px 0 0;
}

.events-section,
.upload-gate {
  background: var(--panel);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 20px 35px rgba(166, 156, 190, 0.15);
  border: 1px solid var(--border);
}
.upload-gate button {
  margin-top: 16px;
  align-self: flex-start;
  padding: 12px 24px;
}

.upload-gate__form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-gate__form--hidden {
  display: none;
}

.event-list {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.event-card {
  border: 1px solid rgba(63, 60, 92, 0.15);
  border-radius: 20px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), #fdfcfa);
}

.event-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.event-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.event-modal--open {
  display: flex;
}

.event-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 15, 25, 0.6);
  backdrop-filter: blur(4px);
}

.event-modal__content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #ffffff, #fdf7f3);
  border: 1px solid #eadfd4;
  border-radius: 24px;
  padding: 24px;
  width: min(640px, 90vw);
  box-shadow: 0 30px 60px rgba(26, 15, 46, 0.18);
}

.event-modal__header h3 {
  margin: 6px 0 0;
  color: #5d4e37;
}

.event-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: #5d4e37;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-modal__close:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.event-modal__list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-modal__item {
  border: 1px solid rgba(93, 78, 55, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: 0 10px 18px rgba(90, 78, 60, 0.08);
}

.event-modal__item h4 {
  margin: 0 0 6px;
  color: #3a2e20;
}

.event-modal__meta {
  color: #6c5b4b;
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.event-modal__desc {
  color: #6a6060;
  margin: 0;
  line-height: 1.5;
  font-size: 0.95rem;
}

.event-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 8px 0 12px;
}

.upload-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.upload-modal--open {
  display: flex;
}

.upload-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 15, 25, 0.65);
  backdrop-filter: blur(2px);
}

.upload-modal__content {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  width: min(90vw, 480px);
  box-shadow: 0 30px 60px rgba(19, 14, 33, 0.45);
  border: 1px solid rgba(49, 42, 95, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.upload-modal input[type="file"] {
  margin-top: 12px;
  border-radius: 14px;
  padding: 10px;
  border: 1px dashed rgba(90, 121, 140, 0.4);
  width: 100%;
}

.upload-history {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-history h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.upload-history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-history__list li {
  font-size: 0.85rem;
  color: #1b1c2b;
  background: rgba(100, 214, 161, 0.15);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upload-history__list span {
  font-size: 0.75rem;
  color: var(--muted);
}

.password-row {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

.password-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(90, 121, 140, 0.3);
  font-size: 1rem;
}

.password-row button {
  border: none;
  border-radius: 14px;
  padding: 10px 18px;
  background: #64d6a1;
  color: #09402b;
  font-weight: 600;
  cursor: pointer;
}

.helper-text {
  font-size: 0.9rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 768px) {
  .layout {
    padding: 20px;
  }

  .password-row {
    flex-direction: column;
  }

  .nav-buttons {
    justify-content: flex-end;
  }
}
