/*
Theme Name:   Astra Child
Theme URI:    http://example.com/astra-child/
Description:  Child theme for the Astra theme.
Author:       Your Name
Author URI:   http://example.com
Template:     astra
Version:      1.0.0
*/

/* Add your custom CSS below */

/* ========== BASIC STYLING ========== */
html,
body {
  background-color: white;
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

/* ========== PAGE LAYOUT & STRUCTURE ========== */
#page {
  display: grid;
  grid-template-columns: 200px 1fr; /* Sidebar fixed at 250px, content takes remaining space */
  grid-template-rows: auto 1fr auto; /* Header area (if any), main content, footer */
  grid-template-areas:
    "sidebar header" /* if you have a header, or you can merge this with content */
    "sidebar content"
    "sidebar footer";
  min-height: 100vh;
  background-color: white;
  /*Set padding to 20 percent of viewport height or width*/
  padding: 10vh 5vw;
  max-width: 1490px; /* Adjust this value as needed */
  margin: 0 auto; /* Centers the content if width is less than max-width */
}

#content {
  grid-area: content;
}

.ast-separate-container #primary {
  /* Set padding to 20 percent of viewport height or width */
  padding: 0;
  margin: 0;
}

/* ========== HEADER & NAVIGATION ========== */
#masthead {
  grid-area: sidebar;
  min-height: 100vh;
}

#ast-desktop-header {
  /* Occupy entire height of parent div */
  min-height: 100vh;
}

.site-header-primary-section-left.site-header-section.ast-flex.site-header-section-left,
#ast-hf-menu-1 {
  /* Set flex direction to column*/
  flex-direction: column;
}

/* Target the site title wrap with float positioning */
.ast-site-title-wrap {
  /* writing-mode: vertical-rl;
  text-orientation: upright; */
  float: left;
  clear: both;
  padding-left: 0;
  margin-left: 0;
  overflow-wrap: break-word;
}

.ast-builder-layout-element.ast-flex.site-header-focus-item[data-section="title_tagline"] {
  padding-right: 60px;
}

/* Target the title itself */
.site-title {
  margin-left: 0 !important;
  padding-left: 0 !important;
  text-align: left !important;
  float: left !important;
}

/* Target the anchor element for the site title */
.site-title a {
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  font-size: 24px;
  padding-left: 0 !important;
  margin-left: 0 !important;
  text-align: left !important;
  float: left !important;
  color: #000000 !important;
}

/* Desktop title (vertical) */
.site-title .desktop-title {
  display: inline-block;
}
.site-title .mobile-title {
  display: none;
}

#ast-hf-menu-1 .menu-item {
  height: 2em; /* Twice the height of text content */
  line-height: 2em; /* Centers the text vertically */
  box-sizing: border-box; /* This line prevents the height of the menu item from increasing */
  padding: 0 1em; /* Adds padding to the left and right of the text */
  font-family: "Poppins", sans-serif;
  font-size: 14px;
}

.main-header-menu > .menu-item > .menu-link,
#astra-footer-menu > .menu-item > a.menu-link {
  /* Set font color to white */
  color: #999999;
  width: 110px;
  padding-right: 0;
  padding-left: 10px;
  transition: none !important; /* Disable transition movement of sidebar navigation */
}

#ast-mobile-header
  > div.ast-main-header-wrap.main-header-bar-wrap
  > div
  > div
  > div.site-header-primary-section-left.site-header-section.ast-flex.site-header-section-left
  > div
  > div {
  transition: none !important; /* Disable transition movement of header bar navigation in mobile view */
}

.ast-primary-header-bar.ast-primary-header.main-header-bar.site-header-focus-item[data-section="section-primary-header-builder"] {
  border-bottom-width: 0;
}

/* Color of menu items on hover */
.ast-builder-menu-1 .menu-item:hover > .menu-link,
.ast-builder-menu-1 .inline-on-mobile .menu-item:hover > .ast-menu-toggle {
  color: #000000;
}

