/* Company landing pages. Brand colors (--brand/--accent) come from the tenant's DB
   branding at runtime; the chosen TEMPLATE sets the overall look via body[data-tpl].
   10 templates share this HTML and restyle it. */
:root {
  --brand: #2c5f7c;
  --brand-deep: #1f4459;
  --brand-soft: #e7eef2;
  --accent: #1668c7;
  /* theme tokens (templates override these) */
  --page-bg: #ffffff;
  --surface: #ffffff;
  --text: #17222a;
  --text-soft: #5a6b74;
  --line: #e2e7ea;
  --radius: 12px;
  --heading: 800 1em/1.1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --heading-spacing: normal;
  --heading-transform: none;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --hero-bg: var(--brand-soft);
  --hero-text: var(--text);
  --btn-radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page-bg); color: var(--text); font-family: var(--body-font); line-height: 1.6; }
img { max-width: 100%; display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -9999px; }
.t-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.t-top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.t-top-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.t-brand { display: flex; align-items: center; gap: 10px; }
.t-logo-img { height: 34px; width: auto; border-radius: 6px; }
.t-name { font: var(--heading); font-size: 20px; letter-spacing: var(--heading-spacing); text-transform: var(--heading-transform); }
.t-btn { font: inherit; font-weight: 700; background: var(--brand); color: #fff; border: none; border-radius: var(--btn-radius); padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.t-btn:hover { background: var(--brand-deep); }
.t-btn-lg { padding: 15px 26px; font-size: 17px; }
.t-ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

/* Hero */
.t-hero { background: var(--hero-bg); color: var(--hero-text); padding: 64px 0; }
.t-hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.t-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 700; margin: 0 0 10px; opacity: 0.75; }
.t-headline { font: var(--heading); font-size: clamp(32px, 5vw, 52px); letter-spacing: var(--heading-spacing); text-transform: var(--heading-transform); margin: 0 0 14px; text-wrap: balance; }
.t-tagline { font-size: 19px; opacity: 0.9; margin: 0 0 24px; max-width: 34ch; }
.t-hero-media img { border-radius: var(--radius); width: 100%; object-fit: cover; aspect-ratio: 4/3; }

/* Sections */
.t-section { padding: 56px 0; }
.t-h2 { font: var(--heading); font-size: 28px; letter-spacing: var(--heading-spacing); text-transform: var(--heading-transform); margin: 0 0 20px; }
.t-about-text { font-size: 18px; max-width: 65ch; color: var(--text-soft); }
.t-service-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.t-service-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-weight: 600; border-left: 4px solid var(--brand); }
.t-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.t-shot { margin: 0; }
.t-shot img { border-radius: var(--radius); aspect-ratio: 1/1; object-fit: cover; width: 100%; }

