/*
Theme Name: Halo Press
Theme URI: https://haloweb.id
Author: Haloweb
Author URI: https://haloweb.id
Description: Performance-first WordPress block theme foundation for gaming media, pop culture, tech, news, and esports publishing.
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Version: 0.1.1-beta.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: halo-press
Tags: block-theme, full-site-editing, news, blog, entertainment
*/

:root {
  --halo-brand: var(--wp--preset--color--brand);
  --halo-brand-dark: var(--wp--custom--halo--brand-dark);
  --halo-brand-pale: var(--wp--custom--halo--brand-pale);
  --halo-brand-rgb: var(--wp--custom--halo--brand-rgb);
  --halo-page-bg: var(--wp--preset--color--page-bg);
  --halo-surface: var(--wp--preset--color--surface);
  --halo-surface-2: var(--wp--custom--halo--surface-2);
  --halo-surface-3: var(--wp--custom--halo--surface-3);
  --halo-border: var(--wp--preset--color--border);
  --halo-border-strong: var(--wp--custom--halo--border-strong);
  --halo-text: var(--wp--preset--color--text);
  --halo-text-muted: var(--wp--preset--color--text-muted);
  --halo-text-faint: var(--wp--custom--halo--text-faint);
  --halo-accent: var(--wp--preset--color--accent);
  --halo-success: var(--wp--preset--color--success);
  --halo-warning: var(--wp--preset--color--warning);
  --halo-danger: var(--wp--preset--color--danger);
  --halo-focus: var(--wp--preset--color--focus);
  --halo-font-body: var(--wp--preset--font-family--system-sans);
  --halo-font-heading: var(--wp--preset--font-family--dm-sans);
  --halo-line-height-tight: 1.15;
  --halo-line-height-body: 1.65;
  --halo-radius-xs: 3px;
  --halo-radius-sm: 6px;
  --halo-radius-md: var(--wp--custom--halo--card-radius);
  --halo-radius-lg: 12px;
  --halo-radius-xl: 16px;
  --halo-radius-pill: var(--wp--custom--halo--badge-radius);
  --halo-button-radius: var(--wp--custom--halo--button-radius);
  --halo-space-xs: var(--wp--preset--spacing--20);
  --halo-space-sm: var(--wp--preset--spacing--30);
  --halo-space-md: var(--wp--preset--spacing--40);
  --halo-space-lg: var(--wp--preset--spacing--50);
  --halo-space-xl: var(--wp--preset--spacing--60);
  --halo-card-padding: var(--wp--custom--halo--card-padding);
  --halo-content-width: 760px;
  --halo-wide-width: var(--wp--custom--halo--site-max-width);
  --halo-sidebar-width: var(--wp--custom--halo--sidebar-width);
  --halo-header-height: var(--wp--custom--halo--header-height);
  --halo-card-media-ratio: var(--wp--custom--halo--card-media-ratio);
  --halo-shadow-card: var(--wp--custom--halo--shadow-card);
  --halo-shadow-hover: var(--wp--custom--halo--shadow-hover);
  --halo-motion-fast: var(--wp--custom--halo--motion-fast);
  --halo-motion-medium: var(--wp--custom--halo--motion-medium);
  --halo-motion-slow: 350ms;
  --halo-component-bg: var(--halo-surface);
  --halo-component-border: var(--halo-border);
  --halo-emphasis: var(--wp--custom--halo--emphasis-color);
  color-scheme: dark;
}