.ast-builder-menu-1 .menu-item.current-menu-item > .menu-link {
  color: #000000;
}

/* Hide menu button outline when click with mouse, show when click with keyboard */
/* 1. Turn the default outline OFF when the user uses the mouse */
:focus:not(:focus-visible) {
  outline: none;
}

/* 2. Optionally restyle the keyboard outline so it matches your brand */
:focus-visible {
  outline: 2px solid #005cff;
  outline-offset: 2px;
}

#ast-scroll-top {
  background-color: #999999 !important;
}

/* ========== CONTENT STYLING ========== */
.video-container-testimonial {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 88vh; /* Controls gap between footer and embedded testimonials */
  overflow: hidden;
}
.video-container-testimonial iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 88vh; /* Controls gap between footer and embedded testimonials */
}

.responsive-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 9/16 = 0.5625 → 56.25% */
  height: 0;
  overflow: hidden;
}
.responsive-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Elementor styling */
.elementor-element.e-con-full.e-flex.e-con.e-child,
.elementor-element.e-con-full.e-flex.e-con.e-parent.e-lazyloaded {
  /* Control margin and padding of about page */
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Standardize paddings for alignment */
#content.site-content .ast-container,
#responsive-wpform,
.entry-content.clear
  .elementor
  .elementor-element.e-flex.e-con-boxed.e-con.e-parent.e-lazyloaded,
.ast-button-wrap
  button.menu-toggle.main-header-menu-toggle.ast-mobile-menu-trigger-minimal,
.elementor-element.e-grid.e-con-boxed.e-con.e-parent.e-lazyloaded {
  padding-left: 0;
  padding-right: 0;
}

/* Align embedded testimonial desktop view */
#embed-testimonial,
#embed-testimonial * {
  max-width: 99%;
}

/* Remove underline from homepage links */
#home-grid > div > div > div > div > p > a {
  text-decoration: none !important;
  color: #999999;
}

/* ========== FOOTER STYLING ========== */
#colophon {
  grid-area: footer;
  /* Styling for the footer */
}

.ast-footer-copyright p {
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  color: #999999;
}

/* ========== FORM STYLING ========== */
/* Set max width for WPForms fields */
.name-fields,
.email-field,
div.wpforms-container-full div.message-field textarea {
  max-width: 50em !important;
}

.wpforms-field-container,
.wpforms-field-container > div > fieldset > legend,
.wpforms-field-container > div > label {
  font-family: "Poppins", sans-serif;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #000000 !important;
}

fieldset > div > div.wpforms-field-row-block > label {
  color: #999999 !important;
}

.wpforms-submit-container > button.wpforms-submit {
  background-color: #999999 !important;
}

/* ========== ANIMATIONS & TRANSITIONS ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes soften {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.elementor-element .elementor-widget-image .elementor-widget-container img {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* Fade effect on hover of homepage images */
.elementor-element
  .elementor-widget-image
  .elementor-widget-container
  img:hover {
  opacity: 0.7;
}

/* No fade effect on hover of about page image */
#about-profile .elementor-widget-container img:hover {
  opacity: 1;
}

/* Initial state - hidden and translated down */
.fade-up-element {
  opacity: 0 !important;
  transform: translateY(300px) !important;
  transition: opacity 1s ease-out, transform 1s ease-out !important;
  will-change: opacity, transform !important;
}

