/* =========================================================
   Bitchin' Bits — Hugo port of WordPress Yamuna custom theme
   ========================================================= */

@font-face {
  font-family: "Streamster";
  src: url("/fonts/Streamster.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "SFAlienEncounters";
  src: url("/fonts/SFAlienEncounters.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "wpkoi";
  src: url("/fonts/wpkoi.ttf") format("truetype");
  /* icon font — block avoids a flash of wrong fallback glyphs */
  font-display: block;
}

:root {
  --bg-page: #161616;
  --text-main: #fff;

  --link: #16eded;
  --link-visited: #578785;
  --link-hover: #ed1651;

  --header-bg: #000;
  --nav-bg: #4f1d72;
  --dropdown-bg: #4f1d72;

  --title-color: #ea69f8;
  --widget-bg: #3d5157;
  --footer-bg: #ea69f8;

  --container-width: 1170px;

  --font-body: "Merriweather", Georgia, serif;
  --font-title: "Streamster", "Anton", cursive;
  --font-heading: "SFAlienEncounters", "Anton", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.3;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:visited {
  color: var(--link-visited);
}

a:hover,
a:focus,
a:active {
  color: var(--link-hover);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-top: 0;
}

h1 { font-size: 50px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }

p,
address,
pre {
  margin: 0 0 1.5em;
}

ul, ol {
  margin: 0 0 1.5em 3em;
  /* Yamuna's reset zeroes list padding (ol,p,table,ul{border:0;padding:0}); without this the
     browser default padding-inline-start: 40px pushes item text ~40px right of the bullet */
  padding: 0;
}

ul { list-style: disc; }
ol { list-style: decimal; }

/* Yamuna parity: nested lists indent 1.5em (not another full 3em) and carry no bottom margin */
li > ul, li > ol {
  margin-bottom: 0;
  margin-left: 1.5em;
}

.screen-reader-text {
  position:absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  width:1px;
  height:1px;
  overflow:hidden;
}

.grid-container {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 10px;
  padding-right: 10px;
}

/* =========================================================
   Header
   ========================================================= */

.site-header {
  background-color: var(--header-bg);
  background-image: url("/images/skyline.jpg");
  background-repeat: repeat-x;
  background-position: bottom center;
  color: #fff;
}

.inside-header {
  padding-top: 5px;
  padding-bottom: 0;
}

.header-content-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-branding {
  margin: 0;
}

.main-title {
  margin: 0;
}

.main-title a {
  color: var(--title-color);
  text-shadow: 2px 2px 4px #000;
  font-family: var(--font-title);
  font-size: 50px;
  line-height: 1.1;
  text-transform: uppercase;
}

.main-title a:hover,
.main-title a:focus,
.main-title a:visited {
  color: var(--title-color);
}

/* =========================================================
   Navigation — desktop
   ========================================================= */

.main-navigation {
  background-color: var(--nav-bg);
}

.inside-navigation {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.menu-toggle,
.mobile-bar-items {
  display: none;
}

.main-nav .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.main-nav .menu > li {
  position: relative;
}

.main-nav a {
  display: block;
  color: var(--link);
  font-family: "Anton", sans-serif;
  text-transform: uppercase;
  font-size: 22px;
  line-height: 62px;
  padding-left: 8px;
  padding-right: 8px;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--link-hover);
}

.search-glyph {
  font-size: 24px;
  line-height: 1;
}

/* Dropdown menus */
.menu-item-has-children .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 0;
  list-style: none;
  background-color: var(--dropdown-bg);
  box-shadow: 0 2px 2px rgba(0,0,0,.1);
}

.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.sub-menu a {
  color: #fff;
  font-size: 20px;
  line-height: normal;
  padding: 10px 20px;
  text-transform: uppercase;
}

.sub-menu a:hover,
.sub-menu a:focus {
  color: #add8e6;
}

/* =========================================================
   Layout
   ========================================================= */

/*.site {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding-top: 25px;
  padding-bottom: 20px;
}

.site.with-sidebar {
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
}

.content-area,
.sidebar {
  width: 100%;
}*/
.site-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding-top: 25px;
  padding-bottom: 20px;
}

.site-content.with-sidebar {
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
}

@media (max-width: 768px) {
  .site-content,
  .site-content.with-sidebar {
    display: block;
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .sidebar {
    margin-top: 40px;
  }
}

/* =========================================================
   Posts / pages
   ========================================================= */

.post {
  margin-bottom: 2em;
}

.inside-article {
  padding-bottom: 30px;
}

.entry-header {
  margin-bottom: 20px;
}

.entry-title {
  margin-bottom: 0;
}

.entry-meta {
  font-size: 85%;
  margin-top: 0.5em;
  line-height: 1.5;
}

.page-header-image-single,
.post-image {
  margin-top: 20px;
  margin-bottom: 20px;
}

.entry-content,
.entry-summary {
  margin-top: 20px;
}

.read-more {
  white-space: nowrap;
}

/* Category / tag links in entry meta — stacked vertically with icons, as on WP */
.entry-meta .cat-links,
.entry-meta .tags-links {
  display: block;
}

.entry-meta .cat-links:before,
.entry-meta .tags-links:before {
  font-family: "wpkoi";
  font-style: normal;
  font-variant: normal;
  line-height: 1;
  text-decoration: inherit;
  position: relative;
  margin-right: 0.6em;
  width: 13px;
  text-align: center;
  display: inline-block;
}

.entry-meta .cat-links:before { content: "\f07b"; }
.entry-meta .tags-links:before { content: "\f02c"; }

/* Series (WP Post Series parity): "part N of M in the series …" line */
.seriesmeta {
  padding-bottom: 30px;
}

/* WP theme resets fieldsets to borderless; the legend is a plain heading.
   Top margin: the Series Navigation fieldset lives OUTSIDE .entry-content
   (Pagefind scope), so the article's final <p> hits p:last-child and loses its
   bottom margin — restore the block gap at 20px, the site's standard spacing. */
.inside-article fieldset {
  margin-top: 20px;
  border: 0;
  padding: 0;
  min-width: inherit;
}

.inside-article fieldset legend {
  padding: 0;
  margin-bottom: 1.5em;
}

/* Content typography */
.entry-content p:last-child,
.entry-summary p:last-child {
  margin-bottom: 0;
}

.entry-content figure,
.entry-summary figure {
  margin: 20px 0;
  text-align: center;
}

.entry-content figcaption,
.entry-summary figcaption {
  font-size: 13px;
  color: #aaa;
  margin-top: 5px;
}

/* Image titles (the picture shortcode's <h4> inside figcaption) use the body font and main
   text color — the generic h1–h6 rule would give them the decorative heading font, and the
   figcaption rule's #aaa is too faint for a title. */
.entry-content figcaption h4,
.entry-summary figcaption h4 {
  font-family: var(--font-body);
  color: var(--text-main);
}

/* Entry alignment — mirrors Yamuna/Genesis .alignleft/.alignright (float shortcode) */
.alignleft {
  display: inline;
  float: left;
  margin-right: 1.5em;
}

.alignright {
  display: inline;
  float: right;
  margin-left: 1.5em;
}

.aligncenter {
  clear: both;
  display: block;
  margin: 0 auto;
  /* class lands on a full-width wrapper div, so center its contents */
  text-align: center;
}

/* Keep floats contained within the article (Genesis clearfix) */
.entry-content::after,
.entry-summary::after {
  content: "";
  display: table;
  clear: both;
}

/* Tables */
.entry-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  color: #fff;
}

.entry-content th,
.entry-content td {
  border: 0.5px solid #fff;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.entry-content thead th,
.entry-content thead td {
  background-color: #32acb7;
  color: #fff;
}

/* Zebra striping is opt-in via the table shortcode (striped=true), matching
   WP's "is-style-stripes" (#000 odd rows over the #3a3a3a even-row base).
   Unstriped tables carry NO background - transparent cells show the #161616
   page background, exactly like WP. */
.entry-content .table-striped tbody tr:nth-child(odd) {
  background-color: #000;
}

.entry-content .table-striped tbody tr:nth-child(even) {
  background-color: #3a3a3a;
}

/* Sticky header, opt-in via the table shortcode (sticky=true) — WP's advgb
   "sticky-header" variant. Sticks per-cell on th/td (never tr), top: 0 because
   our site header scrolls away like WP's. The teal background sits on the cells
   themselves so they stay opaque while pinned; z-index keeps them above the
   striped rows sliding underneath. */
.entry-content .table-sticky thead th,
.entry-content .table-sticky thead td {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Cell/text highlight - WP's pink default-value marker (#f78da7). Use
   class="highlight" on a <td> or inline <span>; it paints over zebra rows
   and transparent unstriped cells alike. */
.entry-content .highlight {
  background-color: #f78da7;
}

/* Pink text accent (WP's inline color:#f78da7, e.g. the joycont post's "Note:"). */
.entry-content .text-pink {
  color: #f78da7;
}

/* Blockquotes */
.entry-content blockquote {
  border-left: 5px solid var(--widget-bg);
  background-color: rgba(255,255,255,.04);
  padding: 16px 20px;
  margin: 0 0 1.5em;
  font-style: italic;
}

/* Code */
.entry-content pre {
  background-color: #202428;
  border-left: 3px solid var(--link);
  padding: 14px;
  overflow-x: auto;
  line-height: 1.5;
}

.entry-content code,
.entry-content pre code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: .9em;
}

/* =========================================================
   Sidebar widgets
   ========================================================= */

.sidebar .widget {
  background-color: var(--widget-bg);
  color: #fff;
  padding: 20px;
  margin-bottom: 20px;
}

.widget-title {
  font-family: "Anton", sans-serif;
  font-size: 30px;
  line-height: 1.5;
  color: var(--title-color);
  margin-top: 0;
  margin-bottom: 20px;
}

.sidebar .widget a {
  color: var(--link);
}

.sidebar .widget a:hover,
.sidebar .widget a:focus {
  color: var(--link-hover);
}

.sidebar .widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar .widget li {
  padding-bottom: 5px;
}

.sidebar .widget ul.children {
  margin-left: 1em;
  margin-top: 5px;
}

.tagcloud a {
  display: inline-block;
  margin-right: 8px;
}

/* Search form */
.search-form {
  width: 100%;
}

.search-field,
input[type="search"],
input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
  color: #555;
  background-color: #fafafa;
  border: 1px solid #ccc;
  border-radius: 0;
  padding: 10px 15px;
  width: 100%;
  max-width: 100%;
  font-family: inherit;
}

.search-field:focus,
input[type="search"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  color: #111;
  background-color: #fff;
  border-color: #bfbfbf;
  outline: none;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  margin-top: 20px;
}

.site-info {
  background-color: var(--footer-bg);
  color: #fff;
  text-align: center;
  padding: 10px 30px;
  font-size: 18px;
}

.site-info a,
.site-info a:visited {
  color: #fff;
}

.site-info a:hover,
.site-info a:focus {
  color: #add8e6;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {
  body {
    padding: 0;
  }

  h1 { font-size: 30px; }
  h2 { font-size: 25px; }

  /* Un-float and center aligned content, matching Yamuna mobile.min.css */
  .alignleft,
  .alignright {
    float: none;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  .main-title a {
    font-size: 25px;
  }

  .grid-container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .header-content-h {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-branding {
    text-align: center;
    margin-bottom: 10px;
  }

  .main-navigation {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 10px;
    padding-right: 10px;
  }

  .inside-navigation {
    display: block;
    width: 100%;
  }

  .menu-toggle,
  .mobile-bar-items {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
  }

  .menu-toggle {
    background: none;
    border: 0;
    color: var(--link);
    font-family: "Anton", sans-serif;
    font-size: 20px;
    line-height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-bar-items {
    margin-left: auto;
  }

  .mobile-bar-items a,
  .menu-toggle {
    color: var(--link);
  }

  .main-nav .menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .main-navigation.toggled .menu {
    display: flex;
  }

  .main-nav a {
    line-height: 40px;
    font-size: 18px;
    text-align: left;
  }

  .menu-item-has-children .sub-menu {
    position: static;
    display: block;
    min-width: 0;
    background-color: #3b1860;
    padding-left: 20px;
  }

  .main-nav .search-item {
    display: none;
  }

  .site,
  .site.with-sidebar {
    display: block;
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .sidebar {
    margin-top: 40px;
  }

  .entry-content ul,
  .entry-content ol {
    margin-left: 1.5em;
  }
}

/* =========================================================
   PhotoSwipe standalone figure fix + lightbox placeholder
   ========================================================= */

/* Width-only thumbnails (default since 2026-09-07) emit no inline background-size, so
   the placeholder must match the img box exactly — same source file/aspect, so
   100% 100% is distortion-free. Gallery tiles keep cover via the theme's
   higher-specificity .gallery .pswp-gallery__item rule. */
.pswp-gallery__item {
  background-size: 100% 100%;
}

/* Standalone figures (outside a gallery) emit both an inline background placeholder and the
   <img> thumbnail, and the theme CSS only dedupes/hides that inside .gallery tiles. Anchor on
   the wrapper instead of a class on the figure: a standalone figure's .pswp-gallery div is a
   DIRECT CHILD of .entry-content, while gallery .pswp-gallery divs are children of .gallery (or
   of another .pswp-gallery). A picture wrapped in another block (e.g. {{< float >}}) would lose
   these rules — extend the selector if that ever happens. */
.entry-content > .pswp-gallery .pswp-gallery__item {
  background-image: none !important;
}

.entry-content > .pswp-gallery .pswp-gallery__item img {
  display: block;
  margin: 0 auto;
}

/* PhotoSwipe v5 renders the page thumbnail (msrc) stretched to fill the
   viewport behind the first lightbox image while the full-size image loads,
   and keeps it ~1s after load completes — a "double image". Hide it. */
.pswp .pswp__img--placeholder {
  display: none;
}

/* Center partial rows of gallery tiles — easy-gallery packs its float:left .box tiles
   against the left edge, so a row with fewer than the full tile count looks off-center.
   Flex on the OUTER .pswp-gallery (the div that directly contains the tiles) keeps the
   % tile widths/aspect but centers rows. The child selectors are load-bearing:
   - NOT .gallery itself: then .pswp-gallery becomes a content-sized flex item and
     collapses to zero, because its only children are floats, which don't contribute
     to intrinsic sizes.
   - NOT descendant (.gallery .pswp-gallery): every picture shortcode nested in a
     gallery shortcode wraps its .box in its OWN .pswp-gallery div (the theme's
     scratch-based suppression is broken in Hugo v0.151.x — see AGENTS.md Pitfalls);
     flexing those per-tile wrappers makes their %-sized children resolve against an
     indeterminate width and vanish. display:contents drops the intermediate wrappers
     from layout so the .box tiles become direct flex items of the outer container. */
.gallery > .pswp-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.gallery > .pswp-gallery > .pswp-gallery {
  display: contents;
}

/* easy-gallery's .gallery has no margin of its own, and this site's p/h/ul all have
   zero top margins, so whatever follows a gallery sits flush against the tiles.
   Match the 20px image-block spacing used by .entry-content figure / .post-image. */
.gallery {
  margin-bottom: 20px;
}

/* Standalone lightbox figures sit flush against following content: the theme CSS's
   .box figure { margin: 0 } (loaded in-body, wins our .entry-content figure margins at
   equal specificity) zeroes them. WP's .wp-block-image has margin-bottom: 1em — match
   the site's 20px image-block spacing on the wrapper instead. Direct-child scope:
   inside a gallery the .pswp-gallery divs are children of .gallery, so tiles keep
   their own spacing. */
.entry-content > .pswp-gallery {
  margin-bottom: 20px;
}

/* YouTube embeds: Hugo's built-in {{< youtube >}} shortcode (shipped in core since v0.151.x)
   emits an unclassed wrapper div with inline styles, which theme CSS can't target — so it is
   overridden in themes/bitchinbits (layouts/shortcodes/youtube.html) to emit .youtube-video.
   16:9 box; WP's .wp-block-embed has margin-bottom: 1em — match the site's 20px block spacing. */
.entry-content .youtube-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 20px;
}

.entry-content .youtube-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================================================
   Search — Pagefind <pagefind-searchbox> nav overlay + /search/ results page
   ========================================================= */

/* Overlay form that slides over the nav bar (Yamuna behavior) */
.header-search {
  position: absolute;
  top: 0;
  left: -99999px;
  width: 100%;
  height: 100%;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
  z-index: 20;
}

.header-search.nav-search-active {
  left: 0;
  right: 0;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Theme Pagefind's <pagefind-searchbox> via its --pf-* custom properties.
   The bundle's own rules use :is(#…) specificity hacks that plain overrides
   can't beat, but variables inherit through — and the bundle's light/dark
   palettes are opt-in (data-pf-theme), so these force the synthwave ones. */
.header-search pagefind-searchbox {
  display: block;
  width: 100%;
  --pf-text: #fff;
  --pf-text-secondary: #c9c9c9;
  --pf-text-muted: #c9c9c9;
  --pf-background: var(--dropdown-bg);
  --pf-border: transparent;
  --pf-border-focus: var(--link);
  --pf-hover: rgba(22, 237, 237, 0.08);
  --pf-mark: var(--title-color);
  --pf-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
  --pf-font: var(--font-body);
  --pf-input-height: 62px; /* nav bar height — input fills the overlay */
  --pf-input-font-size: 20px;
  --pf-result-title-font-size: 18px;
  --pf-result-excerpt-font-size: 14px;
  --pf-outline-focus: var(--link);
  --pf-border-radius: 0;
  --pf-searchbox-max-width: 100%;
}

/* "See all results" row appended to the component's dropdown by js/search.js
   (above the keyboard-hints footer, outside the results listbox). */
.search-see-all {
  display: block;
  padding: 10px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--link);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
}

.search-see-all:hover,
.search-see-all:focus {
  color: var(--link-hover);
  background-color: rgba(22, 237, 237, 0.08);
}

/* Highlighted search terms in result snippets */
mark {
  background-color: rgba(234, 105, 248, 0.35);
  color: #fff;
}

.search-status {
  font-style: italic;
  color: #aaa;
}

@media (max-width: 768px) {
  .header-search pagefind-searchbox {
    --pf-input-height: 40px; /* mobile nav bar height */
    --pf-input-font-size: 18px;
    --pf-result-title-font-size: 16px;
  }
}
