/* Features — article layout (cross-component: FeatureCard renders <article>) */
.features article {
  align-items: center;
  display: flex;
  margin: 0 0 3em 3em;
  position: relative;
  width: calc(50% - 3em);
}
.features article:nth-child(2n - 1) {
  margin-right: 1.5em;
}
.features article:nth-child(2n) {
  margin-left: 1.5em;
}
.features article:nth-last-child(1),
.features article:nth-last-child(2) {
  margin-bottom: 0;
}
.features article .content {
  flex-grow: 1;
  flex-shrink: 1;
  width: 100%;
}
.features article .content > :last-child {
  margin-bottom: 0;
}
@media screen and (max-width: 980px) {
  .features article {
    margin: 0 0 3em 0;
    width: 100%;
  }
  .features article:nth-child(2n - 1) {
    margin-right: 0;
  }
  .features article:nth-child(2n) {
    margin-left: 0;
  }
  .features article:nth-last-child(1),
  .features article:nth-last-child(2) {
    margin-bottom: 3em;
  }
  .features article:last-child {
    margin-bottom: 0;
  }
}
@media screen and (max-width: 736px) {
  .features article {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .features article .content {
    text-align: center;
    padding: 0 1em;
  }
}

/* Features — icon styles (cross-component: Icon.astro renders .icon) */
.features article .icon {
  flex-grow: 0;
  flex-shrink: 0;
  display: block;
  height: 10em;
  line-height: 10em;
  margin: 0 var(--space-element) 0 0;
  text-align: center;
  width: 10em;
}
.features article .icon:before {
  color: var(--color-primary);
  font-size: 2.75rem;
  position: relative;
  top: 0.05em;
}
.features article .icon:after {
  transform: rotate(45deg);
  border-radius: var(--radius-sm);
  border: solid 2px var(--color-border);
  content: '';
  display: block;
  height: 7em;
  left: 50%;
  margin: -3.5em 0 0 -3.5em;
  position: absolute;
  top: 50%;
  width: 7em;
}
@media screen and (max-width: 980px) {
  .features article .icon {
    height: 8em;
    line-height: 8em;
    width: 8em;
  }
  .features article .icon:before {
    font-size: 2.25rem;
  }
  .features article .icon:after {
    height: 6em;
    margin: -3em 0 0 -3em;
    width: 6em;
  }
}
@media screen and (max-width: 736px) {
  .features article .icon {
    height: 6em;
    line-height: 6em;
    margin: 0 0 1.5em 0;
    width: 6em;
  }
  .features article .icon:before {
    font-size: 1.5rem;
  }
  .features article .icon:after {
    height: 4em;
    margin: -2em 0 0 -2em;
    width: 4em;
  }
}
@media screen and (max-width: 480px) {
  .features article .icon:before {
    font-size: 1.25rem;
  }
}

/* Posts — article layout (cross-component: PostCard renders <article>) */
.posts article {
  flex-grow: 0;
  flex-shrink: 1;
  margin: 0 0 6em 6em;
  position: relative;
  width: calc(33.33333% - 6em);
}
.posts article:before {
  background: var(--color-border);
  content: '';
  display: block;
  height: calc(100% + 6em);
  left: -3em;
  position: absolute;
  top: 0;
  width: 1px;
}
.posts article:after {
  background: var(--color-border);
  bottom: -3em;
  content: '';
  display: block;
  height: 1px;
  position: absolute;
  right: 0;
  width: calc(100% + 6em);
}
.posts article > :last-child {
  margin-bottom: 0;
}
.posts article .image {
  display: block;
  margin: 0 0 var(--space-element) 0;
}
.posts article .image img {
  display: block;
  width: 100%;
}
@media screen and (min-width: 1681px) {
  .posts article:nth-child(3n + 1):before {
    display: none;
  }
  .posts article:nth-child(3n + 1):after {
    width: 100%;
  }
  .posts article:nth-last-child(1),
  .posts article:nth-last-child(2),
  .posts article:nth-last-child(3) {
    margin-bottom: 0;
  }
  .posts article:nth-last-child(1):before,
  .posts article:nth-last-child(2):before,
  .posts article:nth-last-child(3):before {
    height: 100%;
  }
  .posts article:nth-last-child(1):after,
  .posts article:nth-last-child(2):after,
  .posts article:nth-last-child(3):after {
    display: none;
  }
}
@media screen and (max-width: 1680px) {
  .posts article {
    width: calc(50% - 6em);
  }
  .posts article:nth-last-child(3) {
    margin-bottom: 6em;
  }
}
@media screen and (min-width: 481px) and (max-width: 1680px) {
  .posts article:nth-child(2n + 1):before {
    display: none;
  }
  .posts article:nth-child(2n + 1):after {
    width: 100%;
  }
  .posts article:nth-last-child(1),
  .posts article:nth-last-child(2) {
    margin-bottom: 0;
  }
  .posts article:nth-last-child(1):before,
  .posts article:nth-last-child(2):before {
    height: 100%;
  }
  .posts article:nth-last-child(1):after,
  .posts article:nth-last-child(2):after {
    display: none;
  }
}
@media screen and (max-width: 736px) {
  .posts article {
    margin: 0 0 4.5em 4.5em;
    width: calc(50% - 4.5em);
  }
  .posts article:before {
    height: calc(100% + 4.5em);
    left: -2.25em;
  }
  .posts article:after {
    bottom: -2.25em;
    width: calc(100% + 4.5em);
  }
  .posts article:nth-last-child(3) {
    margin-bottom: 4.5em;
  }
}
@media screen and (max-width: 480px) {
  .posts article {
    margin: 0 0 4.5em 0;
    width: 100%;
  }
  .posts article:before {
    display: none;
  }
  .posts article:after {
    width: 100%;
  }
  .posts article:last-child {
    margin-bottom: 0;
  }
  .posts article:last-child:after {
    display: none;
  }
}

/* Sidebar — Menu */
#menu ul {
  user-select: none;
  color: var(--color-text-bold);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-normal);
  letter-spacing: 0.075em;
  list-style: none;
  margin-bottom: 0;
  padding: 0;
  text-transform: uppercase;
}
#menu ul a,
#menu ul span {
  border-bottom: 0;
  color: inherit;
  cursor: pointer;
  display: block;
  font-size: 0.9em;
  padding: 0.625em 0;
}
#menu ul a:hover,
#menu ul span:hover {
  color: var(--color-primary);
}
#menu ul a.opener,
#menu ul span.opener {
  transition: color var(--transition-duration) var(--transition-easing);
  text-decoration: none;
  position: relative;
}
#menu ul a.opener:before,
#menu ul span.opener:before {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  text-transform: none !important;
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
}
#menu ul a.opener:before,
#menu ul span.opener:before {
  transition:
    color var(--transition-duration) var(--transition-easing),
    transform var(--transition-duration) var(--transition-easing);
  color: var(--color-meta);
  content: '\f078';
  position: absolute;
  right: 0;
}
#menu ul a.opener:hover:before,
#menu ul span.opener:hover:before {
  color: var(--color-primary);
}
#menu ul a.opener.active + ul,
#menu ul span.opener.active + ul {
  display: block;
}
#menu ul a.opener.active:before,
#menu ul span.opener.active:before {
  transform: rotate(-180deg);
}

