/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme for AP Group
 * Author: Paul
 * Template: blocksy
 * Text Domain: blocksy
 * Version: 1.205
 */

/* the side panel */

@media (max-width: 689.98px) {
  #menu-main-menu {
    margin-left: 32px !important;
  }
}

@media (min-width: 992px) {
  [data-hook-id='1162'] {
    width: 100%;
  }

  .ct-panel-content-inner,
  .ct-header-content-block,
  .entry-content.is-layout-constrained {
    height: 100% !important;
  }
}

/* Fixes the top offset of the 'close' panel in the slide-out panel */
/* This should only affect desktop devices */
@media (min-width: 992px) {
  .ct-panel-actions {
    padding: 0;
    position: absolute;
    z-index: 99;
    right: 24px;
    top: 24px;
  }

  .ct-panel-actions::before {
    content: "Close";
    font-family: "Lexend Peta", sans-serif;
    font-size: 12px;
    margin-right: 12px;
    text-transform: uppercase;
  }
}

/* Staggered slide-in animation for navigation menu items, also requires some JS (see HFCM) */
.wp-block-navigation__container > li {
  opacity: 0;
  animation: staggerSlideIn 0.4s ease forwards;
  /* Delay scales automatically per item index */
  animation-delay: calc(var(--i, 0) * 0.1s);
  transition: padding .3s ease-in-out;
}

.wp-block-navigation__container > li:hover {
  color: #000 !important;
  padding-left: 6px;
}

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

/* Footer widget menu styling */

footer .widget-menu li,
footer .wp-block-categories-list li {
  font-size: 12px !important;
  margin-bottom: 1.2rem !important;
  text-transform: uppercase !important;
  transition: padding .3s ease-in-out;
}

footer .widget-menu li:hover,
footer .wp-block-categories-list li:hover {
  padding-left: 6px;
}

/* ==========================================
   BLOCKSY + GREENSHIFT ALTERNATING ARCHIVE
   ========================================== */

/* 1. Base Container Setup */
article .alternating-card {
  display: flex !important;
  flex-direction: row !important;
  width: 100%;
  align-items: stretch;
}

/* Base Column Widths */
article .alternating-card .card-image-col,
article .alternating-card .card-text-col {
  flex: 1 1 50% !important;
  width: 50% !important;
  box-sizing: border-box;
}

/* 2. ODD ROWS (1st, 3rd, 5th, etc.) */
/* Image First (Order 1), Text Second (Order 2) */
article:nth-child(odd) .alternating-card .card-image-col {
  order: 1 !important;
}

article:nth-child(odd) .alternating-card .card-text-col {
  order: 2 !important;
  background-color: #000;
  color: #fff;
}

/* 3. EVEN ROWS (2nd, 4th, 6th, etc.) */
/* Text First (Order 1), Image Second (Order 2) */
article:nth-child(even) .alternating-card .card-text-col {
  order: 1 !important;
  background-color: #fff;
  color: #000 !important;
}

article:nth-child(even) .alternating-card .OutlineButtonLight {
    background-color: #fff;
    color: #000 !important;
    border-color: #000 !important;
}

/* the containing row for even cards */
article:nth-child(even) .alternating-card .gspb_row__content {
    background-color: #fff;
}

article:nth-child(even) .alternating-card .card-text-col .gspb_text,
article:nth-child(even) .alternating-card .card-text-col .project-card-heading {
  color: #000 !important;
}

article:nth-child(even) .alternating-card .card-image-col {
  order: 2 !important;
}

/* 4. RESPONSIVE MOBILE / TABLET LAYOUT */
@media (max-width: 991px) {
  /* Reset layout to standard vertical stack */
  article .alternating-card,
  .tax-apg-project-category article .alternating-card {
    flex-direction: column !important;
  }

  /* Reset visual order on mobile (Image always top, Text always bottom) */
  article .alternating-card .card-image-col {
    order: 1 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  article .alternating-card .card-text-col {
    order: 2 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }
}