/* Commonplace Companions — component styles. Load after tokens.css.
   Theme: set data-theme="light" or "dark" on <html>. Every class is prefixed cc-. */

body { margin: 0; background: var(--desk); color: var(--ink); font-family: var(--font-text); font-size: 18px; line-height: 30px; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

/* Theme-specific images (seal swaps). */
.cc-only-dark { display: none !important; }
[data-theme="dark"] .cc-only-light { display: none !important; }
[data-theme="dark"] .cc-only-dark { display: block !important; }

/* ---- Sheet: the paper page on the desk ---- */
.cc-sheet { position: relative; max-width: var(--size-page); margin: var(--space-7) auto var(--space-9); padding: var(--space-8) var(--space-8) var(--space-7); background: var(--paper); box-shadow: var(--shadow-sheet); box-sizing: border-box; }
.cc-sheet--framed::before,
.cc-sheet--framed::after { content: ""; position: absolute; pointer-events: none; }
.cc-sheet--framed::before { inset: var(--space-3); border: var(--border-frame) solid var(--frame); }
.cc-sheet--framed::after { inset: calc(var(--space-3) + var(--border-frame) + var(--space-1)); border: var(--border-hairline) solid var(--frame); }
@media (max-width: 640px) {
  .cc-sheet { margin: 0; padding: var(--space-7) var(--space-5) var(--space-6); box-shadow: none; }
  .cc-sheet--framed::before { inset: var(--space-2); }
  .cc-sheet--framed::after { inset: calc(var(--space-2) + var(--border-frame) + var(--space-1)); }
}

/* ---- Site nav ---- */
.cc-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); padding: var(--space-4) var(--space-5); background: var(--paper); border-bottom: var(--border-frame) solid var(--frame); box-shadow: 0 var(--space-1) 0 var(--paper), 0 calc(var(--space-1) + var(--border-hairline)) 0 var(--frame); margin-bottom: calc(var(--space-1) + var(--border-hairline)); }
.cc-nav a { font-family: var(--font-display); font-size: 13px; font-weight: 500; line-height: 20px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); text-decoration: none; white-space: nowrap; padding: 2px 0; }
.cc-nav a:hover { color: var(--accent); }
.cc-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.cc-nav__toggle { margin-left: auto; font-family: var(--font-display); font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; line-height: 16px; color: var(--ink); background: transparent; border: var(--border-hairline) solid var(--ink-muted); border-radius: var(--radius-sm); padding: 5px 10px; cursor: pointer; }
.cc-nav__toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Labels and the motto ---- */
.cc-label { font-family: var(--font-display); font-size: 13px; font-weight: 500; line-height: 20px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin: 0; }
.cc-motto { text-align: center; margin: var(--space-6) 0; }
.cc-motto__latin { font-family: var(--font-display); font-size: 15px; font-weight: 500; line-height: 24px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--accent); margin: 0; padding-left: 0.32em; }
.cc-motto__gloss { font-family: var(--font-display); font-style: italic; font-size: 16px; line-height: 24px; color: var(--ink-muted); margin: var(--space-1) 0 0; }

/* ---- Ornament: line · circle · line, from the cover ---- */
.cc-ornament { display: flex; align-items: center; justify-content: center; color: var(--accent); margin: var(--space-5) auto; }
.cc-ornament::before,
.cc-ornament::after { content: ""; width: var(--size-ornament-line); border-top: var(--border-rule) solid currentColor; }
.cc-ornament > span { width: var(--size-ornament-dot); height: var(--size-ornament-dot); border: var(--border-rule) solid currentColor; border-radius: var(--radius-round); box-sizing: border-box; flex: none; }

/* ---- Page header ---- */
.cc-header { text-align: center; margin: 0 0 var(--space-7); }
.cc-header__seal { display: block; width: var(--size-seal-header); height: auto; margin: 0 auto var(--space-5); }
.cc-header__title { font-family: var(--font-display); font-size: 44px; font-weight: 400; line-height: 48px; letter-spacing: 0.005em; color: var(--ink); margin: 0; text-wrap: balance; }
.cc-header .cc-label { padding-left: 0.24em; }
.cc-header__tagline { font-family: var(--font-display); font-style: italic; font-size: 19px; line-height: 28px; color: var(--ink-muted); margin: var(--space-3) auto 0; max-width: 34em; text-wrap: balance; }
.cc-header__tagline a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cc-header__tagline a:hover { text-decoration-thickness: 2px; }
@media (max-width: 640px) { .cc-header__title { font-size: 34px; line-height: 40px; } }

