/* ==========================================================================
   GG10 Blog — brand layer over Blocksy
   --------------------------------------------------------------------------
   Every colour here is copied from the GG10 brand book (gg10_landing/src/app/
   brand.css) and must stay in step with it. Nothing invents a new colour.

   The blog is a SEPARATE surface from the app: it is a reading experience,
   not a product UI. So it borrows the brand's palette and typeface, but not
   the app's density — long-form text gets generous line height, a measured
   column and real vertical rhythm.

   GEOMETRY NOTE. The app and the landing page use an angular corner CUT.
   A reading surface wants the opposite: large, soft, consistent radii that
   let a card feel like an object you can pick up. The cut survives here only
   as a small accent (the rotated square in kickers and headings), which is
   what actually carries the brand — the red and that diamond — while the
   containers themselves are curved.
   ========================================================================== */

:root {
  /* ---- 01. Primary ---- */
  --gg-primary: #d90251;
  --gg-primary-shade-3: #48011b;
  --gg-primary-shade-2: #79012d;
  --gg-primary-shade-1: #a9023f;
  --gg-primary-tint-4: #e40b5a;
  --gg-primary-tint-3: #ff317c;
  --gg-primary-tint-0: #ffdfeb;

  /* ---- 02. Neutral ---- */
  --gg-bg: #131313;
  --gg-bg-2: #212121;
  --gg-grey-8: #090406;
  --gg-grey-7: #161616;
  --gg-grey-6: #1f1f1f;
  --gg-grey-5: #262626;
  --gg-grey-4: #454545;
  --gg-grey-3: #717171;
  --gg-grey-2: #8a8a8a;
  --gg-grey-1: #a4a4a4;
  --gg-grey-0: #d0d0d0;
  --gg-white: #ffffff;

  --gg-primary-rgb: 217 2 81;
  --gg-primary-tint-3-rgb: 255 49 124;
  --gg-primary-shade-2-rgb: 121 1 45;
  --gg-white-rgb: 255 255 255;
  --gg-black-rgb: 2 2 2;

  /* ---- Curve scale — one ramp, used everywhere ---- */
  --gg-r-xs: 8px;
  --gg-r-sm: 12px;
  --gg-r-md: 18px;
  --gg-r-lg: 24px;
  --gg-r-xl: 32px;
  --gg-r-pill: 999px;

  /* ---- Elevation. Dark UIs read depth from a lifted rim + a deep shadow,
          never from a grey step alone. ---- */
  --gg-rim: inset 0 1px 0 rgb(var(--gg-white-rgb) / 0.06);
  --gg-shadow-sm: 0 2px 8px -2px rgb(var(--gg-black-rgb) / 0.5);
  --gg-shadow-md: 0 12px 28px -12px rgb(var(--gg-black-rgb) / 0.7);
  --gg-shadow-lg: 0 28px 60px -24px rgb(var(--gg-black-rgb) / 0.85);
  --gg-glow: 0 20px 50px -22px rgb(var(--gg-primary-rgb) / 0.55);

  /* ---- Motion. One easing for everything so the surface feels coherent. ---- */
  --gg-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gg-dur: 0.32s;

  /* ---- Reading measure ---- */
  --gg-measure: 42rem;
  --gg-measure-wide: 54rem;

  /* Page gutter — the space between content and the screen edge on narrow
     viewports. Matches what Blocksy applies to its own container. */
  --gg-gutter: clamp(0.9rem, 0.4rem + 2vw, 2rem);

  /* ---- Type ----
     IRANSansXV is the variable face (weight axis 100-900); IRANSansX is the
     static fallback for browsers without variable-font support. Both are
     self-hosted by the child theme — see gg10_blog_font_face(). */
  --gg-font: "IRANSansXV", "IRANSansX", "IRANSans", Tahoma, system-ui, sans-serif;
}

/* ==========================================================================
   Blocksy palette override
   --------------------------------------------------------------------------
   Blocksy renders its whole UI from eight --theme-palette-color-* variables,
   emitted inline in <head> from ITS OWN option store (not plain theme mods).
   Setting those mods via WP-CLI does not reach that store, so the site kept
   rendering Blocksy's default blue-on-white.

   The selector is `html:root`, not `:root`: Blocksy prints its inline <style>
   AFTER this file, and at equal specificity the later rule wins. Adding the
   element selector makes ours heavier so source order stops mattering.

   The mapping keeps Blocksy's own semantics (1 = accent, 8 = page ground):
     1 primary      2 primary-shade-1   3 body text     4 headings
     5 border       6 card/footer       7 page ground   8 deepest ground
   ========================================================================== */
html:root {
  --theme-palette-color-1: var(--gg-primary);
  --theme-palette-color-2: var(--gg-primary-tint-3);
  --theme-palette-color-3: var(--gg-grey-0);
  --theme-palette-color-4: var(--gg-white);
  --theme-palette-color-5: rgb(var(--gg-white-rgb) / 0.12);
  --theme-palette-color-6: var(--gg-grey-6);
  --theme-palette-color-7: var(--gg-bg);
  --theme-palette-color-8: var(--gg-grey-7);

  --theme-text-color: var(--gg-grey-0);
  --theme-headings-color: var(--gg-white);
  --theme-link-initial-color: var(--gg-primary-tint-3);
  --theme-link-hover-color: var(--gg-primary);
  --theme-border-color: rgb(var(--gg-white-rgb) / 0.12);
  --theme-selection-text-color: var(--gg-white);
  --theme-selection-background-color: var(--gg-primary);

  --theme-button-background-initial-color: var(--gg-primary);
  --theme-button-background-hover-color: var(--gg-primary-shade-1);
  --theme-button-text-initial-color: var(--gg-white);
  --theme-button-text-hover-color: var(--gg-white);

  --theme-normal-container-max-width: 1180px;
  --theme-narrow-container-max-width: 760px;

  /* Blocksy rounds form fields from this; keep it on our ramp. */
  --theme-form-border-radius: var(--gg-r-sm);
}

/* ==========================================================================
   Base surfaces
   ========================================================================== */
/* html body, for the same source-order reason as the palette block above:
   Blocksy's inline style sets body{background-color:var(--theme-palette-color-7)}
   after this file. */
