/*
 * Winner Insect Screen - blog styles.
 *
 * Standalone on purpose. The React app's CSS is bundled to a content-hashed
 * filename that changes on every build, so a PHP page cannot link to it. These
 * rules repeat the tokens and the header/footer/card styles from
 * src/styles.css so the blog looks like the rest of the site without being
 * coupled to the build.
 *
 * If a colour or the card look changes in src/styles.css, mirror it here.
 */

:root {
  color: #142033;
  background: #fdfefe;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --red: #c62828;
  --red-dark: #9f1f1f;
  --sky: #0397d6;
  --sky-soft: #dceffc;
  --ink: #142033;
  --muted: #5a6a80;
  --line: #c9ddee;
  --panel: #ffffff;
  --panel-soft: #f8fbfe;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fdfefe;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
}

.header-inner,
.section-inner,
.post-inner,
.footer-inner,
.footer-bottom {
  width: min(1280px, calc(100% - 2rem));
  margin-inline: auto;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 24px;
  align-items: center;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 68px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong {
  color: var(--sky);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #31445b;
  font-size: 0.92rem;
  font-weight: 850;
}

.nav-links a:hover,
.product-card a:hover,
.site-footer a:hover {
  color: var(--red);
}

.header-call,
.button {
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    color 180ms ease;
}

.header-call,
.button.primary {
  background: var(--red);
  color: var(--white);
}

.header-call:hover,
.button.primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.button.secondary {
  border: 2px solid var(--sky);
  background: var(--white);
  color: #0278ad;
}

/* --------------------------------------------------------------------------
   Index - the card grid, matching the product grid on the home page
   -------------------------------------------------------------------------- */

.eyebrow {
  color: var(--sky);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eyebrow.accent {
  color: var(--red);
}

.section-inner {
  padding: clamp(48px, 7vw, 92px) 0;
}

.section-heading {
  display: grid;
  gap: 12px;
  max-width: 960px;
  margin-bottom: 34px;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.7;
}

.product-heading {
  max-width: 24ch;
  color: var(--sky);
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
  line-height: 1.08;
  text-wrap: balance;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(16, 40, 70, 0.08);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.product-card:hover {
  border-color: rgba(3, 151, 214, 0.4);
  box-shadow: 0 22px 60px rgba(16, 40, 70, 0.1);
  transform: translateY(-3px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.product-card-body {
  flex: 1;
  display: grid;
  gap: 12px;
  padding: 22px;
}

.product-card h2 {
  min-height: 2.7em;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
}

.product-card p {
  color: var(--muted);
  line-height: 1.6;
}

.product-card a {
  margin-top: auto;
  color: var(--red);
  font-weight: 900;
}

.blog-empty {
  color: var(--muted);
}

/* Shown on /blog/ when an article file could not be read. Deliberately loud:
   it means someone's article is invisible and needs a fix. */
.blog-broken {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid var(--red);
  border-left-width: 5px;
  border-radius: 12px;
  background: #fff6f6;
  color: var(--ink);
  line-height: 1.6;
}

.blog-broken ul {
  margin: 0;
  padding-left: 20px;
}

.blog-broken code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.blog-broken span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   Article page
   -------------------------------------------------------------------------- */

.post-inner {
  /* Narrower than the grid: long-form text reads best around 70 characters. */
  width: min(760px, calc(100% - 2rem));
  padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 7vw, 80px);
  display: grid;
  gap: 18px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.breadcrumb a {
  color: var(--sky);
}

.breadcrumb a:hover {
  color: var(--red);
}

.post-title {
  color: var(--sky);
  font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  line-height: 1.1;
  text-wrap: balance;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.post-draft {
  color: var(--red);
}

.post-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  margin: 10px 0 6px;
}

.post-body {
  display: grid;
  gap: 20px;
  color: #26364b;
  font-size: 1.04rem;
  line-height: 1.8;
}

.post-body h2 {
  margin-top: 18px;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 850;
  line-height: 1.25;
}

.post-body h3 {
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 800;
}

.post-body ul,
.post-body ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.post-body a {
  color: var(--sky);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-body a:hover {
  color: var(--red);
}

.post-body strong {
  color: var(--ink);
}

.post-body blockquote {
  margin: 0;
  padding: 16px 20px;
  border-left: 4px solid var(--sky);
  border-radius: 0 12px 12px 0;
  background: var(--panel-soft);
  color: var(--ink);
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.post-body th,
.post-body td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-body th {
  background: var(--panel-soft);
  font-weight: 800;
}

.post-body img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.post-cta {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
  box-shadow: 0 22px 60px rgba(16, 40, 70, 0.08);
}

.post-cta h2 {
  color: var(--sky);
  font-size: 1.3rem;
  font-weight: 850;
  line-height: 1.25;
}

.post-cta p {
  color: var(--muted);
  line-height: 1.7;
}

.post-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.post-back a {
  color: var(--red);
  font-weight: 900;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
  color: var(--ink);
  padding-top: 48px;
  border-top: 6px solid var(--red);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 28px;
  align-items: start;
}

.footer-column {
  display: grid;
  gap: 14px;
}

.footer-column h3 {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 850;
}

.footer-column h4 {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-logo-wrap {
  width: 68px;
  height: 68px;
  display: inline-grid;
  place-items: center;
  padding: 8px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--line);
}

.footer-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.site-footer p {
  color: var(--muted);
  line-height: 1.7;
}

.footer-contact {
  display: grid;
  gap: 8px;
}

.footer-contact-phone {
  white-space: nowrap;
}

.site-footer a {
  color: var(--sky);
}

.footer-bottom {
  margin-top: 36px;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-bottom p {
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--sky);
  font-size: 0.9rem;
  font-weight: 800;
}

.footer-links span {
  color: var(--line);
}

/* --------------------------------------------------------------------------
   Responsive - same breakpoints as the main site
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    row-gap: 10px;
  }

  .nav-links {
    order: 3;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.86rem;
  }

  .product-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .product-card h2 {
    min-height: 0;
  }

  .post-body {
    font-size: 1rem;
  }

  .post-cta-actions .button {
    width: 100%;
  }
}
