/* ClearMindsHub - Calm Minimalist Editorial Stylesheet */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-alt: #efeae1;
  --text: #26302b;
  --text-muted: #536059;
  --accent: #3d6b59;
  --accent-dark: #2c5042;
  --earth: #b07d62;
  --earth-text: #83563f;
  --border: #e3ded4;
  --shadow-soft: 0 2px 12px rgba(38, 48, 43, 0.04);
  --radius: 10px;
  --radius-sm: 6px;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container-wide: 1040px;
  --container-prose: 740px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

a:hover {
  color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.9rem;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* Layout containers */

.container {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container--prose {
  max-width: var(--container-prose);
}

/* Header and navigation */

.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--accent);
}

.brand__mark {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 55%, var(--earth) 55%);
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Typography */

h1,
h2,
h3 {
  font-family: var(--font-serif);
  color: var(--text);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.65rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  margin: 2.5rem 0 0.85rem;
}

h3 {
  font-size: 1.18rem;
  margin: 1.75rem 0 0.55rem;
}

p {
  margin: 0 0 1.25rem;
}

ul,
ol {
  margin: 0 0 1.35rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.5rem;
}

.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--earth-text);
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 62ch;
}

/* Hero section */

.hero {
  padding: 3.5rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
}

.hero__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 3rem);
  box-shadow: var(--shadow-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn--primary {
  background-color: var(--accent);
  color: #ffffff;
}

.btn--primary:hover {
  background-color: var(--accent-dark);
  color: #ffffff;
}

.btn--secondary {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Main content sections */

.section {
  padding: 3rem 0;
}

.section--tight {
  padding: 2rem 0;
}

.section__header {
  margin-bottom: 2rem;
  max-width: 64ch;
}

.section__header h2 {
  margin-top: 0;
}

/* Guide cards grid */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 1.4rem;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.guide-card:hover {
  border-color: var(--earth);
  transform: translateY(-2px);
}

.guide-card__theme {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: #edf3f0;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.guide-card__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 0 0 0.7rem;
}

.guide-card__title a {
  color: var(--text);
  text-decoration: none;
}

.guide-card__title a:hover {
  color: var(--accent);
}

.guide-card__excerpt {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.guide-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text-muted);
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.guide-card__link {
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

/* Editorial principles block */

.principles-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--earth);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3.5vw, 2.4rem);
  box-shadow: var(--shadow-soft);
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.principle-item h3 {
  margin-top: 0;
  font-size: 1.08rem;
  color: var(--accent);
}

.principle-item p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Article and prose pages */

.article-shell {
  padding: 2.5rem 0 3.5rem;
}

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

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

.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumbs span {
  margin: 0 0.4rem;
  color: var(--earth);
}

.article-paper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow-soft);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

/* Callouts */

.callout {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  margin: 1.75rem 0;
}

.callout--earth {
  border-left-color: var(--earth);
  background: #faf7f2;
}

.callout__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  color: var(--text);
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

/* Tables */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  background: var(--surface);
}

th,
td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* References and related guides */

.references {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.94rem;
  color: var(--text-muted);
}

.references h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.related-section {
  margin-top: 2.5rem;
}

.related-section h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

/* Error 404 */

.error-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 620px;
  margin: 3.5rem auto;
  box-shadow: var(--shadow-soft);
}

.error-box__code {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--earth-text);
  margin: 0 0 0.5rem;
  line-height: 1.1;
}

/* Footer */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.75rem 0 2.25rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.footer-heading {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 0.7rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.45rem;
}

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

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.25rem;
  font-size: 0.84rem;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero {
    padding: 2.25rem 0 2rem;
  }
}
