/* Meltware — shared site styles.
   System fonts only, no @import/@font-face, no external requests of any kind. */

:root {
  --primary: #00695c;
  --primary-container: #a0f2e4;
  --on-primary-container: #002019;
  --background: #fafdfa;
  --surface: #f1f5f2;
  --text: #191c1b;
  --text-muted: #45514c;
  --border: #dde5e0;
  --max-width: clamp(40rem, 68vw, 76rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #83d5c8;
    --primary-container: #005046;
    --on-primary-container: #a0f2e4;
    --background: #191c1b;
    --surface: #212423;
    --text: #e1e3e0;
    --text-muted: #b1ccc0;
    --border: #3a3f3d;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.55;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

@media (min-width: 60rem) {
  .page {
    padding: 3.5rem 2rem 5rem;
  }
}

.site-bar {
  background: var(--surface);
}

.site-bar-top {
  border-bottom: 1px solid var(--border);
}

.site-bar-bottom {
  border-top: 1px solid var(--border);
}

header.site,
footer.site {
  max-width: var(--max-width);
  margin: 0 auto;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
}

@media (min-width: 60rem) {
  header.site {
    padding: 1.25rem 2rem;
  }
}

.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
}

.wordmark span {
  color: var(--primary);
}

nav.site a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.95rem;
}

nav.site a:hover,
nav.site a:focus {
  color: var(--primary);
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin: 0 0.5rem;
  color: var(--border);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
  color: var(--primary);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

p {
  color: var(--text);
}

main > p,
main > ul.checks,
main > ul.cms-list,
main > ol.cms-list,
main > blockquote.cms-blockquote {
  max-width: 42rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 34rem;
}

.tag {
  display: inline-block;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

ul.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.plain li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

ul.checks {
  padding-left: 1.1rem;
}

ul.checks li {
  margin: 0.4rem 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  margin: 1.5rem 0;
}

.apps ul.plain {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.apps ul.plain li {
  padding: 0;
  border-bottom: none;
}

.apps a.app-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
}

.apps .app-name {
  font-weight: 700;
  color: var(--primary);
}

.apps .app-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.button {
  display: inline-block;
  background: var(--primary);
  color: var(--background);
  text-decoration: none;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 0.5rem;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0 1.5rem;
}

.share-row .button {
  margin-top: 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.button.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.muted-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

footer.site {
  padding: 1.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 60rem) {
  footer.site {
    padding: 1.5rem 2rem;
  }
}

footer.site a {
  color: var(--text-muted);
}

table.permissions {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

table.permissions th,
table.permissions td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.permissions th {
  color: var(--text-muted);
  font-weight: 600;
}

code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

/* CMS-managed page content (cms/src/markdown.php's block-content renderer):
   the same visual language as ul.checks / table.permissions above, applied
   to the generic classes that renderer emits, so admin-authored content
   blends in with the hand-written page chrome around it. */
ul.cms-list,
ol.cms-list {
  padding-left: 1.1rem;
}

ul.cms-list li,
ol.cms-list li {
  margin: 0.4rem 0;
}

table.cms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

table.cms-table th,
table.cms-table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.cms-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.cms-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

blockquote.cms-blockquote {
  border-left: 3px solid var(--primary);
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  color: var(--text-muted);
}

img.cms-content-image {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}

.cms-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1rem 0;
}

.cms-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.page-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 60rem) {
  .page-with-sidebar {
    grid-template-columns: minmax(0, 1fr) 18rem;
    align-items: start;
  }
}

.page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cms-sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.cms-sidebar-widget h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.cms-sidebar-widget p:last-child {
  margin-bottom: 0;
}

.cms-sidebar-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
