/* Card title hover underline — plain CSS (Tailwind bg-size + group-hover gradient is unreliable). */
.csds-title-line {
  display: inline;
  max-width: 100%;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 2px;
  transition: background-size 0.3s ease-out, color 0.2s ease-out;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.group:hover .csds-title-line,
.group:focus-within .csds-title-line {
  background-size: 100% 2px;
}

.csds-title-line--muted {
  color: var(--csds-muted, #5f5a52);
}

.group:hover .csds-title-line--to-ink,
.group:focus-within .csds-title-line--to-ink {
  color: var(--csds-ink, #1c1a17);
}

.group:hover .csds-title-line--to-accent,
.group:focus-within .csds-title-line--to-accent {
  color: var(--csds-accent, #cc2018);
}

@media (prefers-reduced-motion: reduce) {
  .csds-title-line {
    transition: none;
  }
}

/* Mega menus — plain CSS because Tailwind group-hover utilities are not in app.css */

/* Buttons: 15px from xl up (text-sm below) */
@media (min-width: 1280px) {
  .csds-btn {
    font-size: 15px;
  }
}

/* Hidden absolute megas still expand scrollWidth; clip page sideways. */
html {
  overflow-x: clip;
}

nav[aria-label="Primary"] li.group > .mega {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

/* Closed megas must not widen the document (absolute + left-0 still grows scrollWidth). */
nav[aria-label="Primary"] li.group:not(:hover):not(:focus-within):not([data-open]) > .mega {
  left: 0 !important;
  right: auto !important;
  width: 0 !important;
  max-width: 0 !important;
  overflow: hidden;
  border: 0;
}

nav[aria-label="Primary"] li.group:hover > .mega,
nav[aria-label="Primary"] li.group:focus-within > .mega,
nav[aria-label="Primary"] li.group[data-open] > .mega {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Trailing items: open mega leftward so it stays in the viewport */
nav[aria-label="Primary"] li.group:nth-last-child(-n+4) > .mega {
  left: auto;
  right: 0;
}

nav[aria-label="Primary"] li.group:hover > a,
nav[aria-label="Primary"] li.group:focus-within > a,
nav[aria-label="Primary"] li.group[data-open] > a {
  border-color: var(--csds-accent, #cc2018);
  color: var(--csds-accent, #cc2018);
}

/* Auth tab underline (data-active) */
[data-auth-tab] {
  position: relative;
}
[data-auth-tab]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
}
[data-auth-tab][data-active="true"] {
  color: var(--csds-ink, #1c1a17);
}
[data-auth-tab][data-active="true"]::after {
  background: var(--csds-accent, #cc2018);
}

/* Mobile hamburger sheet — body portal, above hero isolation.
   Stay painted while closing (no visibility snap) until [hidden] after transitionend. */
.csds-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.csds-mobile-sheet.is-open {
  pointer-events: auto;
}

.csds-mobile-sheet[hidden] {
  display: none !important;
}

.csds-mobile-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.csds-mobile-sheet.is-open .csds-mobile-sheet__backdrop {
  opacity: 1;
}

.csds-mobile-sheet__panel {
  position: absolute;
  inset-block: 0;
  right: 0;
  display: flex;
  width: min(100%, 24rem);
  max-width: 24rem;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--csds-line, #cdc4b6);
  background: var(--csds-white, #fff);
  box-shadow: -12px 0 32px rgba(11, 31, 58, 0.16);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.csds-mobile-sheet.is-open .csds-mobile-sheet__panel {
  transform: translateX(0);
}

body.csds-sheet-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .csds-mobile-sheet__backdrop,
  .csds-mobile-sheet__panel {
    transition: none;
  }
}

@media (min-width: 1024px) {
  .csds-mobile-sheet,
  #nav-toggle {
    display: none !important;
  }
}

/* —— Event detail page (mockup body) —— */
.csds-ed {
  --ed-navy: #0b2a4a;
  --ed-navy-2: #123a63;
  --ed-blue: #1a5f9e;
  --ed-soft: #e8f1f8;
  --ed-line: #d7e0ea;
  --ed-muted: #5c6b7a;
  --ed-ink: #1c2430;
  background: #f4f7fa;
  color: var(--ed-ink);
}

.csds-ed-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.csds-ed-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(28rem, 52vw, 36rem);
  color: #fff;
  background: var(--ed-navy);
}

.csds-ed-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.csds-ed-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  opacity: 1;
}

.csds-ed-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      100deg,
      rgba(8, 28, 52, 0.92) 0%,
      rgba(8, 28, 52, 0.82) 28%,
      rgba(8, 28, 52, 0.55) 48%,
      rgba(8, 28, 52, 0.22) 72%,
      rgba(8, 28, 52, 0.08) 100%
    ),
    linear-gradient(
      180deg,
      rgba(8, 28, 52, 0.2) 0%,
      transparent 40%,
      rgba(8, 28, 52, 0.35) 100%
    );
}

.csds-ed-hero__title,
.csds-ed-hero__lead,
.csds-ed-hero__meta,
.csds-ed-crumb {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.csds-ed-hero__lead,
.csds-ed-hero__meta li {
  color: rgba(255, 255, 255, 0.95);
}

.csds-ed-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--csds-max, 72rem);
  margin: 0 auto;
  padding: 3rem var(--csds-pad-x, 1.25rem) 2.75rem;
}

.csds-ed-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

.csds-ed-crumb a {
  color: inherit;
  text-decoration: none;
}

.csds-ed-crumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.csds-ed-crumb__current {
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
}

.csds-ed-pill {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ed-navy);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.csds-ed-hero__title {
  max-width: 18ch;
  margin: 0 0 0.85rem;
  font-family: var(--font-heading, "Source Serif 4", Georgia, serif);
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}

.csds-ed-hero__lead {
  max-width: 42ch;
  margin: 0 0 1.5rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.95);
}

.csds-ed-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.csds-ed-hero__meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.92);
}

.csds-ed-tabsbar {
  background: #fff;
  border-bottom: 1px solid var(--ed-line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.csds-ed-tabsbar__inner {
  max-width: var(--csds-max, 72rem);
  margin: 0 auto;
  padding: 0 var(--csds-pad-x, 1.25rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.csds-ed-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.15rem;
}

.csds-ed-tabs__link {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 0.85rem;
  border-bottom: 2px solid transparent;
  color: var(--ed-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.csds-ed-tabs__link:hover {
  color: var(--ed-navy);
}

.csds-ed-tabs__link.is-active {
  color: var(--ed-blue);
  border-bottom-color: var(--ed-blue);
}

.csds-ed-share {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ed-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.csds-ed-share a,
.csds-ed-share__copy {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ed-navy);
  cursor: pointer;
  text-decoration: none;
}

.csds-ed-share a:hover,
.csds-ed-share__copy:hover {
  color: var(--ed-blue);
  background: var(--ed-soft);
}

.csds-ed-layout {
  max-width: var(--csds-max, 72rem);
  margin: 0 auto;
  padding: 1.75rem var(--csds-pad-x, 1.25rem) 3.5rem;
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 1024px) {
  .csds-ed-layout {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20.5rem);
    gap: 2rem;
    align-items: start;
  }
}

.csds-ed-main {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--ed-line);
  border-radius: 0.35rem;
  padding: 1.5rem 1.35rem 2rem;
}

@media (min-width: 640px) {
  .csds-ed-main {
    padding: 1.85rem 1.75rem 2.25rem;
  }
}

.csds-ed-section + .csds-ed-section {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--ed-line);
}

.csds-ed-section h2,
.csds-ed-card h3 {
  margin: 0 0 0.9rem;
  font-family: var(--font-heading, "Source Serif 4", Georgia, serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ed-navy);
}

.csds-ed-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}

.csds-ed-section__head h2 {
  margin: 0;
}

.csds-ed-section__more {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ed-blue);
  text-decoration: none;
}

.csds-ed-section__more:hover {
  text-decoration: underline;
}

.csds-ed-prose {
  display: grid;
  gap: 0.85rem;
  max-width: 66ch;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ed-ink);
}

