* {
  box-sizing: border-box;
}

:root {
  --pao-color-standard: #00e5ff;
  --pao-color-lighter: #6ef1ff;
  --pao-color-very-light: #d8fbff;
  --pbd-safe-top: 0px;
  --pbd-safe-bottom: 0px;
}

@media (display-mode: standalone) {
  :root {
    --pbd-safe-top: env(safe-area-inset-top, 0px);
    --pbd-safe-bottom: env(safe-area-inset-bottom, 0px);
  }
}

html.standalone-mode {
  --pbd-safe-top: env(safe-area-inset-top, 0px);
  --pbd-safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  margin: 0;
  padding: calc(20px + var(--pbd-safe-top)) 20px calc(20px + var(--pbd-safe-bottom)) 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #1a1a1a;
  background-image: url('/images/runner-taipei.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  color: #fff;
}

a {
  color: var(--pao-color-very-light);
}

/* === Shell === */
.detail-shell {
  max-width: 900px;
  margin: 0 auto;
  background-color: rgba(26, 26, 26, 0.9);
  border-radius: 12px;
  padding: 1px 20px 20px;
}

/* === Header (reused from race detail) === */
.site-header {
  text-align: center;
  margin-bottom: 12px;
  padding-top: 15px;
  position: relative;
}

.logo {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logo-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.logo-link:focus-visible,
.utility-link:focus-visible,
.crumb-link:focus-visible,
.site-footer a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--pao-color-standard);
  outline-offset: 3px;
  border-radius: 6px;
}

.logo-char {
  display: inline-block;
  text-align: center;
}

.char-zh {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.1;
  display: block;
  color: #ffffff;
}

.char-en {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  color: #cccccc;
}

.accent-color {
  color: var(--pao-color-standard);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  right: 0;
  top: 18px;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f5fbff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.utility-link:hover {
  background: rgba(0, 229, 255, 0.14);
  border-color: rgba(0, 229, 255, 0.36);
  color: var(--pao-color-standard);
}

/* === Breadcrumb === */
.detail-header {
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.crumb-link {
  color: var(--pao-color-very-light);
  font-weight: 600;
  text-decoration: none;
}

.crumb-link:hover {
  text-decoration: underline;
}

.crumb-sep {
  color: #8fb0b9;
  margin: 0 8px;
}

/* === Main content === */
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero,
section,
.info-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

section {
  padding: 18px;
}

h1, h2, h3, h4, p, ul {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.2;
  color: #ffffff;
}

h2 {
  margin-top: 8px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: #cccccc;
  font-weight: 500;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
  color: #ffffff;
}

.info-card h3 {
  color: var(--pao-color-standard);
}

p {
  color: #f0f0f0;
  line-height: 1.6;
}

.muted {
  color: #c7d6db;
}

/* === Hero with event image === */
.hero {
  padding: 0;
  overflow: hidden;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px 10px 0 0;
}

.hero-copy {
  padding: 24px 20px;
}

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

.support-figure {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
}

.support-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  object-fit: contain;
}

.support-caption {
  margin-top: 10px;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .support-image {
    border-radius: 8px;
  }

  .support-caption {
    font-size: 0.9rem;
    line-height: 1.55;
  }
}

/* === Buttons (from race detail) === */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: #00a6bd;
  color: #ffffff;
  padding: 12px 18px;
}

.button.primary:hover {
  background: #0094aa;
}

.button.secondary {
  background: rgba(0, 229, 255, 0.14);
  border-color: rgba(0, 229, 255, 0.22);
  color: #d8fbff;
  padding: 10px 16px;
}

.button.secondary:hover {
  background: rgba(0, 229, 255, 0.22);
}

/* === Info grid === */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
}

.info-card {
  padding: 16px;
}

/* === Category tags === */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.detail-tag.category {
  background-color: #f0e6ff;
  color: #7b3fb6;
}

.detail-tag.city {
  background-color: #e7f3ff;
  color: #007bff;
}

.detail-tag.fee {
  background-color: #fff0e6;
  color: #d46b08;
}

.detail-tag.language {
  background-color: #e6f6e6;
  color: #34a853;
}

/* === Highlights list === */
.highlights-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.highlights-list li {
  color: #f0f0f0;
  line-height: 1.55;
}

/* === Map link === */
.inline-map-link {
  color: var(--pao-color-very-light);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-map-link:hover {
  color: #ffffff;
}

/* === Practical note === */
.practical-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 200, 50, 0.08);
  border: 1px solid rgba(255, 200, 50, 0.22);
  color: #ffe9a3;
  font-size: 0.92rem;
  line-height: 1.5;
}

.detail-disclaimer {
  padding-top: 12px;
  padding-bottom: 12px;
}

.detail-disclaimer p {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* === Footer === */
.site-footer {
  margin-top: 18px;
  padding: 8px 0 6px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer a {
  color: #d8fbff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* === English block separator === */
.en-block {
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

/* === Mobile === */
@media (max-width: 720px) {
  body {
    background-image: url('/images/runner-taipei-mobile.jpg');
    background-attachment: scroll;
    padding: calc(12px + var(--pbd-safe-top)) 12px calc(12px + var(--pbd-safe-bottom)) 12px;
  }

  .detail-shell {
    padding: 1px 14px 18px;
    background-color: rgba(26, 26, 26, 0.92);
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .header-actions {
    top: 12px;
    right: 2px;
  }

  .hero-copy {
    padding: 18px 14px;
  }
}
