/* Ginger Articles Showcase Styling */
#ginger-articles-showcase {
  --gas-brand-yellow: #facc15;
  --gas-brand-yellow-hover: #ffaa00;
  --gas-brand-yellow-light: #fefce8;
  --gas-brand-yellow-border: #fde047;
  --gas-brand-red: #dc2626;
  --gas-text-dark: #18181b;
  --gas-text-muted: #52525b;
  --gas-bg-card: #ffffff;
  --gas-border: #e4e4e7;
  --gas-border-hover: #ffaa00;
  --gas-radius: 10px;
  --gas-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  --gas-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.08);
  
  font-family: 'Outfit', 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--gas-text-dark);
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  box-sizing: border-box;
}

#ginger-articles-showcase * {
  box-sizing: border-box;
}

/* Defensive theme reset overrides for form controls inside showcase */
#ginger-articles-showcase input[type="text"].gas-search-input,
#ginger-articles-showcase select.gas-filter-select,
#ginger-articles-showcase button.gas-view-btn,
#ginger-articles-showcase button.gas-topic-chip,
#ginger-articles-showcase button.gas-load-more-btn,
#ginger-articles-showcase button.gas-clear-btn,
#ginger-articles-showcase button.gas-search-clear {
  font-family: 'Outfit', 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  max-width: 100%;
}

/* Header & Banner */
.gas-header {
  background: linear-gradient(135deg, #ffffff 0%, #fefce8 100%);
  border: 1px solid #fef08a;
  border-radius: var(--gas-radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 2px 8px rgba(250, 204, 21, 0.1);
}

.gas-header-title {
  margin: 0 0 10px 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gas-text-dark);
  display: inline-block;
  position: relative;
  letter-spacing: -0.3px;
}

.gas-header-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 5px;
  background: var(--gas-brand-yellow);
  border-radius: 4px;
  margin-top: 6px;
}

.gas-header-subtitle {
  margin: 12px 0 0 0;
  font-size: 0.98rem;
  color: var(--gas-text-muted);
  line-height: 1.6;
  max-width: 850px;
}

/* Controls Toolbar - Side-by-side Row Layout */
.gas-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.gas-search-row {
  display: flex !important;
  flex-direction: row;
  gap: 12px !important;
  align-items: center !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

/* Search input container - Elastic flex width */
.gas-search-box {
  position: relative;
  flex: 1 1 0% !important;
  min-width: 220px !important;
  width: auto !important;
  display: flex !important;
  align-items: center !important;
}

.gas-search-input {
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  line-height: 48px !important;
  padding: 0 40px 0 44px !important;
  font-size: 0.95rem !important;
  border: 2px solid var(--gas-border) !important;
  border-radius: var(--gas-radius) !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  background: #ffffff !important;
  color: var(--gas-text-dark) !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.gas-search-input::placeholder {
  color: #9ca3af !important;
  opacity: 1 !important;
}

.gas-search-input:focus {
  border-color: var(--gas-brand-yellow) !important;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.3) !important;
}

.gas-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--gas-text-muted);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  z-index: 2;
}

/* Search Clear Button */
.gas-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e4e4e7;
  color: #52525b;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 2;
}

.gas-search-clear:hover {
  background: #d4d4d8;
  color: #18181b;
}

/* Styled Dropdown Select - Fixed side-by-side width */
.gas-filter-select {
  flex: 0 0 250px;
  width: 250px !important;
  max-width: 260px !important;
  min-width: 180px !important;
  height: 48px !important;
  min-height: 48px !important;
  line-height: 48px !important;
  padding: 0 40px 0 16px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  border: 2px solid var(--gas-border) !important;
  border-radius: var(--gas-radius) !important;
  outline: none !important;
  background-color: #ffffff !important;
  background-image: 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='%2352525b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  color: var(--gas-text-dark) !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.gas-filter-select:focus {
  border-color: var(--gas-brand-yellow) !important;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.3) !important;
}

.gas-filter-select option {
  background: #ffffff;
  color: #18181b;
  padding: 10px;
}

.gas-view-toggle {
  flex: 0 0 auto !important;
  display: flex !important;
  width: auto !important;
  background: #f4f4f5;
  border-radius: var(--gas-radius);
  padding: 4px;
  gap: 4px;
  height: 48px;
  align-items: center;
}

.gas-view-btn {
  border: none !important;
  background: transparent;
  padding: 8px 16px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gas-text-muted);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gas-view-btn.active {
  background: var(--gas-brand-yellow) !important;
  color: var(--gas-text-dark) !important;
  box-shadow: 0 2px 6px rgba(250, 204, 21, 0.4) !important;
}

/* Chips Carousel - Draggable */
.gas-topics-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--gas-brand-yellow-border) transparent;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}

