/* ============================================================
   cdi-layout.css — Premium layout system
   
   PRINCIPLE:
   - Nav (topnav): full width edge-to-edge
   - Hero bands / coloured sections: full width background
   - Body content (.cw): max 1180px centred with auto margins
   - Footer: full width background, content centred inside
   
   This is exactly how Stripe, Linear, Vercel do it.
   Wide screens get whitespace on the sides — premium feel.
   ============================================================ */

/* ── The content wrapper — centred, max-width body ── */
.cw {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* ── Full-width coloured bands — background stretches, content centred ── */
.fw {
  width: 100%;
}

/* Nav content area centred inside full-width nav */
.topnav .row {
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Footer inner centred */
.foot-inner,
footer .cw,
.foot-grid {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* Hero sections — full-width background, content max-width inside */
.mphero,
.cdi-hero,
.page-hero,
.hero-band,
.sec-band,
.browse-toolbar {
  width: 100%;
}

.mphero .cw,
.cdi-hero .cw,
.page-hero .cw,
.hero-band .cw {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ── Sections ── */
.sec,
.cdi-section,
section.sec {
  width: 100%;
}

.sec .cw,
.cdi-section .cw {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ── Prevent anything from exceeding viewport ── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── Mobile — full width with padding ── */
@media (max-width: 768px) {
  .cw,
  .mphero .cw,
  .sec .cw,
  .cdi-section .cw,
  .hero-band .cw,
  .topnav .row,
  .foot-inner {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
  }
}

/* ── Tablet ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .cw,
  .topnav .row,
  .foot-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ── Tables — always scrollable ── */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 0;
  border-collapse: collapse;
}

@media (max-width: 768px) {
  /* Wrap any raw table in a scroll container */
  table:not(.no-scroll) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  
  table th,
  table td {
    font-size: 13px;
    padding: 9px 10px;
    white-space: normal;
  }
}

/* ── Filter pill rows — horizontal scroll on mobile ── */
.qf-bar,
.qf-pills,
.chip-row,
.filter-pills,
.cdi-pills-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.qf-bar::-webkit-scrollbar,
.qf-pills::-webkit-scrollbar,
.chip-row::-webkit-scrollbar,
.filter-pills::-webkit-scrollbar {
  display: none;
}

/* ── Typography scale ── */
h1 { font-size: clamp(24px, 4vw, 42px); line-height: 1.1; }
h2 { font-size: clamp(20px, 3vw, 30px); line-height: 1.2; }
h3 { font-size: clamp(16px, 2.5vw, 22px); line-height: 1.3; }

@media (max-width: 768px) {
  h1 { font-size: clamp(22px, 6.5vw, 32px) !important; }
  h2 { font-size: clamp(18px, 5vw, 26px) !important; }
  h3 { font-size: clamp(15px, 4vw, 20px) !important; }
}

/* ── Grid collapse on mobile ── */
@media (max-width: 768px) {
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  
  [style*="display: flex"][style*="gap"],
  [style*="display:flex"][style*="gap"] {
    flex-wrap: wrap;
  }
}

/* ── Images always fluid ── */
img {
  max-width: 100%;
  height: auto;
}

/* ── Buttons never overflow ── */
.btn {
  max-width: 100%;
  word-break: break-word;
  white-space: normal;
}

/* ── Dashboard and admin — sidebar + content layout ── */
.dsb-wrap,
.adm-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .dsb-wrap,
  .adm-wrap {
    grid-template-columns: 1fr;
  }
  .dsb-sidebar,
  .adm-sidebar {
    display: none;
  }
  .dsb-content,
  .adm-content {
    padding: 14px;
  }
}

/* ── Location city cards ── */
.loc-city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.loc-city-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border: 1.5px solid var(--line, #E6E9EE);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink, #14171F);
  font-size: 14px;
  font-weight: 600;
  min-height: 52px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}

.loc-city-card:hover {
  border-color: var(--navy, #0B1F3D);
  box-shadow: 0 4px 16px rgba(11,31,61,.1);
  transform: translateY(-1px);
}

.loc-region-h {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line, #E6E9EE);
}

@media (max-width: 560px) {
  .loc-city-grid {
    grid-template-columns: 1fr 1fr;
  }
  .loc-city-card {
    padding: 10px 12px;
    min-height: 48px;
    font-size: 13px;
  }
}

/* ── AEO block ── */
.aeo-block {
  background: var(--mist, #F5F7FA);
  border: 1.5px solid var(--line, #E6E9EE);
  border-left: 4px solid var(--green, #00A53C);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.aeo-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green, #00A53C);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

.aeo-q {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.3;
}

.aeo-a {
  font-size: 14.5px;
  color: var(--slate);
  line-height: 1.7;
  margin-bottom: 14px;
}

.aeo-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.aeo-fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line, #E6E9EE);
  border-radius: 99px;
  padding: 4px 12px;
}

.aeo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aeo-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  text-decoration: none;
  transition: border-color .15s;
}

.aeo-link:hover {
  border-color: var(--navy);
}

@media (max-width: 600px) {
  .aeo-block { padding: 14px 16px; }
  .aeo-q { font-size: 15px; }
}
