/*
Theme Name: Hyppychick
Theme URI: 
Author: Hyppychick
Author URI: 
Description: A modern, customizable WordPress theme with flexible header and footer options, Google Fonts integration, and advanced page styling controls.
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hyppychick
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

Hyppychick Theme, (C) 2024
*/

/* ==========================================================================
   CSS Variables - Brand Colors
   ========================================================================== */
:root {
  --hyppychick-brand-primary: #4c5270;
  --hyppychick-brand-secondary: #5a6180;
  --hyppychick-brand-accent: #f3db9b;
  --hyppychick-brand-dark: #4c5270;
  --hyppychick-brand-light: #f7f7f7;

  --hyppychick-header-bg: var(--hyppychick-brand-dark);
  --hyppychick-header-text: var(--hyppychick-brand-light);
  --hyppychick-header-link: var(--hyppychick-brand-light);
  --hyppychick-header-link-hover: var(--hyppychick-brand-accent);

  --hyppychick-footer-bg: var(--hyppychick-brand-dark);
  --hyppychick-footer-text: var(--hyppychick-brand-light);
  --hyppychick-footer-link: var(--hyppychick-brand-light);
  --hyppychick-footer-link-hover: var(--hyppychick-brand-accent);

  --hyppychick-content-bg: rgba(76, 82, 112, 0.85);
  --hyppychick-content-text: #f7f7f7;
  --hyppychick-content-link: var(--hyppychick-brand-accent);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

@font-face {
  font-family: "Kalivo-Regular";
  src:
    url("assets/fonts/Kalivo-Regular.ttf.woff") format("woff"),
    url("assets/fonts/Kalivo-Regular.ttf.svg#Kalivo-Regular") format("svg"),
    url("assets/fonts/Kalivo-Regular.ttf.eot"),
    url("assets/fonts/Kalivo-Regular.eot?#iefix") format("embedded-opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Sumptuous-Light";
  src:
    url("assets/fonts/Sumptuous-Light.ttf.woff") format("woff"),
    url("assets/fonts/Sumptuous-Light.ttf.svg#Sumptuous-Light") format("svg"),
    url("assets/fonts/Sumptuous-Light.ttf.eot"),
    url("assets/fonts/Sumptuous-Light.eot?#iefix") format("embedded-opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Eleganto-Sans-Thin";
  src:
    url("assets/fonts/Eleganto-Sans-Thin.ttf.woff") format("woff"),
    url("assets/fonts/Eleganto-Sans-Thin.ttf.svg#Eleganto-Sans-Thin")
      format("svg"),
    url("assets/fonts/Eleganto-Sans-Thin.ttf.eot"),
    url("assets/fonts/Eleganto-Sans-Thin.eot?#iefix")
      format("embedded-opentype");
  font-weight: normal;
  font-style: normal;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--hyppychick-body-font, "Antic", sans-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--hyppychick-content-text);
  background-color: var(--hyppychick-brand-dark);
  overscroll-behavior: none;
}

.frm_primary_label {
  color: var(--hyppychick-content-text) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--hyppychick-heading-font, "PT Serif", serif);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
}

a {
  color: var(--hyppychick-content-link);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--hyppychick-brand-accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
.site-header {
  background-color: var(--hyppychick-header-bg);
  color: var(--hyppychick-header-text);
  padding: 0.75rem 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.site-header.header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Account for WordPress admin bar when logged in */
.admin-bar .site-header.header-fixed {
  top: var(--wp-admin--admin-bar--height, 32px);
}

@media screen and (max-width: 782px) {
  .admin-bar .site-header.header-fixed {
    top: var(--wp-admin--admin-bar--height, 46px);
  }
}

/* Add spacing for fixed header */
body.has-fixed-header .page-featured-background {
  padding-top: calc(var(--header-height, 160px) + 2rem);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo Positions */
.header-inner.logo-left {
  flex-direction: row;
}

.header-inner.logo-center {
  flex-direction: column;
  text-align: center;
}

.header-inner.logo-center .site-branding {
  justify-content: center;
}

.header-inner.logo-center .site-details {
  align-items: center;
}

.header-inner.logo-center .header-actions {
  align-items: center;
}

.header-inner.logo-right {
  flex-direction: row-reverse;
}

.header-inner.logo-right .site-details {
  align-items: flex-end;
}

.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-logo img {
  max-height: 120px;
  width: auto;
  display: block;
}

/* Site Details - Vertically Centered */
.site-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  gap: 0.125rem;
}

.site-title {
  margin: 0;
  /* Font size controlled by Customizer */
  font-weight: 700;
}

.site-title a {
  color: var(--hyppychick-header-text);
}

.site-title a:hover {
  color: var(--hyppychick-header-link-hover);
}

.site-description {
  margin: 0;
  /* Font size controlled by Customizer */
  opacity: 0.8;
}

/* Header Actions - Menu + Icons stacked right */
.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Header Navigation */
.main-navigation {
  flex-shrink: 0;
}

.primary-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
}

.primary-menu li {
  position: relative;
}

.primary-menu a {
  color: var(--hyppychick-header-link);
  font-weight: 500;
  padding: 0.5rem 0;
  display: block;
}

.primary-menu a:hover {
  color: var(--hyppychick-header-link-hover);
}

/* Current Menu Item Highlight */
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
  color: var(--hyppychick-header-link-hover);
  position: relative;
}

.primary-menu .current-menu-item > a::after,
.primary-menu .current_page_item > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 2px;
  background-color: var(--hyppychick-brand-accent);
}

