/* --- Base Brand Styles --- */
.brand {
  position: relative;
  width: 100%;
}

/* --- Flex Grid Container --- */
.expanding-grid {
  position: relative;
  width: 100%;
  /* Hides the outer borders of the items */
  overflow: hidden; 
}

.expanding-grid .links {
  display: flex;
  flex-wrap: wrap;
  list-style-type: none;
  padding: 0;
  margin: 0 -2px; 
  transition: all .1s ease;
  border-top: 1px solid rgba(61, 176, 238, 0.3);
}

/* --- Flex Grid Items --- */
.expanding-grid .links > li {
  padding: 0;
  min-height: 140px;
  flex: 0 0 25%; /* 4 columns */
  box-sizing: border-box;
  border: 1px solid rgba(61,176,238,0.3); 
}

.main-section p {
  padding-bottom: 30px;
}

/* Responsive: 2 columns for tablets and mobile */
@media (max-width: 992px) {
  .expanding-grid .links > li {
    flex: 0 0 50%;
  }
}

/* --- JS Spacer Adjustment --- */
/* This is critical for the JS to position the section correctly in a Flex layout */
.expanding-grid .spacer {
  flex: 0 0 100%; 
  height: 0;
}

/* --- Link & Interaction Styles --- */
.expanding-grid .links > li a {
  background: #ffffff;
  display: block;
  padding: 35px;
  position: relative;
  text-align: center;
  text-decoration: none;
  height: 100%;
  transition: all .3s ease;
  outline: none!important;
}

.expanding-grid .links > li a.active:focus {
  outline: none!important;
}

/* --- Active State Arrow --- */
.expanding-grid .links > li a.active:after {
  background-color: transparent;
  border-bottom: 14px solid #1a1818;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  bottom: -4px;
  content: '';
  height: 0;
  left: 50%;
  margin-left: -14px;
  position: absolute;
  width: 0;
  z-index: 10;
  outline: none!important;
}

/* --- Expanding Content Area --- */
.expanding-grid .expanding-container {
  display: none;
  width: 100%;
  left: 0 !important; /* Ensure JS doesn't offset it horizontally */
}

.expanding-grid .expanding-container.expanded {
  display: block;
}

.expanding-grid .main-section {
  background: #1a1818;
  color: #fff;
  min-height: 4em;
  padding: 80px;
  width: 100%;
  box-sizing: border-box;
}

.expanding-grid .main-section .entry-title {
  font-size: 25px;
  font-weight: 200;
  color: #ffffff;
  margin-top: 0;
}

.expanding-grid .main-section p {
  text-align: left;
}

/* --- Buttons & Labels --- */
li a .more {
  color: #e06721;
  display: block;
  text-align: center;
  text-transform: uppercase;
  font-size: 80%;
  font-weight: 400;
  transition: all .3s ease;
}

.expanding-grid .close-button {
  color: #fff;
  display: inline-block;
  line-height: 1.5;
  padding: 10px;
  text-decoration: none;
  width: 40px;
  z-index: 5;
  font-size: 125%;
  transition: 0.2s;
}

.expanding-grid .close-button:hover {
  color: #3db0ee;
  transition: 0.2s;
}

/* --- High-DPI / Mobile Specific Adjustments --- */
@media only screen and (min-device-width : 375px) and (max-device-width : 812px) {
  .cardIcon {
    width: 150px;
    height: 150px;
  }
  .expanding-grid .main-section .entry-title {
    font-size: 40px;
  }
  li a .more {
    font-size: 100%;
  }
  .expanding-grid .links > li a {
    padding: 65px;
  }
}