/* Milford — a pages-first proof-of-concept theme for Signal.
   Structural cue taken from milfordcreative.com: minimal top nav, a hero
   with name + one-line description, a row of equal-weight service/section
   cards, generous whitespace. Everything else (palette, type, card
   treatment) is this theme's own design, not a clone.

   Deliberately NOT a warm-neutral palette — Signal's own default theme
   (Daylight Press) already owns that territory (warm ink on warm paper,
   all-sans type). A proof-of-concept theme that reads as "the same
   colours with a different accent" doesn't prove anything. This is cool
   where Daylight Press is warm, and pairs a serif headline face against
   a sans body — a different typographic silhouette, not just a palette
   swap.

   System fonts only — no webfonts to bundle, keeps this theme a single
   small file. Hierarchy comes from size/weight, not dimmed/muted color;
   section separation comes from spacing/background blocks, not
   decorative rule lines (the footer is an ink-colored band, not a ruled
   line — see .site-footer below). */

:root {
  color-scheme: light;
  --ink: #12171F;
  --ink-hover: #000000;
  --paper: #F1F4F7;
  --sheet: #FFFFFF;
  --hairline: #DBE2E8;
  --accent: #0F6E5D;
  --accent-hover: #0A5245;
  --accent-tint: #DFF0EB;
  --text-on-ink: #F4F7F5;
  --text-on-accent: #FFFFFF;
  --font-sans: -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.type-meta {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

/* ── Site chrome ─────────────────────────────────────────────────────── */

.site-header-inner, .site-main, .site-footer-inner {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 1.75rem;
}

.site-header {
  padding: 1.5rem 0;
}
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.site-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.site-title:hover { color: var(--accent); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.site-nav a {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
}
.site-nav a:hover { background: var(--accent-tint); color: var(--accent-hover); }

.site-footer { margin-top: 4rem; padding: 2.25rem 0 3rem; background: var(--ink); }
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.site-footer .footer-copyright, .site-footer .footer-nav a { color: var(--text-on-ink); }
.site-footer .footer-nav a:hover { color: var(--accent-tint); }
.footer-copyright { font-size: 0.875rem; color: var(--ink); margin: 0; }
.footer-nav a { font-size: 0.875rem; color: var(--ink); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }

/* ── Home: hero ──────────────────────────────────────────────────────── */

.milford-home { padding: 2.5rem 0 1rem; }

.hero {
  max-width: 46rem;
  padding: 2.5rem 0 3.5rem;
}
.hero-eyebrow { margin-bottom: 0.75rem; }
.hero-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.hero-desc {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 2rem;
  max-width: 42rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-on-accent); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--text-on-ink); }

/* ── Home: quicklink cards ───────────────────────────────────────────── */

.quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.25rem;
  padding: 2rem 0;
}
.quicklink-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--sheet);
  border: 1.5px solid var(--hairline);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 160ms ease-out, transform 160ms ease-out;
}
.quicklink-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.quicklink-label {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.quicklink-desc { font-size: 0.9375rem; margin: 0; color: var(--ink); }

/* ── Home: latest news / posts list ─────────────────────────────────── */

.section-title, .list-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
}
.home-news { padding: 2.5rem 0 1rem; }

.list-header { margin-bottom: 1.75rem; }
.list-eyebrow { margin-bottom: 0.6rem; }
.milford-list { max-width: 74rem; margin: 0 auto; padding: 3rem 1.75rem 4rem; }

.post-list-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.5rem;
}
.post-list-item { max-width: none; }
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0.5rem;
  background: var(--sheet);
  border: 1.5px solid var(--hairline);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 160ms ease-out, transform 160ms ease-out;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-card-date {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-list-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}
.post-list-excerpt { font-size: 0.9375rem; line-height: 1.55; margin: 0; color: var(--ink); flex-grow: 1; }
.post-card-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.25rem;
}

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

/* ── Page (About / Services / Testimonials / Contact) ───────────────── */

.milford-page, .milford-post { max-width: 74rem; margin: 0 auto; padding: 3rem 1.75rem 4rem; }
.page-header, .post-header { max-width: var(--measure); margin-bottom: 2rem; }
.page-eyebrow, .post-eyebrow { margin-bottom: 0.75rem; }
.page-title, .post-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.post-meta {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--ink);
  margin: 0.75rem 0 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.post-meta > * + *::before { content: '·'; margin-right: 0.75rem; }