/* Visible state applied when page loads */
.fade-up-element.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ========== MEDIA QUERIES ========== */
@media (max-width: 921px) {
  /* Change page grid layout */
  #page {
    grid-template-columns: 1fr; /* Full width single column */
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "header header"
      "content content"
      "footer footer";
    padding: 5vh 5vw; /* Reduced vertical padding */
  }

  /* Adjust header/sidebar properties */
  #masthead {
    grid-area: header;
    min-height: auto;
    width: 100%;
    padding-bottom: 20px;
  }

  #ast-desktop-header {
    min-height: auto;
  }

  /* Convert vertical menu to horizontal */
  .site-header-primary-section-left.site-header-section.ast-flex.site-header-section-left,
  #ast-hf-menu-1 {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: left;
    align-items: left;
  }

  /* Center the site title */
  .ast-site-title-wrap {
    float: none;
    text-align: center;
    width: 100%;
    margin-bottom: 15px;
  }

  .site-title,
  .site-title a {
    float: none !important;
    text-align: center !important;
    width: 100%;
  }

  /* Mobile title handling in media query */
  .site-title .desktop-title {
    display: none;
    color: #000000 !important;
  }
  .site-title .mobile-title {
    display: inline-block;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 24px;
    color: #000000 !important;
  }

  /* Adjust menu item spacing */
  #ast-hf-menu-1 .menu-item {
    margin: 0 8px;
  }
  .ast-primary-header-bar.ast-primary-header.main-header-bar.site-header-focus-item[data-section="section-primary-header-builder"] {
    padding: 0 !important;
  }

  /* Align embedded testimonial tablet view */
  #embed-testimonial,
  #embed-testimonial * {
    max-width: 100% !important;
  }

  h2.elementor-heading-title.elementor-size-default {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .e-con.e-flex > .e-con-inner,
  .elementor-element.e-con-full.e-flex.e-con.e-parent.e-lazyloaded {
    display: flex !important; /* Force a consistent flex container */
    flex-wrap: wrap !important; /* Allow the items to wrap and align correctly */
    --container-max-width: 1024px;
    margin: 0;
    --width: 100%;
  }

  .e-con.e-flex,
  .elementor-element.e-con-full.e-flex.e-con.e-child {
    --width: 100%;
    --flex-wrap: var(--flex-wrap-mobile) !important;
    --container-max-width: 1024px;
    margin: 0;
  }

  /* Add a line break between about page image and text */
  #about-content
    .elementor-element.e-con-full.e-flex.e-con.e-child[data-element_type="container"]::after {
    content: "\A";
    white-space: pre;
  }

  /* Align embedded testimonial mobile view */
  #embed-testimonial,
  #embed-testimonial * {
    max-width: 100% !important;
  }

  /* Fit about page image to container width */
  #about-profile.elementor-element.elementor-widget.elementor-widget-image
    .elementor-widget-container
    img {
    max-width: 100%;
  }

  /* Align images in about page on mobile view*/
  .elementor-element .elementor-widget-image .elementor-widget-container img {
    width: 100em;
  }

  /* Enforce flex wrap mobile */
  .e-con.e-flex > .e-con-inner {
    --flex-wrap: var(--flex-wrap-mobile) !important;
  }

  .e-con.e-flex > .e-con-inner,
  .elementor-element.e-con-full.e-flex.e-con.e-parent.e-lazyloaded {
    flex-wrap: nowrap !important;
  }

  /* Exempt about page image div from nowrap */
  #about-content.elementor-element.e-con-full.e-flex.e-con.e-parent.e-lazyloaded {
    flex-wrap: wrap !important;
  }
}

/* Stop homepage image container height from shrinking on scroll.
   Stop captions placed outside of single column in mobile view */
@media (min-width: 600px) and (max-width: 767px) {
  #home-grid .e-con.e-flex,
  #home-grid .elementor-element.e-con-full.e-flex.e-con.e-child {
    height: 102vw !important;
  }
}

@media (min-width: 431px) and (max-width: 600px) {
  #home-grid .e-con.e-flex,
  #home-grid .elementor-element.e-con-full.e-flex.e-con.e-child {
    height: 105vw !important;
  }
}

@media (max-width: 431px) {
  #home-grid .e-con.e-flex,
  #home-grid .elementor-element.e-con-full.e-flex.e-con.e-child {
    height: 111vw !important;
  }
}