html body {
  background-color: var(--gg-bg);
  color: var(--gg-grey-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;   /* the ambient glows below are intentionally oversized */
}

/* Ambient light. Two very soft red pools, fixed, so the page feels lit rather
   than painted flat — the same trick the landing hero uses, dialled far down
   because text sits on top of it for a long time.

   `background-attachment` is not used: a fixed pseudo-element composites on
   the GPU and does not repaint on scroll, which matters on mobile. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58rem 42rem at 88% -8%, rgb(var(--gg-primary-rgb) / 0.16), transparent 62%),
    radial-gradient(46rem 38rem at 4% 32%, rgb(var(--gg-primary-shade-2-rgb) / 0.16), transparent 66%);
}

/* The tactical grid, kept from the landing footer but softened and faded out
   toward the bottom so it never competes with body copy. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image:
    linear-gradient(to right, #fff 1px, transparent 1px),
    linear-gradient(to bottom, #fff 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%);
          mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

#main-container { position: relative; z-index: 1; }

/* ==========================================================================
   Typography — IRANSansX, self-hosted (Google Fonts is unreliable from Iran,
   and a blocked webfont silently falls back to Tahoma). The family is loaded
   as a single variable file; see gg10_blog_font_face().
   ========================================================================== */
body,
button, input, select, optgroup, textarea,
.entry-content, h1, h2, h3, h4, h5, h6 {
  font-family: var(--gg-font);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--gg-white);
  font-weight: 800;
  letter-spacing: -0.015em;
}
h1 { line-height: 1.32; }
h2 { line-height: 1.4; }
h3 { line-height: 1.45; }

.entry-content p,
.entry-content li {
  line-height: 2.05;          /* Persian needs more leading than Latin */
  color: var(--gg-grey-0);
  font-size: 1.055rem;
}

/* Persian numerals sit better with tabular figures in meta rows. */
.entry-meta, .post-meta, time { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Shared card chrome
   --------------------------------------------------------------------------
   `.gg10-surface` is the one place a panel's look is defined; the hero, the
   cards, the callouts and the author box all reference it so they cannot
   drift apart.
   ========================================================================== */
.entry-card,
.gg10-hero,
.gg10-cta,
.gg10-authorbox,
.gg10-related__card {
  position: relative;
  background: linear-gradient(
    168deg,
    rgb(var(--gg-white-rgb) / 0.055),
    rgb(var(--gg-white-rgb) / 0.015) 42%,
    transparent
  ), var(--gg-grey-7);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.09);
  box-shadow: var(--gg-rim), var(--gg-shadow-md);
}

/* ==========================================================================
   Post grid
   --------------------------------------------------------------------------
   Blocksy computes --grid-template-columns per breakpoint and emits it inline,
   but nothing in the CSS that ships here ever sets `display:grid` on .entries
   — it stayed `display:block`, so on archives every card ran full width and
   each 16:9 cover became a full-bleed banner.

   We ignore Blocksy's 3-column value on the blog index in favour of an auto
   grid: with five posts a rigid 3-track grid leaves a visible hole in the
   last row. `auto-fill` + the featured-card span below keeps the mosaic full
   at every count.
   ========================================================================== */
.entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: clamp(1.25rem, 0.6rem + 1.8vw, 1.9rem);
  align-items: stretch;
}

/* The first post on page 1 of the blog index runs full width as a featured
   card: image beside the copy rather than above it. This is what removes the
   ragged hole in the last row AND gives the index a focal point. */
.home:not(.paged) .entries > .entry-card:first-child {
  grid-column: 1 / -1;
}

/* The featured card is a two-column GRID, not a flex row.
   Blocksy prints the card's five pieces as flat siblings with no wrapper
   around the text, so `flex-direction:row` put the category, title, excerpt
   and date each in its own narrow column. Grid template areas let the media
   occupy one column while the four text pieces stack in the other, without
   needing a wrapper element that only a Blocksy template override could add. */
@media (min-width: 1000px) {
  .home:not(.paged) .entries > .entry-card:first-child {
    display: grid;
    grid-template-columns: 1fr 46%;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "cat   media"
      "title media"
      "desc  media"
      "fill  media"
      "date  media";
    align-items: start;
  }

  .home:not(.paged) .entries > .entry-card:first-child > [data-id="meta_1"] { grid-area: cat; }
  .home:not(.paged) .entries > .entry-card:first-child .entry-title        { grid-area: title; }
  .home:not(.paged) .entries > .entry-card:first-child .entry-excerpt      { grid-area: desc; }
  .home:not(.paged) .entries > .entry-card:first-child > [data-id="meta_2"] { grid-area: date; }
  .home:not(.paged) .entries > .entry-card:first-child .ct-media-container,
  .home:not(.paged) .entries > .entry-card:first-child .ct-image-container {
    grid-area: media;
    height: 100%;
    aspect-ratio: auto;
    min-height: 24rem;
  }

  /* Generous padding on the copy side; the media side keeps its bleed. */
  .home:not(.paged) .entries > .entry-card:first-child > [data-id="meta_1"],
  .home:not(.paged) .entries > .entry-card:first-child .entry-title,
  .home:not(.paged) .entries > .entry-card:first-child .entry-excerpt,
  .home:not(.paged) .entries > .entry-card:first-child > [data-id="meta_2"] {
    padding-inline: clamp(2rem, 1.2rem + 2vw, 3rem);
  }
  .home:not(.paged) .entries > .entry-card:first-child > [data-id="meta_1"] { padding-top: clamp(2rem, 1.2rem + 2vw, 3rem); margin-top: 0; }
  .home:not(.paged) .entries > .entry-card:first-child > [data-id="meta_2"] { padding-bottom: clamp(2rem, 1.2rem + 2vw, 3rem); margin-top: 0; }

  .home:not(.paged) .entries > .entry-card:first-child .entry-title {
    font-size: clamp(1.5rem, 1.05rem + 1.5vw, 2.15rem);
  }
  .home:not(.paged) .entries > .entry-card:first-child .entry-excerpt { max-width: 34rem; }
  .home:not(.paged) .entries > .entry-card:first-child .entry-excerpt p { font-size: 1.02rem; }
}

/* Orphan control.
   With the first post featured full-width, the remaining posts flow into a
   3-track grid — so a total of 5 posts leaves the last card alone in its own
   row with two empty cells beside it, which reads as a mistake rather than a
   layout. When the remainder is 1, the last card spans the full width and
   becomes a second (smaller) banner; when it is 2, the two share the row.

   :nth-last-child() counting is done from the SECOND card onward, so the
   featured card is excluded from the arithmetic. */
@media (min-width: 1000px) {
  /* 4 posts total (3 after the featured one) → the trio fills the row: fine. */

  /* 5 posts total → 4 after the featured: the last one is alone. */
  .home:not(.paged) .entries > .entry-card:first-child ~ .entry-card:nth-child(3n + 2):last-child {
    grid-column: 1 / -1;
  }
  .home:not(.paged) .entries > .entry-card:first-child ~ .entry-card:nth-child(3n + 2):last-child .ct-media-container {
    aspect-ratio: 21 / 6;
  }

  /* 6 posts total → 5 after the featured: two are left over. They are NOT
     stretched — two half-width cards beside one empty third read worse than
     two normal cards left-aligned, and stretching them would make their
     covers inconsistent with the row above. Left as-is deliberately. */
}