/* ---- Prose ---- */
:where(.cc-prose) > * { max-width: var(--size-measure); }
:where(.cc-prose) h2 { font-family: var(--font-display); font-size: 26px; font-weight: 400; line-height: 32px; color: var(--ink); margin: var(--space-7) 0 var(--space-3); }
:where(.cc-prose) h2:first-child { margin-top: 0; }
:where(.cc-prose) h3 { font-family: var(--font-text); font-size: 18px; font-weight: 600; line-height: 26px; margin: var(--space-5) 0 var(--space-2); }
:where(.cc-prose) p { margin: 0 0 var(--space-4); }
:where(.cc-prose) ul { margin: 0 0 var(--space-4); padding-left: 1.2em; }
:where(.cc-prose) li { margin-bottom: var(--space-2); }
:where(.cc-prose) li::marker { color: var(--accent); }
:where(.cc-prose) strong { font-weight: 600; }
:where(.cc-prose) a, .cc-link { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(.cc-prose) a:hover, .cc-link:hover { text-decoration-thickness: 2px; }

/* ---- Shelf entry ---- */
.cc-shelf { margin: 0 0 var(--space-5); }
.cc-entry { padding: var(--space-5) 0; border-top: var(--border-hairline) solid var(--hairline); }
.cc-entry:last-child { border-bottom: var(--border-hairline) solid var(--hairline); }
.cc-entry__title { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 28px; color: var(--ink); margin: 0 0 var(--space-2); }
.cc-entry__title a { color: inherit; text-decoration: none; }
.cc-entry__title a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.cc-entry__desc { font-size: 15px; line-height: 24px; color: var(--ink-muted); margin: 0; max-width: var(--size-measure); }
.cc-entry__meta { font-family: var(--font-display); font-size: 12px; font-weight: 500; line-height: 20px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: var(--space-3) 0 0; }
.cc-entry__action { margin: var(--space-4) 0 0; }

/* ---- Frame: the cover's double rule ---- */
.cc-frame { position: relative; padding: var(--space-6); border: var(--border-frame) solid var(--frame); background: var(--paper); }
.cc-frame::after { content: ""; position: absolute; inset: var(--space-1); border: var(--border-hairline) solid var(--frame); pointer-events: none; }
.cc-frame > :first-child { margin-top: 0; }
.cc-frame > :last-child { margin-bottom: 0; }

/* ---- Buttons ---- */
.cc-btn { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: 13px; font-weight: 500; line-height: 16px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; padding: var(--space-3) 20px; border: var(--border-hairline) solid var(--accent); border-radius: var(--radius-sm); cursor: pointer; }
.cc-btn--primary { background: var(--accent); color: var(--on-accent); }
.cc-btn--secondary { background: transparent; color: var(--accent); }
.cc-btn:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ---- Note ---- */
.cc-note { font-family: var(--font-display); font-style: italic; font-size: 16px; line-height: 24px; color: var(--ink-muted); text-align: center; margin: var(--space-6) 0; }

/* ---- Colophon (footer) ---- */
.cc-colophon { text-align: center; margin: var(--space-8) 0 0; }
.cc-colophon__seal { display: block; width: var(--size-seal-colophon); height: auto; margin: 0 auto var(--space-3); }
.cc-colophon .cc-motto__latin { font-size: 12px; line-height: 20px; letter-spacing: 0.28em; }
.cc-colophon__line { font-size: 15px; line-height: 24px; color: var(--ink-muted); margin: var(--space-1) 0 0; }
.cc-colophon__line a { color: inherit; }

/* ---- For-sale feature: cover beside its description, stacking on phones ---- */
.cc-feature { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-start; }
.cc-feature__cover { flex: 0 0 180px; width: 180px; height: auto; box-shadow: var(--shadow-sheet); }
.cc-feature__body { flex: 999 1 280px; min-width: 0; }
.cc-feature__body p { margin: 0 0 var(--space-3); }
