/*
Theme Name: ARBK Open
Theme URI: https://arbk.org/
Author: Edon Abdullahu / Max Travel ops
Description: Editorial navy + gold + off-white theme for ARBK Open business directory. Source Serif 4 + IBM Plex Sans. Built from a Figma/React mockup.
Version: 0.1.2
Text Domain: arbk-open
*/

/* ARBK Open — Design System Tokens
   Editorial premium platform aesthetic — navy + gold + off-white */

:root {
  /* Colors — light */
  --bg: #FBF7F0;
  --bg-elev: #FFFFFF;
  --bg-sunken: #F4EFE5;
  --bg-tinted: #F9F4EA;

  --ink: #1A2238;          /* Deep navy — primary brand */
  --ink-2: #2B3553;
  --ink-3: #5C6580;
  --ink-4: #8C93A8;
  --ink-5: #B8BCC8;

  --line: rgba(26, 34, 56, 0.10);
  --line-2: rgba(26, 34, 56, 0.18);
  --line-strong: rgba(26, 34, 56, 0.30);

  --gold: #B8975A;          /* Warm accent */
  --gold-deep: #8E6F38;
  --gold-tint: #E8DBB8;
  --gold-bg: #F5EDD8;

  --pos: #2D7A52;           /* Active/positive */
  --pos-bg: #E2EFE5;
  --neg: #B33B3B;           /* Negative/closed */
  --neg-bg: #F4DEDE;
  --warn: #C57A2A;
  --warn-bg: #F7E6CC;
  --info: #2E5C8A;
  --info-bg: #DCE7F2;

  /* Type */
  --serif: 'Source Serif 4', 'Source Serif Pro', 'Charter', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Radius */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(26, 34, 56, 0.06);
  --sh-2: 0 4px 14px rgba(26, 34, 56, 0.08);
  --sh-3: 0 12px 32px rgba(26, 34, 56, 0.12);

  /* Container */
  --container: 1280px;
  --container-narrow: 920px;
  --container-wide: 1440px;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0E1424;
  --bg-elev: #161E33;
  --bg-sunken: #0A0F1D;
  --bg-tinted: #1A2238;

  --ink: #F5F1E8;
  --ink-2: #DCD8CE;
  --ink-3: #A8AEC0;
  --ink-4: #6E7488;
  --ink-5: #444B62;

  --line: rgba(245, 241, 232, 0.10);
  --line-2: rgba(245, 241, 232, 0.18);
  --line-strong: rgba(245, 241, 232, 0.30);

  --gold: #D4B070;
  --gold-deep: #B8975A;
  --gold-tint: #5C4A28;
  --gold-bg: #2B2415;

  --pos-bg: #1A3326;
  --neg-bg: #3D1F1F;
  --warn-bg: #3D2E15;
  --info-bg: #1F2D45;
}

/* Compact density */
[data-density="compact"] {
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 16px;
  --sp-6: 24px;
  --sp-7: 32px;
}
[data-density="comfy"] {
  --sp-4: 20px;
  --sp-5: 28px;
  --sp-6: 40px;
  --sp-7: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: inherit; text-decoration: none; }

/* Type scale */
.t-display {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.t-h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.t-h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.t-h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.t-lead {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
}
.t-body { font-size: 15px; line-height: 1.55; }
.t-small { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.t-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.t-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.t-num {
  font-family: var(--serif);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 40px;
  padding: 0 var(--sp-4);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 120ms ease;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
}
.btn-primary { background: var(--ink); color: #FBF7F0; }
.btn-primary:hover { background: var(--ink-2); }
.btn-secondary { background: var(--bg-elev); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { background: var(--bg-tinted); border-color: var(--line-strong); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-tinted); }
.btn-gold { background: var(--gold); color: #1A2238; }
.btn-gold:hover { background: var(--gold-deep); color: var(--bg); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: 13px; }
.btn-lg { height: 52px; padding: 0 var(--sp-5); font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--r-1);
  letter-spacing: 0.01em;
}
.badge-pos { background: var(--pos-bg); color: var(--pos); }
.badge-neg { background: var(--neg-bg); color: var(--neg); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gold { background: var(--gold-bg); color: var(--gold-deep); }
.badge-ink { background: var(--bg-tinted); color: var(--ink-2); border: 1px solid var(--line); }

/* Cards */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
}

/* Inputs */
.input {
  height: 40px;
  padding: 0 var(--sp-3);
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms;
  width: 100%;
}
.input:focus { border-color: var(--ink); }

/* Disclaimer banner — important for legal positioning */
.disclaimer-banner {
  background: var(--gold-bg);
  border-bottom: 1px solid var(--gold-tint);
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--gold-deep);
  text-align: center;
  font-family: var(--sans);
}
.disclaimer-banner strong { color: var(--ink-2); }

/* Ad slot styling — looks native, labeled */
.ad-slot {
  background: var(--bg-tinted);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
}
.ad-slot::before {
  content: 'REKLAMË';
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--ink-4);
  opacity: 0.7;
}
.ad-banner { height: 90px; }
.ad-square { aspect-ratio: 1; }
.ad-rect { aspect-ratio: 4/3; }
.ad-sticky { height: 600px; }
.ad-incontent { height: 250px; }

/* Verifikuar badge component */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: var(--bg-elev);
  font-family: var(--sans);
}
.verified-badge .vb-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.verified-badge .vb-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.verified-badge .vb-text small {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
}
.verified-badge .vb-text strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

