/* Buttons, cards, forms, alerts, footer, contact, back-to-top. */

.bg-ink { background: var(--ink); color: var(--text-on-ink); }
/* headings inside an ink panel keep the panel's text colour */
.bg-ink :is(h1, h2, h3, h4, h5, h6) { color: var(--text-on-ink); }

/* ---------- Buttons ---------- */

.btn {
  --bs-btn-border-radius: var(--radius);
  --bs-btn-font-weight: 600;
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-padding-y: .65rem;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.btn-lg { --bs-btn-padding-x: 1.75rem; --bs-btn-padding-y: .85rem; --bs-btn-font-size: 1.0625rem; }
.btn-sm { --bs-btn-padding-x: .85rem; --bs-btn-padding-y: .4rem; --bs-btn-font-size: .9rem; }
.btn-primary {
  --bs-btn-color: var(--ink);
  --bs-btn-bg: var(--gold);
  --bs-btn-border-color: var(--gold);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--gold-bright);
  --bs-btn-hover-border-color: var(--gold-bright);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-bg: var(--gold-bright);
  --bs-btn-active-border-color: var(--gold-bright);
  --bs-btn-disabled-color: var(--ink);
  --bs-btn-disabled-bg: var(--gold);
  --bs-btn-disabled-border-color: var(--gold);
}
.btn-outline-primary,
.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-color: var(--text-on-ink);
  --bs-btn-hover-bg: var(--ink);
  --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-color: var(--text-on-ink);
  --bs-btn-active-bg: var(--ink);
  --bs-btn-active-border-color: var(--ink);
}
.btn-outline-light {
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgb(255 255 255 / .7);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: #fff;
}
.btn-light { --bs-btn-color: var(--ink); --bs-btn-bg: #fff; --bs-btn-hover-bg: var(--stone); --bs-btn-hover-color: var(--ink); }

/* ---------- Cards: a border, a picture and a soft shadow that lifts on hover ---------- */

.card {
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: var(--radius-lg);
  --bs-card-inner-border-radius: var(--radius-lg);
  --bs-card-bg: var(--paper);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--navy); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-3px); } }
.quote-form-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); color: var(--text); }
.card-body { padding: 1.25rem 1.25rem .5rem; }
.card-footer { padding: .75rem 1.25rem 1.25rem; border: 0; background: transparent; }
.card-title { margin-bottom: .5rem; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--gold-deep); }
.card-text { color: var(--text-muted); font-size: .975rem; }

/* Card lists (products, blog): as many columns as fit, so one or two records leave no fixed gap (FR-3.1.12) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr)); gap: var(--gap); }
.card-grid > * { max-width: 30rem; }
.price { font-weight: 700; color: var(--gold-deep); }
.meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: .5rem; font-size: .9rem; color: var(--text-muted); max-width: none; }
.meta i { margin-right: .35rem; }
.badge.bg-ink { border-radius: var(--radius); font-weight: 600; }

/* ---------- Forms ---------- */

.form-label { margin-bottom: .35rem; font-size: .95rem; font-weight: 600; color: var(--text); }
.form-control,
.form-select {
  padding: .7rem .9rem;
  border: 1px solid #8d8b7c;
  border-radius: var(--radius);
  background-color: var(--paper);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus,
.form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(var(--gold-rgb) / .35); }
.form-control::placeholder { color: var(--text-muted); opacity: .75; }
.form-control.is-invalid,
.form-control:user-invalid { border-color: var(--danger); }
.invalid-feedback { font-size: .9rem; color: var(--danger); }
.form-text { font-size: .9rem; color: var(--text-muted); }

.alert {
  border: 0;
  border-left: 4px solid var(--alert-color, var(--gold));
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--alert-color, var(--gold)) 10%, var(--paper));
  color: var(--text);
}
/* Bootstrap's room for the close button, which the padding above would cancel (found at 390 px, work item 007 T039). */
.alert-dismissible { padding-right: 3rem; }
.alert-success { --alert-color: var(--success); }
.alert-error,
.alert-danger { --alert-color: var(--danger); }
.alert-info { --alert-color: var(--gold); }

