.home{
  margin-left: 60px;
}

.top-of-page {
  margin: 30px 0px 30px 60px;
}

#search-results-list .search-result p {
  line-height: 1.5;
  font-weight: 300;
  color: #a8a9ad;
  font-size: .75rem;
  font-style: italic;
  margin-top: 45px;
  margin-bottom: 10px;
  padding-left: 2px;
  padding-right: 5px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(320px, clamp(420px, 55vw, 720px)) max-content;
  grid-template-areas:
    "left right"
    "status status";
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
  justify-content: start; 
  margin-left: .5em;        
}

.search-left   { 
  grid-area: left; 
}

.search-right  { 
  grid-area: right; 
  display: flex; 
  gap: 10px; 
  align-items: center; 
}

#searchStatus  { 
  grid-area: status;
}

.search-row .form-control { 
  width: 100%; 
  height: 40px; 
  padding: 8px 12px; 
  box-sizing: border-box; 
}

.search-right {
  grid-area: right;
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-row .form-select {
  width: auto;
  display: inline-block;
  min-width: 180px;
  max-width: 280px;
  height: 40px;
  padding: 8px 12px;
  margin: 0;
}

.search-row .form-control,
.search-row .form-select {
  height: 40px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.reset-link { display: inline-flex; align-items: center; justify-content: center; }
.refreeshicn {
  width: 60px;
  display: block;
  margin-top: 0;
}

.sortby-label {
  display: inline-block;
  margin-bottom: 0;
  margin-left: .5em;
}

.search-right .sortby-label,
.search-right #sortOrder,
.search-right .reset-link { display: none; }

.search-right.sort-visible .sortby-label,
.search-right.sort-visible #sortOrder { display: inline-block; }
.search-right.sort-visible .reset-link { display: inline-flex; } /* keep icon centered */

@media (max-width: 991px) {
  .search-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "right"
      "status";
    margin-left: 5%;
    margin-right: 5%;  
  }
 
  .search-row .search-left{
    margin-left: .5em;
    margin-right: .5em;
  }

  .search-right { justify-content: flex-start; }
  .search-row .form-select {
    min-width: 0;
    max-width: none;
  }

  .home{
    margin-left: 0px;
  }

  #searchStatus  { 
    grid-area: status; 
    margin-left:.5em
  }

  .top-of-page {
    margin: 24px 0px 30px 30px;
  }
}

/* ==== Custom dropdown (works with your existing layout) ==== */

/* Hide native <select> but keep it for form/events */
#sortOrder.dd-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Wrapper inserted after the select */
.dd {
  position: relative;
  display: none; /* default hidden until .sort-visible */
  font: inherit;
  color: inherit;
}

/* Only show the custom dropdown when your controls are visible */
.search-right.sort-visible .dd { display: inline-block; }

.dd-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;

  min-width: 180px;   /* starting point */
  max-width: 280px;
  height: 40px;
  padding: 8px 12px;

  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* JS will override min-width inline */


/* Focus (same orange you used) */
.dd:focus-within .dd-button {
  border-color: #f7941f;
  outline: none;
}

/* Chevron */
.dd-chevron {
  width: 14px; height: 14px; flex: 0 0 14px;
}

/* Popup list */
.dd-list {
  position: absolute;
  z-index: 9999;
  left: 0; right: 0;  /* same width as button */
  margin-top: 4px;
  background: #fff;
  border: 1px solid #ccc;       /* dropdown border */
  border-radius: 6px;
  padding: 4px;
  max-height: 280px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  display: none; /* toggled by [data-open] on .dd */
}

.dd[data-open="true"] .dd-list { display: block; }
.dd[data-open="true"] .dd-list { border-color: #f7941f; }

/* Options */
.dd-option {
  list-style: none;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Hover color (works everywhere, since this is a custom list) */
.dd-option:hover { 
  background: #EEEFEB; 
  color: #414042; 
}

/* Selected option style (matches your select option:checked) */
.dd-option[aria-selected="true"] {
  background: #414042;
  color: #fff;
}

/* Keyboard focus inside the list */
.dd-option:focus { outline: 2px solid #f7941f; outline-offset: 2px; }

/* Mobile stacking keeps working with your media query */
@media (max-width: 991px) {
  .dd-button {
    min-width: 0;
    max-width: none;
  }
}

.articles-index {
  margin-top: 20px;
}

/* Target the clear "X" in WebKit browsers */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; /* remove default icon */
  height: 16px;
  width: 16px;
  cursor: pointer;

  /* Replace with your own SVG so you can control color */
  background: no-repeat center/contain url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%23414042' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'>\
    <line x1='18' y1='6' x2='6' y2='18'/>\
    <line x1='6' y1='6' x2='18' y2='18'/>\
  </svg>");
}