/* ==========================================================================
   Dropdown Submenus
   ========================================================================== */
.primary-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: var(--hyppychick-header-bg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0;
  z-index: 1000;
  list-style: none;
  margin: 0;
  border-radius: 0 0 4px 4px;
}

.primary-menu li {
  position: relative;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.primary-menu .sub-menu li {
  width: 100%;
}

.primary-menu .sub-menu a {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95em;
  font-weight: 400;
  white-space: normal;
  color: var(--hyppychick-header-link);
}

.primary-menu .sub-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--hyppychick-brand-accent);
}

.primary-menu .sub-menu .current-menu-item > a::after {
  display: none;
}

/* 3rd level submenus */
.primary-menu .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  margin-top: -0.5rem;
}

/* Smart Submenu Positioning (handled by JS) */
.primary-menu > li.menu-align-right > .sub-menu {
  left: auto;
  right: 0;
  border-radius: 0 0 4px 4px;
}

.primary-menu > li.menu-align-right > .sub-menu .sub-menu {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: -0.5rem; /* Slight overlap or adjustment matching standard's -0.5rem top */
  /* Standard was margin-top: -0.5rem for vertical. Horizontal needs no margin correction usually unless styled specifically */
}

/* Header Icons */
.header-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.header-icon {
  color: var(--hyppychick-header-link);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.3s ease;
  background: none;
  border: none;
  padding: 0.5rem;
}

.header-icon:hover {
  color: var(--hyppychick-header-link-hover);
}

.header-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
}

