/*
Theme Name: Blink Astro
Author: Melissa Liu
Author URI:
Theme URI: https://blinkastro.com
Tags: full-site-editing, block-patterns
Text Domain: blinkastro
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.4
Version: 100.0

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* Styles intended only for the front.*/
html {
	scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

@media screen and (max-width: 600px) {
  #wpadminbar {
      position: fixed;
  }
}

body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

@media (max-width: 871px) {
  body {
    --wp--preset--spacing--50: 1rem;
    --wp--preset--spacing--70: 2rem;
    --wp--preset--spacing--80: 3rem;
  }
}

body:not(.home) {
  position: relative;

  &:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1040px;
    z-index: -1;
    background:
      url('./assets/images/starfield-optimized.png') repeat-x left top,
      var(--wp--preset--gradient--outer-space) no-repeat,
      var(--wp--preset--color--base) !important;
    background-size: 1440px, cover, auto !important;

    @media (max-width:781px) {
      height: 700px;
    }
  }
}

.wp-element-button,
.wp-block-button > .wp-block-button__link {
	display: inline-block;
  transition: all .3s ease;

  &:has(img) {
    display: inline-flex;
    align-items: center;
    gap: .75em;
    padding-right: .45em;
    padding-top: .42em;
    padding-bottom: .42em;
  }

  img {
    display: block;
    transition: all .3s ease;
  }

  &:hover {
    filter: brightness(110%) saturate(95%);

    img {
      transform: rotate(360deg);
    }
  }
}

.has-medium-font-size {
  line-height: var(--wp--custom--line-height--medium);
}

.is-style-section-heading {
  width: max-content;
}

.wp-block-heading {
  sup {
    font-size: 0.5em;
    font-weight: 300;
  }
}

@media (max-width: 900px) {
  p br {
    display: none;
  }
}

/* White Text Gradient */
.has-white-text-gradient-color {
  background-color: #D4EEFF;
  background-image: linear-gradient(92deg, #FFF 5.02%, #D4EEFF 95.14%);
  background-size: 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -moz-background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-text-fill-color: transparent;
}

.wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  margin: 0;
  flex-grow: 1;
}

.site-header {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--wp--style--global--wide-size);
  max-width: 100%;
  z-index: 2;

  @media (max-width:781px) {
    .is-content-justification-space-between {
      justify-content: flex-start;
      align-items: center !important;
      gap: 11px;
    }

    .wp-element-button {
      padding-left: 1em;
    }
  }
}

.wp-block-site-logo {
  @media (max-width:781px) {
    flex-grow: 1;

    img { 
      width: 130px;
    }
  }
}

/* Navigation Block
--------------------------------------------- */
.wp-block-navigation-item__content {
  text-decoration: none;
}

.site-header .wp-block-navigation-item__content {
  border-bottom: 2px solid transparent;
  padding: 4px 0;
  transition: all .3s ease;
}

.site-header .current-menu-item .wp-block-navigation-item__content,
.site-header .wp-block-navigation-item__content:hover {
  border-bottom-color: var(--wp--preset--color--secondary);
}

/* Override the default 600px breakpoint for the navigation block */
/* Custom breakpoint: mobile menu below 782px, desktop menu at 782px and above */

/* Desktop styles - show desktop menu, hide mobile button */
@media (min-width: 782px) {
  .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: none !important;
  }

  .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: block !important;
  }
}

/* Mobile styles - show mobile button, hide desktop menu */
@media (max-width: 781px) {
  .wp-block-navigation {
    position: static;
    order: 3;
  }

  .has-modal-open .admin-bar .is-menu-open .wp-block-navigation__responsive-dialog {
    margin-top: 0 !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    padding-top: 1rem !important;

    .wp-block-navigation__container {
      gap: 2rem;
    }
  }

  .wp-block-navigation__responsive-container {
    background-color: #000a17 !important;
    position: absolute;
    top: 86px;
    height: 170px;
    width: 200px;
    max-width: calc(250px - var(--wp--preset--spacing--50) * 2);
    right: var(--wp--preset--spacing--50);
    left: auto;
    border-radius: var(--wp--custom--border-radius--medium);
    padding: 2rem !important;
    box-shadow: 0.3px 0.5px 0.7px 0 rgba(0, 0, 0, 0.13), 
                0.8px 1.6px 2.2px -0.5px rgba(0, 0, 0, 0.17), 
                1.7px 3.5px 4.9px -1.1px rgba(0, 0, 0, 0.20), 
                3.9px 7.9px 11px -1.6px rgba(0, 0, 0, 0.24) !important;
  }

  .wp-block-navigation__responsive-container-close {
    top: -8px;
    right: -8px;
  }

  .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex !important;
    background-color: var(--wp--preset--color--secondary);
    border-radius: var(--wp--custom--border-radius--large);
    padding: .634em .68em;

    svg path {
      fill: var(--wp--preset--color--dark-gray);
    }
  }
  
  /* Hide desktop menu when closed */
  .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: none !important;
  }
  
  /* Show desktop menu when open (mobile menu overlay) */
  .wp-block-navigation__responsive-container:not(.hidden-by-default).is-menu-open {
    display: block !important;
  }
}