/* ==========================================================================
   Cards
   --------------------------------------------------------------------------
   Blocksy's "type-3" card prints in source order:
     meta(categories) → title → media → excerpt → meta(date)
   which reads as a title hanging above a picture with no relationship to it.
   The card is a flex column and the pieces are re-ordered visually so it
   becomes the conventional media → category → title → excerpt → date.

   Source order is left alone on purpose: it is the correct READING order for
   a screen reader (heading first), and reordering it in PHP would mean
   overriding a Blocksy template part that updates independently.
   ========================================================================== */
.entry-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--gg-r-lg);
  isolation: isolate;
  transition:
    transform var(--gg-dur) var(--gg-ease),
    border-color var(--gg-dur) var(--gg-ease),
    box-shadow var(--gg-dur) var(--gg-ease);
}

.entry-card .ct-media-container,
.entry-card .ct-image-container { order: 1; }
.entry-card > [data-id="meta_1"]  { order: 2; }   /* category pills */
.entry-card .entry-title          { order: 3; }
.entry-card .entry-excerpt        { order: 4; }
.entry-card > [data-id="meta_2"]  { order: 5; }   /* date */

/* Media. A fixed ratio keeps rows even regardless of the source art. */
.entry-card .ct-media-container,
.entry-card .ct-image-container {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gg-grey-6);
}
.entry-card .ct-media-container img,
.entry-card .ct-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--gg-ease);
}
.entry-card:hover .ct-media-container img { transform: scale(1.045); }

/* A scrim under the art's lower edge so the card body never looks pasted on. */
.entry-card .ct-media-container::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(to top, rgb(var(--gg-black-rgb) / 0.55), transparent);
}

/* The text half. Blocksy has no wrapper around it, so the padding is applied
   to the individual children and the gaps come from flex. */
.entry-card > [data-id="meta_1"],
.entry-card .entry-title,
.entry-card .entry-excerpt,
.entry-card > [data-id="meta_2"] {
  padding-inline: 1.5rem;
}
.entry-card > [data-id="meta_1"] { margin: 1.35rem 0 0; }
.entry-card .entry-title { margin: 0.7rem 0 0; }
.entry-card .entry-excerpt { margin: 0.7rem 0 0; }
.entry-card > [data-id="meta_2"] {
  margin: 0;
  padding-block: 1.15rem 1.4rem;
  margin-top: auto;          /* pins the date to the bottom of every card */
  padding-top: 1.15rem;
}

.entry-card .entry-title { line-height: 1.45; }
.entry-card .entry-title a {
  color: var(--gg-white);
  text-decoration: none;
  background-image: linear-gradient(var(--gg-primary-tint-3), var(--gg-primary-tint-3));
  background-size: 0% 1.5px;
  background-position: 100% 100%;   /* RTL: grow from the right */
  background-repeat: no-repeat;
  transition: color var(--gg-dur) var(--gg-ease), background-size var(--gg-dur) var(--gg-ease);
}
.entry-card:hover .entry-title a {
  color: var(--gg-primary-tint-3);
  background-size: 100% 1.5px;
}

.entry-card .entry-excerpt p {
  margin: 0;
  color: var(--gg-grey-1);
  font-size: 0.95rem;
  line-height: 1.95;
}

/* The date row: quiet, small caps, with a hairline above it. */
.entry-card > [data-id="meta_2"] {
  border-top: 1px solid rgb(var(--gg-white-rgb) / 0.07);
  color: var(--gg-grey-3);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.entry-card:hover {
  transform: translateY(-6px);
  border-color: rgb(var(--gg-primary-rgb) / 0.5);
  box-shadow: var(--gg-rim), var(--gg-shadow-lg), var(--gg-glow);
}

/* Whole-card affordance: the title's link is stretched over the card so the
   entire surface is clickable, while the real anchor stays the title (correct
   for assistive tech). The media anchor is pushed below it so it does not
   swallow the click. */
.entry-card .entry-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
.entry-card .ct-media-container { z-index: 0; }
.entry-card > [data-id="meta_1"] { position: relative; z-index: 3; }

/* Category pills */
.entry-card .entry-meta,
.entry-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.entry-card .entry-meta a[rel~="tag"],
.entry-meta .meta-categories a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgb(var(--gg-primary-rgb) / 0.13);
  color: var(--gg-primary-tint-3);
  border: 1px solid rgb(var(--gg-primary-rgb) / 0.32);
  padding: 0.28rem 0.8rem;
  border-radius: var(--gg-r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;   /* Blocksy uppercases meta; meaningless in Persian */
  transition: background var(--gg-dur) var(--gg-ease), color var(--gg-dur) var(--gg-ease);
}
.entry-card .entry-meta a[rel~="tag"]:hover,
.entry-meta .meta-categories a:hover {
  background: rgb(var(--gg-primary-rgb) / 0.24);
  color: var(--gg-primary-tint-0);
}

/* Blocksy's "simple:slash" meta inserts a / between items; unwanted here. */
.entry-meta[data-type*="slash"] li::after { display: none !important; }
.entry-card .entry-meta { text-transform: none; }

/* ==========================================================================
   Links & buttons
   ========================================================================== */
.entry-content a:not(.wp-block-button__link) {
  color: var(--gg-primary-tint-3);
  text-decoration-color: rgb(var(--gg-primary-rgb) / 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 0.2s var(--gg-ease), text-decoration-color 0.2s var(--gg-ease);
}
.entry-content a:not(.wp-block-button__link):hover {
  color: var(--gg-primary-tint-0);
  text-decoration-color: var(--gg-primary-tint-3);
}

.wp-block-button__link,
.ct-button,
button.ct-button,
.wp-element-button {
  background: var(--gg-primary);
  color: var(--gg-white);
  border-radius: var(--gg-r-pill);
  font-weight: 700;
  border: 0;
  transition: background 0.2s var(--gg-ease), transform 0.2s var(--gg-ease), box-shadow 0.2s var(--gg-ease);
}
.wp-block-button__link:hover,
.ct-button:hover {
  background: var(--gg-primary-shade-1);
  transform: translateY(-2px);
  box-shadow: var(--gg-glow);
}

/* ==========================================================================
   Long-form content
   ========================================================================== */
.entry-content blockquote {
  position: relative;
  background: linear-gradient(90deg, rgb(var(--gg-primary-rgb) / 0.10), transparent 72%);
  border: 1px solid rgb(var(--gg-primary-rgb) / 0.2);
  border-inline-start: 0;
  border-inline-end: 3px solid var(--gg-primary);   /* RTL: accent on the right */
  border-radius: var(--gg-r-md);
  padding: 1.4rem 1.6rem;
  margin-inline: 0;
  color: var(--gg-grey-0);
}
.entry-content blockquote p {
  font-size: 1.08rem;
  line-height: 2;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content code {
  background: var(--gg-grey-5);
  color: var(--gg-primary-tint-0);
  padding: 0.15em 0.5em;
  border-radius: var(--gg-r-xs);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.07);
  font-size: 0.9em;
}
.entry-content pre {
  background: var(--gg-grey-8);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.08);
  border-radius: var(--gg-r-md);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.entry-content pre code { background: none; border: 0; padding: 0; }

/* Tables read as data panels. The wrapper scrolls rather than the page:
   a wide table must never make the whole document scroll sideways. */
.entry-content .wp-block-table,
.entry-content figure.wp-block-table {
  overflow-x: auto;
  border-radius: var(--gg-r-md);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.1);
  background: var(--gg-grey-7);
  box-shadow: var(--gg-rim);
}
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  border: 0;
}
.entry-content thead { background: rgb(var(--gg-white-rgb) / 0.04); }
.entry-content th {
  color: var(--gg-white);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.entry-content th, .entry-content td {
  border: 0;
  border-bottom: 1px solid rgb(var(--gg-white-rgb) / 0.07);
  padding: 0.85rem 1.1rem;
  text-align: start;
}
.entry-content tbody tr:last-child td { border-bottom: 0; }
.entry-content tbody tr { transition: background 0.2s var(--gg-ease); }
.entry-content tbody tr:hover { background: rgb(var(--gg-primary-rgb) / 0.06); }

.entry-content ul, .entry-content ol { padding-inline-start: 1.4rem; }
.entry-content li { margin-block: 0.35rem; }
.entry-content li::marker { color: var(--gg-primary-tint-3); }

.entry-content hr {
  border: 0;
  height: 1px;
  margin: 3rem auto;
  background: linear-gradient(to left, transparent, rgb(var(--gg-white-rgb) / 0.18), transparent);
}

/* Images inside a post get the same curve as everything else. */
.entry-content img,
.wp-block-image img {
  border-radius: var(--gg-r-md);
}

/* ==========================================================================
   Header
   --------------------------------------------------------------------------
   Sticky, translucent, and it only grows a border once the page has moved —
   otherwise the header and the hero are two near-black bands with a hairline
   between them, which is what made the old masthead look glued on.
   ========================================================================== */
header#header {
  position: sticky;
  top: 0;
  z-index: 100;
}
header#header .ct-header {
  background: rgb(19 19 19 / 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
          backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background var(--gg-dur) var(--gg-ease), border-color var(--gg-dur) var(--gg-ease);
}
body.gg10-scrolled header#header .ct-header {
  background: rgb(19 19 19 / 0.92);
  border-bottom-color: rgb(var(--gg-white-rgb) / 0.09);
  box-shadow: 0 10px 30px -18px rgb(var(--gg-black-rgb) / 0.9);
}