/* Stat block */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-lbl {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stat-delta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--pos);
}
.stat-delta.neg { color: var(--neg); }

/* Tables — Bloomberg-style */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-feature-settings: 'tnum';
}
.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-tinted);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.data-table tr:hover td { background: var(--bg-tinted); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .mono { font-family: var(--mono); font-size: 12.5px; }

/* Section header */
.section-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.section-hd h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.section-hd .more {
  color: var(--ink-3);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.section-hd .more:hover { color: var(--ink); }

/* Kicker rule */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.kicker::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1.5px;
  background: var(--gold);
}

/* Skeleton placeholder pattern */
.placeholder-img {
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(26,34,56,0.04) 8px 9px),
    var(--bg-tinted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* Focus ring */
*:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* Map placeholder — abstract */
.map-bg {
  background:
    radial-gradient(circle at 30% 40%, rgba(184,151,90,0.08) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(26,34,56,0.06) 0%, transparent 40%),
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 80px),
    var(--bg-tinted);
}

/* Chart helpers */
.chart-bar {
  background: var(--ink);
  border-radius: 1px 1px 0 0;
  transition: opacity 120ms;
}
.chart-bar.muted { opacity: 0.18; }
.chart-bar.gold { background: var(--gold); }

/* Hover utility */
.hover-row { transition: background 120ms; cursor: pointer; }
.hover-row:hover { background: var(--bg-tinted); }

/* Divider */
.hr-rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: var(--sp-5) 0;
}

/* Utility */
.flex { display: flex; }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.muted { color: var(--ink-3); }
.subtle { color: var(--ink-4); }
.bold { font-weight: 600; }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }

/* Pagination */
.page-numbers {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--ink-3);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
}
.page-numbers.current {
  background: var(--ink);
  color: #FBF7F0;
  border-color: var(--ink);
}
.page-numbers:hover { background: var(--bg-tinted); color: var(--ink); }


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

/* Universal — prevent any element from forcing horizontal scroll */
html, body { overflow-x: hidden; max-width: 100vw; }
img, table, .ad-slot, .map-bg { max-width: 100%; }

.container, .container-wide, .container-narrow {
  width: 100%;
  box-sizing: border-box;
}

/* Tablet ≤ 900px */
@media (max-width: 900px) {
  /* business profile: stack columns */
  .arbk-biz-grid,
  div[style*="grid-template-columns:1fr 340px"],
  div[style*="grid-template-columns: 1fr 340px"] {
    grid-template-columns: 1fr !important;
    gap: var(--sp-5) !important;
  }
  aside[style*="position:sticky"],
  aside[style*="position: sticky"] {
    position: static !important;
  }

  /* footer: stack 3-col grid */
  footer div[style*="grid-template-columns:1.5fr"],
  footer div[style*="grid-template-columns: 1.5fr"] {
    grid-template-columns: 1fr !important;
    gap: var(--sp-6) !important;
  }

  /* hero font scale */
  .t-display { font-size: 36px !important; }
  .t-h1 { font-size: 28px !important; }
  .t-h2 { font-size: 22px !important; }
  .t-lead { font-size: 16px; }

  /* stat block on homepage: 2 cols */
  div[style*="grid-template-columns:repeat(4, 1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: var(--sp-4) !important;
  }
  .stat-num { font-size: 28px; }
}