.post-cover { margin: 2rem 0; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: 12px; }

.page-content, .post-content {
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 1.7;
}
.page-content p, .post-content p { margin: 0 0 1.35rem; }

.page-content h2, .page-content h3, .page-content h4,
.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem;
}
.page-content h2, .post-content h2 { font-size: 1.5rem; }
.page-content h3, .post-content h3 { font-size: 1.25rem; }
.page-content h4, .post-content h4 { font-size: 1.0625rem; }
/* A service/section heading gets a small accent mark instead of a rule
   line — keeps section breaks visible without adding horizontal dividers
   through the page. Applies from h2 down to h3: page content headings
   start at h2 in markdown source but render one level down (h1 is
   reserved for the page's own title), so a single "## Heading" in a
   page's body is the common case and renders as h3. */
.page-content h2::before, .page-content h3::before {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  background: var(--accent);
  border-radius: 3px;
  margin-right: 0.5em;
  transform: translateY(-0.05em);
}

.page-content ul, .page-content ol, .post-content ul, .post-content ol {
  margin: 0 0 1.35rem; padding-left: 1.5rem;
}
.page-content li, .post-content li { margin-bottom: 0.4rem; }

.page-content img, .post-content img { max-width: 100%; height: auto; display: block; border-radius: 12px; }
.page-content figure, .post-content figure { margin: 2.5rem 0; max-width: var(--measure); }
.page-content figure.img-wide, .post-content figure.img-wide,
.page-content figure.img-break, .post-content figure.img-break { max-width: none; }
.page-content figcaption, .post-content figcaption {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink);
  margin-top: 0.6rem;
}
.img-pair { display: flex; gap: 1.25rem; flex-wrap: wrap; max-width: none; }
.img-pair figure { flex: 1 1 14rem; margin: 2.5rem 0; }

/* Testimonials read as blockquotes — give them a card treatment with a
   large accent quote mark rather than a plain rule-left blockquote. */
.page-content blockquote, .post-content blockquote {
  position: relative;
  margin: 2rem 0;
  padding: 1.75rem 1.75rem 1.75rem 3rem;
  background: var(--sheet);
  border: 1.5px solid var(--hairline);
  border-radius: 14px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--ink);
}
.page-content blockquote::before, .post-content blockquote::before {
  content: '“';
  position: absolute;
  top: 0.6rem;
  left: 1rem;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-style: normal;
  color: var(--accent);
  line-height: 1;
}
.pull-quote blockquote { font-size: 1.375rem; }
.quote-interlude { margin: 2.75rem 0; padding: 0.5rem 0; }
.quote-interlude blockquote {
  font-size: 1.625rem;
  text-align: center;
  padding: 2rem 2.5rem;
}
.quote-interlude blockquote::before { display: none; }

/* Contact pages: make a mailto link read as an obvious action, not a
   plain text link — no working form exists, so a clear affordance
   matters more here. */
.page-content a[href^="mailto:"] {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-on-accent);
  background: var(--accent);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  margin: 0.25rem 0;
}
.page-content a[href^="mailto:"]:hover { background: var(--accent-hover); }

.page-content pre, .post-content pre {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.9em;
  overflow-x: auto;
  padding: 1rem 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  margin: 0 0 1.35rem;
}
.page-content code, .post-content code {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.9em;
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
.page-content pre code, .post-content pre code { background: none; border: none; padding: 0; }

.page-content hr, .post-content hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2.5rem 0;
}

.youtube-embed { margin: 2.5rem 0; max-width: none; }
.youtube-embed-frame { position: relative; padding-top: 56.25%; background: var(--sheet); border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.youtube-embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

.post-tags {
  list-style: none;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 2.5rem 0 0;
  padding: 0;
}
.post-tags a, .tag-chip {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-tint);
  text-decoration: none;
  color: var(--accent-hover);
}
.post-tags a:hover, .tag-chip:hover { background: var(--accent); color: var(--text-on-accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2rem; }
  .site-header-inner, .site-main, .site-footer-inner { padding: 0 1.25rem; }
  .milford-page, .milford-post, .milford-list { padding: 2rem 1.25rem 3rem; }
  .quicklinks { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .quicklinks { grid-template-columns: 1fr; }
}
