/*
 * Registration gateway composition.
 * The sunrise arc and offset paper shapes borrow directly from the service mark;
 * interactive states remain conventional so the page is easy to use quickly.
 */

body {
  background: var(--sky-wash);
}

.page {
  position: relative;
  width: min(1160px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  padding: 24px 0 22px;
}

.masthead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 28px 22px;
}

.brand-logo {
  width: min(430px, 58vw);
  height: auto;
  display: block;
}

.masthead-note {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--blue-ink);
  text-align: left;
}

.masthead-note strong {
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.masthead-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gateway {
  position: relative;
  isolation: isolate;
  align-self: stretch;
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(0, 1.38fr);
  grid-template-areas:
    "intro events"
    "intro events";
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(23, 79, 109, 0.16);
  border-radius: 48px 10px 48px 10px;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(23, 79, 109, 0.13);
}

.gateway::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -280px auto auto -205px;
  width: 500px;
  height: 500px;
  border: 64px solid var(--orange);
  border-radius: 50%;
  opacity: 0.96;
}

.gateway::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto auto 42px -85px;
  width: 290px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  transform: rotate(-8deg);
}

.gateway-intro {
  grid-area: intro;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 52px 44px 74px 32px;
}

.season-label {
  width: fit-content;
  margin: 0;
  border-bottom: 4px solid var(--orange);
  color: var(--blue-ink);
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.8;
}

.gateway-intro h1 {
  max-width: 9ch;
  margin: 0;
  color: var(--brown);
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: clamp(38px, 5.1vw, 68px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.045em;
}

.gateway-intro > p:last-child {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.9;
}

.events {
  grid-area: events;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  background: #fff;
  border-inline-start: 1px solid rgba(23, 79, 109, 0.12);
}

.event-card,
.event-card.featured,
.event-card.supporting {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(250px, 1.28fr);
  grid-template-rows: auto;
  gap: 28px;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 34px 38px;
}

.event-card.featured {
  position: relative;
  color: #fff;
  background: var(--blue-ink);
  box-shadow: none;
}

.event-card.featured::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--orange);
}

.event-card.supporting {
  border-top: 1px solid rgba(23, 79, 109, 0.14);
  background: var(--surface);
}

.event-head {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 0;
  border: 0;
}

.eyebrow {
  width: fit-content;
  margin: 0;
  color: var(--red);
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.event-card.featured .eyebrow {
  color: #ffd097;
}

h2,
.featured h2 {
  margin: 0;
  color: var(--brown);
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: clamp(24px, 2.8vw, 37px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.event-card.featured h2 {
  color: #fff;
}

.event-brief {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
}

.event-card.featured .event-brief {
  color: rgba(255, 255, 255, 0.76);
}

.countdown {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 18px 0;
}

.countdown-label {
  color: #fff;
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
  white-space: nowrap;
}

.countdown-units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  direction: rtl;
}

.countdown-unit {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 2px 10px;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.countdown-unit:first-child {
  border-inline-start: 0;
}

.countdown-unit strong {
  color: #fff;
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.15;
  direction: rtl;
}

.countdown-unit span {
  color: #a9d8ee;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  direction: rtl;
}

.countdown.is-open {
  grid-template-columns: 1fr;
  border-color: rgba(255, 255, 255, 0.22);
}

.countdown.is-open .countdown-label {
  color: #fff;
  white-space: normal;
}

.countdown.is-open .countdown-units {
  display: none;
}

.actions {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
}

.featured .actions {
  grid-column: 2;
  grid-row: 1;
}

.featured .countdown {
  grid-row: 2;
}

.action-link,
.action-link.secondary,
.featured .action-link[data-action="registration"] {
  min-height: 76px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(23, 79, 109, 0.2);
  border-radius: 18px 5px 18px 5px;
  background: var(--sky-soft);
  color: var(--blue-ink);
  padding: 12px 14px;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.event-card.featured .action-link,
.event-card.featured .action-link.secondary,
.featured .action-link[data-action="registration"] {
  border-color: rgba(255, 255, 255, 0.28);
  background: #fff;
  color: var(--blue-ink);
}

.action-link:hover,
.action-link.secondary:hover,
.featured .action-link[data-action="registration"]:hover {
  border-color: var(--orange);
  background: #fff;
  transform: translateX(-3px);
}

.action-link.is-disabled,
.action-link[aria-disabled="true"],
.action-link.is-disabled:hover,
.action-link[aria-disabled="true"]:hover,
.event-card.featured .action-link.is-disabled,
.event-card.featured .action-link[aria-disabled="true"] {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.72);
  transform: none;
}

.event-card.supporting .action-link.is-disabled,
.event-card.supporting .action-link[aria-disabled="true"] {
  border-color: rgba(23, 79, 109, 0.12);
  background: #f3f5f4;
  color: #756f69;
}

.action-icon,
.secondary .action-icon,
.featured .action-link[data-action="registration"] .action-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-ink);
  color: #fff;
}

.event-card.featured .action-icon {
  background: var(--orange);
}

.is-disabled .action-icon,
.action-link[aria-disabled="true"] .action-icon,
.event-card.featured .action-link[aria-disabled="true"] .action-icon {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.76);
}