/* Header CTA Button */
.header-cta {
  display: inline-block;
  padding: 0.3rem 1.25rem;
  border: 1px solid var(--hyppychick-header-link);
  border-radius: 0;
  color: var(--hyppychick-header-link);
  background: transparent;
  font-family: var(--hyppychick-body-font);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.header-cta:hover {
  color: var(--hyppychick-brand-accent);
  border-color: var(--hyppychick-brand-accent);
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.search-overlay.active {
  display: flex;
}

.search-overlay-inner {
  width: 100%;
  max-width: 600px;
  padding: 2rem;
}

.search-overlay .search-field {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.5rem;
  border: none;
  border-bottom: 2px solid var(--hyppychick-brand-primary);
  background: transparent;
  color: #fff;
}

.search-overlay .search-field:focus {
  outline: none;
  border-color: var(--hyppychick-brand-accent);
}

.search-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
}

/* Mobile Menu Toggle */
.menu-toggle,
.dropdown-toggle {
  display: none;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--hyppychick-header-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: currentColor;
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Mobile specific header adjustments */
@media (max-width: 768px) {
  /* Reduce header padding to give more space and push hamburger right */
  .header-inner {
    padding: 0;
    gap: 0.75rem;
  }

  /* Update Flex Order */
  .menu-toggle {
    display: block;
    order: 3; /* Last item */
    margin-left: auto; /* Push to far right */
    /* padding-right: 0; Align perfectly with edge */
  }

  /* Ensure search button inside menu is visible/styled */
  .header-actions .search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--hyppychick-header-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-bottom: 1rem; /* Space in the vertical stack */
  }

  /* Mobile Header Sizing - Controlled by Customizer/functions.php now */
  .site-logo img {
    /* Max height controlled by functions.php */
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: center; /* Ensure vertical alignment */
  }

  /* Flex Order Control */
  .site-branding {
    flex: 0 0 auto;
    order: 1;
    padding: 0 0.5rem;
  }

  .site-details {
    flex: 1;
    align-items: flex-start;
    min-width: 0;
    order: 2;
    column-gap: 0;
    row-gap: 0;
  }

  .site-title {
    /* Font size controlled by Customizer */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  .site-description {
    /* Font size controlled by Customizer */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  /* Ensure header acts as positioning anchor */
  .site-header {
    position: relative;
  }

  /* Floating Overlay Menu */
  .header-actions {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 85%; /* Wider on small screens for better CTA fit */
    max-width: 320px;

    background-color: var(--hyppychick-header-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 2000;

    flex-direction: column;
    padding: 1.5rem; /* Added padding for better spacing */
  }

  .header-actions.active {
    display: flex;
  }

  /* Mobile Menu Header Icons (CTA) */
  .header-actions .header-icons {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem; /* Space between CTA and Menu */
  }

  .header-actions .header-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
    margin: 0;
  }

  .main-navigation {
    width: 100%;
    display: block;
  }

  .primary-menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  /* Removed extra closing brace from previous edit if it existed */

  .primary-menu li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .primary-menu a {
    padding: 1rem 0;
    border-bottom: none;
    text-align: left;
    flex: 1;
  }

  /* Remove Active Highlight on Mobile */
  .primary-menu .current-menu-item > a,
  .primary-menu .current_page_item > a {
    color: var(--hyppychick-header-link);
  }

  .primary-menu .current-menu-item > a::after,
  .primary-menu .current_page_item > a::after {
    display: none;
  }

  /* Toggle Button Styles */
  .dropdown-toggle {
    background: transparent;
    border: none;
    color: var(--hyppychick-header-text);
    padding: 0.5rem 1rem;
    cursor: pointer;
    align-self: stretch;
    display: flex;
    align-items: center;
  }

  .dropdown-toggle svg {
    transition: transform 0.3s ease;
  }

  .dropdown-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  /* Mobile Submenu Overrides - Scoped to active menu only */

  /* Hide submenu by default on mobile */
  .header-actions.active .primary-menu .sub-menu {
    position: static;
    display: none; /* Changed from block to none */
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0;
    min-width: auto;
    width: 100%;
    animation: none;
    border-radius: 0;
  }

  /* Show submenu when toggled */
  .header-actions.active .primary-menu .sub-menu.toggled-on {
    display: block;
    animation: fadeIn 0.3s ease;
  }

  .header-actions.active .primary-menu .sub-menu a {
    padding: 0.8rem 1rem; /* indentation */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9em;
  }

  /* Reset 3rd level positioning */
  .header-actions.active .primary-menu .sub-menu .sub-menu {
    left: auto;
    top: auto;
    margin-top: 0;
    background-color: rgba(0, 0, 0, 0.15);
  }

  .header-actions.active .primary-menu .sub-menu .sub-menu a {
    padding-left: 2rem; /* deeper indentation */
  }

  .header-icons {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Page Content Area with Featured Image Background
   ========================================================================== */
.page-featured-background {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4rem 2rem;
}

.page-featured-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.page-featured-background.bg-attachment-fixed::before {
  background-attachment: fixed;
}

.page-featured-background.bg-attachment-scroll::before {
  background-attachment: scroll;
}

.page-featured-background.bg-size-cover::before {
  background-size: cover;
}

.page-featured-background.bg-size-contain::before {
  background-size: contain;
}

/* Content Box */
.content-box {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem;
  background-color: var(--hyppychick-content-bg);
  border-radius: 8px;
}

.content-box > *:first-child {
  margin-top: 0;
}

.content-box > *:last-child {
  margin-bottom: 0;
}

.content-box.has-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Content Box Alignment */
.content-box.align-left {
  /* Align to the 1400px grid left edge (accounting for parent 2rem padding) */
  margin-left: max(0px, calc((100% - 1400px) / 2));
  margin-right: auto;
}

.content-box.align-center {
  margin-left: auto;
  margin-right: auto;
}

.content-box.align-right {
  margin-left: auto;
  /* Align to the 1400px grid right edge */
  margin-right: max(0px, calc((100% - 1400px) / 2));
}

/* Content Box Widths */
.content-box.width-narrow {
  max-width: 600px;
}

.content-box.width-medium {
  max-width: 800px;
}

.content-box.width-wide {
  max-width: 1000px;
}

.content-box.width-full {
  max-width: 100%;
  margin-left: 2rem;
  margin-right: 2rem;
}

/* Page Content Typography */
.entry-header {
  margin-bottom: 2rem;
}

.entry-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.entry-content {
  font-size: 1.125rem;
}

.entry-content p {
  margin-bottom: 1.5rem;
}

.entry-content h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.entry-content h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */
.site-footer {
  background-color: var(--hyppychick-footer-bg);
  color: var(--hyppychick-footer-text);
  padding: 0;
  z-index: 1000;
}

/* Constrain Footer Images */
.site-footer img {
  height: auto;
  width: auto;
  max-height: var(--hyppychick-footer-img-height, 80px);
  max-width: 100%; /* Prevent overflow if image is wide */
}

.site-footer.footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* Add spacing for fixed footer - applied to main content, not body */
body.has-fixed-footer .page-featured-background {
  padding-bottom: calc(var(--footer-height, 200px) + 2rem);
}

.footer-widgets {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.footer-widget {
  padding: 0.5rem;
}

.footer-widget h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--hyppychick-footer-text);
}

.footer-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-widget ul li {
  margin-bottom: 0.25rem;
}

.footer-widget a {
  color: var(--hyppychick-footer-link);
}

.footer-widget a:hover {
  color: var(--hyppychick-footer-link-hover);
}

/* Footer Bottom Row */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 2rem; /* Reduced padding */
}

.footer-bottom-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
  align-items: center; /* Vertically center content */
}

.footer-bottom-widget {
  padding: 0;
}

.footer-bottom-widget p {
  margin: 0; /* Remove default paragraph margins in footer bottom */
}

.footer-bottom-widget.copyright {
  opacity: 0.8;
  font-size: 0.8rem;
}

/* Align Right Widget */
.footer-bottom-right {
  text-align: right;
  justify-self: end; /* Ensure grid item aligns to end */
}

/* Align Left Widget (optional symmetry) */
.footer-bottom-left {
  text-align: left;
  justify-self: start;
}

@media (max-width: 768px) {
  .footer-widgets,
  .footer-bottom-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Force center alignment on mobile */
  .footer-bottom-left,
  .footer-bottom-right,
  .footer-bottom-widget {
    text-align: center;
    justify-self: center;
  }
}

/* Footer Navigation Bar */
.footer-navigation-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
}

.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-menu > li {
  position: relative;
  padding: 0.5rem 0; /* Increase hit area */
}

.footer-menu a {
  color: var(--hyppychick-footer-link);
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
}

.footer-menu a:hover {
  color: var(--hyppychick-footer-link-hover);
}

/* Pull-Up Submenus (Dropup) for Footer Styles - Targets both Theme Location & Widgets */
.footer-menu .sub-menu,
.footer-widget .menu .sub-menu,
.widget_nav_menu .sub-menu {
  display: none; /* Hide by default */
  position: absolute;
  bottom: 100%; /* Push upwards */
  left: 50%;
  transform: translateX(-50%); /* Center align */
  background-color: var(--hyppychick-brand-dark);
  min-width: 200px;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0;
  margin-bottom: 0.5rem; /* Space from trigger */
  border-radius: 4px;
  z-index: 1000;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Arrow pointer at bottom of dropup */
.footer-menu .sub-menu::after,
.footer-widget .menu .sub-menu::after,
.widget_nav_menu .sub-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--hyppychick-brand-dark) transparent transparent transparent;
}

