/* =======================
   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; }
}


/* ========== FAMILY LAW, OPTION 3 TABS ========== */

.familylaw.section { padding: 48px 0 64px; }
.familylaw .container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Heading */
.familylaw .section-header { margin-bottom: 18px; }
.familylaw .section-title {
  color: var(--red, #c00);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 8px;
  display: inline-block;
  position: relative;
  padding-bottom: 8px;
}
.familylaw .section-title::after {
  content: "";
  display: block;
  width: 160px;
  height: 4px;
  background: #111;
  border-radius: 2px;
  margin-top: 8px;
}
.familylaw .section-subtitle {
  color: #666;
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.6;
}

/* Tabs row */
.familylaw .tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}
.familylaw .tab {
  appearance: none;
  border: 1px solid #e1e1e1;
  background: #fff;
  color: #222;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.familylaw .tab:hover { border-color: #cfcfcf; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.familylaw .tab:focus { outline: none; box-shadow: 0 0 0 3px rgba(196, 0, 0, .18); }
.familylaw .tab.is-active,
.familylaw .tab[aria-selected="true"] {
  background: var(--red, #c00);
  color: #fff;
  border-color: var(--red, #c00);
}

/* Panels */
.familylaw .tabpanels { margin-top: 6px; }
.familylaw .tabpanel { display: none; }
.familylaw .tabpanel.is-active { display: block; }

.familylaw .tabpanel h2 {
  margin: 14px 0 8px;
  color: #b30000;
  font-weight: 700;
}
.familylaw .tabpanel p { margin: 0 0 10px; color: #444; line-height: 1.7; }

/* Bullets */
.familylaw .bullets { margin: 8px 0 14px 0; padding-left: 20px; }
.familylaw .bullets li { margin: 6px 0; }

/* CTA button inside panels */
.familylaw .cta {
  display: inline-block;
  background: var(--red, #c00);
  color: #fff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(204,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.familylaw .cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(204,0,0,.3); }
.familylaw .cta:active { transform: translateY(0); box-shadow: 0 4px 8px rgba(204,0,0,.2) inset; }

/* Responsive */
@media (max-width: 720px) {
  .familylaw .tabs { gap: 6px; }
  .familylaw .tab { padding: 9px 12px; font-size: 0.98rem; }
  .familylaw .section-title::after { width: 140px; height: 3px; }
}

.familylaw h2 {
  color: #b30000; /* adjust hex if your brand red is different */
}

.familylaw h3 {
  color: #b30000; /* adjust hex if your brand red is different */
}

.familylaw .tabpanel:focus {
  outline: none;
  box-shadow: none;
}
.familylaw .tabpanel {
  padding-top: 1.5rem; /* adds space between tabs and the first content element */
}

.familylaw .cta {
  display: inline-block;   /* makes margin behave more predictably */
  margin-top: 1.5rem;      /* space above the button */
}

/* Back to services link above heading */
.familylaw .back-services {
  margin-bottom: 1rem;
}

.familylaw .back-services .back-btn {
  background: none;
  color: var(--red, #c00);
  font-weight: 600;
  text-decoration: none;
  padding: 4px 0;
  display: inline-block;
  transition: color .2s ease;
}

.familylaw .back-services .back-btn:hover {
  color: #000;
}