#menu > ul > li {
  border-top: solid 1px var(--color-border);
  margin: 0.5em 0 0 0;
  padding: 0.5em 0 0 0;
}
#menu > ul > li > ul {
  color: var(--color-meta);
  display: none;
  margin: 0.5em 0 1.5em 0;
  padding-left: 1em;
}
#menu > ul > li > ul a,
#menu > ul > li > ul span {
  font-size: 0.8em;
}
#menu > ul > li > a.active {
  color: var(--color-primary);
  font-weight: var(--font-weight-heavy);
}
#menu > ul > li > ul a.active {
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}
#menu > ul > li > ul > li {
  margin: 0.125em 0 0 0;
  padding: 0.125em 0 0 0;
}
#menu > ul > li:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

/* Sidebar — Mini Posts */
.mini-posts article {
  border-top: solid 1px var(--color-border);
  margin-top: var(--space-element);
  padding-top: var(--space-element);
}
.mini-posts article .image {
  display: block;
  margin: 0 0 1.5em 0;
}
.mini-posts article .image img {
  display: block;
  width: 100%;
}
.mini-posts article:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

/* Sidebar — Contact */
ul.contact {
  list-style: none;
  padding: 0;
}
ul.contact li {
  text-decoration: none;
  border-top: solid 1px var(--color-border);
  margin: 1.5em 0 0 0;
  padding: 1.5em 0 0 3em;
  position: relative;
}
ul.contact li:before {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  text-transform: none !important;
  font-family: 'Font Awesome 5 Free';
  font-weight: 400;
}
ul.contact li:before {
  color: var(--color-primary);
  display: inline-block;
  font-size: 1.5em;
  height: 1.125em;
  left: 0;
  line-height: 1.125em;
  position: absolute;
  text-align: center;
  top: 1em;
  width: 1.5em;
}
ul.contact li:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
ul.contact li:first-child:before {
  top: 0;
}
ul.contact li a {
  color: inherit;
}

/* Sidebar — Search Results (dynamic JS elements — must NOT be scoped) */
#search-results.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 0.5em;
  margin: 0;
  list-style: none;
}
#search-results.search-results.active {
  display: block;
}
#search-results .search-result-item {
  padding: 0.9em 1em !important;
  margin: 0.3em 0 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0.35em;
  border-left: 3px solid transparent;
  background: transparent;
  border-bottom: none;
  border-top: none;
}
#search-results .search-result-item + .search-result-item {
  border-top: 1px solid var(--color-border-light);
}
#search-results .search-result-item:hover {
  background-color: rgba(var(--color-primary-rgb), 0.06) !important;
  border-left-color: var(--color-primary);
  padding-left: 1.2em !important;
}
#search-results .search-result-item:hover .search-result-title {
  color: var(--color-primary);
}
#search-results .search-result-item a {
  text-decoration: none;
  color: inherit;
  display: block;
  border: none;
}
#search-results .search-result-title {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-bold);
  font-size: 0.85em;
  margin: 0 0 4px 0;
  line-height: 1.4;
}
#search-results .search-result-description {
  font-size: 0.75em;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0;
}
#search-results .search-no-results {
  padding: 1.5em 1em;
  text-align: center;
  color: var(--color-meta);
  font-size: 0.85em;
  font-style: italic;
}
#search-results .search-header {
  padding: 0.6em 1em;
  margin: 0 0 0.3em 0;
  border-bottom: 2px solid rgba(var(--color-primary-rgb), 0.15);
  font-size: 0.75em;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
