/* ==========================================================================
   05-astra-overrides.css  |  RESTYLING ASTRA'S OWN PARTS + PLUGIN OUTPUT
   --------------------------------------------------------------------------
   The header, footer, blog and form markup is generated by Astra / WPForms,
   so we cannot add our classes to it. Instead we target THEIR class names.
   If a future Astra update renames a class, this is the ONLY file to check.

   CONTENTS
     1  Header (sticky, frosted glass, menu, button)
     2  Footer (dark navy)
     3  Forms (WPForms Lite + generic inputs)
     4  Blog list + single post
     5  Misc (scroll-to-top)

   REQUIREMENT: Appearance > Customize > Header Builder > Mobile menu type must
   stay "Dropdown" (default). A glass header (backdrop-filter) breaks Astra's
   "Off-canvas flyout" menu because it traps fixed-position children.
   ========================================================================== */


/* ---------- 1. Header ---------- */

/* Sticky header: stays at the top while scrolling. Uses CSS only (Astra's own
   sticky header is a Pro feature). Offset by the WP admin bar when logged in. */
#masthead.site-header { position: sticky; top: 0; z-index: var(--cds-z-header); }
.admin-bar #masthead.site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar #masthead.site-header { top: 46px; } }

/* Frosted glass bar. ID selector (#masthead) beats Astra's colour settings. */
#masthead .main-header-bar,
#masthead .ast-primary-header-bar,
#masthead .ast-above-header-bar,
#masthead .ast-below-header-bar {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
          backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid rgba(17, 17, 67, 0.08);
  transition: box-shadow var(--cds-speed) var(--cds-ease), background var(--cds-speed) var(--cds-ease);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #masthead .main-header-bar, #masthead .ast-primary-header-bar { background: rgba(255, 255, 255, 0.97); }
}
/* cds.js adds .cds-is-scrolled to <html> after the page scrolls a little */
.cds-is-scrolled #masthead .main-header-bar,
.cds-is-scrolled #masthead .ast-primary-header-bar { box-shadow: var(--cds-shadow-md); background: rgba(255, 255, 255, 0.86); }

/* Logo size (the real size can also be set in Customizer > Site Identity) */
#masthead .custom-logo-link img,
#masthead .site-logo-img img { width: auto; max-height: 2.25rem; }
@media (min-width: 64em) { #masthead .custom-logo-link img, #masthead .site-logo-img img { max-height: 2.5rem; } }

/* Menu links */
#masthead .main-header-menu > .menu-item > .menu-link,
#masthead .ast-builder-menu .menu-link {
  font-family: var(--cds-font-heading); font-size: 0.9375rem; font-weight: 500;
  color: var(--cds-ink); border-radius: var(--cds-radius-pill);
  transition: color var(--cds-speed), background var(--cds-speed);
}
#masthead .main-header-menu > .menu-item > .menu-link:hover,
#masthead .main-header-menu > .menu-item.current-menu-item > .menu-link,
#masthead .main-header-menu > .menu-item.current_page_item > .menu-link { color: var(--cds-blue); }

/* Drop-down sub menus (Services > Web, SEO ...) */
#masthead .sub-menu {
  padding: 0.5rem; border: 1px solid var(--cds-border); border-radius: var(--cds-radius-md);
  background: var(--cds-white); box-shadow: var(--cds-shadow-lg);
}
#masthead .sub-menu .menu-link { border: 0; border-radius: var(--cds-radius-sm); }
#masthead .sub-menu .menu-link:hover { background: var(--cds-cream); }

/* Header call-to-action button ("Book a call") from Astra's Button element */
#masthead .ast-header-button-1 .ast-custom-button,
#masthead .ast-custom-button {
  min-height: 2.75rem; padding: 0.55rem 1.4rem;
  font-family: var(--cds-font-heading); font-size: 0.9375rem; font-weight: 600;
  color: var(--cds-white); background: var(--cds-blue);
  border: 2px solid var(--cds-blue); border-radius: var(--cds-radius-pill);
  transition: background var(--cds-speed), border-color var(--cds-speed), transform var(--cds-speed);
}
#masthead .ast-custom-button:hover { color: var(--cds-white); background: var(--cds-navy); border-color: var(--cds-navy); transform: translateY(-1px); }

/* Mobile menu panel (dropdown type) */
#masthead .ast-mobile-header-content, .ast-header-break-point .main-header-menu {
  background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--cds-border);
}
.ast-header-break-point .main-header-menu .menu-link { font-size: 1.0625rem; padding-block: 0.85rem; }
.ast-mobile-menu-buttons .menu-toggle { border-radius: var(--cds-radius-sm); }


