/*
Theme Name: Gralus
Description: Blog (/blog) and landing pages (/p/) for gralus.com. Same header, footer, font and colours as the Gralus app.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: gralus
*/

:root {
  --background: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f0f3fa;
  --foreground: #1c2128;
  --muted: #5f6b7a;
  --line: #e4e9f0;
  --accent: #2f5bff;
  --accent-hover: #2349e0;
  --accent-soft: #eef2ff;
  --accent-ink: #1d3fd1;
  --card-shadow: 0 6px 16px -6px rgb(31 36 41 / 0.06), 0 1px 2px rgb(31 36 41 / 0.03);
  --pop-shadow: 0 12px 34px rgb(16 49 110 / 0.14), 0 2px 6px rgb(16 49 110 / 0.06);
  --btn-sheen: inset 0 3px 14px rgb(255 255 255 / 0.35);
  --navy: #0d1124;
  --font: "Geist", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0b0c10;
    --surface: #121419;
    --surface-2: #1a1d24;
    --foreground: #f2f4f7;
    --muted: #9aa4b2;
    --line: #262a33;
    --accent: #4d7bff;
    --accent-hover: #3d69f0;
    --accent-soft: #142441;
    --accent-ink: #a9c3ff;
    --card-shadow: 0 1px 2px rgb(0 0 0 / 0.4);
    --pop-shadow: 0 16px 40px rgb(0 0 0 / 0.55), 0 2px 6px rgb(0 0 0 / 0.4);
    --btn-sheen: inset 0 3px 14px rgb(255 255 255 / 0.22);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: floating rounded bar, like the app's SiteNav */
.g-nav-wrap { position: sticky; top: 0; z-index: 50; padding: 12px 16px 0; }
.g-nav {
  max-width: 1024px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 12px; border-radius: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--pop-shadow);
}
.g-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--foreground); text-decoration: none; font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; padding-left: 4px; }
.g-logo:hover { color: var(--foreground); }
.g-links { display: flex; align-items: center; gap: 24px; font-size: 13.5px; }
.g-links a { color: color-mix(in srgb, var(--foreground) 75%, transparent); text-decoration: none; transition: color .15s; }
.g-links a:hover, .g-links a.is-current { color: var(--foreground); }
.g-actions { display: flex; align-items: center; gap: 8px; }
.g-btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 8px 14px; font-size: 13.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: background .15s;
}
.g-btn-ghost { color: var(--foreground); }
.g-btn-ghost:hover { background: var(--surface-2); color: var(--foreground); }
.g-btn-primary { background: var(--accent); color: #fff; box-shadow: var(--btn-sheen); }
.g-btn-primary:hover { background: var(--accent-hover); color: #fff; }
.g-menu-btn { display: none; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--foreground); cursor: pointer; place-items: center; }
.g-mobile { display: none; }
@media (max-width: 767px) {
  .g-links { display: none; }
  .g-menu-btn { display: grid; }
  .g-btn-ghost { display: none; }
  .g-mobile.is-open {
    display: block; max-width: 1024px; margin: 8px auto 0; padding: 8px; border-radius: 16px; border: 1px solid var(--line);
    background: var(--surface); box-shadow: var(--pop-shadow);
  }
  .g-mobile a { display: block; padding: 10px 12px; border-radius: 12px; color: var(--foreground); text-decoration: none; font-size: 15px; }
  .g-mobile a:hover { background: var(--surface-2); }
}

/* Layout */
.g-main { padding: 48px 16px 80px; }
.g-wrap { max-width: 1080px; margin: 0 auto; }
.g-narrow { max-width: 720px; margin: 0 auto; }
.g-eyebrow { font-size: 13px; font-weight: 500; color: var(--accent-ink); margin: 0 0 8px; }
.g-title { font-size: clamp(30px, 4vw, 48px); line-height: 1.1; font-weight: 500; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.g-lead { color: var(--muted); font-size: 17px; margin: 12px 0 0; max-width: 620px; }
.g-head { margin-bottom: 36px; }

/* Blog index cards */
.g-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.g-card {
  display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--card-shadow); overflow: hidden; text-decoration: none; color: var(--foreground); transition: box-shadow .2s, transform .2s;
}
.g-card:hover { box-shadow: var(--pop-shadow); transform: translateY(-2px); color: var(--foreground); }
.g-card-img { aspect-ratio: 1200 / 630; background: var(--surface-2); overflow: hidden; }
.g-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.g-card h2 { font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.g-card p { color: var(--muted); font-size: 14.5px; margin: 0; }
.g-meta { color: var(--muted); font-size: 13px; }
.g-empty { border: 1px dashed var(--line); border-radius: 16px; padding: 40px 24px; text-align: center; color: var(--muted); background: var(--surface); }
.g-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.g-pager a { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 14px; text-decoration: none; color: var(--foreground); font-size: 14px; }

/* Article */
.g-article-head { margin-bottom: 28px; }
.g-cover { margin: 0 0 32px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.g-cover img { display: block; width: 100%; }
.g-content { font-size: 17px; line-height: 1.75; }
.g-content > * { margin-top: 0; margin-bottom: 1.1em; }
.g-content h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; margin: 1.8em 0 .6em; }
.g-content h3 { font-size: 20px; line-height: 1.3; font-weight: 600; margin: 1.5em 0 .5em; }
.g-content ul, .g-content ol { padding-left: 1.3em; }
.g-content li { margin: .3em 0; }
.g-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); }
.g-content code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.g-content pre { background: var(--navy); color: #eef1fb; padding: 16px; border-radius: 12px; overflow-x: auto; font-size: 14px; }
.g-content pre code { background: none; padding: 0; }
.g-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.g-content th, .g-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.g-content img { border-radius: 12px; }
.g-content .alignwide { max-width: 1080px; margin-left: 50%; transform: translateX(-50%); width: min(1080px, calc(100vw - 32px)); }
.g-content .alignfull { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.g-content .wp-block-button__link { background: var(--accent); color: #fff; border-radius: 12px; padding: 12px 20px; text-decoration: none; font-weight: 500; font-size: 15px; box-shadow: var(--btn-sheen); }
.g-content .wp-block-button__link:hover { background: var(--accent-hover); color: #fff; }
.g-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.g-tags a { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.g-back { display: inline-block; margin-top: 40px; font-size: 14px; text-decoration: none; }

/* Landing page: content is full width, sections set their own widths */
.g-landing .g-content { font-size: 17px; }
.g-landing .g-content > *:not(.alignfull):not(.alignwide) { max-width: 760px; margin-left: auto; margin-right: auto; }

/* Footer: dark band, like the app's SiteFooter */
.g-footer { padding: 0 12px 12px; }
.g-footer-in { position: relative; overflow: hidden; border-radius: 30px; background: var(--navy); color: #fff; padding: 64px 24px 32px; }
.g-footer-in::before, .g-footer-in::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; filter: blur(64px); pointer-events: none; }
.g-footer-in::before { top: -96px; left: 25%; background: rgb(63 107 255 / .35); }
.g-footer-in::after { bottom: -96px; right: 25%; background: rgb(139 92 246 / .3); }
.g-cta { position: relative; max-width: 640px; margin: 0 auto; text-align: center; }
.g-cta h2 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; margin: 20px 0 0; text-wrap: balance; }
.g-cta p { color: rgb(255 255 255 / .7); margin: 12px 0 0; }
.g-cta .g-btn { margin-top: 28px; padding: 12px 20px; font-size: 14px; }
.g-cols { position: relative; max-width: 1152px; margin: 72px auto 0; display: grid; gap: 32px; font-size: 14px; grid-template-columns: 1.2fr repeat(4, 1fr); }
.g-cols p.h { color: #fff; font-weight: 500; margin: 0; }
.g-cols ul { list-style: none; margin: 12px 0 0; padding: 0; }
.g-cols li { margin: 0 0 8px; }
.g-cols a { color: rgb(255 255 255 / .6); text-decoration: none; }
.g-cols a:hover { color: #fff; }
.g-cols .about { color: rgb(255 255 255 / .6); }
.g-cols .about .g-logo { color: #fff; padding-left: 0; }
.g-copy { position: relative; max-width: 1152px; margin: 40px auto 0; color: rgb(255 255 255 / .5); font-size: 14px; }
@media (max-width: 1023px) { .g-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .g-cols { grid-template-columns: 1fr; } }