@media (max-width: 475px) {
  .wp-block-navigation {
    order: 0;
  }

  .wp-block-navigation__responsive-container-content {
    gap: 5px;
  }

  .wp-block-navigation__responsive-container {
    height: 240px;
  }
}

/* Group Block Mobile Margins */
.entry-content > .wp-block-group:not(.alignfull) {
  @media (max-width:1400px) {
    margin-left: 1.5rem !important;
    margin-right: 1.5rem !important;
  }
}

/* Spacing between Group blocks in content */
.entry-content > .wp-block-group:first-child {
  padding-top: 12.5rem;

  @media (max-width:781px) {
    padding-top: 8.5rem;
  }
}

.entry-content > .wp-block-group:not(:first-child) {
  margin-top: 9rem;

  @media (max-width:1024px) {
    margin-top: 6rem;
  }

  @media (max-width:600px) {
    margin-top: 4rem;
  }
}

/* Flex Group block alignment fix */
.wp-block-group.is-layout-flex {
  align-items: stretch;
  overflow: hidden;

  .wp-block-image.size-full img {
    width: 100%;
  }
}

.wp-block-separator.is-style-default {
  width: 6rem;
}

.is-style-mobile-unset-styles {
  @media (max-width:600px) {
    padding-right: 0 !important;
    padding-left: 0 !important;
  }
}

.site-footer {
  a {
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

@media (max-width:781px) {
  .contact-callout {
    &:after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: var(--wp--preset--color--black);
      opacity: 0.5;
      z-index: 0;
      border-radius: var(--wp--custom--border-radius--medium);
    }

    .wp-block-columns {
      position: relative;
      z-index: 1;
    }
  }
}

/* Home Hero Section
--------------------------------------------- */
.wp-block-group.has-outer-space-large-gradient-background {
  background:
    url('./assets/images/starfield-optimized.png') repeat-x left top,
    var(--wp--preset--gradient--outer-space-large) no-repeat,
    var(--wp--preset--color--base) !important;
  background-size: 1440px, cover, auto !important;
}

.hero .wp-block-columns {
  background: url('./assets/images/satellites-group-optimized.png') no-repeat right 17%;
  background-size: 60.5%;

  @media (max-width:1400px) {
    padding: 0 1.5rem;
  }

  @media (max-width:781px) {
    background: url('./assets/images/single-satellite.png') no-repeat right 45%;
    background-size: 36%;
  }

  @media (max-width:374px) {
    background-position: right 54%;
  }
}

@media (max-width:781px) {
  .hero .wp-block-image img {
    margin-left: -5rem;
    width: 460px !important;
  }
}

/* About Hero Section
--------------------------------------------- */
.about-hero-gallery {
  @media (max-width:781px) {
    flex-wrap: nowrap !important;
  }

  @media (max-width:600px) {
    gap: 10px;
  }

  .wp-block-image {
    position: relative;

    &:before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: 20px;
      background-color: var(--wp--preset--color--dark-gray);
      box-shadow: var(--wp--preset--shadow--large);
      mix-blend-mode: multiply;
      z-index: -1;
    }
  }

  img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;

    @media (max-width:600px) {
      border-radius: 10px !important;
    }
  }

  .wp-block-column:first-child,
  .wp-block-column:last-child {
    img {
      aspect-ratio: 216 / 398;
    }

    @media (max-width:781px) {
      flex-basis: 16.12% !important;
      flex-grow: 0;
    }
  }

  .wp-block-column:nth-child(3) {
    img {
      aspect-ratio: 300 / 550;
    }

    @media (max-width:781px) {
      flex-basis: 22.39% !important;
      flex-grow: 0;
    }
  }

  .wp-block-column:nth-child(2),
  .wp-block-column:nth-child(4) {
    img {
      aspect-ratio: 256 / 474;
    }

    @media (max-width:781px) {
      flex-basis: 19.1% !important;
      flex-grow: 0;
    }
  }
}

/* Custom Image Size for inline arrow icon */
.wp-image-156 {
  @media (max-width:1000px) {
    width: 23px !important;
  }
}