:root[data-halo-color-scheme='dark'] {
  --wp--preset--color--brand: #6d5dfc;
  --wp--custom--halo--brand-dark: #3730a3;
  --wp--custom--halo--brand-pale: color-mix(in srgb, #6d5dfc 16%, #17171f);
  --wp--custom--halo--brand-rgb: 109, 93, 252;
  --wp--preset--color--accent: #20d6a2;
  --wp--preset--color--page-bg: #0d0d14;
  --wp--preset--color--surface: #17171f;
  --wp--custom--halo--surface-2: #1f1f2a;
  --wp--custom--halo--surface-3: #272736;
  --wp--preset--color--border: #2e2e42;
  --wp--custom--halo--border-strong: #3d3d56;
  --wp--preset--color--text: #f4f7fb;
  --wp--preset--color--text-muted: #9aa6b8;
  --wp--custom--halo--text-faint: #52526a;
  --wp--preset--color--success: #26c281;
  --wp--preset--color--warning: #f4b740;
  --wp--preset--color--danger: #ff5d6c;
  --wp--preset--color--focus: #9be7ff;
  --wp--custom--halo--emphasis-color: var(--wp--preset--color--accent);
  --wp--custom--halo--shadow-card: 0 12px 30px rgba(0, 0, 0, 0.22);
  --wp--custom--halo--shadow-hover: 0 18px 42px rgba(0, 0, 0, 0.26);
  color-scheme: dark;
}

:root[data-halo-color-scheme='light'] {
  --wp--preset--color--brand: #4f46e5;
  --wp--custom--halo--brand-dark: #3730a3;
  --wp--custom--halo--brand-pale: #eef2ff;
  --wp--custom--halo--brand-rgb: 79, 70, 229;
  --wp--preset--color--accent: #047c8c;
  --wp--preset--color--page-bg: #f8f8fb;
  --wp--preset--color--surface: #ffffff;
  --wp--custom--halo--surface-2: #f3f4f6;
  --wp--custom--halo--surface-3: #eceef2;
  --wp--preset--color--border: #e4e4e9;
  --wp--custom--halo--border-strong: #d0d0d8;
  --wp--preset--color--text: #111118;
  --wp--preset--color--text-muted: #6b7280;
  --wp--custom--halo--text-faint: #9ca3af;
  --wp--preset--color--success: #168257;
  --wp--preset--color--warning: #a16207;
  --wp--preset--color--danger: #dc2626;
  --wp--preset--color--focus: #2563eb;
  --wp--custom--halo--emphasis-color: var(--wp--preset--color--accent);
  --wp--custom--halo--shadow-card: 0 10px 26px rgba(17, 24, 39, 0.08);
  --wp--custom--halo--shadow-hover: 0 16px 38px rgba(17, 24, 39, 0.12);
  color-scheme: light;
}

.halo-sr-only {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--halo-page-bg);
  color: var(--halo-text);
  font-family: var(--halo-font-body);
  line-height: var(--halo-line-height-body);
  overflow-wrap: break-word;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.wp-element-button,
.wp-block-button__link,
.wp-block-search__button {
  border-radius: var(--halo-button-radius);
  font-weight: 700;
  min-height: 44px;
  transition:
    background-color var(--halo-motion-fast) ease,
    border-color var(--halo-motion-fast) ease,
    color var(--halo-motion-fast) ease,
    transform var(--halo-motion-fast) ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 3px;
}

.wp-block-navigation-item__content:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
  border-radius: var(--halo-radius-pill);
}

.halo-category-chips__chip:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
  background: color-mix(in srgb, var(--halo-brand) 18%, transparent);
}

.halo-post-card__title a:focus-visible,
.halo-feed-card .wp-block-post-title a:focus-visible,
.halo-related-grid .wp-block-post-title a:focus-visible,
.halo-trending-query .wp-block-post-title a:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
  border-radius: var(--halo-radius-sm);
}

.halo-mobile-bottom-nav a:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--halo-brand) 18%, transparent);
}

.halo-breadcrumbs__link:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
  border-radius: var(--halo-radius-sm);
}

.halo-post-tags a:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-post-navigation .wp-block-post-navigation-link a:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
  border-radius: var(--halo-radius-sm);
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
details:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
  outline: 2px solid var(--halo-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.halo-skip-link {
  background: var(--halo-brand);
  border-radius: var(--halo-radius-md);
  color: #ffffff;
  font-weight: 700;
  left: var(--halo-space-sm);
  padding: 0.75rem 1.1rem;
  position: absolute;
  top: var(--halo-space-sm);
  transform: translateY(-160%);
  transition: transform var(--halo-motion-fast) ease;
  z-index: 100;
}

.halo-skip-link:focus {
  box-shadow: 0 4px 16px rgba(109, 93, 252, 0.35);
  transform: translateY(0);
}

.halo-site-header {
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--halo-page-bg) 88%, transparent);
  border-bottom: 1px solid var(--halo-border);
  min-height: var(--halo-header-height);
  position: sticky;
  top: 0;
  z-index: 20;
}

.halo-disable-sticky-header .halo-site-header {
  position: relative;
}

.halo-site-header .wp-block-navigation a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.halo-site-header .wp-block-navigation__container {
  gap: var(--halo-space-sm);
}

