/* ============================================================
   Digital Business Cards — Shared Stylesheet
   Mobile-first, no framework, system font stack.
   Client theme (src/clients/<id>/theme.css) is appended by the
   build pipeline and overrides the :root fallback values below.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Generic fallback palette — overridden by the client theme appended below */
  --teal:          #6b7280;
  --teal-dark:     #4b5563;
  --teal-darker:   #374151;
  --cream:         #f9fafb;
  --cream-dark:    #f3f4f6;
  --white:         #ffffff;
  --text:          #111827;
  --text-light:    #6b7280;
  --border:        #e5e7eb;
  --copy-success:  #059669;

  --shadow:        0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-md:     0 4px 16px rgba(0, 0, 0, 0.12);
  --radius:        6px;
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ───────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.container {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* ── Header ───────────────────────────────────────────────── */

.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--teal);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.site-logo img {
  height: 38px;
  width: auto;
  display: block;
}

.site-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-darker);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  background: var(--teal-darker);
  color: rgba(255, 255, 255, 0.65);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
}

.site-footer strong { color: var(--white); }

/* ── Search bar ───────────────────────────────────────────── */

.search-bar { margin-bottom: 2rem; }

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(100, 166, 160, 0.2);
}

/* ── Index: groups & cards ────────────────────────────────── */

.group { margin-bottom: 2.5rem; }

.group-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal-darker);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--teal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cards-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-company {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-city {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-dark);
  text-decoration: none;
}
/* Stretched link: the ::after covers the whole card, making it fully clickable */
.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}
.card-link:hover { text-decoration: underline; }

/* ── Search results counter ───────────────────────────────── */

.results-count {
  font-size: 0.82rem;
  color: var(--text-light);
  margin: -1rem 0 1.25rem;
}

/* ── Highlight ────────────────────────────────────────────── */

mark {
  background: rgba(100, 166, 160, 0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── No results ───────────────────────────────────────────── */

.no-results {
  text-align: center;
  color: var(--text-light);
  padding: 2rem;
}

/* ── Card detail page ─────────────────────────────────────── */

.card-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .card-layout { flex-direction: row; align-items: flex-start; }
  .card-info   { flex: 1 1 auto; }
  .card-sidebar { flex: 0 0 240px; position: sticky; top: 5rem; }
}

.card-detail { display: flex; flex-direction: column; }

.field-label {
  margin: 0.85rem 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
}
.card-detail > .field-label:first-child { margin-top: 0; }

.field-value {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  white-space: pre-line;
}

.company-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal-darker);
}

.establishment-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

/* ── Click-to-copy ────────────────────────────────────────── */

.copyable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover       { color: var(--teal-dark); border-color: var(--teal); }
.copy-btn.copied      { color: var(--copy-success); border-color: var(--copy-success); }

/* ── QR sidebar ───────────────────────────────────────────── */

.qr-card { text-align: center; }

.qr-label {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-light);
  font-style: italic;
}

.qr-container {
  margin: 0 auto 1rem;
  width: 200px;
  height: 200px;
}
.qr-container svg { width: 100%; height: 100%; }

/* ── Primary button ───────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
  .site-title { display: none; }
  .back-link { white-space: nowrap; }
}


/* ============================================================
   Malteurop theme — CSS custom properties
   Palette: teal #64A6A0 | cream #EFEFEC | dark #2c4e4b
   ============================================================ */

:root {
  --teal:          #64A6A0;
  --teal-dark:     #3d7d78;
  --teal-darker:   #2c4e4b;
  --cream:         #EFEFEC;
  --cream-dark:    #e2e2de;
  --white:         #ffffff;
  --text:          #2d3748;
  --text-light:    #5f6b7a;
  --border:        #d4d4cf;
  --copy-success:  #2E7D32;

  --shadow:        0 2px 12px rgba(44, 78, 75, 0.10);
  --shadow-md:     0 4px 16px rgba(44, 78, 75, 0.15);
  --radius:        6px;
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}
