/* Tākoha Ghost theme.
   Tokens lifted verbatim from the marketing site's tailwind.config.ts and
   app/globals.css so the blog and takoha.nz render identically. Plain CSS on
   purpose — a Ghost theme ships as static assets, with no build step. */

:root {
  --kohatu: #141414;   /* near-black, primary text */
  --moana: #0d4284;    /* deep blue, links and eyebrows */
  --royal: #326db3;    /* mid blue, focus ring */
  --atea: #88bee2;     /* light blue, selection */
  --stone: #828282;    /* muted text */
  --hukarere: #f7f8f9; /* off-white section background */

  --content: 76rem;    /* matches Tailwind maxWidth.content */
  --rule: rgba(20, 20, 20, 0.1);
  --border: rgba(20, 20, 20, 0.12);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: #fff;
  color: var(--kohatu);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--atea);
  color: var(--kohatu);
}

a { color: inherit; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 60;
  background: var(--kohatu);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

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

.container {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 640px) {
  .container { padding: 0 2rem; }
}

.section { padding: 4rem 0; }
@media (min-width: 768px) {
  .section { padding: 5rem 0; }
}
.section--tint { background: var(--hukarere); }
.section--hairline { border-bottom: 1px solid var(--rule); }

/* ---- header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
}
@media (min-width: 768px) {
  .site-header__inner { height: 80px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--kohatu);
}
@media (min-width: 640px) {
  .brand { gap: 1rem; }
}
.brand__mark { height: 36px; width: 36px; flex: none; }
@media (min-width: 768px) {
  .brand__mark { height: 40px; width: 40px; }
}
.brand__divider {
  display: none;
  height: 36px;
  width: 1px;
  background: rgba(20, 20, 20, 0.2);
}
@media (min-width: 640px) {
  .brand__divider { display: block; }
}
.brand__text { line-height: 1; }
.brand__wordmark { display: block; height: 17px; width: auto; }
@media (min-width: 768px) {
  .brand__wordmark { height: 19px; }
}
.brand__tagline {
  margin-top: 7px;
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--stone);
}

.nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .nav { display: flex; }
}
@media (min-width: 1280px) {
  .nav { gap: 2rem; }
}
.nav__link {
  font-size: 15px;
  font-weight: 500;
  color: rgba(20, 20, 20, 0.8);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav__link:hover { color: var(--moana); }
.nav__link[aria-current="page"] { color: var(--moana); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--kohatu);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 0.625rem 1rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--moana); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  border: 1px solid rgba(20, 20, 20, 0.15);
  border-radius: 6px;
  background: none;
  color: var(--kohatu);
  cursor: pointer;
}
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--rule);
  background: #fff;
}
.mobile-menu[data-open="true"] { display: block; }
@media (min-width: 1024px) {
  .mobile-menu[data-open="true"] { display: none; }
}
.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}
.mobile-menu__link {
  padding: 0.75rem 0;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 20, 20, 0.05);
}
.mobile-menu__cta { margin-top: 1rem; padding: 0.75rem 1rem; }

/* ---- type -------------------------------------------------------------- */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--moana);
  margin: 0;
}

.h1 {
  margin: 1.25rem 0 0;
  font-size: clamp(2.25rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lead {
  margin: 1.5rem 0 0;
  font-size: 19px;
  line-height: 1.7;
  color: rgba(20, 20, 20, 0.75);
  max-width: 48rem;
}

.measure { max-width: 48rem; }

/* ---- post list --------------------------------------------------------- */

.post-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.post-card:hover { border-color: var(--royal); }

.post-card__image {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--kohatu);
}

.post-card__body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.post-card__meta {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
  margin: 0;
}

.post-card__title {
  margin: 0.75rem 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.post-card__excerpt {
  margin: 0.75rem 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(20, 20, 20, 0.7);
}

.post-card__more {
  margin: 1.25rem 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--moana);
}

.empty {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  color: rgba(20, 20, 20, 0.7);
}

/* ---- single post ------------------------------------------------------- */

.article-header { padding: 3.5rem 0 0; }
@media (min-width: 768px) {
  .article-header { padding: 5rem 0 0; }
}

.article-meta {
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 14px;
  color: var(--stone);
}
.article-meta__author {
  color: var(--kohatu);
  font-weight: 600;
  text-decoration: none;
}
.article-meta__dot { color: rgba(20, 20, 20, 0.25); }

.article-feature {
  margin: 3rem 0 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--kohatu);
}

.article-body {
  max-width: 44rem;
  margin: 3rem 0 0;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(20, 20, 20, 0.85);
}
.article-body > * + * { margin-top: 1.5rem; }
.article-body h2 {
  margin-top: 3rem;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--kohatu);
}
.article-body h3 {
  margin-top: 2.5rem;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--kohatu);
}
.article-body a {
  color: var(--moana);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--royal); }
.article-body ul,
.article-body ol { padding-left: 1.5rem; }
.article-body li + li { margin-top: 0.5rem; }
.article-body img,
.article-body figure { border-radius: 12px; overflow: hidden; }
.article-body figcaption {
  margin-top: 0.75rem;
  font-size: 14px;
  color: var(--stone);
  text-align: center;
}
.article-body blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--royal);
  color: rgba(20, 20, 20, 0.75);
  font-size: 19px;
}
.article-body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}
.article-body code {
  background: var(--hukarere);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--kohatu);
  color: #fff;
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.article-body pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