/* Mobile ≤ 640px */
@media (max-width: 640px) {
  .container, .container-wide, .container-narrow {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  /* Header: hide secondary items, keep logo + search + login */
  header > .container-wide nav { display: none !important; }
  header > .container-wide .btn-ghost span:not([style*="border"]) { display: none; }
  header > .container-wide .btn-ghost span[style*="border"] { display: none; }
  header > .container-wide div[style*="font-family:var(--mono)"] { display: none; }
  header > .container-wide { gap: var(--sp-3) !important; height: 56px !important; }

  /* Disclaimer ribbon — smaller, allow wrap */
  .disclaimer-banner { font-size: 11px; padding: 8px 12px; }
  .disclaimer-banner .container-wide { flex-wrap: wrap; gap: 4px; }

  /* Single business page: header card stacks */
  main > div[style*="display:flex"][style*="gap:24px"][style*="margin-bottom:32px"] {
    flex-direction: column !important;
    gap: var(--sp-4) !important;
  }
  main > div[style*="display:flex"] > div[style*="display:flex; flex-direction:column; gap:8px"] {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  /* Tables — make them horizontally scrollable instead of overflow */
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 6px; }
  /* For single-business tables, wrap each in scroll container */
  main > div table.data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Hero search bar */
  form > div[style*="height:64px"] { height: 52px !important; }
  form > div[style*="height:64px"] input { font-size: 14px !important; }
  form > div[style*="height:64px"] button { height: 40px !important; padding: 0 12px !important; font-size: 13px !important; }

  /* Card grids: 1 col */
  div[style*="grid-template-columns:repeat(auto-fill, minmax(320px, 1fr))"],
  div[style*="grid-template-columns: repeat(auto-fill, minmax(320px, 1fr))"],
  div[style*="grid-template-columns:repeat(auto-fill, minmax(280px, 1fr))"],
  div[style*="grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))"],
  div[style*="grid-template-columns:repeat(auto-fill, minmax(220px, 1fr))"],
  div[style*="grid-template-columns: repeat(auto-fill, minmax(220px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }

  /* Stat block on homepage: 2x2 still, but bigger gap */
  div[style*="grid-template-columns:repeat(4, 1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
    gap: var(--sp-5) !important;
  }
  .stat-num { font-size: 24px; }

  /* Big H1s (single-business hero) */
  h1[style*="font-size:42px"] { font-size: 28px !important; line-height: 1.15 !important; }

  /* Footer text */
  footer { padding-top: var(--sp-6); padding-bottom: var(--sp-5); margin-top: var(--sp-7); }
  footer h4 { margin-bottom: 8px; }

  /* In-content ad slot at smaller size */
  .ad-incontent { height: 200px; }
  .ad-banner { height: 60px; }

  /* Tabs row (if added later): horizontal scroll */
  div[role="tablist"] { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; }
}

/* Very small ≤ 380px */
@media (max-width: 380px) {
  .t-display { font-size: 28px !important; }
  h1[style*="font-size:42px"] { font-size: 24px !important; }
  .container, .container-wide, .container-narrow { padding-left: 12px; padding-right: 12px; }
}

/* ─── Mobile side-padding hard reset ───
   Many templates use inline `padding: var(--sp-7) 0` which wipes the container
   class's horizontal padding. Force horizontal padding on every direct child
   of body so content never hits the screen edge. */
@media (max-width: 900px) {
  body > div.container-wide,
  body > div.container,
  body > div.container-narrow,
  main > div.container-wide,
  main > div.container,
  main > div.container-narrow,
  body header > div.container-wide,
  body footer > div.container-wide,
  .container, .container-wide, .container-narrow {
    padding-left: var(--sp-4) !important;
    padding-right: var(--sp-4) !important;
  }

  /* Disclaimer ribbon — guarantee inner padding */
  .disclaimer-banner > .container-wide {
    padding-left: var(--sp-4) !important;
    padding-right: var(--sp-4) !important;
  }

  /* Cards inside a flush-padding container should keep their own horizontal padding */
  .card { padding-left: var(--sp-4); padding-right: var(--sp-4); }

  /* Tables already have td padding but ensure none push past edge */
  .data-table { width: 100%; }
}

@media (max-width: 480px) {
  body > div.container-wide,
  body > div.container,
  body > div.container-narrow,
  .container, .container-wide, .container-narrow {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .disclaimer-banner > .container-wide,
  body header > div.container-wide,
  body footer > div.container-wide {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

/* ─── Mobile: prevent iOS auto-zoom on input focus.
   iOS Safari zooms in when an input has font-size < 16px. Force ≥16px on
   touch devices so the page never zooms (which also prevents horizontal scroll
   from the zoom artifact). Desktop typography unaffected. */
@media (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
}