.footer-menu li:hover > .sub-menu,
.footer-menu li:focus-within > .sub-menu,
.footer-widget .menu li:hover > .sub-menu,
.footer-widget .menu li:focus-within > .sub-menu,
.widget_nav_menu li:hover > .sub-menu,
.widget_nav_menu li:focus-within > .sub-menu {
  display: block;
  animation: fadeUp 0.2s ease;
}

.footer-menu .sub-menu li,
.footer-widget .menu .sub-menu li,
.widget_nav_menu .sub-menu li {
  display: block;
}

.footer-menu .sub-menu a,
.footer-widget .menu .sub-menu a,
.widget_nav_menu .sub-menu a {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--hyppychick-footer-text);
  display: block; /* Ensure full width hover */
}

.footer-menu .sub-menu a:hover,
.footer-widget .menu .sub-menu a:hover,
.widget_nav_menu .sub-menu a:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--hyppychick-brand-accent);
}

/* Ensure Widget Menus Have Relative Positioning for Dropups */
.footer-widget .menu li,
.widget_nav_menu li {
  position: relative;
  list-style: none;
}

/* Ensure Widget Menus are displayed inline if intended to look like a bar, 
   otherwise, they stack. For consistency with footer-menu, we can make them flex 
   if they are inside the footer-bottom area, or keep them stacked in main footer widgets. */