/* Blocksy's 120px header is far too tall for a blog; it pushed the hero off
   the fold entirely. */
[data-header*="type-1"] .ct-header [data-row*="middle"] { --height: 68px; }
[data-header*="type-1"] { --header-height: 68px; }

@media (max-width: 999.98px) {
  [data-header*="type-1"] .ct-header [data-row*="middle"] { --height: 60px; }
  [data-header*="type-1"] { --header-height: 60px; }
}

/* EVERY control in the header inherits the brand face. Blocksy sets its own
   font-family on nav links, the mobile menu and the search field, so without
   this the whole masthead silently rendered in the system UI font while the
   rest of the page was IRANSansX. */
header#header,
header#header a,
header#header button,
header#header input,
#offcanvas,
#offcanvas a,
#offcanvas button,
#offcanvas input,
#search-modal,
#search-modal input { font-family: var(--gg-font); }

/* The site title duplicates the logo image, which already says "GG10". */
header#header .site-title-container { display: none; }
header#header .site-logo-container img { height: 30px; width: auto; display: block; }

/* ---- Row layout ---------------------------------------------------------
   Logo hard against the inline-start edge, everything else against the other
   end, both flush with the content column below. Blocksy lays this row out as
   a 3-track grid whose middle track absorbs the slack; collapsing that middle
   track is what actually pins the two groups to the edges. */
header#header .ct-header [data-row*="middle"] > .ct-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}
header#header [data-column="start"]  { justify-self: start; }
header#header [data-column="middle"] { display: none; }
header#header [data-column="end"]    { justify-self: end; }

/* In RTL, `start` is the right edge — which is where the logo belongs, and
   the nav then falls to the left. That is the requested arrangement and it is
   also the direction-correct one, so no LTR-style overrides here. */
header#header [data-column] > div {
  display: flex;
  align-items: center;
  /* shrink-wrap: without this the column stretched and the search button was
     pushed to the far edge, far from the nav it belongs with */
  width: auto;
  gap: clamp(0.75rem, 0.4rem + 1.2vw, 1.4rem);
}

/* ---- Desktop nav --------------------------------------------------------
   Quiet by default, one clear active state. The underline grows from the
   inline-start edge so it reads right in RTL. */
header#header [data-id="menu"] > ul { gap: clamp(0.5rem, 0.2rem + 1vw, 1.35rem); }

header#header [data-id="menu"] > ul > li > a {
  position: relative;
  padding-block: 0.5rem;
  text-transform: none;      /* uppercase does nothing for Persian */
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--gg-grey-1);
  transition: color 0.2s var(--gg-ease);
}
header#header [data-id="menu"] > ul > li > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--gg-primary);
  transition: width var(--gg-dur) var(--gg-ease);
}
header#header [data-id="menu"] > ul > li > a:hover { color: var(--gg-white); }
header#header [data-id="menu"] > ul > li > a:hover::after,
header#header [data-id="menu"] > .current-menu-item > a::after,
header#header [data-id="menu"] > .current_page_item > a::after { width: 100%; }
header#header [data-id="menu"] > .current-menu-item > a,
header#header [data-id="menu"] > .current_page_item > a {
  color: var(--gg-white);
  font-weight: 600;
}

/* Search toggle becomes a round icon button. */
header#header .ct-header-search {
  width: 36px;
  height: 36px;
  border-radius: var(--gg-r-pill);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.12);
  background: rgb(var(--gg-white-rgb) / 0.04);
  transition: background 0.2s var(--gg-ease), border-color 0.2s var(--gg-ease);
}
header#header .ct-header-search:hover {
  background: rgb(var(--gg-primary-rgb) / 0.18);
  border-color: rgb(var(--gg-primary-rgb) / 0.45);
}
header#header .ct-header-search .ct-label { display: none; }

/* ---- Mobile: the hamburger ---------------------------------------------
   Blocksy's bare glyph has no hit area worth tapping. Give it the same round
   chrome as the search button so the two read as a pair. */
