/*
Theme Name:     Geekist (Child)
Theme URI:      https://geekist.co/
Description:    Custom child theme for Twenty Twenty-Five
Author:         Jason Nathan
Template:       twentytwentyfive
Version:        1.1.16
*/

* {
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

body {
  line-height: 1.6;
  word-spacing: 0.02em;
  font-feature-settings: "kern", "liga", "calt";
}

/* Standard desktop listing excerpts use the Gutenberg Medium preset. Lists,
   series and the Forge keep their already legible, intentional sizes. */
@media (min-width: 48.001rem) {
  body:not(.page-id-4092):not(.page-id-4072):not(.page-id-4082):not(.page-id-4083):not(.tax-series):not(.post-type-archive-geek_repo_cur) .wp-block-query .wp-block-post-excerpt {
    font-size: var(--wp--preset--font-size--medium) !important;
  }
  body :is(.gkh-feed, .page-id-4085 .gk-tech-latest-posts, .page-id-4085 .gk-tech-category-posts, .page-id-4061 .geekist-all-category-posts) .wp-block-post-title {
    font-size: var(--wp--preset--font-size--x-large) !important;
  }
}
body:is(.page-id-4072, .page-id-4082, .page-id-4083, .tax-series, .post-type-archive-geek_repo_cur) .wp-block-post-excerpt {
  font-size: inherit;
}

/* Page reading text: CSS viewport width, not device pixel density, determines
   the scale. Keep rem in the expression so browser font preferences and zoom
   remain effective. The Forge has its own deliberately larger typography. */
@media (max-width: 48rem) {
  body:is(.home, .page:not(.page-id-4092)) main :is(
    .wp-block-post-content p:not(.has-large-font-size):not(.has-x-large-font-size):not(.has-xx-large-font-size):not(.gk-landing-hero *):not(.gk-landing-hero-block__body):not(.gk-landing-hero-block__accent),
    .wp-block-post-content li:not(.wp-block-geekist-breadcrumbs__item):not(.gk-landing-hero *),
    .wp-block-post-excerpt__excerpt:not(.gk-landing-hero *)
  ) {
    font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.375rem) !important;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: normal;
  }
}

:root {
  --ui-trns-fast: 150ms;
  --ui-trns-med: 220ms;
  --ui-trns-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ui-trns-fast: 0ms;
    --ui-trns-med: 0ms;
  }
}

:root
  body
  :where(
    .wp-element-button,
    .wp-block-button__link,
    .wp-block-file__button,
    .wp-block-navigation-item__content,
    button,
    [type="button"],
    [type="submit"],
    [role="button"],
    a
  ) {
  transition:
    background-color var(--ui-trns-med) var(--ui-trns-ease),
    color var(--ui-trns-fast) var(--ui-trns-ease),
    border-color var(--ui-trns-fast) var(--ui-trns-ease),
    box-shadow var(--ui-trns-fast) var(--ui-trns-ease),
    transform var(--ui-trns-fast) var(--ui-trns-ease);
}

:root body :where(.wp-element-button:hover, .wp-block-button__link:hover) {
  background-color: #3c3c3c !important;
  color: var(--wp--preset--color--text) !important;
  border-color: transparent !important;
}

:root body .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: #3c3c3c !important;
  color: var(--wp--preset--color--text) !important;
  border-color: #3c3c3c !important;
}

.hero-text {
  text-shadow: 0 0 0.5px rgba(255, 255, 255, 0.1);
  mix-blend-mode: lighten;
  opacity: 0.92; /* Just enough to ease the bite */
}

.series-description-block {
  font-size: var(--wp--preset--font-size--large);
  color: var(--wp--preset--color--text);
  font-family: var(--wp--preset--font-family--ysabeau-office);
  line-height: 1.6;
  padding-left: 1.25rem;
  border-left: 3px solid var(--wp--preset--color--muted);
  margin-bottom: 2rem;
  opacity: 0.95;
}

.series-description-block p {
  margin: 0.5em 0;
}

.series-toc-listing .serieslist-box {
  background: var(--wp--preset--color--base);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.series-toc-listing .serieslist-content h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.25em;
  vertical-align: middle;
  background-color: currentColor;

  /* SVG as mask for external icon */
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M14 3h7v7m0-7L10 14m-7 7h7v-7'/%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;

  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M14 3h7v7m0-7L10 14m-7 7h7v-7'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask-size: contain;
}


.reddit-embed {
  filter: invert(1) hue-rotate(180deg);
}

pre,
code,
code.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: normal;
  font-weight: 400;
}

