/**
 * Shared frame for content pages: background, container, header, back button, titles.
 * Page-specific styles live in each page's own stylesheet.
 */

/* Page background */
body {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, var(--md-sys-color-surface));
  min-height: 100vh;
  padding: 20px;
  transition: var(--theme-transition);
}

[data-theme="dark"] body {
  background: var(--md-sys-color-background);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background: var(--md-sys-color-background);
  }
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Theme toggle aligned with the back button */
.theme-toggle {
  position: absolute;
  top: 40px;
  right: max(20px, calc((100vw - 900px) / 2 + 20px));
}

/* Header card */
.header-card {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 20px;
  box-shadow: var(--md-sys-elevation-1);
  text-align: center;
  position: relative;
}

[data-theme="dark"] .header-card {
  background: var(--md-sys-color-surface-1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .header-card {
    background: var(--md-sys-color-surface-1);
  }
}

/* Back button */
.back-link {
  position: absolute;
  top: 20px;
  left: 20px;
  flex-shrink: 0;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.back-link span:not(.material-icons) {
  display: none;
}

.back-link:hover {
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

/* Page titles */
.page-title {
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 600px;
  margin: 0 auto;
}

/* Content card */
.content-card {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 20px;
  box-shadow: var(--md-sys-elevation-1);
}

[data-theme="dark"] .content-card {
  background: var(--md-sys-color-surface-1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .content-card {
    background: var(--md-sys-color-surface-1);
  }
}

/* Sections */
.section {
  margin-bottom: 48px;
}

.section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title .material-icons {
  font-size: 1.8rem;
}