header#header [data-id="trigger"] {
  width: 40px;
  height: 40px;
  border-radius: var(--gg-r-pill);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.12);
  background: rgb(var(--gg-white-rgb) / 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
header#header [data-id="trigger"]:active { transform: scale(0.94); }

/* ==========================================================================
   Mobile menu (Blocksy's #offcanvas panel)
   --------------------------------------------------------------------------
   Blocksy ships this as a translucent blue-grey sheet with no structure: the
   page showed through behind the links, the type was the system font at 20px,
   and there was nothing separating one item from the next. Rebuilt here as an
   opaque brand panel with a real list — the "clean blog" treatment.
   ========================================================================== */
/* Blocksy writes this panel's background as an INLINE style, so a plain class
   rule loses no matter how it is ordered. !important is the honest tool here:
   the alternative is a translucent sheet with the article text showing through
   the menu, which is what it looked like before. */
#offcanvas .ct-panel-inner,
#offcanvas.ct-panel .ct-panel-inner {
  background: var(--gg-bg) !important;
  border-inline-start: 1px solid rgb(var(--gg-white-rgb) / 0.08);
}

/* The panel itself is the backdrop; keep it fully opaque too. */
#offcanvas.ct-panel { background: rgb(var(--gg-black-rgb) / 0.6); }

/* Full-width sheet on a phone — a 65vw drawer wastes the screen and leaves the
   links in an awkward narrow column. */
@media (max-width: 690px) {
  /* Blocksy's own rule is `[data-header*="type-1"] #offcanvas` inside its own
     media query and sets 90vw, leaving a sliver of the page visible down one
     side. Same selector + #offcanvas.ct-panel to out-weigh it. */
  [data-header*="type-1"] #offcanvas,
  [data-header*="type-1"] #offcanvas.ct-panel { --side-panel-width: 100vw; }
}

/* A soft brand glow in the corner so the panel is not a flat black box. */
#offcanvas .ct-panel-inner::before {
  content: "";
  position: absolute;
  inset-block-start: -30%;
  inset-inline-end: -25%;
  width: 22rem;
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgb(var(--gg-primary-rgb) / 0.22), transparent 62%);
}

#offcanvas .ct-panel-content { position: relative; padding: 0.5rem 1.25rem 2rem; }

/* Close button: same round chrome as the trigger it replaces. */
#offcanvas .ct-toggle-close {
  width: 40px;
  height: 40px;
  margin: 0.75rem 0.35rem;
  border-radius: var(--gg-r-pill);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.12);
  background: rgb(var(--gg-white-rgb) / 0.04);
  color: var(--gg-white);
}

/* Each item is a full-width row with a divider — a list, not floating words. */
#offcanvas [data-id="mobile-menu"] > ul { display: block; }

#offcanvas [data-id="mobile-menu"] li { display: block; }

#offcanvas [data-id="mobile-menu"] a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 0.25rem;
  border-bottom: 1px solid rgb(var(--gg-white-rgb) / 0.07);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--gg-grey-0);
  text-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s var(--gg-ease), padding-inline-start 0.18s var(--gg-ease);
}
#offcanvas [data-id="mobile-menu"] a:active {
  color: var(--gg-white);
  padding-inline-start: 0.6rem;
}

/* A chevron on every row, so each one reads as tappable. Pointing inline-start
   (left in RTL) — the direction the page will move. */
#offcanvas [data-id="mobile-menu"] .ct-toggle-dropdown-mobile { display: none; }

#offcanvas [data-id="mobile-menu"] a::after {
  content: "";
  width: 7px;
  height: 7px;
  /* Two adjacent borders rotated 45deg make a chevron, and the PAIR decides
     where the point faces. We want it aimed at the inline-start edge (left in
     RTL) — the direction the page moves when the row is tapped. Keeping the
     top + left physical borders and rotating -45deg puts the corner there.
     Earlier attempts used block-end/block-start pairs, which produced a
     down-caret (read as a dropdown) and then an up-caret. */
  border-top: 2px solid rgb(var(--gg-white-rgb) / 0.3);
  border-left: 2px solid rgb(var(--gg-white-rgb) / 0.3);
  rotate: -45deg;
  flex: none;
  transition: border-color 0.18s var(--gg-ease);
}
#offcanvas [data-id="mobile-menu"] a:active::after {
  border-color: var(--gg-primary);
}

/* Current page: brand red, with a bar on the leading edge. */
#offcanvas [data-id="mobile-menu"] .current-menu-item > a,
#offcanvas [data-id="mobile-menu"] .current_page_item > a {
  color: var(--gg-primary-tint-3);
  font-weight: 700;
}

/* The last row has nothing after it, so its divider is just a stray line. */
#offcanvas [data-id="mobile-menu"] > ul > li:last-child > a { border-bottom: 0; }

/* A single CTA pinned under the list — the one action worth having here. */
#offcanvas .gg10-menu-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: var(--gg-r-pill);
  background: var(--gg-primary);
  color: var(--gg-white);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--gg-glow);
}
#offcanvas .gg10-menu-cta:active { transform: scale(0.985); }

@media (prefers-reduced-motion: reduce) {
  header#header [data-id="menu"] > ul > li > a::after,
  #offcanvas [data-id="mobile-menu"] a { transition: none; }
}

/* ==========================================================================
   Homepage hero (printed by gg10_blog_hero() on the blog index only)
   --------------------------------------------------------------------------
   MOBILE FIRST. Most blog traffic arrives on a phone, so the base rules below
   describe the PHONE layout and the media queries add desktop, not the other
   way round.

   Two things follow from that:

   1. The hero must not eat the screen. An earlier version was 483px tall on a
      390px-wide phone — more than half the viewport before a single article
      was visible. Vertical padding and type now scale from a small base, and
      the whole band is capped so the first card always peeks above the fold.

   2. It earns its height by carrying the LEAD STORY, not just a slogan. The
      newest post is promoted into the hero (and skipped in the loop), so the
      space is editorial rather than decorative.
   ========================================================================== */
.gg10-hero {
  /* Match the header's content column exactly. The hero is printed OUTSIDE
     Blocksy's .ct-container, so without this it ran full-bleed to 1440px while
     the masthead above it stopped at 1180px — the logo and nav visibly did not
     line up with the box beneath them. */
  /* Match Blocksy's own container EXACTLY, at every width.
     Blocksy does not use a fixed gutter: it sizes the container as
     `min(--theme-container-edge-spacing, --theme-normal-container-max-width)`,
     where the edge spacing is a percentage (88vw on phones, 90vw on tablets).
     A fixed gutter therefore lined up only at the widest breakpoint and drifted
     everywhere else, so the hero and the masthead above it did not share an
     edge. Reusing both variables keeps them locked together. */
  width: min(
    var(--theme-container-edge-spacing, 90vw),
    var(--theme-normal-container-max-width, 1180px)
  );
  margin-inline: auto;
  overflow: hidden;
  margin-bottom: clamp(1.75rem, 1.2rem + 2.4vw, 3.5rem);
  padding: clamp(1.5rem, 1.1rem + 2.2vw, 3.5rem) clamp(1.15rem, 0.7rem + 2.4vw, 3.5rem);
  border-radius: var(--gg-r-lg);
  border-color: rgb(var(--gg-white-rgb) / 0.1);
  box-shadow: var(--gg-rim), var(--gg-shadow-lg);
}