/* ---- Koenig editor cards ----------------------------------------------
   Ghost's editor emits these classes; .kg-width-wide and .kg-width-full are
   required by theme validation, and without them wide images render at the
   body measure as though the setting had been ignored.

   The article measure is 44rem. Wide breaks out past it; full runs to the
   container width rather than the viewport — an edge-to-edge bleed needs
   100vw, which overflows by the scrollbar width, and the usual remedy
   (overflow-x: hidden on body) would break the sticky header. */

.article-body .kg-card { margin-top: 2.5rem; }

.article-body .kg-width-wide {
  width: min(60rem, 92vw);
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: none;
}

.article-body .kg-width-full {
  width: min(76rem, 96vw);
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: none;
}

.article-body .kg-image { border-radius: 12px; }
.article-body .kg-width-full .kg-image,
.article-body .kg-width-full img { border-radius: 12px; width: 100%; }

.article-body .kg-image-card figcaption,
.article-body .kg-embed-card figcaption,
.article-body .kg-gallery-card figcaption {
  margin-top: 0.75rem;
  font-size: 14px;
  color: var(--stone);
  text-align: center;
}

/* Galleries */
.article-body .kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.article-body .kg-gallery-row { display: flex; gap: 0.75rem; }
.article-body .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* Embeds keep their aspect ratio rather than collapsing */
.article-body .kg-embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.article-body .kg-embed-card iframe { max-width: 100%; border-radius: 12px; }

/* Bookmark card */
.article-body .kg-bookmark-card a.kg-bookmark-container {
  display: flex;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  transition: border-color 0.15s ease;
}
.article-body .kg-bookmark-card a.kg-bookmark-container:hover { border-color: var(--royal); }
.article-body .kg-bookmark-content { flex: 1 1 auto; padding: 1.25rem; }
.article-body .kg-bookmark-title { font-weight: 700; font-size: 17px; }
.article-body .kg-bookmark-description {
  margin-top: 0.5rem;
  font-size: 15px;
  color: rgba(20, 20, 20, 0.7);
}
.article-body .kg-bookmark-metadata {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: var(--stone);
}
.article-body .kg-bookmark-icon { width: 18px; height: 18px; }
.article-body .kg-bookmark-thumbnail { flex: 0 0 33%; }
.article-body .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Callout, toggle and button cards */
.article-body .kg-callout-card {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--hukarere);
  border: 1px solid var(--border);
}
.article-body .kg-callout-text { font-size: 16px; }

.article-body .kg-toggle-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.article-body .kg-toggle-heading-text { font-size: 17px; font-weight: 700; }
.article-body .kg-toggle-card[data-kg-toggle-state="close"] .kg-toggle-content { display: none; }

.article-body .kg-button-card { display: flex; justify-content: center; }
.article-body .kg-btn {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: var(--kohatu);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}
.article-body .kg-btn:hover { background: var(--moana); color: #fff; }

@media (max-width: 640px) {
  /* Below the measure there is nothing to break out of. */
  .article-body .kg-width-wide,
  .article-body .kg-width-full {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
  .article-body .kg-gallery-row { flex-direction: column; }
  .article-body .kg-bookmark-card a.kg-bookmark-container { flex-direction: column; }
  .article-body .kg-bookmark-thumbnail { flex: none; max-height: 180px; }
}
.article-body th,
.article-body td {
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem;
  text-align: left;
}

/* ---- next-page card (mirrors the marketing site) ----------------------- */

.next-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
@media (min-width: 640px) {
  .next-card { padding: 2rem; }
}
.next-card:hover { border-color: var(--kohatu); }
.next-card__label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--stone);
}
.next-card__title {
  margin: 0.75rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.next-card__arrow { color: var(--moana); }
.next-card__note {
  margin: 0.5rem 0 0;
  font-size: 16px;
  color: rgba(20, 20, 20, 0.7);
}

/* ---- footer ------------------------------------------------------------ */

.site-footer {
  background: var(--kohatu);
  color: #fff;
}
.site-footer__inner { padding: 3rem 0; }
.site-footer__top {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  justify-content: space-between;
}
@media (min-width: 768px) {
  .site-footer__top { flex-direction: row; align-items: flex-end; }
}
.site-footer__mark { height: 44px; width: 44px; flex: none; }
.site-footer__divider { height: 44px; width: 1px; background: rgba(255, 255, 255, 0.25); }
.site-footer__wordmark { display: block; height: 19px; width: auto; }
.site-footer__tagline {
  margin-top: 0.5rem;
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.55);
}
.site-footer__line {
  margin: 1.5rem 0 0;
  max-width: 28rem;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}
.site-footer__nav a {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer__nav a:hover { color: var(--atea); }
.site-footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
@media (min-width: 768px) {
  .site-footer__bottom { flex-direction: row; align-items: center; }
}

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

.pagination {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 15px;
}
.pagination a {
  color: var(--moana);
  font-weight: 600;
  text-decoration: none;
}
.pagination__page { color: var(--stone); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
