/*
 * Chrome over an inverted blog band.
 *
 * Generated by hand, not by tools/build-header-css.py, and loaded after
 * tolinku-header.css so it can correct it.
 *
 * This cannot live in src/main.css. Tailwind v4 wraps that file in @layer,
 * and the cascade puts every unlayered rule above every layered one
 * regardless of specificity, so tolinku-header.css would win even against a
 * five-class selector. The symptom was precise and worth recording: the band
 * inverted, the logo swapped, and the nav text stayed black, because only the
 * rules competing with tolinku-header.css were being discarded.
 *
 * Everything is scoped to :not(.sticky-menu). Once the header sticks it draws
 * its own white bar, and the theme's default dark type is correct again.
 */
/*
 * Chrome over an inverted band.
 *
 * The header is fixed and is not a descendant of the band, so it cannot be
 * reached by a selector rooted there: the state is published on <body>
 * instead. Everything is scoped to :not(.sticky-menu), because once the
 * header sticks it draws its own white bar and the default dark type is
 * correct again. The selectors are deliberately long: tolinku-header.css
 * is enqueued after this file and would otherwise win.
 */
/*
 * The light mark is hidden by default. Qualified with .header-logo img
 * rather than written as a bare class: both marks were rendering on the
 * light band because an unlayered rule elsewhere sets display on the header
 * logo image, and at (0,1,0) a lone class could not reach it.
 */
.header-logo img.tolinku-logo-light {
  display: none;
}
body.tolinku-dark-chrome .azzle-header-section:not(.sticky-menu) .header-logo img.tolinku-logo-dark {
  display: none;
}
body.tolinku-dark-chrome .azzle-header-section:not(.sticky-menu) .header-logo img.tolinku-logo-light {
  display: block;
}
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .main-menu a,
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .main-menu ul li.menu-item-has-children > a {
  color: #fff;
}
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .azzle-header-login-button ul li a {
  color: #fff;
  border-color: rgb(255 255 255 / 0.35);
}
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .azzle-header-login-button ul li a:hover {
  color: var(--color-ink);
  background-color: #fff;
  border-color: transparent;
}
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .azzle-default-btn.azzle-header-btn {
  background-color: #fff;
  color: var(--color-ink);
}
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .azzle-default-btn.azzle-header-btn:hover {
  color: var(--color-ink);
}
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .site-header .azzle-menu-toggle span,
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .site-header .azzle-menu-toggle span:before,
body.tolinku-dark-chrome .tolinku-chrome .azzle-header-section:not(.sticky-menu) .site-header .azzle-menu-toggle span:after {
  background-color: #fff;
}

/*
 * Type and rules inside the inverted band.
 *
 * These correct Tailwind utilities, so they cannot live in src/main.css
 * either: that file's custom rules are @layer components and the utilities
 * they fight are @layer utilities, which wins on layer order alone. Being
 * unlayered, this file sits above both.
 */
.tolinku-blog-band.is-dark h1,
.tolinku-blog-band.is-dark h2,
.tolinku-blog-band.is-dark h3,
.tolinku-blog-band.is-dark .text-black,
.tolinku-blog-band.is-dark .text-dark,
.tolinku-blog-band.is-dark .text-ink,
.tolinku-blog-band.is-dark .text-gray-900,
.tolinku-blog-band.is-dark .text-gray-800 {
  color: #fff;
}
.tolinku-blog-band.is-dark .text-gray-700,
.tolinku-blog-band.is-dark .text-gray-600,
.tolinku-blog-band.is-dark .text-gray-500,
.tolinku-blog-band.is-dark .text-gray-400,
.tolinku-blog-band.is-dark .text-muted {
  color: rgb(255 255 255 / 0.68);
}
.tolinku-blog-band.is-dark .hover\:text-dark:hover,
.tolinku-blog-band.is-dark a:hover .text-gray-500 {
  color: #fff;
}
/* Accent on a dark surface is lilac, never orange. See the surface rule. */
.tolinku-blog-band.is-dark .text-purple-deep,
.tolinku-blog-band.is-dark .text-orange,
.tolinku-blog-band.is-dark .group:hover .group-hover\:text-purple-deep {
  color: var(--color-lilac);
}
.tolinku-blog-band.is-dark .border-line,
.tolinku-blog-band.is-dark .border-b {
  border-color: var(--color-line-dark);
}
.tolinku-blog-band.is-dark .hover\:bg-gray-100:hover {
  background-color: rgb(255 255 255 / 0.1);
}

