/* ==========================================================================
   HSE Business Directory — Stylesheet
   Matches the Softr-based design at houstonse.org/directory-v2/
   Author: Busy Bee Creatives | Version: 1.4.2
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.hse-dir-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  padding: 24px 16px 40px;
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Toolbar (search + sort)
   -------------------------------------------------------------------------- */
.hse-dir-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hse-dir-search-wrap {
  flex: 1;
  min-width: 200px;
}

.hse-dir-sort-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hse-dir-sort-label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.hse-dir-sort {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.hse-dir-sort:focus {
  border-color: #2B6CB0;
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}

.hse-dir-search {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
  padding-left: 36px;
}

.hse-dir-search:focus {
  border-color: #2B6CB0;
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.hse-dir-filters { margin-bottom: 20px; }
.hse-dir-filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hse-dir-filter-item { min-width: 220px; flex: 1; }
.hse-dir-filter-item label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
  font-weight: 600;
}
.hse-dir-filter-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}
.hse-dir-filter-row--checks label {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 18px;
  padding: 6px 12px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Category Filter Tabs
   -------------------------------------------------------------------------- */
.hse-dir-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.hse-dir-cat-btn {
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  white-space: nowrap;
  font-family: inherit;
}

.hse-dir-cat-btn:hover {
  background: #e8f0fb;
  border-color: #2B6CB0;
  color: #2B6CB0;
}

.hse-dir-cat-btn.active {
  background: #2B6CB0;
  border-color: #2B6CB0;
  color: #fff;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Results Count
   -------------------------------------------------------------------------- */
.hse-dir-count {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin: 0 0 20px;
}

/* --------------------------------------------------------------------------
   Card Grid
   -------------------------------------------------------------------------- */
.hse-dir-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .hse-dir-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .hse-dir-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.hse-dir-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.hse-dir-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* Hidden state (filtered out) */
.hse-dir-card.hse-hidden {
  display: none;
}

/* --------------------------------------------------------------------------
   Loading State
   -------------------------------------------------------------------------- */
.hse-dir-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: #888;
  font-size: 15px;
}

.hse-dir-loading p {
  margin: 0;
}

.hse-dir-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #2B6CB0;
  border-radius: 50%;
  animation: hse-spin 0.75s linear infinite;
}

@keyframes hse-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Logo Area
   -------------------------------------------------------------------------- */
.hse-dir-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  padding: 12px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.hse-dir-logo {
  max-width: 140px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hse-dir-logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #718096;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Business Info
   -------------------------------------------------------------------------- */
.hse-dir-info {
  padding: 14px 16px 8px;
  flex: 1;
}

.hse-dir-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1a202c;
  line-height: 1.3;
}

.hse-dir-description {
  font-size: 12px;
  color: #5a5a5a;
  font-style: italic;
  margin: 0 0 8px;
}

/* Category tags */
.hse-dir-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 10px;
}

.hse-dir-cat-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #ebf4ff;
  color: #2B6CB0;
  font-weight: 500;
}

.hse-dir-cultural-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #a0522d;
  color: #fff;
  font-weight: 500;
}

.hse-dir-attr-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hse-dir-attr-badge {
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Fields */
.hse-dir-field {
  margin: 0 0 6px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: #4a5568;
  word-break: break-word;
}

.hse-dir-field:last-child {
  margin-bottom: 0;
}

.hse-dir-icon {
  flex-shrink: 0;
  font-size: 12px;
  margin-top: 1px;
}

.hse-dir-field a {
  color: #2B6CB0;
  text-decoration: none;
  word-break: break-all;
}

.hse-dir-field a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Get Directions Button
   -------------------------------------------------------------------------- */
.hse-dir-actions {
  padding: 12px 16px 16px;
}

.hse-dir-btn {
  display: block;
  width: 100%;
  padding: 9px 16px;
  background: #2B6CB0;
  color: #fff !important;
  text-align: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s;
  box-sizing: border-box;
}

.hse-dir-btn:hover {
  background: #2c5282;
  text-decoration: none !important;
}

.hse-dir-btn:focus {
  outline: 3px solid rgba(43, 108, 176, 0.4);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.hse-dir-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  padding: 8px 0;
}

.hse-dir-page-btn {
  padding: 8px 20px;
  background: #2B6CB0;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s;
}

.hse-dir-page-btn:hover:not(:disabled) {
  background: #2c5282;
}

.hse-dir-page-btn:disabled {
  background: #cbd5e0;
  cursor: default;
}

.hse-dir-page-info {
  font-size: 13px;
  color: #555;
  min-width: 90px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Empty / No-results States
   -------------------------------------------------------------------------- */
.hse-dir-empty,
.hse-dir-no-results {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-size: 15px;
}

/* ==========================================================================
   HSE Business Submission Form — [hse_submit]
   ========================================================================== */

.hse-submit-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
  max-width: 680px;
  margin: 0 auto;
}

.hse-submit-intro {
  margin-bottom: 28px;
}

.hse-submit-intro h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px;
}

.hse-submit-intro p {
  color: #555;
  margin: 0;
  line-height: 1.6;
}

.hse-submit-row {
  margin-bottom: 20px;
}

.hse-submit-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 8px 16px;
}

.hse-submit-check-grid label {
  font-size: 13px;
  color: #2d3748;
}

.hse-submit-row--half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .hse-submit-row--half {
    grid-template-columns: 1fr;
  }
}

.hse-submit-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
}

.hse-required {
  color: #e53e3e;
  margin-left: 2px;
}

.hse-submit-hint {
  display: block;
  font-size: 12px;
  color: #718096;
  margin-top: 4px;
}

.hse-submit-hint-inline {
  font-size: 12px;
  color: #718096;
  font-weight: 400;
}

.hse-submit-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  background: #fff;
  color: #1a202c;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hse-submit-input:focus {
  border-color: #2B6CB0;
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}

.hse-submit-select {
  cursor: pointer;
  appearance: auto;
}

/* File upload */
.hse-submit-file-wrap {
  position: relative;
}

.hse-submit-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.hse-submit-file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 2px dashed #cbd5e0;
  border-radius: 6px;
  cursor: pointer;
  background: #f7fafc;
  transition: border-color 0.2s, background 0.2s;
  font-size: 13px;
  color: #718096;
}

.hse-submit-file-label:hover {
  border-color: #2B6CB0;
  background: #ebf4ff;
  color: #2B6CB0;
}

.hse-submit-file-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* Submit button */
.hse-submit-actions {
  margin-top: 28px;
}

.hse-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: #2B6CB0;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s;
}

.hse-submit-btn:hover:not(:disabled) {
  background: #2c5282;
}

.hse-submit-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.hse-submit-btn-spinner {
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hse-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Result messages */
#hse-submit-result {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}

#hse-submit-result p { margin: 0; }

.hse-submit-success {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #276749;
}

.hse-submit-error {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #c53030;
}

.hse-submit-error a {
  color: #c53030;
}

/* --------------------------------------------------------------------------
   Loading Skeleton (optional future use)
   -------------------------------------------------------------------------- */
@keyframes hse-skeleton-pulse {
  0%   { background-color: #e2e8f0; }
  50%  { background-color: #edf2f7; }
  100% { background-color: #e2e8f0; }
}
