/* ---------- basic site style ---------- */

:root {
  --bg: #f3eeea;
  --paper: #f3eeea;
  --text: #171717;
  --muted: #5c5a54;
  --accent: #243c67;
  --border: #8c8980;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html {
  min-height: 100%;
  scrollbar-gutter: stable;
}

/* ---------- page layout ---------- */

.header-inner,
.main-content,
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg);
}

.header-main {
  padding-top: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--accent);
}

.header-layout {
  position: relative;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}

.header-image-wrapper {
  position: absolute;
  top: 0;
  right: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.header-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-inner {
  flex: 1;
  min-width: 0;
}

.page-subtitle {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
  color: var(--muted);
}

.main-content {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  flex: 1;

  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  .writing-content p {
    text-align: left;
    hyphens: none;
  }
  .header-image-wrapper {
    display: none;
  }
}

.site-footer {
  padding-top: 0;
  padding-bottom: 1.5rem;
  border-top: none;
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer::before {
  content: "";
  display: block;
  width: 100%;
  margin-bottom: 0.65rem;
  border-top: 1px solid var(--border);
}

/* ---------- writing content ---------- */

.writing-content {
  font-family: inherit;
  font-size: 1em;
  line-height: 1.55;
}

.writing-content > :first-child {
  margin-top: 0;
}

.writing-content > :last-child {
  margin-bottom: 0;
}

.writing-content p {
  margin: 0 0 0.8rem;
  text-align: justify;
  hyphens: auto;
}

.writing-content h1 {
  margin: 0 0 1rem;
  line-height: 1.2;
}

.writing-content h2 {
  margin: 1.4rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: normal;
  line-height: 1.25;
}

.writing-content h3 {
  margin: 1.2rem 0 0.3rem;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.3;
}

.writing-content ul,
.writing-content ol {
  margin: 0 0 0.8rem;
  padding-left: 1.5rem;
}

/* ---------- progress notes ---------- */

.progress-note-preview {
  padding: 1.5rem 0;
}

.progress-note-preview:first-child {
  padding-top: 0.5rem;
}

.progress-note-preview + .progress-note-preview {
  border-top: 1px solid var(--border);
}

.progress-note-date {
  margin: 0 0 0.65rem;
  font-size: 1em;
  font-weight: normal;
  line-height: 1.3;
}

.progress-note-page,
.progress-note-excerpt {
  font-size: 0.95em;
}

.progress-note-excerpt {
  line-height: 1.5;
}

.progress-note-excerpt > :first-child {
  margin-top: 0;
}

.progress-note-page h2,
.progress-note-excerpt h2 {
  font-size: 1.1rem;
  font-weight: bold;
}

.progress-note-page h2:first-of-type,
.progress-note-excerpt h2:first-of-type {
  font-size: 1.3rem;
}

.progress-note-more {
  margin: 0.65rem 0 0;
  font-size: 0.9em;
}

/* ---------- feed pagination ---------- */

.feed-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;

  margin-top: auto;
  padding-top: 2.5rem;

  border-top: none;
  font-size: 0.9rem;
}

.feed-pagination > :last-child {
  text-align: right;
}

.feed-pagination span {
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- typography ---------- */

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: normal;
}

h1 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

h1 + * {
  margin-top: 0;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

p {
  margin: 1rem 0;
}

ul,
ol {
  padding-left: 1.5rem;
}

li {
  margin: 0.35rem 0;
}

.page-list li {
  margin-bottom: 0.5rem;
}

.page-list p {
  margin: 0.15rem 0 0;
}

.before-compact-list {
  margin-bottom: 0rem;
}

.compact-list {
  margin-top: 0rem;
  margin-bottom: 0rem;
}

.after-compact-list {
  margin-top: 0rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

/* ---------- links ---------- */

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover,
a:focus {
  text-decoration-thickness: 2px;
}

/* ---------- header and navigation ---------- */

.site-title {
  display: block;
  font-weight: bold;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: flex-start;
  font-size: 1rem;
  line-height: 1.4;
}

.site-nav a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  padding: 0.08rem 0.2rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--paper);
  background: var(--accent);
  text-decoration: none;
}

.mobile-nav {
  display: none;
}

.mobile-nav summary {
  width: fit-content;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.mobile-nav nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  margin-top: 0.65rem;
}

.mobile-nav a {
  color: var(--accent);
}

/* ---------- simple content blocks ---------- */

.note,
.service-card,
.callout {
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 1rem;
  margin: 1.25rem 0;
}

.service-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.small {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- buttons / calls to action ---------- */

.cta {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--paper);
  text-decoration: none;
}

.cta:hover,
.cta:focus {
  background: var(--paper);
}

/* ---------- mobile ---------- */

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }
}