/* ===== Features page (Featured.html) styles ===== */

/* ---------- Heading band ---------- */
.features-head {
  padding: 34px 16px 50px;
  border-bottom: 1px solid #ccc;
  background: #f7f7f7;
  text-align: center;
}

.features-head h1 {
  margin: 0;
  font-family: "Roboto", "Open Sans", Arial, sans-serif;
  font-size: clamp(34px, 4.5vw, 64px);
  font-weight: 300;
  line-height: 1.2;
  color: #111;
}

/* ---------- Picture tiles ---------- */
.feature-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 270px));
  justify-content: center;
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 52px 16px 48px;
  border-bottom: 1px solid #ddd;
  box-sizing: border-box;
}

.feature-tile {
  position: relative;
  display: block;
  overflow: hidden;
}

.feature-tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

/* White wash on hover, like the live page */
.feature-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-tile:hover::after,
.feature-tile:focus-visible::after {
  opacity: 0.25;
}

.feature-tile:hover img {
  transform: scale(1.05);
}

.feature-tile:focus-visible {
  outline: 3px solid #00a8f3;
  outline-offset: 3px;
}

/* ---------- Feature list: 3 columns with dividers ---------- */
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1275px;
  margin: 0 auto;
  padding: 36px 16px 30px;
  box-sizing: border-box;
  scroll-margin-top: 10px;
}

.feature {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 28px;
  align-content: start;
  padding: 10px 28px 36px;
  border-right: 1px solid #ddd;
  /* bottom divider that doesn't touch the column lines */
  background: linear-gradient(#ddd, #ddd) 28px calc(100% - 1px) / calc(100% - 56px) 1px no-repeat;
  margin-bottom: 35px;
}

.feature:nth-child(3n) {
  border-right: 0;
}

/* no bottom line on the last row */
.feature:nth-last-child(-n + 3) {
  background: none;
  margin-bottom: 0;
}

/* The icon files are white drawings; the blue square comes from CSS (as on the live site) */
.feature__icon {
  grid-row: 1 / span 2;
  margin-top: 8px;
  border-radius: 6px;
  background: #00a7f4;
}

.feature__title {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.15;
  color: #333;
}

.feature p {
  margin: 0;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #888;
}

.feature:hover .feature__icon {
  animation: feature-pop 0.4s ease;
}

@keyframes feature-pop {
  50% { transform: scale(1.15); }
}

/* Short blue flash when "All Features" is clicked */
.feature-list.is-highlighted .feature__title {
  animation: feature-flash 1.2s ease;
}

@keyframes feature-flash {
  30% { color: #00a8f3; }
}

/* ---------- Fade-in on scroll (classes set by js/Featured.js) ---------- */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0s);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .feature:hover .feature__icon,
  .feature-list.is-highlighted .feature__title {
    animation: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .feature-tiles {
    gap: 24px;
  }

  .feature__title {
    font-size: 21px;
  }
}

@media (max-width: 900px) {
  .feature-tiles {
    grid-template-columns: repeat(2, minmax(0, 270px));
  }

  .feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature,
  .feature:nth-child(3n) {
    border-right: 1px solid #ddd;
  }

  .feature:nth-child(2n) {
    border-right: 0;
  }

  .feature:nth-last-child(-n + 3) {
    background: linear-gradient(#ddd, #ddd) 28px calc(100% - 1px) / calc(100% - 56px) 1px no-repeat;
    margin-bottom: 35px;
  }

  .feature:last-child {
    background: none;
    margin-bottom: 0;
  }
}

@media (max-width: 600px) {
  .feature-tiles {
    gap: 14px;
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .feature-list {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 20px;
  }

  .feature,
  .feature:nth-child(3n) {
    column-gap: 16px;
    padding: 10px 0 26px;
    border-right: 0;
    background: linear-gradient(#ddd, #ddd) left bottom / 100% 1px no-repeat;
    margin-bottom: 20px;
  }

  .feature:nth-last-child(-n + 3) {
    background: linear-gradient(#ddd, #ddd) left bottom / 100% 1px no-repeat;
    margin-bottom: 20px;
  }

  .feature:last-child {
    background: none;
    margin-bottom: 0;
  }

  .feature__title {
    font-size: 20px;
  }
}