/* ---------- 2. Footer ---------- */
.site-footer { color: rgba(255, 255, 255, 0.78); background: var(--cds-navy); }
.site-footer .site-primary-footer-wrap,
.site-footer .site-above-footer-wrap,
.site-footer .site-below-footer-wrap { background: transparent; }
.site-footer .site-primary-footer-wrap { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.site-footer .site-below-footer-wrap { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.site-footer a { color: var(--cds-blue-200); text-decoration: none; }
.site-footer a:hover { color: var(--cds-white); text-decoration: underline; }
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4,
.site-footer .widget-title { color: var(--cds-white); font-size: var(--cds-fs-h4); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer .custom-logo-link img { max-height: 2.5rem; width: auto; }


/* ---------- 3. Forms ---------- */
/* Inputs are 16px minimum: smaller text makes iPhones zoom in on focus. */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="search"], input[type="number"], textarea, select,
div.wpforms-container-full .wpforms-form .wpforms-field input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
div.wpforms-container-full .wpforms-form .wpforms-field textarea,
div.wpforms-container-full .wpforms-form .wpforms-field select {
  width: 100%; max-width: 100%; min-height: 3rem; padding: 0.7rem 1rem;
  font-family: var(--cds-font-body); font-size: 1rem; color: var(--cds-ink);
  background: var(--cds-white); border: 1.5px solid #cfcfd6; border-radius: var(--cds-radius-sm);
  transition: border-color var(--cds-speed), box-shadow var(--cds-speed);
}
textarea, div.wpforms-container-full .wpforms-form .wpforms-field textarea { min-height: 9rem; }
input:focus, textarea:focus, select:focus,
div.wpforms-container-full .wpforms-form .wpforms-field input:focus,
div.wpforms-container-full .wpforms-form .wpforms-field textarea:focus {
  border-color: var(--cds-blue); box-shadow: 0 0 0 4px rgba(47, 57, 255, 0.15); outline: none;
}
div.wpforms-container-full .wpforms-form .wpforms-field-label {
  font-family: var(--cds-font-heading); font-size: 0.9375rem; font-weight: 600; color: inherit;
}
/* Submit button = primary button look */
div.wpforms-container-full .wpforms-form button[type="submit"],
input[type="submit"], button[type="submit"] {
  min-height: 3rem; padding: 0.75rem 1.8rem; cursor: pointer;
  font-family: var(--cds-font-heading); font-size: 1rem; font-weight: 600;
  color: var(--cds-white); background: var(--cds-blue);
  border: 2px solid var(--cds-blue); border-radius: var(--cds-radius-pill);
  transition: background var(--cds-speed), border-color var(--cds-speed), transform var(--cds-speed);
}
div.wpforms-container-full .wpforms-form button[type="submit"]:hover,
input[type="submit"]:hover, button[type="submit"]:hover { background: var(--cds-navy); border-color: var(--cds-navy); transform: translateY(-2px); }
/* A glass card to hold the contact form: <div class="cds-card cds-card--glass"> [wpforms] </div> */


/* ---------- 4. Blog ---------- */
/* Archive cards */
.blog .ast-article-post .ast-article-inner,
.archive .ast-article-post .ast-article-inner {
  overflow: hidden; border: 1px solid var(--cds-border); border-radius: var(--cds-radius-lg);
  background: var(--cds-white); box-shadow: var(--cds-shadow-sm);
  transition: transform var(--cds-speed) var(--cds-ease), box-shadow var(--cds-speed) var(--cds-ease);
}
.blog .ast-article-post .ast-article-inner:hover,
.archive .ast-article-post .ast-article-inner:hover { transform: translateY(-4px); box-shadow: var(--cds-shadow-lg); }
.blog .entry-title, .archive .entry-title { font-size: var(--cds-fs-h3); }
.blog .entry-title a, .archive .entry-title a { color: var(--cds-ink); text-decoration: none; }
.blog .entry-title a:hover, .archive .entry-title a:hover { color: var(--cds-blue); }
.post-thumb-img-content img, .wp-post-image { border-radius: var(--cds-radius-md); }

/* Single post: comfortable reading */
.single-post .entry-title { font-size: var(--cds-fs-h1); }
.single-post .entry-content { font-size: var(--cds-fs-body); line-height: 1.75; }
.single-post .entry-content h2 { margin-top: 1.8em; }
.single-post .entry-content img { border-radius: var(--cds-radius-md); }
.entry-content blockquote { margin: 1.5em 0; padding: 0.25em 0 0.25em 1.25rem; border-left: 4px solid var(--cds-blue); font-size: 1.1em; }


/* ---------- 5. Misc ---------- */
#ast-scroll-top { color: var(--cds-white); background: var(--cds-blue); border-radius: 50%; }
#ast-scroll-top:hover { background: var(--cds-navy); }
/* The page title is hidden by functions.php (we write our own H1 in content),
   so collapse the empty header block Astra may still print. */
.page .entry-header:empty { display: none; }