/*
 * White surfaces inside an inverted band keep their dark type.
 *
 * The blanket overrides above turn every muted utility white, which is right
 * for type sitting on the band and wrong for type sitting on the search
 * field or its results panel, both of which stay white. Restored here rather
 * than excluded above, because CSS has no ancestor-negation.
 *
 * Scoped with "> svg" on purpose: on the blog index that selects the
 * magnifier inside the white field, while the single-post view's search
 * toggle is a button sitting directly on the band and must stay white.
 */
.tolinku-blog-band.is-dark [data-search-wrap] > svg {
  color: #9ca3af;
}
.tolinku-blog-band.is-dark .tolinku-search-input {
  color: #111827;
  border-color: var(--color-line);
}
.tolinku-blog-band.is-dark .tolinku-search-input::placeholder {
  color: #9ca3af;
}
.tolinku-blog-band.is-dark .tolinku-search-dropdown .text-gray-400 {
  color: #9ca3af;
}
.tolinku-blog-band.is-dark .tolinku-search-dropdown .text-gray-500 {
  color: #6b7280;
}
.tolinku-blog-band.is-dark .tolinku-search-dropdown .text-dark,
.tolinku-blog-band.is-dark .tolinku-search-dropdown .text-black {
  color: #111827;
}
.tolinku-blog-band.is-dark .tolinku-search-dropdown .text-purple-deep {
  color: var(--color-purple-deep);
}
.tolinku-blog-band.is-dark .tolinku-search-dropdown .border-gray-100,
.tolinku-blog-band.is-dark .tolinku-search-dropdown .border-gray-200,
.tolinku-blog-band.is-dark .tolinku-search-dropdown .border-b {
  border-color: #e5e7eb;
}
.tolinku-blog-band.is-dark .tolinku-search-dropdown .hover\:bg-gray-100:hover {
  background-color: #f3f4f6;
}

/*
 * The search trigger keeps a white background on the inverted band, so its
 * placeholder type and border stay light-surface values. Same reasoning as
 * the search field above; it is a separate selector because the trigger is a
 * button, not an input, and carries no [data-search-wrap].
 */
.tolinku-blog-band.is-dark .tolinku-search-trigger,
.tolinku-blog-band.is-dark .tolinku-search-trigger .text-gray-400 {
  color: #9ca3af;
}
.tolinku-blog-band.is-dark .tolinku-search-trigger {
  border-color: var(--color-line);
}
.tolinku-blog-band.is-dark .tolinku-search-trigger:hover {
  border-color: var(--color-ink);
}

/*
 * Search modal layout.
 *
 * Written as plain CSS rather than Tailwind arbitrary values (z-[9999],
 * mt-[8vh], max-h-[50vh]). Those are generated only if the scanner picks the
 * file up, and the modal partial's unique arbitrary classes were not being
 * emitted, so the panel rendered at the top of the viewport with no height
 * cap. Ordinary utilities used elsewhere in the theme still work in this
 * markup, because they were already in the bundle.
 */
.tolinku-search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.tolinku-search-modal.hidden {
  display: none;
}
.tolinku-search-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
}
.tolinku-search-panel {
  position: relative;
  margin: 8vh auto 0;
  width: 92%;
  max-width: 42rem;
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
  overflow: hidden;
}
.tolinku-search-scroll {
  max-height: 50vh;
  overflow-y: auto;
}
@media (max-width: 640px) {
  .tolinku-search-panel {
    margin-top: 4vh;
    width: 94%;
  }
}

/*
 * Link hover inside the inverted band.
 *
 * Hover is orange everywhere on the blog. On black, the base orange
 * (#FE330A) lands at about 5:1, which passes but sits at the bottom of the
 * range, so the band uses the soft orange instead: same hue, roughly 6:1,
 * and it reads at the small sizes the card meta uses.
 *
 * This does not disturb the .text-orange mapping above, which sends a
 * resting orange to lilac: Tailwind compiles the hover variants to
 * .group:hover .group-hover\:text-orange and .hover\:text-orange:hover,
 * neither of which matches a bare .text-orange.
 */
.tolinku-blog-band.is-dark .group:hover .group-hover\:text-orange,
.tolinku-blog-band.is-dark .hover\:text-orange:hover {
  color: var(--color-orange-soft);
}