.pagination {
  --bs-pagination-color: var(--ink);
  --bs-pagination-hover-color: var(--ink);
  --bs-pagination-hover-bg: var(--stone);
  --bs-pagination-active-bg: var(--ink);
  --bs-pagination-active-border-color: var(--ink);
  --bs-pagination-active-color: var(--text-on-ink);
  --bs-pagination-focus-color: var(--ink);
  --bs-pagination-focus-box-shadow: 0 0 0 3px rgb(var(--gold-rgb) / .35);
  --bs-pagination-border-radius: var(--radius);
}
.breadcrumb { --bs-breadcrumb-divider-color: var(--text-muted); font-size: .95rem; }
.list-group { --bs-list-group-border-color: var(--line); }

/* ---------- Contact section ---------- */

.contact-grid { display: grid; gap: var(--gap); }
.contact-grid .contact-form { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
.contact-grid h3 { margin-bottom: 1.25rem; }
.contact-list { margin: 0 0 1.75rem; padding: 0; list-style: none; }
.contact-list li { display: flex; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-list i { flex: 0 0 1.25rem; margin-top: .3rem; text-align: center; color: var(--gold-deep); }
.contact-list strong { display: block; color: var(--ink); }
.contact-list a { color: var(--ink); }
.contact-list li > div { min-width: 0; overflow-wrap: anywhere; }  /* a long address or e-mail wraps instead of widening the page (1.4.4) */
.contact-list a:hover { color: var(--gold-deep); }
.map-embed { margin-top: var(--gap); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-embed iframe { display: block; width: 100%; height: clamp(260px, 40vw, 400px); border: 0; }

@media (min-width: 992px) {
  .contact-grid { grid-template-columns: 5fr 7fr; gap: 4rem; align-items: start; }
}

/* ---------- Footer: a deep-blue band, its top edge sweeping down to the right (after the letterhead) ---------- */

.site-footer {
  padding: 0 0 1.5rem;
  background: var(--ink);
  color: var(--text-on-ink-muted);
  font-size: .975rem;
}
.footer-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; padding-block: clamp(2rem, 5vw, 3rem); margin-bottom: clamp(2.5rem, 5vw, 3.5rem); border-bottom: 1px solid rgb(255 255 255 / .15); }
.footer-cta-title { margin: 0 0 .35rem; font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); font-weight: 800; line-height: 1.15; color: #fff; }
.footer-cta p:last-child { margin: 0; }
.footer-cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.site-footer .btn-outline-light:hover { color: var(--ink); text-decoration: none; }
.footer-grid { display: grid; gap: 2.5rem; }
.footer-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.footer-brand img { display: block; width: 56px; height: 62px; }
.footer-brand span { padding-bottom: .25rem; border-bottom: 2px solid var(--gold); font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; line-height: 1.15; text-transform: uppercase; color: #fff; }
.footer-title { margin: 0 0 1rem; font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--gold-bright); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: .5rem; }
.footer-contact li { display: flex; gap: .85rem; }
.footer-contact i { flex: 0 0 1.1rem; margin-top: .3rem; text-align: center; color: var(--gold-bright); }
.site-footer p { margin-bottom: .5rem; }
.site-footer a { color: var(--text-on-ink); text-decoration: none; transition: color var(--transition); }
.site-footer a:hover { color: var(--gold-bright); text-decoration: underline; }
.site-footer .btn-primary { color: var(--ink); }
.site-footer .btn-primary:hover { color: var(--ink); text-decoration: none; }
.footer-social { display: flex; gap: .75rem; margin-top: 1.25rem; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid rgb(255 255 255 / .3); border-radius: var(--radius);
}
.footer-social a:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); text-decoration: none; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin: 3rem 0 0; padding-top: 1.25rem; border-top: 1px solid rgb(255 255 255 / .15); font-size: .9rem; max-width: none; }

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 3rem; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .footer-grid { grid-template-columns: 1.5fr repeat(auto-fit, minmax(10rem, 1fr)); }
  .footer-grid > :first-child { grid-column: auto; }
}

/* ---------- Back to top ---------- */

/* main.js watches this strip: once it scrolls out of view the button appears */
.scroll-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 300px; pointer-events: none; }
.back-to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1000;
  width: 44px; height: 44px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--gold); color: var(--ink);
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), background-color var(--transition);
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--gold-bright); }

