/* ==========================================================================
   Inner page styling (events, detail, info, about, 404).
   Loaded after site.css so the existing behaviour/markup is preserved while
   applying the school's light editorial visual system.
   ========================================================================== */

:root {
  --bg: #f8f6f6;
  --surface: #ffffff;
  --surface-muted: #efedec;
  --text: #161616;
  --text-muted: rgb(22 22 22 / 0.7);
  --text-subtle: rgb(22 22 22 / 0.48);
  --border: #e0dcdb;
  --border-strong: #161616;
  --accent: #f85c0e;
  --accent-ink: #a63d06;
  --orange-ink: #a63d06;
  --focus: #35cbfd;
  --radius-xs: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --header-height: 80px;
  --header-height-mobile: 64px;
  --container-max: 1114px;
  --font-sans: "Geist", "PingFang HK", "Microsoft JhengHei", "Noto Sans CJK TC",
    "Noto Sans TC", "Heiti TC", system-ui, sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", Consolas, monospace;
}

body {
  background: var(--page-bg);
  color: var(--primary);
  font-family: var(--font-sans);
  line-height: 1.45;
}

.container {
  max-width: 1114px;
  padding-inline: 24px;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: none;
}

.page-head {
  padding-top: calc(var(--header-height) + 72px);
  padding-bottom: 56px;
}

