/**
 * CMS static pages — layout aligned with news/blog (cards + sidebar), theme tokens from dynamic-colors.css
 */
.cms-static-page {
  padding-bottom: 2.5rem;
}

.cms-page-article {
  border: 1px solid var(--border-light, #e9ecef) !important;
  background: var(--bg-primary, #fff);
}

.cms-page-article__cover {
  line-height: 0;
  background: var(--bg-tertiary, #e9ecef);
}

.cms-page-article__cover img {
  width: 100%;
  max-height: min(52vh, 420px);
  object-fit: cover;
  display: block;
}

.cms-page-article__title {
  color: var(--text-primary, #2c3e50);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cms-page-article__excerpt {
  line-height: 1.55;
}

.cms-page-article__gallery-link {
  border: 1px solid var(--border-color, #dee2e6);
  background: var(--bg-secondary, #f8f9fa);
  aspect-ratio: 4 / 3;
}

.cms-page-article__gallery-link img {
  height: 100%;
  object-fit: cover;
}

/* Prose: admin HTML; keep readable and on-brand */
.cms-static-page .cms-prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary, #2c3e50);
  word-wrap: break-word;
  overflow-x: auto;
}

.cms-static-page .cms-prose > *:first-child {
  margin-top: 0;
}

.cms-static-page .cms-prose > *:last-child {
  margin-bottom: 0;
}

.cms-static-page .cms-prose h1,
.cms-static-page .cms-prose h2,
.cms-static-page .cms-prose h3,
.cms-static-page .cms-prose h4 {
  color: var(--text-primary, #2c3e50);
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.cms-static-page .cms-prose h2 {
  font-size: 1.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  border-color: color-mix(in srgb, var(--primary-color, #377dff) 25%, var(--border-color, #dee2e6));
}

.cms-static-page .cms-prose h1 {
  font-size: 1.35rem;
}

.cms-static-page .cms-prose p {
  margin-bottom: 1rem;
  color: var(--text-secondary, #6c757d);
}

.cms-static-page .cms-prose a {
  color: var(--primary-color, #377dff);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cms-static-page .cms-prose a:hover {
  color: var(--primary-hover, #2c5ce6);
}

.cms-static-page .cms-prose ul,
.cms-static-page .cms-prose ol {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
  color: var(--text-secondary, #6c757d);
}

.cms-static-page .cms-prose blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--primary-color, #377dff);
  background: var(--bg-secondary, #f8f9fa);
  font-style: italic;
  color: var(--text-secondary, #6c757d);
}

.cms-static-page .cms-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.35rem;
  margin: 1rem 0;
}

.cms-static-page .cms-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
}

.cms-static-page .cms-prose th,
.cms-static-page .cms-prose td {
  border: 1px solid var(--border-color, #dee2e6);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.cms-static-page .cms-prose th {
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-primary, #2c3e50);
  font-weight: 600;
}

.cms-static-page .cms-prose pre {
  background: var(--bg-dark, #343a40);
  color: var(--text-light, #fff);
  padding: 1rem;
  border-radius: 0.35rem;
  overflow-x: auto;
  font-size: 0.875rem;
}

/* Mobile app download — clickable store badge images (stacked, no column overlap) */
.cms-static-page .cms-app-download {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.25rem;
  margin: 1.5rem 0 1.25rem;
  position: relative;
  z-index: 50;
  isolation: isolate;
}

.cms-static-page .cms-app-download__item {
  flex: 0 1 300px;
  width: 100%;
  max-width: 300px;
  position: relative;
  z-index: 51;
}

.cms-static-page .cms-app-download__link {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color, #dee2e6);
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  z-index: 52;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.12);
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cms-static-page .cms-app-download__link:hover,
.cms-static-page .cms-app-download__link:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  text-decoration: none !important;
  outline: none;
}

.cms-static-page .cms-app-download__link--android:hover,
.cms-static-page .cms-app-download__link--android:focus {
  border-color: #3ddc84;
}

.cms-static-page .cms-app-download__link--ios:hover,
.cms-static-page .cms-app-download__link--ios:focus {
  border-color: #333;
}

.cms-static-page .cms-app-download__badge-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  margin: 0 auto;
}

@media (max-width: 991px) {
  .cms-static-page .cms-page-article__cover img {
    max-height: 38vh;
  }
}