/* ---------- Quick-contact bar (FR-3.15.1-4): phones only, plain links, no script ---------- */

.quickbar { display: none; }
@media (max-width: 767.98px) {
  .quickbar {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 1020; /* below the sticky header (1030) */
    height: var(--quickbar-h);
    border-top: 3px solid var(--gold); background: var(--ink);
  }
  .quickbar a {
    display: flex; flex: 1 1 0; align-items: center; justify-content: center; gap: .5rem; min-width: 0;
    font-family: var(--font-display); font-size: .95rem; font-weight: 700; color: var(--text-on-ink); text-decoration: none;
  }
  .quickbar a + a { border-left: 1px solid rgb(255 255 255 / .14); }
  .quickbar i { color: var(--gold-bright); }
  .quickbar .quickbar-quote { background: var(--gold); color: var(--ink); }
  .quickbar .quickbar-quote i { color: var(--ink); }
  .quickbar a:focus-visible { outline: 3px solid var(--paper); outline-offset: -6px; }
  .quickbar .quickbar-quote:focus-visible { outline-color: var(--ink); }
  body { padding-bottom: var(--quickbar-h); } /* the footer's last line stays reachable (FR-3.15.2) */
  .back-to-top { bottom: calc(var(--quickbar-h) + 1rem); } /* after the base .back-to-top rule: equal specificity, the later one wins */
  body:has(input:focus, textarea:focus, select:focus) .quickbar { display: none; } /* the keyboard takes the strip; the padding stays */
}

/* The hidden spam-trap field (FR-3.11.2): off screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* The FAQ (FR-3.14.1): <details> opens and closes its answer with no script. */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 1rem 0; font-weight: 600; cursor: pointer; }
.faq summary:hover { color: var(--gold-deep); }
.faq details > div { padding-bottom: 1rem; color: var(--text-muted); }

/* The short quote form, step one (FR-3.1.8): on the home page's ink band and, after an error, on the quote page. */
.short-form { display: grid; gap: 1rem; align-items: end; padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); color: var(--text); }
.short-field { min-width: 0; }
.short-form .btn { width: 100%; }
@media (min-width: 768px) { .short-form { grid-template-columns: repeat(3, minmax(0, 1fr)); } .short-form .btn { grid-column: 1 / -1; } }
.quote-form-card .short-form { padding: 0; box-shadow: none; }

/* Targets of at least 24 px (NFR-9, 2.5.8): links in stacked lists and in headings grow by their own padding. */
.footer-grid a, .footer-base a { display: inline-block; padding-block: .2rem; }
.trail a, .card-title a, .contact-list a, .quote-intro a, .downloads h3 a { display: inline-block; padding-block: .1rem; }

/* ===== touch:start ===== */
/* Touch targets and form text (work item 037, FR-3.37.3). Written for a phone first: every link and button of the site's own layout is at least 44 by 44 CSS
   pixels, except a link inside a paragraph of running text. From 768 px up the same selectors go back to their own size, so a mouse layout is not made taller.
   The list is the families `tools/phone_audit.mjs touch` found under 44 px; a new kind of link is added here when the audit lists it. */
.more, .row-quote, .solo-link, .page-link, .trail a, .contact-list a, .btn,
.footer-grid a, .footer-base a,
main :is(h2, h3, h4) > a {
  display: inline-flex; align-items: center;
  min-height: 44px; min-width: 44px;
}
.footer-grid li { margin-bottom: 0; } /* the links' own height is the spacing now */
.page-link, .btn { justify-content: center; }

/* A field's text is 16 px or more, or a phone zooms the page in when it is touched. Bootstrap says 1rem today; this keeps it so. */
.form-control, .form-select { font-size: 1rem; }

@media (min-width: 768px) {
  .more, .row-quote, .solo-link, .page-link, .trail a, .contact-list a, .btn,
  .footer-grid a, .footer-base a,
  main :is(h2, h3, h4) > a {
    min-height: 0; min-width: 0;
  }
  .footer-grid li { margin-bottom: .5rem; }
}
/* ===== touch:end ===== */