.page-head__title {
  max-width: 18ch;
  margin-top: 12px;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.page-head__intro {
  max-width: 60ch;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Buttons (inner pages)
   -------------------------------------------------------------------------- */

.btn {
  min-height: 44px;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 650;
  transition:
    background-color 150ms var(--ease-ui),
    border-color 150ms var(--ease-ui),
    color 150ms var(--ease-ui),
    transform 150ms var(--ease-ui);
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.btn--primary:hover {
  background: #2c2c2c;
  border-color: #2c2c2c;
  color: var(--white);
}

.btn--secondary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn--secondary:hover {
  background: rgb(22 22 22 / 0.06);
  color: var(--primary);
}

.btn--ghost {
  color: var(--orange);
}

.btn--ghost:hover {
  color: var(--primary);
}

/* Pixel hover shared with .mkp-btn */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, var(--lime) 50%, transparent 50%),
    linear-gradient(0deg, var(--cyan) 50%, transparent 50%),
    linear-gradient(135deg, var(--orange) 50%, transparent 50%);
  background-size: 12px 12px;
  opacity: 0;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 32%, transparent 68%, #000);
  mask-image: linear-gradient(90deg, #000, transparent 32%, transparent 68%, #000);
}

.btn:hover::before,
.btn:focus-visible::before {
  animation: pixel-hover 480ms steps(7) both;
}

/* --------------------------------------------------------------------------
   Events split view
   -------------------------------------------------------------------------- */

.events-page {
  padding-top: var(--header-height);
  background: var(--page-bg);
}

.events-shell {
  display: block;
  width: 100%;
}

.events-sidebar {
  padding: 32px 24px 48px;
}

.events-sidebar__head {
  margin-bottom: 28px;
}

.events-title {
  margin-top: 8px;
  font-size: clamp(38px, 4.4vw, 48px);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.events-intro {
  max-width: 46ch;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.45;
}

.events-detail {
  display: none;
  background: var(--white);
}

.filter-panel {
  padding: 16px;
  margin-bottom: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0;
}

.filter-grid {
  gap: 14px;
}

.field__label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.input,
.select {
  min-height: 44px;
  padding: 10px 12px;
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 14px;
}

.input:focus-visible,
.select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.search-field .input {
  padding-left: 38px;
}

.chip-row {
  gap: 6px;
  margin-top: 14px;
}

.chip {
  min-height: 38px;
  padding: 8px 12px;
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.filter-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.results-count {
  font-size: 13px;
}

.clear-filters {
  color: var(--orange-ink);
  font-size: 13px;
  font-weight: 650;
}

.clear-filters:hover {
  color: var(--primary);
}

.events-sidebar .archive-grid {
  gap: 0;
  border-top: 1px solid var(--border);
}

.activity-card {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.activity-card__body {
  padding: 16px 8px;
  gap: 6px;
}

.activity-card__meta {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.activity-card__title {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  -webkit-line-clamp: 2;
}

.activity-card__excerpt {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  -webkit-line-clamp: 2;
}

.activity-card__footer {
  display: none;
}

.activity-card__media {
  background: var(--surface-muted);
}

.activity-card:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.activity-card:hover .activity-card__body {
  background: rgb(22 22 22 / 0.04);
}

.activity-card.is-active {
  border-bottom-color: var(--orange);
  box-shadow: inset 3px 0 0 var(--orange);
}

.activity-card.is-active .activity-card__title {
  color: var(--orange-ink);
}

.activity-card:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.load-more {
  margin-top: 24px;
}

.all-shown {
  color: var(--text-muted);
  font-size: 13px;
}

/* Desktop split */
@media (min-width: 1024px) {
  .events-page {
    padding-top: var(--header-height);
  }

  .events-shell {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    max-width: none;
    padding-inline: 0;
    height: calc(100dvh - var(--header-height));
  }

  .events-sidebar {
    padding: 28px 22px 48px;
    border-right: 1px solid var(--keyline);
    overflow-y: auto;
  }

  .events-detail {
    display: block;
    overflow-y: auto;
    background: var(--white);
  }

  .events-sidebar .archive-grid {
    grid-template-columns: 1fr;
  }

  .events-sidebar .activity-card__link {
    flex-direction: row;
  }

  .events-sidebar .activity-card__media {
    width: 82px;
    flex: 0 0 82px;
    aspect-ratio: 1;
  }

  .events-sidebar .activity-card__excerpt {
    display: none;
  }

  .events-sidebar .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .events-sidebar .field:first-child {
    grid-column: 1 / -1;
  }

  .events-sidebar .chip {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
  }
}

/* Mobile list keeps full cards */
@media (max-width: 1023px) {
  .events-sidebar .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
    border-top: 0;
  }

  .events-sidebar .activity-card {
    border: 0;
    border-bottom: 0;
  }

  .events-sidebar .activity-card__body {
    padding: 16px 0 0;
  }

  .events-sidebar .activity-card__title {
    font-size: 18px;
  }

  .events-sidebar .activity-card__excerpt {
    display: -webkit-box;
  }

  .events-sidebar .activity-card__footer {
    display: flex;
  }

  .events-sidebar .activity-card.is-active {
    box-shadow: none;
  }
}

@media (max-width: 639px) {
  .events-sidebar .archive-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Embedded detail (right pane / modal)
   -------------------------------------------------------------------------- */

.detail--embedded {
  padding: 0;
}

.event-detail__body {
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  padding: 48px 56px 72px;
}

.detail--embedded .activity-title {
  margin-top: 8px;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.detail--embedded .activity-meta {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.detail--embedded .activity-cover {
  margin-top: 28px;
  border-radius: 0;
}

.detail--embedded .detail__section {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.detail__section-title {
  font-size: 22px;
  font-weight: 650;
}

.prose {
  font-size: 18px;
  line-height: 1.65;
  color: var(--primary);
}

.prose a {
  color: var(--orange);
}

.gallery-grid {
  gap: 4px;
}

.gallery-item {
  border-radius: 0;
  background: var(--surface-muted);
}

.attachments {
  gap: 6px;
}

.attachment {
  border-radius: 0;
  border-color: var(--border);
}

.attachment:hover {
  border-color: var(--primary);
  transform: none;
  background: rgb(22 22 22 / 0.03);
}

.attachment__icon {
  border-radius: 2px;
  color: var(--orange);
  background: var(--page-bg);
}

/* --------------------------------------------------------------------------
   Info page
   -------------------------------------------------------------------------- */

.info-layout {
  gap: 40px;
}

.info-nav__link {
  font-size: 13px;
  font-weight: 600;
  border-left: 1px solid transparent;
}

.info-nav__link:hover {
  border-left-color: var(--orange);
}

.info-section {
  padding: 40px 0;
  border-top: 1px solid var(--keyline);
}

.info-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.info-section__title {
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.info-section__text {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
}

.info-section__links {
  gap: 8px;
}

.info-link {
  min-height: 58px;
  padding: 14px 16px;
  border-radius: 0;
  border-color: var(--border);
  background: var(--white);
}

.info-link:hover {
  border-color: var(--primary);
  transform: none;
  background: rgb(22 22 22 / 0.03);
}

.info-link__label {
  font-size: 15px;
  font-weight: 600;
}

.info-link__meta {
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about-grid {
  gap: 48px;
}

.about-copy {
  font-size: 18px;
  line-height: 1.65;
}

.about-photo {
  border-radius: 0;
  border-color: var(--border);
}

.about-photo__caption {
  color: var(--text-muted);
  font-size: 12px;
}

.contact-card {
  border-radius: 0;
  border-color: var(--border);
  background: var(--white);
}

.contact-card__title {
  font-size: 24px;
  font-weight: 550;
}

.contact-list__item {
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Standalone activity page
   -------------------------------------------------------------------------- */

.detail {
  background: var(--page-bg);
}

.detail .container {
  max-width: 980px;
}

.activity-header {
  max-width: none;
}

.activity-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.activity-meta {
  font-size: 14px;
  font-weight: 600;
}

.activity-cover {
  border-radius: 0;
}

.detail__back {
  font-weight: 650;
}

.breadcrumb a {
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   States / filter / misc
   -------------------------------------------------------------------------- */

.state {
  border-radius: 0;
  border-color: var(--border);
  background: var(--white);
}

.state__icon {
  border-radius: 0;
  color: var(--orange);
}

.state__title {
  font-weight: 550;
}

.state__text {
  font-size: 14px;
}

.skeleton {
  border-radius: 0;
  border-color: var(--border);
}

.empty-state,
.archive-empty {
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Event modal (mobile)
   -------------------------------------------------------------------------- */

.event-modal {
  background: var(--page-bg);
}

.event-modal__bar {
  padding:
    calc(var(--safe-top) + 10px)
    calc(16px + var(--safe-right))
    10px
    calc(16px + var(--safe-left));
  background: rgb(248 246 246 / 0.94);
  border-bottom-color: var(--border);
}

.event-modal__label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: none;
}

.event-modal__close {
  border-radius: 50%;
  border-color: var(--border);
}

.event-modal__content {
  background: var(--white);
}

.event-modal .event-detail__body {
  padding: 24px 20px calc(var(--safe-bottom) + 56px);
}

.event-modal .activity-title {
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 550;
}

.event-modal .activity-cover {
  margin-top: 20px;
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.error-page {
  padding-top: calc(var(--header-height) + 96px);
  padding-bottom: 96px;
}

.error-page__code {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.12em;
  color: var(--orange-ink);
}

.error-page__title {
  max-width: 16ch;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.error-page__text {
  font-size: 18px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .container {
    padding-inline: 20px;
  }

  .page-head {
    padding-top: calc(var(--header-height-mobile) + 44px);
    padding-bottom: 32px;
  }

  .page-head__title {
    font-size: 38px;
  }

  .page-head__intro {
    font-size: 16px;
  }

  .events-page {
    padding-top: var(--header-height-mobile);
  }

  .events-sidebar {
    padding: 28px 20px 44px;
  }

  .event-detail__body {
    padding: 28px 20px 56px;
  }

  .detail--embedded .activity-title {
    font-size: 32px;
  }

  .footer-brand__name {
    display: none;
  }

  .error-page {
    padding-top: calc(var(--header-height-mobile) + 64px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn::before {
    display: none;
  }
}


/* Full-bleed sky page header for info/about */
.page-head--sky {
  position: relative;
  isolation: isolate;
  max-width: none;
  padding-top: calc(var(--header-height) + 112px);
  padding-bottom: 112px;
  color: var(--white);
}

.page-head--sky::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgb(8 18 30 / 0.46), rgb(8 18 30 / 0.58)),
    url("../img/landing-sky.jpg") center 42% / cover no-repeat;
}

.page-head--sky .eyebrow {
  color: rgb(255 255 255 / 0.82);
}

.page-head--sky .page-head__title {
  color: var(--white);
}

.page-head--sky .page-head__intro {
  color: rgb(255 255 255 / 0.84);
}

.page-head--sky .page-head__title {
  max-width: 20ch;
}

@media (max-width: 767px) {
  .page-head--sky {
    padding-top: calc(var(--header-height-mobile) + 72px);
    padding-bottom: 72px;
  }
}

/* Info tables migrated from the old 262 page */
.info-table-wrap {
  width: 100%;
  margin: 20px 0 24px;
  overflow-x: auto;
  border-top: 1px solid var(--keyline);
  border-bottom: 1px solid var(--border);
}

.info-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}

.info-table caption {
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: left;
}

.info-table th,
.info-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.info-table thead th {
  background: var(--page-bg);
  color: var(--text);
  font-weight: 650;
  white-space: nowrap;
}

.info-table tbody th {
  color: var(--text);
  font-weight: 650;
  white-space: nowrap;
}

.info-table tbody td {
  color: var(--text-muted);
}

.info-table tbody tr:last-child th,
.info-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Mission statement on About */
.about-mission {
  margin-bottom: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--keyline);
}

.about-mission__title {
  margin: 8px 0 18px;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.about-mission p:not(.eyebrow) {
  max-width: 68ch;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.7;
}

.about-mission p:not(.eyebrow) + p:not(.eyebrow) {
  margin-top: 14px;
}

/* Keep tables from forcing the mobile grid wider than the viewport. */
.info-layout > *,
.info-section {
  min-width: 0;
}

.info-table-wrap {
  max-width: 100%;
}
