/* ======================================================
   DIF Business Directory Styles (Elementor-optimized) v2.0.1
   - All text visible (wrapping)
   - 12px font across table
   - Stacked "card" mode below width threshold
   ====================================================== */

/* Wrapper */
.dbd-table-wrapper {
  overflow-x: auto;
  margin-bottom: 2em;
  min-width: 0;
  max-width: 100%;
}

/* Core table */
.dbd-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 12px;
  min-width: 0;
}

/* Headers & cells */
.dbd-table th,
.dbd-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Header style */
.dbd-table th {
  background-color: #f4f4f4;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* Zebra + hover */
.dbd-table tr:nth-child(even) { background-color: #fafafa; }
.dbd-table tr:hover { background-color: #f0f8ff; }

/* Links */
.dbd-table td a {
  color: #0066cc;
  text-decoration: underline;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Desktop/Laptop: ensure header minimum width */
@media (min-width: 992px) {
  .dbd-table th { min-width: 150px; }
}

/* CTA bar */
.dbd-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}
.dbd-upgrade-btn,
.dbd-sponsor-btn {
    display: flex;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    line-height: 1.2;
    position: relative;
    z-index: 2000;
}
.dbd-sponsor-btn { background: #0066cc; color: #fff !important; }
.dbd-sponsor-btn:hover { background:#0053a6; }
.dbd-upgrade-btn { background: #10a37f; color: #fff !important; }
.dbd-upgrade-btn:hover { background:#0d8468; }

/* Category list grid */
.dbd-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1em;
  padding-left: 0;
  list-style: none;
  margin: 2em 0;
}
.dbd-category-list li { margin: 0; padding: 0; }
.dbd-category-list a {
  display: block; padding: 8px 12px; background: #f4f4f4; border: 1px solid #ddd;
  border-radius: 4px; text-decoration: none; color: #333; transition: background 0.2s;
}
.dbd-category-list a:hover { background: #e6f0ff; }

/* Sponsor block */
.dbd-sponsor { display:flex; gap:12px; align-items:center; padding:12px; margin:12px 0 20px; border:1px solid #eee; background:#fafafa; }
.dbd-sponsor-label { font-weight:600; color:#555; }
.dbd-sponsor-logo { max-height:60px; width:auto; }

/* -------- Stacked mode (FooTable-like) -------- */
.dbd-table.is-stacked { 
  width: 100%;
  table-layout: fixed;
  border-collapse: separate; 
  border-spacing: 0;
}

.dbd-table.is-stacked thead { display: none; }
.dbd-table.is-stacked tbody { display: block; }
.dbd-table.is-stacked tr {
  display: block;
  border: 1px solid #ddd;
  margin-bottom: 12px;
  background: #fff;
}
.dbd-table.is-stacked td {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid #eee;
  position: relative;
  box-sizing: border-box;
  padding: 8px 8px 8px calc(var(--dbd-label-w, 140px) + 16px);
}
.dbd-table.is-stacked td:last-child { border-bottom: none; }

.dbd-table.is-stacked td::before {
  content: attr(data-label);
  position: absolute;
  left: 8px;
  top: 8px;
  width: var(--dbd-label-w, 140px);
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .dbd-table.is-stacked td {
    padding-left: calc(var(--dbd-label-w, 120px) + 14px);
  }
  .dbd-table.is-stacked td::before { width: var(--dbd-label-w, 120px); }
}

/* Elementor containers: allow shrinking */
.elementor .elementor-container,
.elementor .elementor-row,
.elementor .elementor-column,
.elementor .elementor-widget-wrap,
.elementor .elementor-widget-container { min-width: 0; }