.gas-topics-scroll.is-dragging {
  cursor: grabbing !important;
}

.gas-topics-scroll::-webkit-scrollbar {
  height: 6px;
}

.gas-topics-scroll::-webkit-scrollbar-thumb {
  background: var(--gas-brand-yellow-border);
  border-radius: 10px;
}

.gas-topic-chip {
  border: 1.5px solid var(--gas-border) !important;
  background: #ffffff !important;
  color: var(--gas-text-dark) !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  flex-shrink: 0;
}

.gas-topic-chip:hover {
  border-color: var(--gas-brand-yellow) !important;
  background: var(--gas-brand-yellow-light) !important;
}

.gas-topic-chip.active {
  background: var(--gas-brand-yellow) !important;
  color: var(--gas-text-dark) !important;
  border-color: var(--gas-brand-yellow) !important;
  box-shadow: 0 3px 10px rgba(250, 204, 21, 0.35) !important;
}

.gas-chip-count {
  font-size: 0.75rem;
  background: #f4f4f5;
  color: var(--gas-text-dark);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  pointer-events: none;
}

.gas-topic-chip.active .gas-chip-count {
  background: rgba(0, 0, 0, 0.08);
}

/* Summary Bar */
.gas-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gas-text-muted);
  padding: 0 4px;
}

.gas-clear-btn {
  color: var(--gas-text-dark) !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  cursor: pointer !important;
  background: none !important;
  border: none !important;
  font-size: 0.85rem !important;
  padding: 0 !important;
}

.gas-clear-btn:hover {
  color: var(--gas-brand-red) !important;
}

/* Layout Grid & List */
.gas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.gas-grid.list-mode {
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Card */
.gas-card {
  background: var(--gas-bg-card);
  border: 1px solid var(--gas-border);
  border-radius: var(--gas-radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--gas-shadow);
  position: relative;
  text-decoration: none !important;
  color: inherit !important;
  overflow: hidden;
}

.gas-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: background 0.2s ease;
}

.gas-card:hover {
  transform: translateY(-4px);
  border-color: var(--gas-brand-yellow);
  box-shadow: var(--gas-shadow-hover);
}

.gas-card:hover::before {
  background: var(--gas-brand-yellow);
}

.gas-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.gas-badge-cat {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gas-text-dark);
  background: var(--gas-brand-yellow-light);
  border: 1px solid var(--gas-brand-yellow-border);
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gas-badge-source {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gas-text-muted);
  background: #f4f4f5;
  padding: 3px 8px;
  border-radius: 4px;
}

.gas-card-title {
  margin: 0 0 16px 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--gas-text-dark);
  transition: color 0.2s ease;
}

.gas-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gas-text-dark);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f4f4f5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gas-link-btn {
  background: var(--gas-brand-yellow);
  color: var(--gas-text-dark);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.gas-card:hover .gas-link-btn {
  transform: translateX(4px);
  background: var(--gas-brand-yellow-hover);
}

/* List view adjustments */
.gas-grid.list-mode .gas-card {
  flex-direction: row;
  align-items: center;
  padding: 14px 20px;
}

.gas-grid.list-mode .gas-card-meta {
  margin-bottom: 0;
  margin-right: 16px;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.gas-grid.list-mode .gas-card-title {
  margin: 0;
  flex: 1;
  font-size: 0.98rem;
}

.gas-grid.list-mode .gas-card-footer {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-left: 16px;
  flex-shrink: 0;
}

.gas-grid.list-mode .gas-card-footer span:first-child {
  display: none;
}

/* Load More */
.gas-pagination {
  text-align: center;
  margin-top: 36px;
}

.gas-load-more-btn {
  background: var(--gas-brand-yellow) !important;
  color: var(--gas-text-dark) !important;
  border: none !important;
  padding: 14px 34px !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  border-radius: var(--gas-radius) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.4) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
}

.gas-load-more-btn:hover {
  background: var(--gas-brand-yellow-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.5) !important;
}

.gas-empty-state {
  text-align: center;
  padding: 48px 20px;
  background: #fafafa;
  border-radius: var(--gas-radius);
  border: 2px dashed var(--gas-border);
  grid-column: 1 / -1;
}

.gas-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.gas-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gas-text-dark);
  margin-bottom: 6px;
}

.gas-empty-desc {
  color: var(--gas-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .gas-search-row {
    flex-direction: column;
  }
  .gas-filter-select {
    width: 100% !important;
  }
  .gas-grid.list-mode .gas-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .gas-grid.list-mode .gas-card-meta {
    flex-direction: row;
    margin-right: 0;
    margin-bottom: 8px;
  }
  .gas-grid.list-mode .gas-card-footer {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }
}