@media (min-width: 700px) {
  .gg10-hero { border-radius: var(--gg-r-xl); }
}

/* ---- Depth layers --------------------------------------------------------
   Two offset glows give the light a direction; the radar sweep and scan line
   are the same motifs the landing hero uses, dialled well down because text
   sits on top of them. All are decorative and pointer-events:none. */
.gg10-hero::before {
  content: "";
  position: absolute;
  inset-block-start: -52%;
  inset-inline-start: -14%;
  width: 68%;
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgb(var(--gg-primary-rgb) / 0.5), transparent 62%);
}
.gg10-hero::after {
  content: "";
  position: absolute;
  inset-block-end: -58%;
  inset-inline-end: -10%;
  width: 52%;
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgb(var(--gg-primary-tint-3-rgb) / 0.16), transparent 66%);
}

/* Slow conic sweep, masked to a ring so only its leading edge reads. Hidden on
   phones: it is pure ornament and not worth the compositing on a small screen. */
.gg10-hero__radar {
  display: none;
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -18%;
  width: 34rem;
  aspect-ratio: 1;
  translate: 0 -50%;
  pointer-events: none;
  opacity: 0.14;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 300deg, var(--gg-primary) 358deg, transparent 360deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, #000 52%, transparent 70%);
          mask-image: radial-gradient(circle, #000 0%, #000 52%, transparent 70%);
  animation: gg10-radar 14s linear infinite;
}
@media (min-width: 900px) { .gg10-hero__radar { display: block; } }

@keyframes gg10-radar { to { rotate: 360deg; } }

/* A hairline that sweeps the top edge — the same accent line as the footer,
   but moving. Cheap: one transform on a 1px element. */
.gg10-hero__scan {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(to left, transparent, rgb(var(--gg-primary-tint-3-rgb) / 0.85), transparent);
  animation: gg10-scan 7s ease-in-out infinite;
}
@keyframes gg10-scan {
  0%, 100% { transform: translateX(-60%); opacity: 0; }
  50%      { transform: translateX(60%);  opacity: 1; }
}

/* ---- Layout -------------------------------------------------------------
   One column on a phone (copy, then the lead card). Two columns from 900px,
   where the lead card sits beside the copy instead of under it. */
.gg10-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}

@media (min-width: 900px) {
  .gg10-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 20.5rem);
    align-items: center;
  }
}

.gg10-hero__copy { min-width: 0; }

.gg10-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gg-primary-tint-3);
}
.gg10-hero__diamond {
  width: 6px;
  height: 6px;
  rotate: 45deg;
  background: var(--gg-primary);
}

/* The headline is the one place the type is allowed to get big, and it is
   still capped: 1.65rem on a 360px phone keeps it to three lines. */
.gg10-hero__title {
  margin: 0.6rem 0 0;
  font-size: clamp(1.5rem, 1.1rem + 2.1vw, 3.05rem);
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.015em;
  color: var(--gg-white);
  text-wrap: balance;   /* avoids a lone short last line */
}

/* <em> is a styling hook, not emphasis — reset the italic and clip the brand
   gradient to the text instead. */
.gg10-hero__title em {
  font-style: normal;
  background: linear-gradient(to left, var(--gg-primary-tint-3), var(--gg-primary-tint-0));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.gg10-hero__sub {
  margin: 0.7rem 0 0;
  max-width: 34rem;
  font-size: clamp(0.9rem, 0.87rem + 0.18vw, 1.02rem);
  /* 1.85 not 2: this is a two-line deck, not body copy. At 2 it read as four
     loosely-stacked lines and pushed the first card off a phone screen. */
  line-height: 1.85;
  color: var(--gg-grey-1);
  text-wrap: pretty;
}

/* ---- Actions ------------------------------------------------------------
   On a phone the buttons are full-width and stacked, which is both easier to
   hit and visually calmer than two half-width pills. They become inline from
   the first breakpoint up. Min height 48px = the accessible touch target. */
.gg10-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(1.05rem, 0.85rem + 0.9vw, 1.9rem);
}

/* Both actions share one row even on the narrowest phone: stacked full-width
   buttons cost ~110px of vertical space for two taps, and that was enough to
   push the first article card off the fold. They still meet the 48px target. */
/* Two buttons, one row, on every phone.
   `flex: 1 1 0` alone did not do it: with flex-wrap:wrap the items are placed
   BEFORE free space is distributed, and each button's max-content width was
   wider than the line, so both wrapped and only then grew to fill. Giving each
   an explicit half-minus-half-gap basis makes them fit at placement time. */
.gg10-hero__actions > a {
  flex: 0 1 calc(50% - 0.3rem);
  min-width: 0;
  /* nowrap + a slightly smaller phone size: allowing the label to wrap made
     the two buttons different heights, which looks broken side by side. */
  white-space: nowrap;
}

@media (min-width: 480px) {
  .gg10-hero__actions > a { flex: 0 0 auto; white-space: nowrap; }
}

.gg10-hero__cta,
.gg10-hero__ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--gg-r-pill);
  padding-inline: clamp(0.7rem, 0.25rem + 2vw, 1.5rem);
  font-size: clamp(0.8rem, 0.72rem + 0.36vw, 0.97rem);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--gg-dur) var(--gg-ease),
              background-color var(--gg-dur) var(--gg-ease),
              box-shadow var(--gg-dur) var(--gg-ease),
              border-color var(--gg-dur) var(--gg-ease);
}

.gg10-hero__cta {
  background: var(--gg-primary);
  color: var(--gg-white);
  /* transparent border, matching .gg10-hero__ghost's 1px, so the two buttons
     are exactly the same height and sit on one baseline */
  border: 1px solid transparent;
  box-shadow: var(--gg-glow);
}
.gg10-hero__cta:hover,
.gg10-hero__cta:focus-visible {
  background: var(--gg-primary-tint-4);
  color: var(--gg-white);
  transform: translateY(-2px);
}
/* The arrow nudges on hover — a small affordance that the link goes somewhere.
   It points left because the reading direction is RTL. */
.gg10-hero__cta-arrow { transition: translate var(--gg-dur) var(--gg-ease); }
.gg10-hero__cta:hover .gg10-hero__cta-arrow { translate: -4px 0; }

.gg10-hero__ghost {
  background: rgb(var(--gg-white-rgb) / 0.05);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.16);
  color: var(--gg-white);
}
.gg10-hero__ghost:hover,
.gg10-hero__ghost:focus-visible {
  background: rgb(var(--gg-white-rgb) / 0.1);
  border-color: rgb(var(--gg-primary-rgb) / 0.5);
  color: var(--gg-white);
  transform: translateY(-2px);
}

