/* cardanode.com.au — brand styles
   Palette pulled from the live WordPress site:
     primary blue   #0693e3
     deep navy      #003388  (accent / hover)
     ink            #0b1320  (body text on white)
     muted          #5a6577
     surface        #ffffff
     surface-2      #f4f7fb  (cards / strips)
     border         #e3e8ef
   Fonts: Raleway (body), Rubik (display) — matches the legacy site.
*/

:root {
  --blue: #0693e3;
  --blue-hover: #0379bd;
  --navy: #003388;
  --ink: #0b1320;
  --muted: #5a6577;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --border: #e3e8ef;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 19, 32, 0.06);
  --shadow-md: 0 6px 24px rgba(11, 19, 32, 0.08);
  --max-w: 1140px;
}

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: "Rubik", "Raleway", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 1.5em 0 0.5em; }
h3 { font-size: 1.3rem; margin: 1.2em 0 0.4em; }

p { margin: 0 0 1em; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }

/* External-link affordance — arrow appended to any link that opens in
   a new tab. Used by all external links across the site (homepage nav,
   cards, footer, and blog-post body links). Suppressed inside .btn and
   .link-card so the visual chrome there isn't doubled-up. */
a[target="_blank"]::after {
  content: "↗";
  display: inline-block;
  margin-left: 3px;
  font-size: 0.85em;
  vertical-align: baseline;
  color: currentColor;
  opacity: 0.7;
}
.btn[target="_blank"]::after,
.link-card[target="_blank"]::after,
.site-nav a[target="_blank"]::after { content: none; }

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Top nav */
.site-nav {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav .brand {
  font-family: "Rubik", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}
.site-nav .brand .accent { color: var(--blue); }
.site-nav nav { margin-left: auto; display: flex; gap: 20px; }
.site-nav nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav nav a:hover { color: var(--blue); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--blue-hover); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}
.btn.ghost:hover { background: var(--blue); color: #fff; }

/* Hero */
.hero {
  padding: 72px 0 56px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}
/* Hero two-column: copy on left, portrait on right; stacks on narrow */
.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
}
.hero-copy { min-width: 0; }
.hero-portrait {
  margin: 0;
  text-align: center;
  flex-shrink: 0;
}
.hero-portrait img {
  width: 320px;
  height: 320px;
  max-width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  border: 4px solid #fff;
  outline: 1px solid var(--border);
  display: block;
}
.hero-portrait figcaption {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}
@media (max-width: 820px) {
  .hero-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-portrait { order: -1; }
  .hero-portrait img { width: 220px; height: 220px; }
}

.hero .eyebrow {
  color: var(--blue);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.hero h1 { max-width: 740px; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.hero .ctas { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.stats-foot { color: var(--muted); font-size: 0.85rem; margin-top: -16px; }

/* Generic section spacing */
.section { padding: 64px 24px; }
.section .lede { font-size: 1.1rem; color: var(--muted); max-width: 720px; }

/* 2/3-col card grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card-icon { font-size: 1.6rem; margin-bottom: 10px; line-height: 1; }
.link-card { display: block; color: var(--ink); text-decoration: none; }
.link-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); text-decoration: none; }
.link-card:hover h3 { color: var(--blue); }

/* Operator block */
.operator-section { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.operator-text { max-width: 760px; }
.operator-text h3 { font-size: 1.6rem; margin: 0 0 4px; }
.operator-text .meta { color: var(--muted); margin-bottom: 18px; font-size: 0.95rem; }

/* Delegate section */
.delegate-section { background: linear-gradient(180deg, #ffffff 0%, #f0f8ff 100%); border-top: 1px solid var(--border); }
.how-to {
  max-width: 720px;
  margin: 20px 0 28px;
  padding-left: 22px;
  color: var(--ink);
}
.how-to li { margin-bottom: 10px; }

/* Footer build code */
.site-footer code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }
.site-footer .muted { opacity: 0.6; margin-left: 6px; }

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 40px 0;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stat .value { font-family: "Rubik", sans-serif; font-size: 1.6rem; font-weight: 600; color: var(--ink); margin-top: 4px; }

/* Post list */
.post-list { display: grid; gap: 24px; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-card h2 { margin: 0 0 6px; font-size: 1.3rem; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--blue); text-decoration: none; }
.post-card .meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 8px; }
.post-card.related h3 { margin: 0 0 4px; font-size: 1.05rem; }
.post-card.related h3 a { color: var(--ink); }
.post-card.related h3 a:hover { color: var(--blue); text-decoration: none; }

/* Category badges + filter strip */
.cat-badge, .cat-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  margin-right: 4px;
  white-space: nowrap;
}
.cat-badge:hover, .cat-pill:hover { color: var(--blue); border-color: var(--blue); text-decoration: none; }
.cat-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.cat-pill { padding: 6px 12px; font-size: 0.85rem; background: var(--surface); }
.cat-pill .n { color: var(--muted); font-weight: 400; margin-left: 4px; }

/* Article body */
.post {
  max-width: 760px;
  margin: 48px auto;
}
.post h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.post .meta { color: var(--muted); margin-bottom: 24px; }
.post img { border-radius: var(--radius); margin: 24px 0; }
.post blockquote {
  border-left: 3px solid var(--blue);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  color: var(--muted);
  font-style: italic;
}
.post pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  font-size: 0.9rem;
}
.post code { background: var(--surface-2); padding: 2px 5px; border-radius: 4px; font-size: 0.9em; }
.post pre code { background: transparent; padding: 0; }

/* Hero image on post */
.post img.hero { width: 100%; margin: 0 0 32px; }

/* Comments */
.comments { max-width: 760px; margin: 56px auto 0; }
.comments h2 { font-size: 1.4rem; }
.comment-list { list-style: none; padding: 0; margin: 24px 0 0; }
.comment {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--surface);
}
.comment header { margin-bottom: 6px; font-size: 0.95rem; }
.comment .comment-body { color: var(--ink); }
.comment .comment-body p { margin: 0 0 6px; }

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 40px 0 0;
  justify-content: center;
}
.pagination .page {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--surface);
}
.pagination .page:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pagination .page.current { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Embedded YouTube iframes responsive */
.post iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  margin: 24px 0;
}

/* Podcast embed (Spreaker) — fixed height, not 16:9 */
.post iframe.podcast-embed {
  aspect-ratio: auto;
  height: 200px;
  background: transparent;
}

/* Footer */
.site-footer {
  margin-top: 80px;
  padding: 40px 0 32px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--blue); }

/* Skip link (a11y) */
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; border: 2px solid var(--blue); border-radius: 6px; z-index: 1000; }