/* Details (Specs)
--------------------------------------------- */
.wp-block-details {
  summary {
    font-weight: 700;
    font-size: var(--wp--preset--font-size--xx-small);
    border: 2px solid var(--wp--preset--color--secondary);
    border-radius: var(--wp--custom--border-radius--large);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;

    &::-webkit-details-marker {
      display:none;
    }

    &:after {
      display: block;
      content: '+';
      font-size: 1.5rem;
      line-height: 1;
      font-weight: 400;
      transition: 0.2s;
    }
  }

  & + & {
    margin: 0 auto;
  }

  &[open] {
    summary {
      &:after {
        content: "-"
      }
    }
  }
}

/* Tables */
.wp-block-table table {
  border-collapse: separate;
  border-spacing: 0;

  th {
    line-height: 1.2;
    border: none;
    background-color: #f9cb58;
  }

  td {
    border: none;
    background-color: var(--wp--preset--color--light-gray);
  }

  tr:first-child th:first-child {
    border-top-left-radius: 18px;
  }
      
  tr:first-child th:last-child {
    border-top-right-radius: 18px;
  }

  tr:last-child td:first-child {
      border-bottom-left-radius: 18px;
  }
      
  tr:last-child td:last-child {
      border-bottom-right-radius: 18px;
  }
}

/* Gallery Slideshow (Splide)
--------------------------------------------- */
.gallery-slider {
  .splide__slide {
    position: relative;
    aspect-ratio: 622 / 490;
    overflow: hidden;
    border-radius: var(--wp--custom--border-radius--small);
  }

  .splide__slide figure {
    margin: 0;
    width: 100%;
    height: 100%;
  }

  .splide__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .splide__pagination {
    bottom: 22px;
  }

  .splide__pagination__page {
    background-color: var(--wp--preset--color--secondary);
    opacity: .4;
    height: 14px;
    width: 14px;
    margin: 7px;
  }

  .splide__pagination__page.is-active {
    opacity: 1;
    transform: none;
    background: var(--wp--preset--color--secondary);
  }
}

/* Forms
--------------------------------------------- */
.site-main form {
  .nf-field-container {
    margin-bottom: 50px;
  }

  .submit-container {
    margin-bottom: 0;
  }

  .one-half {
    width: calc(50% - 24px);
    margin-left: 48px;

    @media (max-width:600px) {
      width: 100%;
      margin-left: 0;
    }
  }

  .first {
    margin-left: 0;
  }

  .nf-field-label {
    margin-bottom: 8px;
  }

  label {
    font-weight: 600;
    font-size: var(--wp--preset--font-size--xx-small);
    color: var(--wp--preset--color--dark-gray);
  }

  input,
  textarea {
    border: none;
    font-family: var(--wp--preset--font-family--inter);
    font-size: 1rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark-gray);
    border-bottom: 2px solid #C2CCD7;
    padding: 7px 0;
    height: 36px;
    resize: none;

    &:focus {
      outline: none;
    }
  }

  .submit-wrap {
    text-align: right;
  }

  input[type="submit"] {
    background: url('/wp-content/uploads/2025/11/icon-button-arrow.svg') no-repeat right 7px center var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--dark-gray);
    font-size: var(--wp--preset--font-size--xx-small);
    line-height: var(--wp--custom--line-height--small);
    font-weight: 700;
    padding: 1em 3.25em 1em 1.5em;
    border-radius: var(--wp--custom--border-radius--medium);
    border: none;
    cursor: pointer;
    transition: all .3s ease;
    height: auto;

    &:hover {
      filter: brightness(110%) saturate(95%);
    }
  }

  .nf-field:has(.nf-field-element input:focus) {
    .nf-field-label label {
      color: #7C8C9B;
    }

    .nf-field-element input,
    .nf-field-element textarea {
      border-bottom-color: var(--wp--preset--color--secondary);
    }
  }

  .nf-before-form-content {
    margin-bottom: 20px;
  }

  .nf-response-msg {
    h4 {
      display: inline-block;
      padding-bottom: 4px;
      border-bottom: 2px solid var(--wp--preset--color--secondary);
      margin-top: 0;
    }
  }

  .nf-after-form-content {
    margin-top: 1.5rem;
  }

  .nf-form-fields-required {
    font-size: 12px;
    font-weight: 600;
    color: var(--wp--preset--color--gray);
  }

  .nf-after-field {
    position: absolute;
  }

  .nf-error .ninja-forms-field {
    border: none;
    border-bottom: 2px solid #E8555F;
  }

  .ninja-forms-req-symbol {
    color: #e2a401;
  }

  .nf-error-msg {
    color: #E8555F;
    font-size: 12px;
    font-weight: 600;
  }
}