/* Touch devices have no hover, so the press state is the only feedback that a
   tap registered. Applied to every primary target on the page. */
.gg10-hero__cta:active,
.gg10-hero__ghost:active,
.gg10-lead:active,
.entry-card:active { transform: scale(0.985); }

/* Stop the grey flash iOS/Android paint over tapped links; the :active state
   above is the intended feedback. */
.gg10-hero__cta,
.gg10-hero__ghost,
.gg10-lead,
.entry-card a { -webkit-tap-highlight-color: transparent; }

/* ---- Lead story card ----------------------------------------------------
   The newest post, promoted. On a phone it is a horizontal strip (thumbnail
   beside the text) so it costs ~96px instead of ~300px; from 900px it becomes
   a vertical card in the hero's second column. */
.gg10-lead {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.6rem;
  border-radius: var(--gg-r-md);
  background: rgb(var(--gg-black-rgb) / 0.28);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.09);
  text-decoration: none;
  transition: transform var(--gg-dur) var(--gg-ease),
              border-color var(--gg-dur) var(--gg-ease),
              background-color var(--gg-dur) var(--gg-ease);
}
.gg10-lead:hover,
.gg10-lead:focus-visible {
  transform: translateY(-2px);
  border-color: rgb(var(--gg-primary-rgb) / 0.45);
  background: rgb(var(--gg-black-rgb) / 0.4);
}

.gg10-lead__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--gg-r-sm);
  aspect-ratio: 1;
  background: var(--gg-grey-6);
}
.gg10-lead__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The "newest" flag only has room once the card goes vertical. */
.gg10-lead__badge {
  display: none;
  position: absolute;
  inset-block-start: 0.6rem;
  inset-inline-end: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--gg-r-pill);
  background: var(--gg-primary);
  color: var(--gg-white);
  font-size: 0.7rem;
  font-weight: 700;
}

.gg10-lead__body { min-width: 0; display: block; }

.gg10-lead__cat {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gg-primary-tint-3);
}

.gg10-lead__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--gg-white);
}

.gg10-lead__meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--gg-grey-2);
  font-variant-numeric: tabular-nums;
}
.gg10-lead__dot { margin: 0 0.35rem; }

@media (min-width: 900px) {
  .gg10-lead {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--gg-r-lg);
  }
  .gg10-lead__media { aspect-ratio: 16 / 10; border-radius: 0; }
  .gg10-lead__badge { display: block; }
  .gg10-lead__body { padding: 1rem 1.1rem 1.15rem; }
  .gg10-lead__title { font-size: 1.02rem; }
}

/* Everything above animates only as decoration. */
@media (prefers-reduced-motion: reduce) {
  .gg10-hero__radar,
  .gg10-hero__scan { animation: none; }
  .gg10-hero__cta,
  .gg10-hero__ghost,
  .gg10-lead,
  .gg10-hero__cta-arrow { transition: none; }
  .gg10-hero__cta:hover,
  .gg10-hero__ghost:hover,
  .gg10-lead:hover { transform: none; }
  .gg10-hero__cta:hover .gg10-hero__cta-arrow { translate: 0; }
}

/* The hero sits OUTSIDE Blocksy's .ct-container (it is printed on
   blocksy:content:top), and that container then adds its own 50px of top
   padding. Stacked on the hero's own bottom margin that left a ~78px dead band
   between the hero and the first section heading — most of a thumb-scroll on a
   phone. Collapse the container's top padding on the blog index only; the hero
   already provides the separation. */
.home #main-container .ct-container:first-of-type,
.blog #main-container .ct-container:first-of-type { padding-top: 0; }

/* ==========================================================================
   Section heading above the card grid
   ========================================================================== */
.gg10-sectionhead {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.gg10-sectionhead__title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--gg-white);
}
.gg10-sectionhead__rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(to left, transparent, rgb(var(--gg-white-rgb) / 0.16));
}

/* ==========================================================================
   Single post
   ========================================================================== */
/* The title block. Blocksy's hero-section is a bare header; give it air and
   centre the furniture over the reading column. */
.single .hero-section {
  padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem) clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  text-align: center;
}
.single .hero-section .entry-header { max-width: var(--gg-measure-wide); margin-inline: auto; }

.single .entry-header .page-title,
.single .entry-header .entry-title {
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
}
.single .page-description {
  margin: 1rem auto 0;
  max-width: 40rem;
  font-size: 1.08rem;
  line-height: 1.95;
  color: var(--gg-grey-1);
}
/* Meta row under the title, centred, with the pills. */
.single .hero-section .entry-meta {
  justify-content: center;
  margin-top: 1.5rem;
  color: var(--gg-grey-2);
  font-size: 0.85rem;
  text-transform: none;
}

/* Reading column. `figure` is excluded so tables and images may go wider. */
.single .entry-content > *:not(.alignwide):not(.alignfull):not(figure) {
  max-width: var(--gg-measure);
  margin-inline: auto;
}
.single .entry-content > figure {
  max-width: var(--gg-measure-wide);
  margin-inline: auto;
}

/* Standfirst: the first paragraph carries more weight than body copy. */
.single .entry-content > p:first-of-type {
  font-size: 1.2rem;
  color: var(--gg-white);
  line-height: 1.95;
  font-weight: 500;
}

/* Section headings. The diamond is placed with a pseudo-element positioned
   OUTSIDE the text box rather than as an inline-block, which is what made it
   collide with the first word. */
.entry-content h2 {
  position: relative;
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem);
  padding-inline-start: 0;
}
.entry-content h2::before {
  content: "";
  position: absolute;
  inset-inline-end: calc(100% + 0.85rem);
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--gg-primary);
  box-shadow: 0 0 14px rgb(var(--gg-primary-rgb) / 0.8);
}
/* Below the reading column there is no room in the margin for the diamond,
   so it comes back inline. */
@media (max-width: 900px) {
  .entry-content h2::before {
    position: static;
    display: inline-block;
    margin-inline-end: 0.6rem;
    vertical-align: middle;
  }
}

.entry-content h3 {
  margin-top: 2.1rem;
  margin-bottom: 0.75rem;
  font-size: clamp(1.12rem, 1rem + 0.5vw, 1.32rem);
  color: var(--gg-grey-0);
}

/* Cover image */
.gg10-cover {
  position: relative;
  margin: 0 auto clamp(2rem, 1.4rem + 2vw, 3rem);
  max-width: var(--gg-measure-wide);
  border-radius: var(--gg-r-xl);
  overflow: hidden;
  border: 1px solid rgb(var(--gg-white-rgb) / 0.09);
  box-shadow: var(--gg-rim), var(--gg-shadow-lg);
}
.gg10-cover__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 0;
}

/* Reading-progress bar. Fixed under the sticky header; its width is driven by
   a custom property the tiny inline script updates on scroll. */
