/* =======================
   Brand tokens
   ======================= */
:root{
  --brand-teal: #b00202;
  --brand-teal-dark: #B94747;
  --tile-gap: 24px;
  --tile-radius: 4px;
}

/* =======================
   Services section spacing
   ======================= */
/* Header is immediately followed by the services section in services.html */
.site-header + .services-tiles{
  padding-top: 70px;   /* space below sticky navbar, adjust if needed */
  padding-bottom: 64px; /* internal bottom padding */
  margin-bottom: 60px;  /* extra space before footer */
}

/* Give gutters ONLY to the services block, not the navbar */
.services-tiles.container{
  max-width: 1215px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Match Team heading size */
.services-tiles .page-title{
  font-size: 40px;     /* adjust if your Team h1 is different */
  line-height: 1.1;
  font-weight: 700;
  color: #c41212;
  margin: 0 0 12px;
  position: relative;
}

.services-tiles .page-intro{
  max-width: 900px;
  color: #333;
  margin: 0 0 24px;
}

/* short underline */
.services-tiles .page-title::after{
  content: "";
  display: block;
  width: 96px;
  height: 4px;
  background: #111;
  border-radius: 2px;
  margin-top: 12px;
}

/* mobile scale down if needed */
@media (max-width: 640px){
  .services-tiles .page-title{ font-size: 32px; }
}

/* =======================
   Tile grid layout
   ======================= */
.tile-grid{
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* 3 broad columns on desktop */
  gap: var(--tile-gap);
  margin: 0 0 60px 0;
  padding: 0;
  align-items: stretch;
}
@media (max-width: 1024px){
  .tile-grid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .tile-grid { grid-template-columns: 1fr; }
}

/* =======================
   Tile cards
   ======================= */
.tile{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;

  height: 100%;
  min-height: 240px;

  background: var(--brand-teal);
  color: #fff;
  text-decoration: none;
  border-radius: var(--tile-radius);
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tile:hover,
.tile:focus-visible{
  background: var(--brand-teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
  outline: none;
}

/* Icon */
.tile i{
  font-size: 44px;
  line-height: 1;
  margin-bottom: 16px;
  filter: brightness(100%) contrast(100%);
}

/* Title */
.tile-title{
  text-transform: uppercase;
  text-align: center;
  font-weight: 700;
  letter-spacing: .5px;
  margin: 4px 0 18px;
  line-height: 1.3;
  min-height: 3.2em; /* keep rows aligned even when titles wrap */
}

/* Optional: style for the description text */
.tile-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  margin: 0 0 18px;
}

/* CTA */
.tile-cta{
  display: inline-block;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .5px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 3px;
  padding: 10px 18px;
}
.tile:hover .tile-cta{ border-color: #fff; }

/* Visually hidden, accessible label */
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Search bar, full width of content and strong red focus */
.services-search{
  margin: 12px 0 16px;
  width: 100%;
}

.services-search input{
  width: 100%;
  display: block;
  padding: 14px 16px;
  border: 2px solid #e6e6e6;
  border-radius: 10px;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.services-search input::placeholder{
  color: #777;
}

/* Strong red focus and hover */
.services-search input:focus{
  outline: none;
  border-color: #c41212;                 /* red red */
  box-shadow: 0 0 0 3px rgba(196,18,18,.15);
}

.services-search input:hover{
  border-color: #c41212;
}

/* Hide non-matches */
.tile-grid li.is-hidden{ display: none !important; }

/* No results message */
.no-results{
  margin: 10px 0 0;
  color: #555;
  font-size: 0.95rem;
}

/* Center the last row when exactly 2 tiles remain in a 4-column grid (desktop) */
@media (min-width: 1025px){
  .tile-grid > li:nth-last-child(2):nth-child(4n+1){ grid-column: 2; }
  .tile-grid > li:nth-last-child(1):nth-child(4n+2){ grid-column: 3; }
}
