@import url("./theme.css");
@import url("./layout.css");
@import url("./components.css");

/* Keep centered public pages from shifting when content changes scroll height. */
html {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

/*
 * Opt-in public page shell. Feature pages keep importing the lower-level
 * theme/layout/components files until their own interaction surfaces are
 * deliberately migrated.
 */
body.site-theme.site-shell-theme {
  --color-copy-muted: #806a76;
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.92) 0, transparent 31%),
    radial-gradient(circle at 88% 18%, rgba(255, 218, 235, 0.72) 0, transparent 30%),
    radial-gradient(circle at 70% 85%, rgba(237, 233, 254, 0.72) 0, transparent 34%),
    linear-gradient(135deg, #fff0f6 0%, #fff9fc 52%, #fbf3ff 100%);
  background-attachment: fixed;
}

/*
 * Feature pages opt in to the public outer background without receiving the
 * normal-page card treatment or the dotted overlay. The final gradient keeps
 * the bottle page's original base colors intact.
 */
body.site-theme.site-feature-theme {
  --color-copy-muted: #806a76;
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.92) 0, transparent 31%),
    radial-gradient(circle at 88% 18%, rgba(255, 218, 235, 0.42) 0, transparent 30%),
    linear-gradient(135deg, #fff0f6 0%, #fffdf9 52%, #fff8fc 100%);
  background-attachment: fixed;
}

body.site-theme.site-shell-theme::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(223, 127, 170, 0.06) 1px, transparent 1.5px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent 70%);
}

body.site-theme.site-shell-theme a {
  color: inherit;
  text-decoration: none;
}

.site-shell.site-shell--page {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  box-sizing: border-box;
  width: min(var(--site-max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.site-shell--page > main {
  flex: 1 0 auto;
}

/*
 * Functional pages use the same outer flow but deliberately avoid position,
 * overflow, transform, contain, and z-index so page-owned fixed overlays and
 * absolute positioning retain their original containing blocks.
 */
.site-shell.site-shell--feature {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  box-sizing: border-box;
}

.site-shell.site-shell--feature.site-shell--wide {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 38px;
}

.site-shell--feature > main {
  flex: 1 0 auto;
}

.site-shell--feature > .site-header .site-auth-logout {
  min-width: 0;
}

.site-status-page {
  display: grid;
  place-items: center;
  padding: 12px 0 28px;
}

.site-status-card {
  width: min(100%, 560px);
  text-align: center;
}

.site-status-card .site-page-summary {
  margin-right: auto;
  margin-left: auto;
}

.site-status-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.site-page-intro {
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.48)),
    linear-gradient(120deg, rgba(255, 228, 240, 0.46), rgba(237, 233, 254, 0.26));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-page-kicker {
  margin: 0 0 7px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 650;
}

.site-page-title {
  margin: 0;
  color: var(--color-primary);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: var(--weight-title);
  line-height: 1.18;
}

.site-page-summary {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--color-copy-muted);
  line-height: 1.8;
}

.site-shell--page > .site-footer,
.site-shell--feature > .site-footer {
  margin-top: 26px;
  padding: 18px 4px 0;
  color: var(--color-copy-muted);
  font-size: 13px;
  line-height: 1.6;
}

.site-shell--page > .site-footer .footer-content,
.site-shell--feature > .site-footer .footer-content {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 28px;
  min-width: 0;
}

.site-shell--page > .site-footer .footer-links,
.site-shell--feature > .site-footer .footer-links {
  display: flex;
  align-items: baseline;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px 10px;
  text-align: left;
}

.site-shell--page > .site-footer .footer-link-group,
.site-shell--feature > .site-footer .footer-link-group {
  display: inline-flex;
  align-items: baseline;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0 7px;
}

.site-shell--page > .site-footer .footer-meta,
.site-shell--feature > .site-footer .footer-meta {
  display: flex;
  align-items: baseline;
  flex: 0 0 auto;
  margin: 0;
  gap: 12px;
  color: var(--color-copy-muted);
  text-align: right;
}

.site-shell--page > .site-footer .footer-links a,
.site-shell--feature > .site-footer .footer-links a {
  color: var(--color-primary);
  font-weight: 650;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--motion-gentle) ease-out;
}

.site-shell--page > .site-footer .footer-links a:hover,
.site-shell--page > .site-footer .footer-links a:focus-visible,
.site-shell--feature > .site-footer .footer-links a:hover,
.site-shell--feature > .site-footer .footer-links a:focus-visible {
  color: var(--color-primary-hover);
  text-decoration-line: underline;
}

.site-shell--page > .site-footer .footer-links a:focus-visible,
.site-shell--feature > .site-footer .footer-links a:focus-visible {
  outline: 2px solid rgba(223, 127, 170, 0.62);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 760px) {
  .site-shell.site-shell--page {
    width: min(100% - 24px, var(--site-max-width));
    padding-top: 12px;
  }

  .site-shell--page > .site-footer .footer-content,
  .site-shell--feature > .site-footer .footer-content {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .site-shell--page > .site-footer .footer-meta,
  .site-shell--feature > .site-footer .footer-meta {
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 680px) {
  .site-shell.site-shell--feature.site-shell--wide {
    width: min(100% - 24px, 1180px);
    padding-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.site-theme.site-shell-theme { scroll-behavior: auto; }
  body.site-theme.site-shell-theme .site-shell--page *,
  body.site-theme.site-shell-theme .site-shell--page *::before,
  body.site-theme.site-shell-theme .site-shell--page *::after { transition-duration: 0.01ms !important; }
  body.site-theme.site-shell-theme .site-shell--page .ui-button:hover,
  body.site-theme.site-shell-theme .site-shell--page .ui-button:focus-visible,
  body.site-theme.site-shell-theme .site-shell--page .site-nav-link:hover,
  body.site-theme.site-shell-theme .site-shell--page .site-nav-link:focus-visible,
  body.site-theme.site-shell-theme .site-shell--page .site-auth-link:hover,
  body.site-theme.site-shell-theme .site-shell--page .site-auth-link:focus-visible,
  body.site-theme.site-shell-theme .site-shell--page .site-auth-logout:hover,
  body.site-theme.site-shell-theme .site-shell--page .site-auth-logout:focus-visible {
    transform: none;
  }
}