.halo-site-header .wp-block-navigation-item__content {
  border-radius: var(--halo-radius-pill);
  padding: 0.35rem 0.7rem;
  transition:
    background-color var(--halo-motion-fast) ease,
    color var(--halo-motion-fast) ease;
}

.halo-site-header .wp-block-navigation-item__content:hover {
  background: color-mix(in srgb, var(--halo-brand) 16%, transparent);
  color: var(--halo-brand);
}

.halo-site-header .wp-block-navigation__submenu-container {
  background: var(--halo-surface);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-md);
  box-shadow: var(--halo-shadow-card);
  padding: var(--halo-space-xs);
}

.halo-site-header .wp-block-navigation__submenu-container a {
  border-radius: var(--halo-radius-sm);
  padding: 0.5rem 0.75rem;
}

.halo-site-header .wp-block-navigation__submenu-container a:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-site-header .wp-block-navigation__responsive-container {
  background: var(--halo-page-bg);
}

.halo-site-header .wp-block-navigation__responsive-container-content {
  padding: var(--halo-space-md);
}

.halo-site-header .wp-block-navigation__responsive-container-close {
  border-radius: var(--halo-radius-sm);
}

.halo-site-header .wp-block-navigation__responsive-container-close:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-site-header .wp-block-navigation__responsive-container-open {
  border-radius: var(--halo-radius-sm);
  min-height: 44px;
  min-width: 44px;
}

.halo-site-header .wp-block-navigation__responsive-container-open:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-site-header .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content {
  background: color-mix(in srgb, var(--halo-brand) 22%, transparent);
  color: var(--halo-brand);
  font-weight: 700;
}

.halo-color-scheme-toggle {
  appearance: none;
  background: var(--halo-surface);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-pill);
  color: var(--halo-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  min-width: 40px;
  padding: 0.45rem;
  transition:
    background-color var(--halo-motion-fast) ease,
    border-color var(--halo-motion-fast) ease,
    color var(--halo-motion-fast) ease,
    transform var(--halo-motion-fast) ease;
}

.halo-color-scheme-toggle:hover {
  background: color-mix(in srgb, var(--halo-brand) 14%, transparent);
  border-color: var(--halo-brand);
  color: var(--halo-brand);
}

.halo-color-scheme-toggle:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-color-scheme-toggle__icon {
  display: none;
  height: 18px;
  width: 18px;
}

.halo-color-scheme-toggle__icon svg {
  display: block;
}

.halo-disable-dark-mode-toggle .halo-color-scheme-toggle {
  display: none;
}

:root[data-halo-color-scheme='dark'] .halo-color-scheme-toggle__icon--dark,
:root[data-halo-color-scheme='light'] .halo-color-scheme-toggle__icon--light {
  display: inline-flex;
}

.halo-card a:focus-visible {
  outline-offset: 2px;
}

.halo-post-card__title a:focus-visible {
  outline-offset: 2px;
  text-decoration: underline;
  text-decoration-color: var(--halo-focus);
  text-decoration-thickness: 2px;
}

.halo-feed-card .wp-block-post-title a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--halo-focus);
  text-decoration-thickness: 2px;
}

.halo-trending-query .wp-block-post-title a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--halo-focus);
  text-decoration-thickness: 2px;
}

.halo-utility-bar {
  background: color-mix(in srgb, var(--halo-surface) 72%, var(--halo-page-bg));
  border-bottom: 1px solid var(--halo-border);
  color: var(--halo-text-muted);
}

.halo-utility-bar .wp-block-group {
  gap: var(--halo-space-sm);
}

.halo-utility-bar p {
  margin: 0;
}

.halo-utility-bar a {
  color: var(--halo-text-muted);
  min-height: 36px;
  text-decoration: none;
}

.halo-utility-bar a:hover {
  color: var(--halo-text);
}

.halo-utility-bar a:focus-visible {
  color: var(--halo-text);
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
  border-radius: var(--halo-radius-sm);
}

.halo-category-nav {
  overflow-x: auto;
  scrollbar-width: thin;
}

.wp-block-halo-category-chips.halo-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--halo-space-xs);
}

.halo-category-chips__chip {
  align-items: center;
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-pill);
  color: var(--halo-text);
  display: inline-flex;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 700;
  gap: 0.4rem;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.halo-category-chips__chip:hover {
  background: color-mix(in srgb, var(--halo-brand) 14%, transparent);
  border-color: var(--halo-brand);
  color: var(--halo-brand);
}