pre,
code,
code.inline-code {
  font-size: 0.8em;
  background: rgba(100, 100, 100, 0.3);
  border-radius: 4px;
}

code,
code.inline-code {
  padding: 0.1em 0.3em;
}

pre {
  padding: 0.75em;
  overflow-x: auto;
}

pre code {
  font-size: 1em;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.enlighter-t-dracula .enlighter span {
  font-size: 1.1em !important;
}

.enlighter-default,
.enlighter-default * {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

.geekist-pingbacks-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  align-items: center;
  font-size: 1.25rem;
  color: var(--wp--preset--color--base, rgba(255, 255, 255, 0.4));
}

.geekist-pingbacks-inline a {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--wp--preset--color--base-2, rgba(0, 0, 0, 0.5));
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1.4;
  transition: all var(--ui-trns-fast, 150ms) var(--ui-trns-ease, ease);
  color: var(--wp--preset--color--contrast, rgba(255, 255, 255, 0.7));
  white-space: nowrap;
  font-style: normal;
}

.geekist-pingbacks-inline a:hover {
  background: var(--wp--preset--color--base-3, rgba(0, 0, 0, 0.3));
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wp-block-post-content h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.wp-block-post-template.is-layout-grid > .wp-block-post {
  margin-block-start: 0;
}

/* The footer follows the page directly, without an empty block of padding. */
body .wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }
body footer.wp-block-template-part > .wp-block-group {
  padding-block: clamp(2.5rem, 5vw, 4.5rem) !important;
}
/* Linked headings use the same established text colour as their headings. */
:is(h1, h2, h3, h4, h5, h6) > a { color: inherit; }
.gk-analytics-notice { position: fixed; z-index: 1000; inset: auto 1rem 1rem; max-width: 34rem; margin-inline: auto; padding: 1rem 1.25rem; background: #1b1b1b; color: #e6e6e6; border: 1px solid #555; border-radius: .4rem; box-shadow: 0 6px 28px #0009; font-family: var(--wp--preset--font-family--ysabeau-office, sans-serif); }
.gk-analytics-notice[hidden] { display: none; }
.gk-analytics-notice p { margin: 0 0 .75rem; }
.gk-analytics-notice a { color: inherit; text-decoration: underline; }
.gk-analytics-notice__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.gk-analytics-notice button, .gk-analytics-settings { min-height: 44px; padding: .55rem 1rem; border: 1px solid #777; border-radius: .3rem; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.gk-analytics-notice button[data-gk-analytics-allow] { background: #ffde59; border-color: #ffde59; color: #121212; }
.gk-analytics-settings { display: block; margin: 1rem auto 0; color: #bbb; }
.gk-analytics-notice :focus-visible, .gk-analytics-settings:focus-visible { outline: 2px solid #ffde59; outline-offset: 3px; }

/* Restored classic post bodies retain query-loop classes without generated block CSS. */
.single-post .wp-block-post-content .wp-block-post-template.is-layout-grid {
  gap: 25.28px;
}

.single-post
  .wp-block-post-content
  .wp-block-post-template.is-layout-grid.columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-post
  .wp-block-post-content
  .wp-block-post-template.is-layout-grid.columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.single-post
  .wp-block-post-content
  .wp-block-post-template.is-layout-grid.columns-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* The restored category pages contain saved Query Loop markup as HTML. */
:is(.page-id-4086, .page-id-4087, .page-id-4088, .page-id-4089, .page-id-4091)
  .entry-content
  .wp-block-post-template.is-layout-grid.columns-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19.2px;
}

@media (max-width: 600px) {
  :is(.page-id-4086, .page-id-4087, .page-id-4088, .page-id-4089, .page-id-4091)
    .entry-content
    .wp-block-post-template.is-layout-grid.columns-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Fables uses one native category Query Loop in chronological column-major order. */
.page-id-4061 .geekist-column-major-category-posts.is-layout-grid {
  margin-top: 76px;
  grid-template-columns: repeat(2, minmax(0, 480px));
  column-gap: 70px;
  justify-content: center;
  row-gap: 28px;
}

@media (min-width: 601px) and (max-width: 1100px) {
  .page-id-4061 .geekist-column-major-category-posts.is-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
  }
}

@media (max-width: 600px) {
  .page-id-4061 .geekist-column-major-category-posts.is-layout-grid {
    grid-auto-flow: row !important;
    grid-template-columns: minmax(0, 289px) !important;
    justify-content: center;
    row-gap: 40px;
  }
}

:is(body.author, body.tax-series) main.wp-block-group {
  box-sizing: border-box;
  width: min(1024px, 100%);
  margin: 19.2px auto 0;
  padding: 10px;
}

:is(body.author, body.tax-series) main.wp-block-group > .wp-block-query {
  width: auto;
  margin: 0;
}

:is(body.author, body.tax-series) header.wp-block-template-part {
  min-height: 90.53125px;
}

@media (max-width: 600px) {
  :is(body.author, body.tax-series) main.wp-block-group {
    padding: 0 !important;
  }

  .single-post
    .wp-block-post-content
    .wp-block-post-template.is-layout-grid.columns-2,
  .single-post
    .wp-block-post-content
    .wp-block-post-template.is-layout-grid.columns-3,
  .single-post
    .wp-block-post-content
    .wp-block-post-template.is-layout-grid.columns-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.wp-block-uagb-info-box.uagb-infobox__content-wrap {
  position: static !important;
}

@media (max-width: 768px) {
  body.home .entry-content > section.has-background:has(> .wp-block-query > .columns-4) {
    padding-right: 25.265625px;
    padding-left: 25.265625px;
  }

  body.home .entry-content > section.has-background > .wp-block-query {
    width: 100%;
  }

  body.home .entry-content .wp-block-post-template.columns-4 {
    width: 100%;
    grid-template-columns: 1fr !important;
  }

  body.home .entry-content > section:first-of-type > .wp-block-columns,
  body.home .entry-content > section:last-of-type > .wp-block-columns {
    width: calc(100vw - 50.53px) !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: calc(50% - 50vw + 25.265px) !important;
  }

  body.home .entry-content > section:first-of-type > .wp-block-columns {
    column-gap: 39.1px;
  }

  body.home .entry-content > section:first-of-type > .wp-block-columns > .wp-block-column,
  body.home .entry-content > section:last-of-type > .wp-block-columns > .wp-block-column {
    flex-basis: 100% !important;
  }

  .geekist-pingbacks-inline {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .geekist-pingbacks-inline a {
    white-space: normal;
  }
}

/* Related reading stays secondary to the article, including on narrow screens. */
.geekist-related-posts {
  margin-block: 2rem;
}

.geekist-related-posts > .wp-block-separator {
  width: 100%;
  max-width: none;
  border: 0;
  border-top: 2px solid var(--wp--preset--color--section-border-light);
  margin: 0 0 1.25rem;
}

.geekist-related-posts > h2,
.single-post .wp-block-post-content > p:has(+ .geekist-related-posts__authored) {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 1rem;
}

/* The older authored query has its own heading inside post content. */
.single-post .wp-block-post-content > p:has(+ .geekist-related-posts__authored) {
  border-top: 2px solid var(--wp--preset--color--section-border-light);
  padding-top: 1.25rem;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
}

.geekist-related-posts__scroller,
.geekist-related-posts__authored {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 0.5rem;
}

.geekist-related-posts__scroller:focus-visible,
.geekist-related-posts__authored:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.geekist-related-posts .geekist-related-posts__items,
.single-post .geekist-related-posts__authored .wp-block-post-template {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.geekist-related-posts__items > .wp-block-post,
.single-post .geekist-related-posts__authored .wp-block-post-template > .wp-block-post {
  flex: 0 0 180px;
  min-width: 0;
  margin: 0;
}

.geekist-related-posts__items .wp-block-post-featured-image,
.geekist-related-posts__authored .wp-block-post-featured-image {
  margin: 0 0 0.5rem;
}

.geekist-related-posts__items .wp-block-post-featured-image img,
.geekist-related-posts__authored .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.geekist-related-posts__items .wp-block-post-title,
.single-post .geekist-related-posts__authored .wp-block-post-title {
  font-size: 0.95rem;
  line-height: 1.3;
  margin: 0;
}

.geekist-related-posts__authored .wp-block-post-date,
.geekist-related-posts__authored .wp-block-post-excerpt {
  display: none;
}

/* Keep footer navigation compact and easy to scan on phones. */
@media (max-width: 600px) {
  body footer.wp-block-template-part > .wp-block-group {
    padding-block: 2rem !important;
  }
  footer.wp-block-template-part .wp-block-columns:has(.wp-block-site-tagline) .wp-block-spacer {
    display: none;
  }
  footer.wp-block-template-part .wp-block-group.alignfull:has(.wp-block-site-tagline) {
    margin-inline: 0;
    width: 100%;
  }
  footer.wp-block-template-part .wp-block-site-tagline {
    padding-inline: 0 !important;
    margin-block: .75rem 1.5rem;
  }
}
