/*  main.css
    Everything below the fold. Deferred from the layout so it never render-blocks.
    Section/component styles land here as each section gets built.
*/

/* Button styles moved to critical.css: the header CTA and hero CTAs are above the fold, so
   deferring them flashed an unstyled button on first paint. */

/* Alternating section background, to break up a long page. */
.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

/* ---------- Call to action ----------
   The conversion block that closes every service page. Accent-tinted so it reads as the
   decision point rather than just another section. */
.section--cta {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  border-block: 1px solid var(--border);
  text-align: center;
}

.section--cta .text {
  margin-inline: auto;
  margin-bottom: 1.75rem;
}

/* ---------- Service page features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature__title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.feature__text {
  color: var(--text-muted);
}

/* ---------- Category filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.filter {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.filter:hover,
.filter:focus-visible {
  color: var(--text);
  border-color: var(--text-muted);
}

/* The selected filter is marked with aria-current in the markup as well as this colour,
   so it isn't signalled by colour alone. */
.filter--on {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

/* ---------- Project cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.card:hover {
  border-color: var(--text-muted);
}

/* The whole card is one link, so there's a single tab stop per project rather than one
   for the image and another for the title. */
.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* Fixed ratio here rather than in the file: the pipeline keeps each image's real aspect
   so nothing is cropped on disk, and the grid does its own cropping for display only. */
.card__media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--border);
}

.card__body {
  padding: 1.25rem;
}

.card__category {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.375rem;
}

.card__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

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

.card__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

.cards__more {
  margin-top: 2rem;
}

/* ---------- Home: what I do ---------- */
.offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* The whole offer is one link, so there's one tab stop per service and the whole card is a
   target, not just the title. */
.offer {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
}

.offer:hover,
.offer:focus-visible {
  border-color: var(--text-muted);
}

.offer__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.offer__text {
  color: var(--text-muted);
}

/* Pushed to the bottom of the card and coloured like a link, as the "go here" affordance. */
.offer__more {
  margin-top: auto;
  padding-top: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.offer:hover .offer__more::after,
.offer:focus-visible .offer__more::after {
  content: " \2192"; /* → nudges on hover */
}

/* ---------- Project detail: points ---------- */
.points {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.point {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}

.point__title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

/* pre-line keeps the line breaks typed into the admin without needing markdown or Html.Raw. */
.point__body {
  color: var(--text-muted);
  white-space: pre-line;
}

/* ---------- Project detail: gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.shot__caption {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ---------- Contact form ----------
   The admin has its own form styles in admin.css, which the public layout doesn't load.
   These are the public equivalent, scoped to the contact form. */
.container--form {
  max-width: 40rem;
}

.form--contact {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form__field label {
  font-weight: 600;
}

.form--contact input,
.form--contact textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  color: var(--text);
  font: inherit;
  width: 100%;
}

.form--contact input:focus-visible,
.form--contact textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Honeypot: off-screen, not display:none. A bot reads the DOM and fills visible-in-markup
   fields; keeping it in the layout but out of view catches more than display:none does,
   which some bots specifically skip. aria-hidden + tabindex in the markup keep humans out. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

/* Phone and email above the form, for people who'd rather call than type. */
.contact-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 1.5rem 0 0;
  padding: 0;
}

.contact-methods li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.contact-methods__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.contact-methods a {
  font-weight: 600;
}

/* Authority line. Accent left border sets it apart from the plain lede text as a claim
   worth pausing on, without shouting. */
.contact-authority {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin-top: 1.5rem;
  color: var(--text);
}

.form__errors:not(:empty),
.form__error:not(:empty) {
  color: var(--error);
  font-size: 0.9rem;
}

.form__errors ul {
  margin: 0;
}

/* ---------- Services hub ---------- */
.services {
  display: grid;
  gap: 1.5rem;
  margin: 0;
}

.service {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  background: var(--surface);
}

.service__title {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

/* The pain-point question. Accent colour so it reads as the hook, not body text. */
.service__hook {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service__text {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.service__link {
  font-weight: 600;
}

/* ---------- Blog list ---------- */
.post-list {
  display: grid;
  gap: 2.5rem;
  margin: 0;
}

.post-item__title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.post-item__title a {
  color: var(--text);
  text-decoration: none;
}

.post-item__title a:hover,
.post-item__title a:focus-visible {
  color: var(--accent);
}

.post-item__date {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.post-item__excerpt {
  color: var(--text-muted);
}

/* ---------- Rendered post body (markdown → HTML) ----------
   Element selectors, not classes: this markup comes from Markdig, so it has no class hooks. */
.prose {
  line-height: 1.7;
}

.prose h2,
.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin-bottom: 1.25rem;
}

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

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.375rem; }

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

.prose blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--text-muted);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}

/* A code block already has the pre background; don't double it on the inner code. */
.prose pre code {
  background: none;
  padding: 0;
}

.prose img {
  border-radius: 8px;
}

.prose__back {
  margin-top: 2.5rem;
}

/* ---------- 404 page ---------- */
.notfound-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--text);
}

.site-footer__location {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