/* Contact + chat */
.t-contact { background: var(--brand-soft); }
.t-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.t-contact-line { font-size: 17px; margin: 6px 0; }
.t-chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 8px 30px -18px rgba(0,0,0,0.35); }
.t-chat-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.t-lamp { width: 10px; height: 10px; border-radius: 50%; background: #2e8b57; box-shadow: 0 0 0 4px color-mix(in srgb, #2e8b57 22%, transparent); }
.t-chat-title { margin: 0; font-size: 18px; }
.t-chat-sub { font-size: 13px; color: var(--text-soft); }
.t-chat-scroll { height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px; background: var(--brand-soft); border-radius: 8px; }
.t-chat-hint { color: var(--text-soft); font-size: 14px; margin: 6px; }
.t-bubble { padding: 9px 13px; border-radius: 12px; max-width: 85%; font-size: 15px; }
.t-bubble.me { align-self: flex-end; background: var(--brand); color: #fff; }
.t-bubble.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.t-bubble.wait { align-self: flex-start; color: var(--text-soft); font-style: italic; }
.t-bubble.err { align-self: flex-start; background: #fdecea; color: #b23b3b; }
.t-chat-input { display: flex; gap: 8px; margin-top: 10px; }
.t-chat-input input { flex: 1; font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; }
.t-ticket { margin-top: 12px; background: var(--brand-soft); border-radius: 8px; padding: 12px; }
.t-ticket-head { font-weight: 700; margin-bottom: 6px; }
.t-ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.t-ticket dt { color: var(--text-soft); }
.t-ticket-note { margin: 8px 0 0; color: var(--text-soft); }
.t-chat .t-ghost { margin-top: 10px; width: 100%; }

/* Footer */
.t-foot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--text-soft); }
.t-foot .t-wrap { display: flex; justify-content: space-between; }
.t-foot-by { opacity: 0.7; }

@media (max-width: 820px) {
  .t-hero-grid, .t-contact-grid { grid-template-columns: 1fr; }
  .t-hero-media { order: -1; }
}

/* ── 10 TEMPLATES ─────────────────────────────────────────────────────────── */

/* 1) BOLD — condensed uppercase, strong color hero */
body[data-tpl="bold"] { --heading: 800 1em/1 "Arial Narrow", "Helvetica Neue", sans-serif; --heading-transform: uppercase; --heading-spacing: 0.02em; --hero-bg: var(--brand); --hero-text: #fff; --btn-radius: 4px; --radius: 6px; }
body[data-tpl="bold"] .t-btn { background: #fff; color: var(--brand); }
body[data-tpl="bold"] .t-btn:hover { background: #f0f0f0; }

/* 2) CLASSIC — serif, centered, understated */
body[data-tpl="classic"] { --heading: 700 1em/1.15 Georgia, "Times New Roman", serif; --page-bg: #fbfaf7; --hero-bg: #fbfaf7; --brand-soft: #f3f0ea; --radius: 4px; --btn-radius: 2px; }
body[data-tpl="classic"] .t-hero-grid, body[data-tpl="classic"] .t-headline, body[data-tpl="classic"] .t-tagline { text-align: center; }
body[data-tpl="classic"] .t-hero-grid { grid-template-columns: 1fr; max-width: 760px; }
body[data-tpl="classic"] .t-tagline { margin-left: auto; margin-right: auto; }

/* 3) TRADE — industrial, mono accents, gunmetal */
body[data-tpl="trade"] { --heading: 800 1em/1.05 "Arial Narrow", sans-serif; --heading-transform: uppercase; --page-bg: #eef0ef; --hero-bg: #1c262b; --hero-text: #fff; --radius: 4px; --btn-radius: 3px; }
body[data-tpl="trade"] .t-eyebrow { color: var(--accent); opacity: 1; }
body[data-tpl="trade"] .t-service-list li { border-left-color: var(--accent); }

/* 4) FRESH — airy, rounded, lots of whitespace */
body[data-tpl="fresh"] { --radius: 20px; --btn-radius: 999px; --hero-bg: var(--brand-soft); --line: #eef1f3; }
body[data-tpl="fresh"] .t-section { padding: 72px 0; }
body[data-tpl="fresh"] .t-service-list li { border-left: none; text-align: center; box-shadow: 0 6px 20px -12px rgba(0,0,0,0.25); }

/* 5) MINIMAL — monochrome, thin, restrained */
body[data-tpl="minimal"] { --heading: 300 1em/1.1 system-ui, sans-serif; --hero-bg: #fff; --brand-soft: #f6f6f6; --radius: 0; --btn-radius: 0; --line: #e6e6e6; }
body[data-tpl="minimal"] .t-btn { background: #111; }
body[data-tpl="minimal"] .t-btn:hover { background: #333; }
body[data-tpl="minimal"] .t-service-list li { border: none; border-bottom: 1px solid var(--line); border-radius: 0; }

/* 6) WARM — warm cream, friendly rounded cards */
body[data-tpl="warm"] { --page-bg: #fdf6ee; --hero-bg: #fbeede; --brand-soft: #f7ead9; --radius: 16px; --btn-radius: 12px; --text: #3b2f26; --text-soft: #7a6a5c; --line: #ecdcc9; }

/* 7) SLATE — dark, cool, modern */
body[data-tpl="slate"] { --page-bg: #12171c; --surface: #1a2128; --hero-bg: #0e1216; --hero-text: #fff; --text: #e6ecf1; --text-soft: #93a2ad; --line: #2a333c; --brand-soft: #1a2128; --radius: 10px; }
body[data-tpl="slate"] .t-top { background: #0e1216; }
body[data-tpl="slate"] .t-bubble.them { background: #232c34; }
body[data-tpl="slate"] .t-chat-input input { background: #232c34; color: #fff; }

/* 8) COASTAL — breezy light blue/teal */
body[data-tpl="coastal"] { --page-bg: #f2f9fb; --hero-bg: linear-gradient(135deg, #e3f2f6, #d3e9f0); --brand-soft: #e3f2f6; --radius: 14px; --btn-radius: 999px; --line: #d5e6ea; }

/* 9) SUNRISE — warm gradient hero */
body[data-tpl="sunrise"] { --hero-bg: linear-gradient(120deg, var(--brand), var(--accent)); --hero-text: #fff; --radius: 14px; --btn-radius: 999px; }
body[data-tpl="sunrise"] .t-btn { background: #fff; color: var(--brand); }

/* 10) NIGHTSHIFT — dark with neon accent */
body[data-tpl="nightshift"] { --page-bg: #0b0b10; --surface: #14141c; --hero-bg: #0b0b10; --hero-text: #fff; --text: #eaeaf2; --text-soft: #9a9ab0; --line: #24243040; --brand-soft: #14141c; --radius: 10px; }
body[data-tpl="nightshift"] .t-headline { text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); }
body[data-tpl="nightshift"] .t-service-list li { border-left-color: var(--accent); }
body[data-tpl="nightshift"] .t-bubble.them { background: #1c1c26; }
body[data-tpl="nightshift"] .t-chat-input input { background: #1c1c26; color: #fff; }

/* Loading skeleton: hide content + show a spinner until JS renders (SSR head is already present). */
body.t-loading main { visibility: hidden; }
body.t-loading::after { content: ""; position: fixed; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: t-spin 0.8s linear infinite; }
@keyframes t-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body.t-loading::after { animation: none; } }

/* Retry state (transient load failure — don't bounce the visitor). */
.t-retry { max-width: 480px; margin: 80px auto; text-align: center; padding: 0 20px; }
.t-retry p { color: var(--text-soft); margin-bottom: 16px; }

/* Testimonials */
.t-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.t-quote { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; border-left: 4px solid var(--brand); }
.t-quote blockquote { margin: 0 0 10px; font-size: 16px; }
.t-quote figcaption { color: var(--text-soft); font-size: 14px; font-weight: 600; }

/* Contact form */
.t-contact-form { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.t-contact-form input, .t-contact-form textarea { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.t-contact-status { font-size: 14px; color: var(--text-soft); margin: 4px 0 0; min-height: 16px; }
.t-directions a { color: var(--brand); font-weight: 600; }

/* Footer social links */
.t-socials { display: inline-flex; gap: 14px; }
.t-socials a { color: var(--text-soft); text-decoration: none; font-size: 14px; }
.t-socials a:hover { color: var(--brand); }
.t-foot .t-wrap { align-items: center; gap: 12px; flex-wrap: wrap; }