.halo-badge,
.taxonomy-category a,
.wp-block-post-terms a {
  background: color-mix(in srgb, var(--halo-emphasis) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--halo-emphasis) 36%, var(--halo-border));
  border-radius: var(--halo-radius-pill);
  color: var(--halo-emphasis);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  margin-right: 0.35rem;
  padding: 0.35rem 0.55rem;
  text-decoration: none;
  text-transform: uppercase;
}

.halo-category-chips__count {
  color: var(--halo-text-muted);
  font-weight: 600;
}

.halo-home-section {
  min-width: 0;
}

.halo-hero-section {
  container-type: inline-size;
}

.wp-block-halo-section-heading.halo-section-heading {
  align-items: end;
  display: grid;
  gap: var(--halo-space-sm);
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: var(--halo-space-md);
}

.halo-section-heading__eyebrow {
  color: var(--halo-emphasis);
  font-size: 0.75rem;
  font-weight: 700;
  grid-column: 1 / -1;
  margin: 0;
  text-transform: uppercase;
}

.halo-section-heading__title {
  font-size: var(--wp--preset--font-size--x-large);
  line-height: 1.15;
  margin: 0;
}

.halo-section-heading__link {
  color: var(--halo-brand);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 700;
  text-decoration: none;
}

.halo-card {
  background: var(--halo-component-bg);
  border: 1px solid var(--halo-component-border);
  border-radius: var(--halo-radius-md);
  box-shadow: var(--halo-shadow-card);
  overflow: clip;
  position: relative;
  transition:
    border-color var(--halo-motion-fast) ease,
    box-shadow var(--halo-motion-fast) ease,
    transform var(--halo-motion-fast) ease;
}

.halo-card .wp-block-post-featured-image,
.halo-media-frame {
  aspect-ratio: var(--halo-card-media-ratio);
  background: color-mix(in srgb, var(--halo-surface) 72%, var(--halo-brand));
  overflow: hidden;
}