/* Specific fix for Navigation Menu Widgets in Footer Bottom */
.footer-bottom-widget .widget_nav_menu .menu {
  /* display: flex; */
  justify-content: center;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.footer-bottom-widget .widget_nav_menu .menu > li > a {
  color: var(--hyppychick-footer-link);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 768px) {
  .footer-menu {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   WordPress Core Styles
   ========================================================================== */
.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.875rem;
  font-style: italic;
  opacity: 0.8;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */
.widget {
  margin-bottom: 2rem;
}

/* Remove margin from footer widgets */
.site-footer .widget,
.site-footer .footer-bottom-widget .wp-block-image {
  margin-bottom: 0;
}
.widget-title {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--hyppychick-brand-primary);
}

button,
input[type="submit"] {
  background: var(--hyppychick-brand-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

button:hover,
input[type="submit"]:hover {
  background: var(--hyppychick-brand-secondary);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ==========================================================================
   Posts List Styles
   ========================================================================== */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.posts-list article {
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.posts-list article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.entry-meta {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

.entry-meta span {
  margin-right: 1rem;
}

.entry-summary {
  margin: 1rem 0;
}

.read-more {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--hyppychick-brand-primary);
  color: #fff;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.read-more:hover {
  background: var(--hyppychick-brand-secondary);
  color: #fff;
}

/* ==========================================================================
   Archive & Search Styles
   ========================================================================== */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.archive-description {
  opacity: 0.8;
}

/* ==========================================================================
   Search Form Styles
   ========================================================================== */
.search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 500px;
}

.search-form .search-field {
  flex: 1;
}

.search-form .search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
}

.search-form .search-submit svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Comments Styles
   ========================================================================== */
.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list .comment {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-list .comment:last-child {
  border-bottom: none;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.comment-author .avatar {
  border-radius: 50%;
}

.comment-author .fn {
  font-weight: 600;
}

.comment-metadata {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-bottom: 1rem;
}

.comment-content {
  padding-left: 0;
}

.comment-content p {
  margin-bottom: 1rem;
}

.comment-reply-link {
  font-size: 0.875rem;
  font-weight: 500;
}

.comment-respond {
  margin-top: 2rem;
}

.comment-reply-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  margin-bottom: 1rem;
}

.comment-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* ==========================================================================
   Post Navigation
   ========================================================================== */
.post-navigation {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.nav-previous,
.nav-next {
  flex: 1;
}

.nav-next {
  text-align: right;
}

.nav-subtitle {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 0.25rem;
}

.nav-title {
  font-weight: 600;
}

/* Posts Navigation (archive) */
.posts-navigation {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Tags and Categories
   ========================================================================== */
.tags-links {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tags-label {
  font-weight: 600;
  margin-right: 0.5rem;
}

.tags-links a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.875rem;
}

.tags-links a:hover {
  background: var(--hyppychick-brand-primary);
  color: #fff;
}

/* ==========================================================================
   Edit Link
   ========================================================================== */
.edit-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.edit-link a {
  opacity: 0.6;
}

.edit-link a:hover {
  opacity: 1;
}

/* ==========================================================================
   404 Page
   ========================================================================== */
.error-404 .entry-content {
  text-align: center;
}

.error-404 .search-form {
  margin: 2rem auto;
}

.error-links {
  margin-top: 2rem;
}

.error-links ul {
  list-style: none;
  padding: 0;
}

.error-links li {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Page Links (multi-page posts)
   ========================================================================== */
.page-links {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-links a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0 0.25rem;
  background: var(--hyppychick-brand-primary);
  color: #fff;
  border-radius: 4px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .page-featured-background {
    padding: 2rem 0.25rem; /* Minimal side padding on mobile wrapper */
  }

  .content-box {
    padding: 2rem 1.5rem;
    /* Override desktop alignment classes to force centering and full width */
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
  }

  .entry-title {
    font-size: 1.75rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-next {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .page-featured-background {
    padding: 1.5rem 0.125rem; /* Even tighter on very small screens */
  }

  .content-box {
    padding: 1.5rem 1rem;
  }

  .entry-title {
    font-size: 1.5rem;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form .search-submit {
    width: 100%;
  }
}

/* ==========================================================================
   Forminator Compatibility
   ========================================================================== */
/* Standard Inputs & Textareas */
.forminator-ui.forminator-custom-form .forminator-input,
.forminator-ui.forminator-custom-form .forminator-textarea,
.forminator-ui.forminator-custom-form .forminator-select-element {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: inherit !important;
  border-radius: 4px !important;
  font-size: 1rem !important;
  /* Match theme padding logic (approx height calculation) */
  min-height: 50px;
}

/* Select2 Dropdown Container (The initial click box) */
.forminator-ui .select2-container .select2-selection--single {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px !important;
  height: 50px !important; /* Match input height */
  display: flex !important;
  align-items: center !important;
  /* Force text color inheritance */
  color: var(--hyppychick-content-text, #f7f7f7) !important;
}

/* The text inside the select box */
.forminator-ui .select2-selection__rendered {
  color: var(--hyppychick-content-text, #f7f7f7) !important;
  line-height: normal !important;
  padding-left: 1rem !important;
  padding-right: 2rem !important;
  font-size: 1rem !important;
}

/* Select2 Placeholder Text */
.forminator-ui
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Arrow Icon styling */
.forminator-ui
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 48px !important;
  width: 40px !important;
  top: 1px !important;
  right: 1px !important;
}

.forminator-ui
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow
  b {
  border-color: var(--hyppychick-content-text, #f7f7f7) transparent transparent
    transparent !important;
}

/* The actual dropdown menu itself */
.select2-dropdown {
  background-color: var(--hyppychick-brand-dark, #4c5270) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: var(--hyppychick-content-text, #f7f7f7) !important;
  z-index: 99999 !important;
}

/* Options */
.select2-container--default .select2-results__option {
  padding: 0.75rem 1rem !important;
  font-size: 0.95rem !important;
}

.select2-container--default
  .select2-results__option--highlighted[aria-selected],
.select2-container--default
  .select2-results__option--highlighted[aria-selected]:hover {
  background-color: var(--hyppychick-brand-primary, #5a6180) !important;
  color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Search Box inside dropdown */
.select2-search--dropdown .select2-search__field {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  border-radius: 4px !important;
}

/* Placeholder styling */
.forminator-ui ::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
  opacity: 1 !important;
}
