:root {
    --bg: #f5f5f5;
    --card: #ffffff;
    --accent: #b22222;
    --text: #222222;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
header {
    background: #1f2933;
    color: #ffffff;
    padding: 1.75rem 1rem;
}
.hero {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}
.hero-logo {
    flex: 0 0 96px;
}
.hero-logo img {
    max-width: 96px;
    height: auto;
    border-radius: 999px;
}
.hero-text {
    flex: 1 1 240px;
}
.hero-text h1 {
    margin: 0 0 0.25rem;
    font-size: 1.9rem;
}
.hero-text p {
    margin: 0.25rem 0;
    font-size: 0.98rem;
    opacity: 0.9;
}
.hero-cta {
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
}
.hero-cta a {
    color: #ffffff;
    text-decoration: none;
}
.hero-cta a:hover {
    text-decoration: underline;
}

main {
    max-width: 960px;
    margin: 2rem auto 3rem;
    padding: 0 1rem;
}
.section {
    background: var(--card);
    border-radius: 10px;
    padding: 1.6rem 1.5rem;
    margin-bottom: 1.6rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.section h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 0.4rem;
}
ul {
    padding-left: 1.2rem;
    margin-top: 0.25rem;
}
.badge-row {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #444;
}
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.15);
    margin-right: 0.4rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    background: #fafafa;
}
.highlight {
    color: var(--accent);
    font-weight: 600;
}
.contact-block {
    font-size: 1rem;
    line-height: 1.6;
}
.contact-block a {
    color: var(--accent);
    text-decoration: none;
}
.contact-block a:hover {
    text-decoration: underline;
}
footer {
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    padding: 1.5rem 0 2rem;
}
@media (max-width: 640px) {
    header {
        padding: 1.25rem 1rem;
    }
    .hero-text h1 {
        font-size: 1.6rem;
    }
}
/* Desktop: hide embedded chat */
@media (min-width: 768px) {
    .chat-embedded {
        display: none;
    }
}

/* Mobile: hide floating chat */
@media (max-width: 767px) {
    .chat-floating {
        display: none;
    }
}


/* Service image gallery (constrained grid items) */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gallery figure {
  max-width: 100%;
}

.gallery-group {
  grid-column: 1 / -1;
}

.gallery-group figcaption {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

/* CRITICAL: allow grid items to shrink */
.gallery > figure {
  min-width: 0;
}

/* Subgrid inside a single gallery cell */
.gallery-group-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 700px) {
  .gallery-group-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Hard constraint so nothing can overflow */

/* === Gallery layout invariants (authoritative) === */

/* Allow all gallery items to shrink within CSS Grid */
.gallery > * {
  min-width: 0;
}

/* Scale all gallery images to their container */
.gallery img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure grouped gallery images are also constrained */
.gallery-group-images img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}