.csds-ed-prose p {
  margin: 0;
}

.csds-ed-muted {
  margin: 0 0 0.85rem;
  color: var(--ed-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.csds-ed-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.csds-ed-pills li {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--ed-soft);
  color: var(--ed-navy-2);
  font-size: 0.82rem;
  font-weight: 600;
}

.csds-ed-speakers {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .csds-ed-speakers {
    grid-template-columns: 1fr 1fr;
  }
}

.csds-ed-speaker {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--ed-line);
  border-radius: 0.35rem;
  background: #fff;
}

.csds-ed-speaker__photo {
  width: 4.25rem;
  height: 4.25rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.25rem;
  background: #dbe3ec;
}

.csds-ed-speaker__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.csds-ed-speaker__text h3 {
  margin: 0 0 0.2rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ed-navy);
}

.csds-ed-speaker__text p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ed-muted);
}

.csds-ed-agenda {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.csds-ed-agenda dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ed-muted);
}

.csds-ed-agenda dd {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--ed-ink);
}

.csds-ed-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.csds-ed-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .csds-ed-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

.csds-ed-gallery__item {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.45rem;
  background: #dbe3ec;
}

.csds-ed-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.csds-ed-gallery__item:hover img {
  transform: scale(1.04);
}

.csds-ed-gallery__item--more::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 28, 52, 0.62);
}