.event-card.supporting .action-link[aria-disabled="true"] .action-icon {
  background: #9ca5a6;
  color: #fff;
}

.action-icon svg {
  width: 21px;
  height: 21px;
}

.action-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.action-text strong {
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.action-text span {
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  opacity: 0.7;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 0;
  padding: 20px 28px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.footer > div {
  display: grid;
  gap: 2px;
}

.footer strong {
  color: var(--brown);
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.social-link {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--blue-ink);
  padding: 7px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(23, 79, 109, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.social-link:hover {
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(23, 79, 109, 0.14);
}

.social-icon {
  width: 27px;
  height: 27px;
}

.social-icon svg {
  width: 25px;
  height: 25px;
}

.social-name,
.social-link .handle {
  display: none;
}

a:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

@media (max-width: 940px) {
  .page {
    width: min(100% - 28px, 760px);
  }

  .gateway {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "events";
  }

  .gateway-intro {
    min-height: 300px;
    padding: 50px 42px 70px;
  }

  .gateway-intro h1 {
    max-width: 12ch;
    font-size: clamp(40px, 9vw, 64px);
  }

  .events {
    border-inline-start: 0;
    border-top: 1px solid rgba(23, 79, 109, 0.12);
  }
}

@media (max-width: 680px) {
  .page {
    width: min(100% - 20px, 620px);
    padding: 12px 0 18px;
  }

  .masthead {
    align-items: flex-end;
    padding: 2px 10px 14px;
  }

  .brand-logo {
    width: min(310px, 70vw);
  }

  .masthead-note span {
    display: none;
  }

  .masthead-note strong {
    font-size: 13px;
  }

  .gateway {
    border-radius: 28px 7px 28px 7px;
  }

  .gateway::before {
    inset: -240px auto auto -240px;
    width: 430px;
    height: 430px;
    border-width: 50px;
  }

  .gateway::after {
    bottom: 34px;
    left: -130px;
  }

  .gateway-intro {
    min-height: 280px;
    gap: 14px;
    padding: 38px 26px 62px;
  }

  .gateway-intro > p:last-child {
    max-width: 30ch;
    font-size: 14px;
  }

  .event-card,
  .event-card.featured,
  .event-card.supporting {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 28px 22px;
  }

  .featured .actions,
  .featured .countdown {
    grid-column: 1;
    grid-row: auto;
  }

  .featured .countdown {
    order: 2;
  }

  .featured .actions {
    order: 3;
  }

  .countdown {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .countdown-label {
    white-space: normal;
  }

  .countdown-unit {
    padding-inline: 6px;
  }

  .countdown-unit strong {
    font-size: 24px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 10px 0;
  }

  .social-links {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 390px) {
  .masthead-note {
    display: none;
  }

  .brand-logo {
    width: 100%;
  }

  .countdown-units {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .countdown-unit:nth-child(3) {
    border-inline-start: 1px solid rgba(255, 255, 255, 0.2);
  }

  .countdown-unit:nth-child(n + 3) {
    border-top: 0;
  }

  .action-link,
  .action-link.secondary,
  .featured .action-link[data-action="registration"] {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 10px;
  }

  .action-icon {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
