/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/


/* ============================================================
   BLOCK AGENCY — Typography System
   ============================================================ */


/* ------------------------------------------------------------
   Font rendering
   Improves text sharpness across browsers, especially on Mac.
   antialiased = thinner, crisper strokes (modern web standard).
   ------------------------------------------------------------ */

*,
*::before,
*::after {
  -webkit-font-smoothing  : antialiased;
  -moz-osx-font-smoothing : grayscale;
  text-rendering          : optimizeLegibility;
}


/* ------------------------------------------------------------
   Design tokens
   Single source of truth. Change a value here, it updates
   everywhere — marketing pages, blog, docs, legal.
   ------------------------------------------------------------ */

:root {

  /* Font sizes */
  --font-display-xl : clamp(48px, 8vw, 96px);
  --font-display    : clamp(36px, 6vw, 72px);
  --font-h1         : clamp(36px, 5vw, 60px);
  --font-h2         : clamp(30px, 4vw, 48px);
  --font-h3         : clamp(24px, 3vw, 36px);
  --font-h4         : clamp(22px, 2.5vw, 30px);
  --font-h5         : clamp(20px, 2vw, 24px);
  --font-body-xl    : 20px;
  --font-body-lg    : 18px;
  --font-body-md    : 16px;
  --font-body-sm    : 14px;
  --font-label      : 14px;
  --font-caption    : 12px;

  /* Line heights */
  --lh-display-xl   : 1.05;
  --lh-display      : 1.05;
  --lh-h1           : 1.1;
  --lh-h2           : 1.15;
  --lh-h3           : 1.2;
  --lh-h4           : 1.25;
  --lh-h5           : 1.3;
  --lh-body-xl      : 1.6;
  --lh-body-lg      : 1.6;
  --lh-body-md      : 1.6;
  --lh-body-sm      : 1.5;
  --lh-label        : 1.4;
  --lh-caption      : 1.4;

  /* Letter spacing */
  --ls-display-xl   : -0.02em;
  --ls-display      : -0.015em;
  --ls-h1           : -0.015em;
  --ls-h2           : -0.01em;
  --ls-h3           : -0.005em;
  --ls-caption      : 0.08em;

  /* Spacing */
  --space-paragraph   : 1.5em;
  --space-heading-top : 2em;
  --space-heading-bot : 0.6em;
  --max-width-prose   : 65ch;
}


/* Tablet (≤ 1024px) */

@media (max-width: 1024px) {
  :root {
    --lh-display-xl : 1.08;
    --lh-display    : 1.08;
    --lh-h2         : 1.2;
    --lh-h3         : 1.25;
    --lh-h4         : 1.3;
    --lh-h5         : 1.35;
    --ls-display-xl : -0.015em;
    --ls-display    : -0.01em;
    --ls-h1         : -0.01em;
    --ls-h2         : -0.005em;
    --ls-h3         : 0em;
  }
}


/* Mobile (≤ 767px) */

@media (max-width: 767px) {
  :root {
    --lh-display-xl : 1.1;
    --lh-display    : 1.1;
    --lh-h1         : 1.15;
    --lh-h3         : 1.3;
    --lh-h4         : 1.35;
    --lh-h5         : 1.4;
    --ls-display-xl : -0.01em;
    --ls-display    : -0.005em;
    --ls-h1         : -0.005em;
    --ls-h2         : 0em;
    --font-body-xl  : 18px;
    --font-body-lg  : 16px;
  }
}


/* ------------------------------------------------------------
   Base elements
   Applied globally — marketing pages, landing pages, everywhere.
   .prose overrides what it needs without duplicating anything.
   ------------------------------------------------------------ */

h1 {
  font-size      : var(--font-h1);
  line-height    : var(--lh-h1);
  letter-spacing : var(--ls-h1);
  font-weight    : 700;
  margin-top     : var(--space-heading-top);
  margin-bottom  : var(--space-heading-bot);
}

h2 {
  font-size      : var(--font-h2);
  line-height    : var(--lh-h2);
  letter-spacing : var(--ls-h2);
  font-weight    : 700;
  margin-top     : var(--space-heading-top);
  margin-bottom  : var(--space-heading-bot);
}

h3 {
  font-size      : var(--font-h3);
  line-height    : var(--lh-h3);
  letter-spacing : var(--ls-h3);
  font-weight    : 600;
  margin-top     : var(--space-heading-top);
  margin-bottom  : var(--space-heading-bot);
}