.csds-ed-gallery__more {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
}

.csds-ed-video__frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.35rem;
  background: #0b1f33;
}

.csds-ed-video__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
}

.csds-ed-video__play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.csds-ed-video__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.9rem;
  border-color: transparent transparent transparent var(--ed-navy);
}

.csds-ed-video__cap {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ed-navy);
}

.csds-ed-aside {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .csds-ed-aside {
    position: sticky;
    top: 4.25rem;
  }
}

.csds-ed-card {
  background: #fff;
  border: 1px solid var(--ed-line);
  border-radius: 0.35rem;
  padding: 1.15rem 1.1rem 1.25rem;
}

.csds-ed-stats {
  background: var(--ed-soft);
  border-color: #cfe0ee;
}

.csds-ed-stats ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.csds-ed-stats li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--ed-navy);
}

.csds-ed-stats strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.csds-ed-stats span {
  display: block;
  font-size: 0.8rem;
  color: var(--ed-muted);
  font-weight: 500;
}

.csds-ed-details {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.95rem;
}

.csds-ed-details li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--ed-navy);
  font-size: 0.9rem;
  line-height: 1.4;
}

.csds-ed-details__label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ed-muted);
}

.csds-ed-aside__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.15rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--ed-navy);
  border-radius: 0.25rem;
  color: var(--ed-navy);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.csds-ed-aside__cta:hover {
  background: var(--ed-navy);
  color: #fff;
}

.csds-ed-resources {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.csds-ed-resources li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
}

.csds-ed-resources__ico {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.25rem;
  background: #fde8e6;
  color: #b42318;
}

.csds-ed-resources a {
  color: var(--ed-navy);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.csds-ed-resources a:hover {
  color: var(--ed-blue);
}

.csds-ed-resources small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  color: var(--ed-muted);
  font-weight: 500;
}

.csds-ed-related__item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.csds-ed-related__thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.25rem;
  background: #dbe3ec;
}

.csds-ed-related__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.csds-ed-related__date,
.csds-ed-related__kind {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ed-muted);
}

.csds-ed-related__kind {
  color: var(--ed-blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.csds-ed-related__title {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ed-navy);
}

.csds-ed-related__place {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--ed-muted);
}

.csds-ed-related__place .csds-ed-icon {
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.1rem;
}

@media (max-width: 639px) {
  .csds-ed-hero__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .csds-ed-tabs__link {
    padding-inline: 0.55rem;
    font-size: 0.82rem;
  }
}
