/*
Theme Name: Twenty Twenty-Five Child
Theme URI: https://wordpress.org/themes/twentytwentyfive/
Description: Child theme for Twenty Twenty-Five with custom sticky header
Author: Your Name
Template: twentytwentyfive
Version: 1.0
Text Domain: twentytwentyfive-child
*/

/* ------------------------------------------------------------
   Sticky Header
   ------------------------------------------------------------ */

/*
  This targets the Header template part when it has
  className: "site-header"
*/
.wp-site-blocks > .wp-block-template-part.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #ffffff;
}

/*
  Sticky often fails if any ancestor has overflow hidden/auto.
  This ensures sticky can work.
*/
.wp-site-blocks,
html,
body {
  overflow: visible;
}

/* Optional: subtle shadow so the header is visually separated */
.wp-site-blocks > .wp-block-template-part.site-header {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------
   Optional tweaks (safe to remove if not needed)
   ------------------------------------------------------------ */

/* Improve focus outline visibility */
:where(.wp-site-blocks *:focus) {
  outline-width: 2px;
  outline-style: solid;
}

/* Navigation submenu spacing improvements */
.wp-block-navigation
.wp-block-navigation-submenu
.wp-block-navigation-item:not(:last-child) {
  margin-bottom: 3px;
}

/* Prevent horizontal scrollbar on long <pre> blocks */
:where(pre) {
  overflow-x: auto;
}

/* === Sticky site header (block themes) === */
/* Target the header template part whether it's a header or div */
.wp-site-blocks > .wp-block-template-part {
  position: sticky !important;
  top: 0 !important;
  z-index: 99999 !important;
  background: #fff !important;
}

/* Logged-in: keep below WP admin bar */
body.admin-bar .wp-site-blocks > .wp-block-template-part {
  top: 32px !important;
}

/* Sticky commonly breaks when ancestors constrain overflow or create new stacking contexts */
html, body, .wp-site-blocks {
  overflow: visible !important;
}

/* Extra: if any wrapper is using transform/filter, sticky may fail; this helps in many themes */
.wp-site-blocks {
  transform: none !important;
  filter: none !important;
}