.gg10-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  z-index: 101;
  height: 2px;
  width: 100%;
  transform-origin: 100% 50%;     /* RTL: grows from the right */
  transform: scaleX(var(--gg-progress, 0));
  background: linear-gradient(to left, var(--gg-primary), var(--gg-primary-tint-3));
  pointer-events: none;
}

/* ==========================================================================
   Article footer — CTA back to the app, and the next posts
   ========================================================================== */
.gg10-cta {
  max-width: var(--gg-measure-wide);
  margin: clamp(3rem, 2rem + 3vw, 4.5rem) auto 0;
  padding: clamp(1.8rem, 1.2rem + 2vw, 2.75rem);
  border-radius: var(--gg-r-xl);
  overflow: hidden;
  text-align: center;
}
.gg10-cta::before {
  content: "";
  position: absolute;
  inset-block-start: -70%;
  inset-inline-start: 50%;
  translate: 50% 0;
  width: 70%;
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgb(var(--gg-primary-rgb) / 0.28), transparent 64%);
}
.gg10-cta__inner { position: relative; z-index: 1; }
.gg10-cta__title {
  margin: 0;
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
}
.gg10-cta__text {
  margin: 0.8rem auto 0;
  max-width: 32rem;
  color: var(--gg-grey-1);
  line-height: 1.95;
  font-size: 0.98rem;
}
.gg10-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.6rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--gg-r-pill);
  background: var(--gg-primary);
  color: var(--gg-white);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 32px -14px rgb(var(--gg-primary-rgb) / 0.9);
  transition: background 0.25s var(--gg-ease), transform 0.25s var(--gg-ease);
}
.gg10-cta__btn:hover {
  background: var(--gg-primary-tint-4);
  color: var(--gg-white);
  transform: translateY(-2px);
}

/* Related posts */
.gg10-related {
  max-width: var(--gg-measure-wide);
  margin: clamp(3rem, 2rem + 3vw, 4.5rem) auto 0;
}
/* auto-FILL, not auto-fit: with a single related post auto-fit collapses the
   empty tracks and the one card stretches to the full 54rem, which looks like
   a bug. auto-fill keeps the track width so one card stays card-sized. */
.gg10-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1.25rem;
  margin-top: 1.4rem;
}
.gg10-related__card {
  display: flex;
  flex-direction: column;
  border-radius: var(--gg-r-lg);
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--gg-dur) var(--gg-ease),
              border-color var(--gg-dur) var(--gg-ease),
              box-shadow var(--gg-dur) var(--gg-ease);
}
.gg10-related__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.gg10-related__body { padding: 1.1rem 1.25rem 1.3rem; }
.gg10-related__cat {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gg-primary-tint-3);
  margin-bottom: 0.45rem;
}
.gg10-related__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gg-white);
  font-weight: 700;
}
.gg10-related__card:hover {
  transform: translateY(-5px);
  border-color: rgb(var(--gg-primary-rgb) / 0.45);
  box-shadow: var(--gg-rim), var(--gg-shadow-lg), var(--gg-glow);
}
.gg10-related__card:hover .gg10-related__title { color: var(--gg-primary-tint-3); }

/* ==========================================================================
   Pagination
   ========================================================================== */
.ct-pagination {
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.ct-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding-inline: 0.9rem;
  border-radius: var(--gg-r-pill);
  border: 1px solid rgb(var(--gg-white-rgb) / 0.1);
  background: rgb(var(--gg-white-rgb) / 0.03);
  color: var(--gg-grey-0);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s var(--gg-ease), border-color 0.2s var(--gg-ease), color 0.2s var(--gg-ease);
}
.ct-pagination .page-numbers:hover {
  background: rgb(var(--gg-primary-rgb) / 0.16);
  border-color: rgb(var(--gg-primary-rgb) / 0.4);
  color: var(--gg-white);
}
.ct-pagination .page-numbers.current {
  background: var(--gg-primary);
  border-color: var(--gg-primary);
  color: var(--gg-white);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer.ct-footer {
  position: relative;
  margin-top: clamp(3rem, 2rem + 3vw, 5rem);
  border-top: 1px solid rgb(var(--gg-white-rgb) / 0.08);
  background: linear-gradient(to bottom, transparent, rgb(var(--gg-black-rgb) / 0.45));
}
footer.ct-footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(to left, transparent, rgb(var(--gg-primary-rgb) / 0.55), transparent);
}
.ct-footer-copyright {
  color: var(--gg-grey-2);
  font-size: 0.88rem;
  line-height: 2;
}
.ct-footer-copyright a {
  color: var(--gg-grey-0);
  text-decoration: none;
  border-bottom: 1px solid rgb(var(--gg-primary-rgb) / 0.5);
  transition: color 0.2s var(--gg-ease), border-color 0.2s var(--gg-ease);
}
.ct-footer-copyright a:hover { color: var(--gg-primary-tint-3); border-bottom-color: var(--gg-primary-tint-3); }

/* ==========================================================================
   Focus, selection, scrollbar
   ========================================================================== */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--gg-primary-tint-3);
  outline-offset: 3px;
  border-radius: var(--gg-r-xs);
}
::selection { background: rgb(var(--gg-primary-rgb) / 0.35); color: var(--gg-white); }
* { scrollbar-color: var(--gg-grey-4) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--gg-grey-7); }
::-webkit-scrollbar-thumb {
  background: var(--gg-grey-4);
  border-radius: var(--gg-r-pill);
  border: 2px solid var(--gg-grey-7);
}
::-webkit-scrollbar-thumb:hover { background: var(--gg-grey-3); }

/* ==========================================================================
   Entrance animation
   --------------------------------------------------------------------------
   Cards fade up as they enter. Driven by a class the observer adds, and the
   whole effect is gated behind `.gg10-js` so that with JS off the cards are
   simply visible rather than permanently transparent.
   ========================================================================== */
.gg10-js .gg10-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--gg-ease), transform 0.6s var(--gg-ease);
}
.gg10-js .gg10-reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Reduced motion — every transform/transition above is decorative.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .entry-card:hover,
  .gg10-related__card:hover,
  .gg10-hero__cta:hover,
  .gg10-hero__ghost:hover,
  .gg10-cta__btn:hover { transform: none; }
  .entry-card:hover .ct-media-container img { transform: none; }
  .gg10-js .gg10-reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 690px) {
  /* NOTE: this block used to force .gg10-hero__actions to a column. The hero
     is now mobile-first and deliberately keeps both buttons on one row (see
     the .gg10-hero__actions rules above), so that override is gone — leaving
     it here silently beat the newer rule and re-stacked the buttons. */
  .entry-card { border-radius: var(--gg-r-md); }
  .gg10-cover { border-radius: var(--gg-r-lg); }
  .gg10-cta { border-radius: var(--gg-r-lg); }
  .single .entry-content > p:first-of-type { font-size: 1.1rem; }
}