.halo-card .wp-block-post-featured-image img,
.halo-media-frame img {
  aspect-ratio: var(--halo-card-media-ratio);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.wp-block-halo-hero-grid.halo-hero-grid {
  display: grid;
  gap: var(--halo-space-md);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.halo-hero-grid .halo-post-card {
  height: 100%;
}

.halo-hero-grid__item--1 {
  grid-row: span 2;
}

.halo-hero-grid > :first-child {
  grid-row: span 2;
}

.halo-hero-grid__item--1 .halo-post-card__title {
  font-size: var(--wp--preset--font-size--x-large);
}

.halo-hero-grid > :first-child .halo-post-card__title {
  font-size: var(--wp--preset--font-size--x-large);
}

.halo-post-card {
  background: var(--halo-component-bg);
  border: 1px solid var(--halo-component-border);
  border-radius: var(--halo-radius-md);
  box-shadow: var(--halo-shadow-card);
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition:
    border-color var(--halo-motion-fast) ease,
    box-shadow var(--halo-motion-fast) ease,
    transform var(--halo-motion-fast) ease;
}

.halo-post-card__image,
.halo-feed-card__media {
  aspect-ratio: var(--halo-card-media-ratio);
  background: color-mix(in srgb, var(--halo-surface) 72%, var(--halo-brand));
  display: block;
  overflow: hidden;
}

.halo-post-card__image--placeholder {
  align-items: center;
  color: var(--halo-text-faint);
  display: flex;
  justify-content: center;
}

.halo-post-card__image--placeholder::after {
  background: color-mix(in srgb, var(--halo-brand) 16%, transparent);
  border-radius: var(--halo-radius-pill);
  content: "";
  display: block;
  height: 42%;
  width: 42%;
}

.halo-post-card__image img,
.halo-feed-card__media img {
  aspect-ratio: var(--halo-card-media-ratio);
  height: 100%;
  object-fit: cover;
  transition: opacity var(--halo-motion-fast) ease, transform var(--halo-motion-medium) ease;
  width: 100%;
}

.halo-post-card__body {
  padding: var(--halo-card-padding);
}

.halo-post-card__meta,
.halo-post-card__excerpt {
  color: var(--halo-text-muted);
  font-size: var(--wp--preset--font-size--small);
}

.halo-post-card__title {
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.25;
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
}

.halo-post-card__title a {
  color: inherit;
  text-decoration: none;
}

.halo-post-card__excerpt {
  margin: 0.6rem 0 0;
}

.halo-trending-strip {
  background: color-mix(in srgb, var(--halo-surface) 82%, var(--halo-page-bg));
  border: 1px solid var(--halo-component-border);
  border-radius: var(--halo-radius-md);
  box-shadow: var(--halo-shadow-card);
  gap: var(--halo-space-md);
  overflow: hidden;
}

.halo-strip-label {
  color: var(--halo-emphasis);
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.halo-trending-query {
  min-width: 0;
  width: 100%;
}

.halo-trending-query .wp-block-post-template {
  gap: var(--halo-space-sm);
  margin: 0;
}

.halo-trending-query .wp-block-post-title {
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.halo-trending-query .wp-block-post-title a {
  text-decoration: none;
}

.halo-post-list > li {
  min-width: 0;
}

.halo-main-grid {
  align-items: flex-start;
  display: grid;
  gap: var(--halo-space-lg);
  grid-template-columns: minmax(0, 1fr) minmax(240px, var(--halo-sidebar-width));
}

.halo-sidebar {
  position: sticky;
  top: calc(var(--halo-header-height) + var(--halo-space-md));
}

.halo-video-feed {
  display: grid;
  gap: var(--halo-space-md);
}

.halo-feed-card {
  display: grid;
  gap: var(--halo-space-md);
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  min-width: 0;
}

.halo-feed-card__media {
  border-radius: var(--halo-radius-md);
}

.halo-feed-card__body {
  min-width: 0;
}

.halo-feed-card .wp-block-post-title {
  line-height: 1.25;
  margin-bottom: var(--halo-space-xs);
  margin-top: 0;
}

.halo-feed-card .wp-block-post-title a {
  text-decoration: none;
}

.halo-feed-card .wp-block-post-excerpt {
  margin-bottom: var(--halo-space-xs);
}

.halo-feed-card .wp-block-post-excerpt__excerpt {
  margin: 0;
}

.halo-placeholder-grid {
  gap: var(--halo-space-md);
}

.halo-module-placeholder {
  min-height: 100%;
  padding: var(--halo-space-md);
}

.halo-module-placeholder__eyebrow {
  color: var(--halo-emphasis);
  font-weight: 800;
  margin: 0 0 var(--halo-space-xs);
  text-transform: uppercase;
}

.halo-module-placeholder__title {
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.25;
  margin: 0;
}

.halo-module-placeholder__text {
  color: var(--halo-text-muted);
  font-size: var(--wp--preset--font-size--small);
  margin: var(--halo-space-xs) 0 0;
}

.halo-blocks-empty {
  color: var(--halo-text-muted);
}

.wp-block-post-author {
  align-items: center;
  background: var(--halo-component-bg);
  border: 1px solid var(--halo-component-border);
  border-radius: var(--halo-radius-md);
  box-shadow: var(--halo-shadow-card);
  display: flex;
  gap: var(--halo-space-sm);
  padding: var(--halo-card-padding);
}

.wp-block-post-author__avatar img {
  border-radius: var(--halo-radius-pill);
}

.wp-block-search {
  gap: var(--halo-space-xs);
}

.wp-block-search__input {
  background: var(--halo-component-bg);
  border: 1px solid var(--halo-component-border);
  border-radius: var(--halo-button-radius);
  color: var(--halo-text);
  min-height: 44px;
  padding: 0.65rem 0.85rem;
}

.wp-block-search__input::placeholder {
  color: var(--halo-text-muted);
  opacity: 1;
}

.wp-block-search__button {
  border: 1px solid var(--halo-brand);
  min-height: 44px;
}

.wp-block-search__button:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-query-loading {
  opacity: 0.6;
  pointer-events: none;
}

.halo-query-loading::after {
  content: "";
  animation: halo-spin 1s linear infinite;
  border: 2px solid var(--halo-border);
  border-top-color: var(--halo-brand);
  border-radius: 50%;
  display: inline-block;
  height: 1rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  width: 1rem;
}

@keyframes halo-spin {
  to {
    transform: rotate(360deg);
  }
}

.halo-mobile-bottom-nav {
  animation: halo-mobile-nav-in 220ms ease-out;
  background: color-mix(in srgb, var(--halo-page-bg) 94%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--halo-border);
  bottom: 0;
  display: none;
  left: 0;
  padding-bottom: env(safe-area-inset-bottom);
  position: fixed;
  right: 0;
  z-index: 30;
}

.halo-disable-mobile-bottom-nav .halo-mobile-bottom-nav {
  display: none !important;
}

@keyframes halo-mobile-nav-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.halo-mobile-bottom-nav a {
  min-height: 48px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--halo-radius-sm);
  transition: background-color var(--halo-motion-fast) ease;
}

.halo-mobile-bottom-nav a:hover {
  background: color-mix(in srgb, var(--halo-brand) 12%, transparent);
}

.halo-mobile-bottom-nav .wp-block-navigation-item__label {
  font-size: 0.7rem;
  font-weight: 600;
}

.wp-block-post-title a,
.wp-block-site-title a {
  text-decoration: none;
}

.wp-block-post-excerpt__excerpt {
  color: var(--halo-text-muted);
}

.wp-block-query-pagination {
  margin-top: var(--halo-space-lg);
}

.wp-block-query-pagination a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--halo-radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.wp-block-query-pagination a:hover {
  color: var(--halo-brand);
}

.wp-block-query-pagination a:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.wp-block-query-pagination-numbers a,
.wp-block-query-pagination-numbers span {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: var(--halo-radius-sm);
}

.wp-block-query-pagination-numbers .current {
  background: var(--halo-brand);
  color: #ffffff;
  font-weight: 700;
}

.wp-block-query-pagination .page-numbers {
  border-radius: var(--halo-radius-sm);
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wp-block-query-pagination .page-numbers.current {
  background: var(--halo-brand);
  color: #ffffff;
  font-weight: 700;
}

.halo-breadcrumbs {
  font-size: var(--wp--preset--font-size--small);
  line-height: 1.4;
  margin-bottom: var(--halo-space-md);
}

.halo-breadcrumbs__list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--halo-space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.halo-breadcrumbs__item {
  align-items: center;
  display: inline-flex;
  gap: var(--halo-space-xs);
}

.halo-breadcrumbs__link {
  color: var(--halo-text-muted);
  text-decoration: none;
}

.halo-breadcrumbs__link:hover {
  color: var(--halo-brand);
  text-decoration: underline;
}

.halo-breadcrumbs__sep {
  color: var(--halo-border);
  user-select: none;
}

.halo-breadcrumbs__current {
  color: var(--halo-text);
  font-weight: 700;
}

.halo-author-bio .wp-block-post-author {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.halo-post-author-box .wp-block-post-author {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.halo-post-navigation {
  padding: var(--halo-space-md) 0;
}

.halo-post-navigation .wp-block-post-navigation-link {
  max-width: 48%;
}

.halo-post-navigation .wp-block-post-navigation-link a {
  color: var(--halo-text);
  text-decoration: none;
}

.halo-post-navigation .wp-block-post-navigation-link a:hover {
  color: var(--halo-brand);
}

.halo-post-tags a {
  background: var(--halo-component-bg);
  border: 1px solid var(--halo-component-border);
  border-radius: var(--halo-radius-pill);
  color: var(--halo-text);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  margin: 0.2rem 0.35rem 0.2rem 0;
  padding: 0.35rem 0.6rem;
  text-decoration: none;
  text-transform: uppercase;
}

.halo-post-tags a:hover {
  border-color: var(--halo-brand);
  color: var(--halo-brand);
}

.halo-related-grid {
  display: grid;
  gap: var(--halo-space-md);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.halo-related-grid .halo-card {
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--halo-motion-fast) ease,
    box-shadow var(--halo-motion-fast) ease;
}

.halo-related-grid .halo-card:hover {
  border-color: color-mix(in srgb, var(--halo-brand) 45%, var(--halo-border));
  box-shadow: var(--halo-shadow-hover);
}

.halo-related-card__image {
  aspect-ratio: var(--halo-card-media-ratio);
  background: color-mix(in srgb, var(--halo-surface) 72%, var(--halo-brand));
  display: block;
  overflow: hidden;
}

.halo-related-card__image img {
  aspect-ratio: var(--halo-card-media-ratio);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.halo-related-grid .wp-block-post-title {
  line-height: 1.25;
  margin-bottom: var(--halo-space-xs);
  margin-top: 0;
}

.halo-related-grid .wp-block-post-title a {
  text-decoration: none;
}

.wp-block-term-description {
  margin-bottom: var(--halo-space-md);
}

@media (max-width: 720px) {
  .halo-related-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (hover: hover) {
  .halo-card {
    transition:
      border-color var(--halo-motion-fast) ease,
      box-shadow var(--halo-motion-fast) ease,
      transform var(--halo-motion-fast) ease;
  }

  .halo-card:hover,
  .halo-post-card:hover {
    border-color: color-mix(in srgb, var(--halo-brand) 32%, var(--halo-border));
    box-shadow: var(--halo-shadow-hover);
    transform: translateY(-2px);
  }

  .halo-post-card:hover .halo-post-card__image img {
    opacity: 0.94;
    transform: scale(1.02);
  }

  button:hover,
  .wp-element-button:hover,
  .wp-block-button__link:hover,
  .wp-block-search__button:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 900px) {
  .halo-main-grid {
    display: block;
  }

  .halo-sidebar {
    margin-top: var(--halo-space-lg);
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 64px;
  }

  .halo-site-header {
    min-height: 60px;
  }

  .halo-desktop-nav {
    display: none !important;
  }

  .halo-mobile-bottom-nav {
    display: block;
  }

  .halo-utility-bar {
    display: none;
  }

  .wp-block-halo-hero-grid.halo-hero-grid,
  .halo-feed-card {
    grid-template-columns: 1fr;
  }

  .halo-hero-grid__item--1 {
    grid-row: auto;
  }

  .halo-hero-grid > :first-child {
    grid-row: auto;
  }

  .halo-trending-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .halo-trending-query .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }

  .halo-post-list,
  .halo-placeholder-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 520px) {
  .wp-block-halo-section-heading.halo-section-heading {
    grid-template-columns: 1fr;
  }
}

/* Loading skeleton */
@keyframes halo-skeleton-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.4; }
}

.halo-loading-skeleton {
  animation: halo-skeleton-pulse 1.8s ease-in-out infinite;
  background: var(--halo-border);
  border-radius: var(--halo-radius-md);
}

.halo-loading-skeleton--text {
  height: 1rem;
  margin-bottom: var(--halo-space-xs);
}

.halo-loading-skeleton--text-short {
  width: 60%;
}

.halo-loading-skeleton--title {
  height: 1.25rem;
  width: 80%;
  margin-bottom: var(--halo-space-xs);
}

.halo-loading-skeleton--media {
  aspect-ratio: var(--halo-card-media-ratio);
  width: 100%;
}

/* Fade-slide-in animation for cards and components */
@keyframes halo-fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.halo-fade-slide-in {
  animation: halo-fade-slide-in var(--halo-motion-medium) ease-out both;
}

.halo-fade-slide-in--delay-1 { animation-delay: 60ms; }
.halo-fade-slide-in--delay-2 { animation-delay: 120ms; }
.halo-fade-slide-in--delay-3 { animation-delay: 180ms; }
.halo-fade-slide-in--delay-4 { animation-delay: 240ms; }

/* Sidebar collapse toggle (YouTube-style) */
.halo-sidebar-toggle-wrapper {
  display: none;
}

.halo-sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--halo-border);
  border-radius: 999px;
  color: var(--halo-text-muted);
  cursor: pointer;
  min-height: 40px;
  min-width: 40px;
  padding: 0.4rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.halo-sidebar-toggle-btn:hover {
  background: color-mix(in srgb, var(--halo-brand) 14%, transparent);
  color: var(--halo-brand);
  border-color: var(--halo-brand);
}

.halo-sidebar-toggle-btn:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-sidebar-toggle-btn svg {
  display: block;
  height: 20px;
  width: 20px;
}

.halo-sidebar.is-collapsed {
  display: none;
}

.halo-main-grid.has-collapsed-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 901px) {
  .halo-sidebar-toggle-wrapper {
    display: block;
  }
}

/* Back to top button */
.halo-back-to-top {
  background: var(--halo-surface);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-pill);
  bottom: var(--halo-space-lg);
  color: var(--halo-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  opacity: 0;
  padding: 0.5rem;
  position: fixed;
  right: var(--halo-space-lg);
  transition:
    opacity var(--halo-motion-fast) ease,
    background-color var(--halo-motion-fast) ease,
    color var(--halo-motion-fast) ease;
  visibility: hidden;
  z-index: 25;
}

.halo-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.halo-back-to-top:hover {
  background: color-mix(in srgb, var(--halo-brand) 14%, transparent);
  color: var(--halo-brand);
}

.halo-back-to-top:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
}

.halo-back-to-top svg {
  display: block;
  height: 20px;
  width: 20px;
}

@media (max-width: 720px) {
  .halo-back-to-top {
    bottom: calc(64px + var(--halo-space-md));
  }
}

/* Integration slot placeholders */
.halo-integration-slot {
  min-height: 120px;
}

.halo-integration-slot:empty {
  display: none;
}

/* Post list grid layout support */
.halo-post-list {
  display: grid;
  gap: var(--halo-space-md);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 720px) {
  .halo-post-list {
    grid-template-columns: 1fr !important;
  }
}

/* Sidebar sidebar item gap */
.halo-sidebar .wp-block-query .wp-block-post-template {
  display: flex;
  flex-direction: column;
  gap: var(--halo-space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.halo-sidebar .wp-block-post-title {
  margin: 0;
  line-height: 1.3;
}

.halo-sidebar .wp-block-post-date {
  margin: 0;
}

/* Footer social navigation */
.halo-footer-social {
  display: flex;
  gap: var(--halo-space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.halo-footer-social a {
  color: var(--halo-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  text-decoration: none;
  transition: color var(--halo-motion-fast) ease;
}

.halo-footer-social a:hover {
  color: var(--halo-brand);
}

.halo-footer-social a:focus-visible {
  outline: 2px solid var(--halo-focus);
  outline-offset: 2px;
  border-radius: var(--halo-radius-sm);
}

/* Skip link wrapper */
.halo-skip-link-wrapper {
  margin: 0;
  padding: 0;
}

.halo-skip-link-wrapper > .halo-skip-link {
  position: absolute;
}

/* Table styles */
.wp-block-table {
  border-collapse: collapse;
  width: 100%;
}

.wp-block-table th,
.wp-block-table td {
  border: 1px solid var(--halo-border);
  padding: var(--halo-space-xs) var(--halo-space-sm);
  text-align: left;
}

.wp-block-table th {
  background: var(--halo-surface);
  font-weight: 700;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background: var(--halo-surface);
}

/* Code block styles */
.wp-block-code code {
  background: var(--halo-surface);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-sm);
  color: var(--halo-accent);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.2em 0.4em;
}

.wp-block-preformatted pre,
.wp-block-code pre {
  background: var(--halo-surface);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-md);
  overflow-x: auto;
  padding: var(--halo-space-md);
}

/* Empty states */
.halo-empty-state {
  background: var(--halo-component-bg);
  border: 1px solid var(--halo-component-border);
  border-radius: var(--halo-radius-md);
  padding: var(--halo-space-xl) var(--halo-space-md);
  text-align: center;
}

.halo-empty-state__icon {
  color: var(--halo-text-muted);
  display: block;
  font-size: 2.5rem;
  margin-bottom: var(--halo-space-sm);
}

.halo-empty-state__title {
  font-size: var(--wp--preset--font-size--large);
  font-weight: 700;
  margin: 0 0 var(--halo-space-xs);
}

.halo-empty-state__text {
  color: var(--halo-text-muted);
  margin: 0;
}

.halo-empty-state__action {
  display: inline-block;
  margin-top: var(--halo-space-md);
}

/* Navigation accessibility */
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
  background: var(--halo-surface);
  border: 1px solid var(--halo-border);
  border-radius: var(--halo-radius-md);
  box-shadow: var(--halo-shadow-card);
  padding: var(--halo-space-xs) 0;
}

.wp-block-navigation__responsive-container-open:focus-visible {
  outline-offset: 2px;
}

/* Search accessibility */
.wp-block-search__input:focus {
  border-color: var(--halo-focus);
}

/* Post terms / tag links focus */
.halo-post-tags a:focus-visible,
.taxonomy-category a:focus-visible,
.wp-block-post-terms a:focus-visible {
  outline-offset: 0;
}

/* Related posts card */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .halo-card:hover {
    transform: none !important;
  }

  button:hover,
  .wp-element-button:hover,
  .wp-block-button__link:hover,
  .wp-block-search__button:hover {
    transform: none !important;
  }

  html {
    scroll-behavior: auto !important;
  }

  .halo-loading-skeleton {
    animation: none !important;
    background: var(--halo-border) !important;
  }

  .halo-fade-slide-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