h4 {
  font-size      : var(--font-h4);
  line-height    : var(--lh-h4);
  font-weight    : 600;
  margin-top     : var(--space-heading-top);
  margin-bottom  : var(--space-heading-bot);
}

h5 {
  font-size      : var(--font-h5);
  line-height    : var(--lh-h5);
  font-weight    : 600;
  margin-top     : 1.5em;
  margin-bottom  : var(--space-heading-bot);
}

p {
  font-size     : var(--font-body-md);
  line-height   : var(--lh-body-md);
  margin-bottom : var(--space-paragraph);
}

p:last-child { margin-bottom: 0; }

li {
  font-size   : var(--font-body-md);
  line-height : var(--lh-body-md);
}


/* ------------------------------------------------------------
   .prose
   Editorial context: blogs, docs, legal pages.
   Constrains line length, bumps body to 18px, adds rich-text
   element styles. Headings inherit global tokens — no repetition.
   ------------------------------------------------------------ */

.prose {
  max-width : var(--max-width-prose);
}

.prose h1 {
  font-size : clamp(30px, 4vw, 48px);
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child,
.prose h5:first-child {
  margin-top : 0;
}

.prose p,
.prose li {
  font-size : var(--font-body-lg);
}

.prose ul,
.prose ol {
  margin-left   : 2.5em;
  margin-bottom : var(--space-paragraph);
}

.prose li {
  margin-bottom : 0.5em;
}

.prose a {
  transition : color 0.1s ease;
}

.prose a:hover {
  color : var(--fg-strong);
}

.prose blockquote {
  border-left  : 3px solid currentColor;
  padding-left : 1.25em;
  margin       : 2em 0;
  opacity      : 0.75;
}

.prose blockquote p {
  font-style    : italic;
  margin-bottom : 0;
}

.prose code {
  font-family   : ui-monospace, "SF Mono", monospace;
  font-size     : 0.875em;
  background    : rgba(0, 0, 0, 0.06);
  padding       : 0.15em 0.4em;
  border-radius : 4px;
}

.prose pre {
  font-family   : ui-monospace, "SF Mono", monospace;
  font-size     : var(--font-body-sm);
  line-height   : 1.7;
  overflow-x    : auto;
  margin        : 2em 0;
  padding       : 1.25em 1.5em;
  border-radius : 8px;
  background    : rgba(0, 0, 0, 0.04);
}

.prose pre code {
  background : transparent;
  padding    : 0;
  font-size  : inherit;
}

.prose table {
  width           : 100%;
  border-collapse : collapse;
  font-size       : var(--font-body-sm);
  margin          : 2em 0;
}

.prose th {
  font-weight   : 600;
  text-align    : left;
  padding       : 0.625em 0.875em;
  border-bottom : 2px solid currentColor;
}

.prose td {
  padding        : 0.625em 0.875em;
  border-bottom  : 1px solid rgba(0, 0, 0, 0.08);
  vertical-align : top;
}

.prose .wp-block-image {
  margin : 2em 0;
}

.prose .wp-block-image .wp-element-caption {
  font-size     : var(--font-caption);
  line-height   : var(--lh-caption);
  margin-top    : 0.75em;
  margin-bottom : 0;
  opacity       : 0.6;
}


/* ------------------------------------------------------------
   Utility classes — GenerateBlocks
   ------------------------------------------------------------ */

.is-display-xl {
  font-size      : var(--font-display-xl);
  line-height    : var(--lh-display-xl);
  letter-spacing : var(--ls-display-xl);
}

.is-display {
  font-size      : var(--font-display);
  line-height    : var(--lh-display);
  letter-spacing : var(--ls-display);
}

.is-body-xl {
  font-size   : var(--font-body-xl);
  line-height : var(--lh-body-xl);
}

.is-body-lg {
  font-size   : var(--font-body-lg);
  line-height : var(--lh-body-lg);
}

.is-body-sm {
  font-size   : var(--font-body-sm);
  line-height : var(--lh-body-sm);
}

.is-label {
  font-size   : var(--font-label);
  line-height : var(--lh-label);
  font-weight : 500;
}

.is-caption {
  font-size      : var(--font-caption);
  line-height    : var(--lh-caption);
  letter-spacing : var(--ls-caption);
  font-weight    : 500;
  text-transform : uppercase;
}