/* =============================================================
   Serenity Smart Homes — components.css
   Buttons, cards, grids, forms, FAQ, callouts, credentials.
   ============================================================= */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: .75rem 1.5rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 2px solid var(--btn-bg); border-radius: 999px;
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-fg); }
.btn--ghost { background: transparent; color: var(--link); }
.btn--ghost:hover { background: var(--teal-wash); color: var(--link-hover); }
.btn--light { background: #ffffff; color: #0f3f44; border-color: #ffffff; }
.btn--light:hover { background: #e7f2f1; border-color: #e7f2f1; color: #0f3f44; }
.btn--block { width: 100%; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: var(--s3); }
@media (min-width: 48rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}
.split { display: grid; gap: var(--s4); align-items: center; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card h3 { font-size: var(--fs-h4); }
.card__media { margin: calc(var(--s4) * -1) calc(var(--s4) * -1) var(--s3); }
.card__media img { width: 100%; border-radius: var(--radius) var(--radius) 0 0; aspect-ratio: 16 / 10; object-fit: cover; }
.card__icon { width: 72px; height: 72px; object-fit: contain; margin-bottom: var(--s2); }
.card .btn, .card .card__link { margin-top: auto; align-self: flex-start; }
.card__link { font-weight: 700; }

.checklist { list-style: none; padding: 0; margin: 0 0 var(--s3); }
.checklist li { position: relative; padding-left: 2rem; margin-bottom: var(--s1); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; background: var(--teal);
}
.checklist li::after {
  content: ""; position: absolute; left: .38rem; top: .55em; width: .35rem; height: .6rem;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---------- Credentials ---------- */
.creds { display: grid; gap: var(--s3); }
@media (min-width: 48rem) { .creds { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 70rem) { .creds { grid-template-columns: repeat(4, 1fr); } }
.cred { text-align: center; }
.cred img { width: 120px; height: 120px; object-fit: contain; margin: 0 auto var(--s2); }
.cred h3 { font-size: 1.125rem; }
.cred p { color: var(--fg-muted); font-size: var(--fs-sm); }

/* ---------- Quotes ---------- */
.quote { margin: 0; }
.quote p { font-size: var(--fs-lg); }
.quote footer { color: var(--fg-muted); font-weight: 700; }

/* ---------- Call-to-action band ---------- */
.cta-band { text-align: center; }
.cta-band p { max-width: 42rem; margin-left: auto; margin-right: auto; font-size: var(--fs-lg); }

/* ---------- Forms ---------- */
.form { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow); }
.form h2 { font-size: var(--fs-h3); text-align: center; }
.field { margin-bottom: var(--s3); }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; }
.field .req { color: var(--amber); }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: .65rem .85rem;
  font: inherit; color: var(--fg); background: var(--bg-raised);
  border: 2px solid #8b9a9b; border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); }
.field__hint { color: var(--fg-muted); font-size: var(--fs-sm); margin-top: .25rem; }
.form .btn { width: 100%; }

/* ---------- Booking calendar (Google appointment scheduling) ---------- */
/* Google stacks the widget into one tall column on narrow screens, so the
   frame is taller on phones than on desktops. */
.booking-frame { width: 100%; height: 1100px; }
@media (min-width: 48rem) { .booking-frame { height: 900px; } }

/* ---------- FAQ ---------- */
.faq { max-width: 48rem; margin: 0 auto; }
.faq details { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--s2); }
.faq summary {
  cursor: pointer; list-style: none; padding: var(--s2) var(--s3); min-height: var(--tap);
  font-weight: 700; color: var(--fg-heading); display: flex; justify-content: space-between; gap: var(--s2);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--teal); }
.faq details[open] summary::after { content: "−"; }
.faq .faq__answer { padding: 0 var(--s3) var(--s2); }

/* ---------- Offer callout (used inside blog posts) ---------- */
.callout {
  display: grid; gap: var(--s3); align-items: center;
  background: var(--bg-inverse); color: var(--fg-inverse);
  border-radius: var(--radius); padding: var(--s4); margin: var(--s5) 0;
}
@media (min-width: 48rem) { .callout--media { grid-template-columns: 2fr 3fr; } }
.callout img { border-radius: var(--radius-sm); width: 100%; }
.callout h3 { color: var(--fg-inverse); }
.callout p { color: #d4e6e4; }
.callout .btn { background: #ffffff; color: #0f3f44; border-color: #ffffff; }
.callout .btn:hover { background: #e7f2f1; border-color: #e7f2f1; }
.callout form { display: flex; flex-wrap: wrap; gap: var(--s1); }
.callout input[type="email"] {
  flex: 1 1 16rem; min-height: var(--tap); padding: .6rem .85rem; font: inherit;
  border: 2px solid #ffffff; border-radius: 999px;
}

/* ---------- Numbered step cards (the step number is in each heading) ---------- */
.steps { list-style: none; padding: 0; margin: 0; }

/* ---------- Affiliation logos (About page) ---------- */
.affiliations { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: center; align-items: center; }
.affiliations a { display: inline-flex; min-height: var(--tap); align-items: center; }
.affiliations img { max-height: 72px; width: auto; max-width: 200px; }

/* ---------- Checkbox groups (survey) ---------- */
.choices { border: 0; padding: 0; margin: 0; }
.choices legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.choices label { display: flex; gap: .65rem; align-items: flex-start; min-height: 40px; padding: .35rem 0; font-weight: 400; }
.choices input[type="checkbox"] { width: 1.25rem; height: 1.25rem; min-height: 0; margin-top: .2rem; flex: none; accent-color: var(--teal); }
.field input[type="file"] { padding: .5rem; }

/* Cards that are whole links (404 page) */
a.card { text-decoration: none; color: var(--fg); }
a.card:hover h3 { text-decoration: underline; }

/* ---------- Case study ---------- */
.case-study { display: grid; gap: var(--s4); align-items: start; }
@media (min-width: 62rem) { .case-study { grid-template-columns: minmax(0, 1fr) 18rem; } .case-study__facts { position: sticky; top: 96px; } }
.case-study__body { margin: 0; }

/* ---------- Video embed (email video pages) ---------- */
.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Page video (self-hosted clip with poster, no autoplay) ---------- */
.page-video { max-width: 44rem; margin: var(--s4) auto 0; }
.page-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); box-shadow: var(--shadow); background: #000; }

/* Author box at the end of blog posts (_includes/author-box.html) */
.author-box { display: flex; gap: var(--s3); align-items: flex-start; margin-top: var(--s5); padding: var(--s3); border-radius: var(--radius); background: var(--bg-raised, #f4f8f7); box-shadow: var(--shadow); }
.author-box__photo { flex: none; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; }
.author-box__name { font-weight: 700; margin: 0 0 var(--s1); }
.author-box p:last-child { margin-bottom: 0; }
@media (max-width: 36rem) { .author-box { flex-direction: column; align-items: center; text-align: center; } }
