/* Add your css code here */
/*
Variable Definitions:
  --r-bg: Region background color. Sets the overall background color of the region wrapper.
  --r-tx: Region text color. Sets the default text color for all paragraph and inline text within the region.
  --r-h1: Region heading color. Specifically sets the color for headings (h1, h2, h3) within the region, allowing heading color control independently from body text.
  --r-lk: Region link color. Sets the color for anchor (<a>) links within the region in their normal (non-hover) state.
  --r-lk-h: Region link hover color. Sets the color of links within the region when hovered or focused, providing clear interactive feedback.
  --r-br: Region border color. Sets the border color for the region, useful for visual separation of sections.
  --r-bg-fr: Form background color within the region. Sets the background color specifically for input forms (e.g., login forms, search bars) within the region, enabling clear visual separation of form areas.
  --r-tx-lk: Menu link text color within the region. Sets the text color for menu links in navigation blocks or region-based menus, ensuring consistency with your theme’s navigation design.
  --r-tx-lk-h: Menu link hover text color within the region. Sets the hover or focus color for menu link text, aiding in clear navigation feedback for users.
  --r-bg-lk: Menu link background color within the region. Sets the background color of menu links in their normal state within the region for better menu styling control.
  --r-bg-lk-h: Menu link background hover color within the region. Sets the background color for menu links on hover/focus, ensuring clear user interaction indication.
  --r-tx-bt:  Button text color within the region. Sets the text color for buttons within the region (e.g., call-to-action buttons, form submit buttons).
  --r-tx-bt-h: Button text hover color within the region. Sets the text color for buttons when hovered/focused, providing interactive feedback.
  --r-bg-bt: Button background color within the region. Sets the background color for buttons in their normal state, aligning them visually with your design system.
  --r-bg-bt-h:  Button background hover color within the region. Sets the background color for buttons on hover/focus, improving interactivity and user experience.
*/

/*
Regions Names, each region has an ID and a Class with the same name.
You can use .page-wrapper or #page-wrapper
#page-wrapper {}
#primary-sidebar-menu {}
#fixed-search-block {}
#popup-login-block {}
#header {}
#primary-menu {}
#welcome-text {}

#top-container {}
#top-box-first {}
#top-box-second {}
#top-box-third {}

#system-messages {}
#breadcrumb {}
#page-title {}

#main-container {}
#sidebar-box-first {}
#sidebar-box-main {}
#sidebar-box-second {}

#bottom-container {}
#bottom-box-first {}
#bottom-box-second {}
#bottom-box-third {}
#bottom-box-fourth {}

#footer-container {}
#footer-box-first {}
#footer-box-second {}
#footer-box-third {}

#footer-menu {}
#copyright {}

Examples:

#page-wrapper {
  background-color: var(--r-bg);
  color: var(--r-tx);
  border-color: var(--r-br);
}

h1, h2, h3 {
  color: var(--r-h1);
}

a:not(li.nav__menu-item a) {
  color: var(--r-lk);
  color: var(--r-lk-h);
}

input:not(.button) {
  background-color: var(--r-bg-fr);
}

li.nav__menu-item a {
  color: var(--r-tx-lk);
  background-color: var(--r-bg-lk);
}

li.nav__menu-item a:hover {
  color: var(--r-tx-lk-h);
  background-color: var(--r-bg-lk-h);
}

button:not(li.nav__menu-item button) {
  color: var(--r-tx-bt);
  background-color: var(--r-bg-bt);
}

button:not(li.nav__menu-item button):hover {
  color: var(--r-tx-bt-h);
  background-color: var(--r-bg-bt-h);
}
https://www.drupal.org/docs/extending-drupal/themes/contributed-themes/solo/instructions-for-developers-on-using-colors-in-solo-theme
*/



/* ==========================================================
   STELA — MEDIA LIBRARY MODAL
   Scoped deliberately to the field-widget media modal.
   ========================================================== */

.media-library-widget-modal {
  --stela-media-accent: #3f7568;
  --stela-media-accent-dark: #315b51;
  --stela-media-accent-soft: #f1ebf4;
  --stela-media-bg: #f6f6f8;
  --stela-media-panel: #ffffff;
  --stela-media-border: #e3e3e8;
  --stela-media-border-strong: #d4d3da;
  --stela-media-text: #25232a;
  --stela-media-muted: #73717a;
  width: min(1180px, calc(100vw - 40px)) !important;
  max-width: 1180px !important;
  left: 50% !important;
  transform: translateX(-50%);
  top: 4vh !important;
  max-height: 92vh;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: var(--stela-media-bg) !important;
  box-shadow:
    0 28px 80px rgba(25, 20, 30, 0.20),
    0 4px 18px rgba(25, 20, 30, 0.08) !important;
  overflow: hidden;
}


/* ==========================================================
   TITLE BAR
   ========================================================== */

.media-library-widget-modal > .ui-dialog-titlebar {
  display: flex;
  align-items: center;

  min-height: 72px;

  padding: 0 24px !important;

  border: 0 !important;
  border-bottom: 1px solid var(--stela-media-border) !important;
  border-radius: 0 !important;

  background: #fff !important;

  box-shadow: none !important;
}


.media-library-widget-modal .ui-dialog-title {
  flex: 1;

  margin: 0 !important;

  color: var(--stela-media-text);

  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}


/* Close button */

.media-library-widget-modal .ui-dialog-titlebar-close {
  position: static !important;

  display: grid !important;
  place-items: center;

  width: 38px !important;
  height: 38px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 1px solid var(--stela-media-border) !important;
  border-radius: 50% !important;

  background: #f8f8fa !important;

  color: transparent !important;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}


.media-library-widget-modal .ui-dialog-titlebar-close:hover {
  background: #efedf1 !important;
  border-color: #cecad1 !important;
  transform: rotate(4deg);
}


.media-library-widget-modal .ui-dialog-titlebar-close .ui-icon {
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 !important;
    background: none !important;
    position: relative;
    left: 0px;
    top: 11px;
}


.media-library-widget-modal .ui-dialog-titlebar-close .ui-icon::before,
.media-library-widget-modal .ui-dialog-titlebar-close .ui-icon::after {
  content: "";

  position: absolute;
  top: 6px;
  left: 1px;

  width: 12px;
  height: 2px;

  border-radius: 2px;

  background: #55515b;
}


.media-library-widget-modal .ui-dialog-titlebar-close .ui-icon::before {
  transform: rotate(45deg);
}


.media-library-widget-modal .ui-dialog-titlebar-close .ui-icon::after {
  transform: rotate(-45deg);
}


.media-library-widget-modal .ui-dialog-titlebar-close .ui-button-icon-space {
  display: none;
}


/* ==========================================================
   MAIN SCROLLING AREA
   ========================================================== */

.media-library-widget-modal #drupal-modal {
  width: auto !important;

  max-height: calc(92vh - 146px) !important;

  padding: 0 !important;

  background: var(--stela-media-bg);

  overflow-x: hidden !important;
  overflow-y: auto !important;
}


.media-library-widget-modal #media-library-wrapper,
.media-library-widget-modal #media-library-content {
  width: 100%;
}


/* ==========================================================
   ADD / SOURCE AREA
   ========================================================== */

.media-library-widget-modal #media-library-add-form-wrapper {
  padding: 22px 24px;

  background: #fff;

  border-bottom: 1px solid var(--stela-media-border);
}


.media-library-widget-modal #media-library-add-form-wrapper > form {
  margin: 0;
}


/*
 * Only target the top-level source selector.
 * Do NOT target every select inside this form because AI tools
 * also live inside it.
 */

.media-library-widget-modal
#media-library-add-form-wrapper
> form
> .form-item-image-source {
  display: grid;

  grid-template-columns: auto minmax(240px, 360px);
  align-items: center;

  gap: 16px;

  max-width: 560px;

  margin: 0;
}


.media-library-widget-modal
#media-library-add-form-wrapper
> form
> .form-item-image-source
> label {
  margin: 0;

  color: var(--stela-media-text);

  font-size: 13px;
  font-weight: 700;
}


.media-library-widget-modal
#media-library-add-form-wrapper
> form
> .form-item-image-source
select {
  width: 100%;
  min-height: 44px;

  padding: 0 42px 0 14px;

  border: 1px solid var(--stela-media-border-strong);
  border-radius: 10px;

  background-color: #fff;

  color: var(--stela-media-text);

  font-size: 14px;
  font-weight: 600;

  box-shadow: 0 1px 2px rgba(0,0,0,.025);
}


.media-library-widget-modal
#media-library-add-form-wrapper
> form
> .form-item-image-source
select:focus {
  outline: 3px solid rgba(104, 77, 114, 0.13);
  outline-offset: 1px;

  border-color: var(--stela-media-accent);
}


/* ==========================================================
   STANDARD FILE UPLOAD
   ========================================================== */

.media-library-widget-modal
#media-library-add-form-wrapper
> form
> [data-drupal-selector="edit-container"] {
  margin-top: 18px;

  padding: 18px 20px;

  border: 1px dashed #d3ced7;
  border-radius: 13px;

  background: #faf9fb;
}


.media-library-widget-modal
#media-library-add-form-wrapper
> form
> [data-drupal-selector="edit-container"]
.form-item-upload {
  margin: 0;
}


.media-library-widget-modal
#media-library-add-form-wrapper
> form
> [data-drupal-selector="edit-container"]
.form-item__label {
  display: block;

  margin-bottom: 9px;

  color: var(--stela-media-text);

  font-size: 13px;
  font-weight: 700;
}


.media-library-widget-modal
#media-library-add-form-wrapper
.solo-file-upload-wrapper {
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--stela-media-border);
  border-radius: 10px;
  /* border: 1px solid var(--stela-media-border); */
}


.media-library-widget-modal
#media-library-add-form-wrapper
.solo-file-custom {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
  padding: 0;
}


.media-library-widget-modal
#media-library-add-form-wrapper
.solo-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 51px;
  padding: 0 18px;
  margin: 0 !important;
  border: 0 !important;
  border-right: 1px solid var(--stela-media-border) !important;
  border-radius: 0 !important;
  background: var(--stela-media-accent) !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
}


.media-library-widget-modal
#media-library-add-form-wrapper
.solo-file-button:hover {
  background: var(--stela-media-accent-dark) !important;
}


.media-library-widget-modal
#media-library-add-form-wrapper
.solo-file-name {
  padding: 0 15px;

  color: var(--stela-media-muted);

  font-size: 13px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.media-library-widget-modal
#media-library-add-form-wrapper
.form-item__description {
  margin-top: 9px;

  color: var(--stela-media-muted);

  font-size: 12px;
  line-height: 1.45;
}


/* Keep the custom AI / Background Studio interfaces independent. */

.media-library-widget-modal
#media-library-add-form-wrapper
> form
> .ai-media-image-form-wrapper,

.media-library-widget-modal
#media-library-add-form-wrapper
> form
> [data-drupal-selector="edit-media-ai-background-studio"] {
  margin-top: 20px;
}


/* ==========================================================
   MEDIA LIBRARY AREA
   ========================================================== */

.media-library-widget-modal #media-library-view {
  padding: 24px;

  background: var(--stela-media-bg);
}


/* ==========================================================
   GRID / TABLE SWITCHER
   ========================================================== */

.media-library-widget-modal #media-library-view .view-header {
  display: flex;
  justify-content: flex-end;

  margin: 0 0 14px;
}


.media-library-widget-modal #media-library-view .view-header {
  font-size: 0;
}


.media-library-widget-modal
#media-library-view
.views-element-container
.view-header a,
.media-library-widget-modal
#media-library-view
.view-header
.views-display-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;

  padding: 0 15px;

  border: 1px solid var(--stela-media-border-strong);

  background: #fff;

  color: #65626a;

  font-size: 13px;
  font-weight: 650;

  text-decoration: none;

  transition: all .16s ease;
}


.media-library-widget-modal
#media-library-view
.view-header
.views-display-link:first-child {
  border-radius: 9px 0 0 9px;
}


.media-library-widget-modal
#media-library-view
.view-header
.views-display-link:last-child {
  margin-left: -1px;

  border-radius: 0 9px 9px 0;
}


.media-library-widget-modal
#media-library-view
.view-header
.views-display-link:hover {
  position: relative;

  background: #f7f5f8;

  color: var(--stela-media-accent);

  border-color: #cfc7d3;

  z-index: 1;
}


.media-library-widget-modal
#media-library-view
.view-header
.views-display-link.is-active {
  position: relative;

  background: var(--stela-media-accent-soft);

  color: var(--stela-media-accent-dark);

  border-color: #c9bacf;

  z-index: 2;
}


/* ==========================================================
   FILTER BAR
   ========================================================== */

.media-library-widget-modal #media-library-view .view-filters {
  margin: 0 0 20px;

  padding: 16px;

  border: 1px solid var(--stela-media-border);
  border-radius: 13px;

  background: #fff;

  box-shadow: 0 2px 8px rgba(32, 26, 36, 0.025);
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.solo-block {
  display: grid;

  grid-template-columns:
    minmax(220px, 1fr)
    minmax(180px, 230px)
    auto;

  align-items: end;

  gap: 12px;
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-item {
  margin: 0;
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-item__label {
  display: block;

  margin: 0 0 6px;

  color: #57545c;

  font-size: 11px;
  font-weight: 750;

  letter-spacing: .035em;
  text-transform: uppercase;
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-text,

.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-select {
  width: 100%;
  min-height: 42px;

  padding: 0 12px;

  border: 1px solid var(--stela-media-border-strong);
  border-radius: 9px;

  background-color: #fff;

  color: var(--stela-media-text);

  font-size: 13px;

  box-shadow: none;
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-text:focus,

.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-select:focus {
  outline: 3px solid rgba(104,77,114,.11);

  border-color: var(--stela-media-accent);
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-actions {
  margin: 0;
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-submit {
  min-height: 42px;

  padding: 0 17px;

  border: 1px solid var(--stela-media-accent) !important;
  border-radius: 9px !important;

  background: var(--stela-media-accent) !important;

  color: #fff !important;

  font-size: 13px;
  font-weight: 700;

  box-shadow: none !important;
}


.media-library-widget-modal
#media-library-view
.views-exposed-form
.form-submit:hover {
  background: var(--stela-media-accent-dark) !important;
  border-color: var(--stela-media-accent-dark) !important;
}


/* ==========================================================
   MEDIA GRID
   Drupal places each media item directly inside the Views form.
   ========================================================== */

.media-library-widget-modal
#media-library-view
.view-content
.views-form
> form {
  display: grid;

  grid-template-columns:
    repeat(auto-fill, minmax(155px, 1fr));

  gap: 16px;

  align-items: stretch;
}


/* Messages span the whole grid. */

.media-library-widget-modal
#media-library-view
#media-library-messages {
  grid-column: 1 / -1;
}


/* Hidden submit wrapper should never become a grid tile. */

.media-library-widget-modal
#media-library-view
.view-content
.views-form
> form
> .form-actions {
  display: none;
}


/* ==========================================================
   MEDIA CARD
   ========================================================== */

.media-library-widget-modal
#media-library-view
.js-media-library-item {
  position: relative;

  min-width: 0;

  margin: 0 !important;

  border: 1px solid var(--stela-media-border);
  border-radius: 13px;

  background: #fff;

  box-shadow:
    0 1px 2px rgba(23, 19, 27, .025),
    0 4px 12px rgba(23, 19, 27, .025);

  overflow: hidden;

  cursor: pointer;

  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}


.media-library-widget-modal
#media-library-view
.js-media-library-item:hover {
  transform: translateY(-2px);

  border-color: #cac3cd;

  box-shadow:
    0 8px 22px rgba(30, 24, 34, .08);
}


/* Selected card — works even if Drupal does not add its own class. */

.media-library-widget-modal
#media-library-view
.js-media-library-item:has(
  .views-field-media-library-select-form input:checked
) {
  border-color: var(--stela-media-accent);

  background: #fdfbfe;

  box-shadow:
    0 0 0 2px rgba(104,77,114,.11),
    0 8px 22px rgba(30,24,34,.08);
}


/* ==========================================================
   CARD CHECKBOX
   ========================================================== */

.media-library-widget-modal
#media-library-view
.views-field-media-library-select-form {
  position: absolute;

  top: 10px;
  right: 10px;

  z-index: 5;
}


.media-library-widget-modal
#media-library-view
.views-field-media-library-select-form
.form-item {
  margin: 0;
}


.media-library-widget-modal
#media-library-view
.views-field-media-library-select-form
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;

  display: block;

  width: 26px;
  height: 26px;

  margin: 0;

  border: 2px solid rgba(75, 69, 79, .40);
  border-radius: 50%;

  background: rgba(255,255,255,.96);

  box-shadow: 0 2px 7px rgba(0,0,0,.16);

  cursor: pointer;

  transition: all .15s ease;
}


.media-library-widget-modal
#media-library-view
.views-field-media-library-select-form
input[type="checkbox"]:hover {
  border-color: var(--stela-media-accent);
}


.media-library-widget-modal
#media-library-view
.views-field-media-library-select-form
input[type="checkbox"]:checked {
  border-color: var(--stela-media-accent);

  background-color: var(--stela-media-accent);

  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='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E");

  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px;
}


/* ==========================================================
   IMAGE PREVIEW
   ========================================================== */

.media-library-widget-modal
#media-library-view
.views-field-rendered-entity {
  height: 100%;
}


.media-library-widget-modal
#media-library-view
.views-field-rendered-entity
> .field-content {
  display: block;

  height: 100%;
}


.media-library-widget-modal
#media-library-view
.views-field-rendered-entity
article {
  display: flex;
  flex-direction: column;

  height: 100%;

  margin: 0;

  background: transparent;
}


.media-library-widget-modal
#media-library-view
.js-media-library-item-preview {
  position: relative;

  width: 100%;

  aspect-ratio: 4 / 3;

  background:
    linear-gradient(135deg, #eeeef1, #f8f8fa);

  overflow: hidden;
}


.media-library-widget-modal
#media-library-view
.js-media-library-item-preview
.field,

.media-library-widget-modal
#media-library-view
.js-media-library-item-preview
.field__item {
  width: 100%;
  height: 100%;
}


.media-library-widget-modal
#media-library-view
.js-media-library-item-preview
img {
  display: block;

  width: 100% !important;
  height: 100% !important;

  max-width: none !important;

  object-fit: cover;

  transition: transform .24s ease;
}


.media-library-widget-modal
#media-library-view
.js-media-library-item:hover
.js-media-library-item-preview
img {
  transform: scale(1.025);
}


/* Media name */

.media-library-widget-modal
#media-library-view
.views-field-rendered-entity
article
> div:last-child:not(.js-media-library-item-preview) {
  padding: 11px 12px 12px;

  color: #403d44;

  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ==========================================================
   DIALOG FOOTER
   ========================================================== */

.media-library-widget-modal > .ui-dialog-buttonpane {
  display: flex;
  align-items: center;

  min-height: 72px;

  margin: 0 !important;
  padding: 12px 24px !important;

  border: 0 !important;
  border-top: 1px solid var(--stela-media-border) !important;

  background: rgba(255,255,255,.98) !important;

  box-shadow: 0 -6px 18px rgba(28,23,32,.035);
}


.media-library-widget-modal
.ui-dialog-buttonpane
.ui-dialog-buttonset {
  order: 2;

  margin-left: auto;
}


.media-library-widget-modal
.media-library-selected-count {
  order: 1;

  color: var(--stela-media-muted);

  font-size: 13px;
  font-weight: 600;
}


.media-library-widget-modal
.ui-dialog-buttonpane
.button--primary {
  min-height: 44px;

  padding: 0 20px !important;

  border: 1px solid var(--stela-media-accent) !important;
  border-radius: 10px !important;

  background: var(--stela-media-accent) !important;

  color: #fff !important;

  font-size: 13px;
  font-weight: 750;

  box-shadow:
    0 5px 13px rgba(104,77,114,.18) !important;

  transition:
    background .15s ease,
    transform .15s ease,
    box-shadow .15s ease;
}


.media-library-widget-modal
.ui-dialog-buttonpane
.button--primary:hover {
  background: var(--stela-media-accent-dark) !important;

  transform: translateY(-1px);

  box-shadow:
    0 7px 17px rgba(104,77,114,.24) !important;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 900px) {

  .media-library-widget-modal {
    width: calc(100vw - 22px) !important;

    top: 11px !important;

    max-height: calc(100vh - 22px);

    border-radius: 14px !important;
  }


  .media-library-widget-modal #drupal-modal {
    max-height: calc(100vh - 155px) !important;
  }


  .media-library-widget-modal
  #media-library-view
  .views-exposed-form
  .solo-block {
    grid-template-columns: 1fr 1fr;
  }


  .media-library-widget-modal
  #media-library-view
  .views-exposed-form
  .form-actions {
    grid-column: 1 / -1;
  }


  .media-library-widget-modal
  #media-library-view
  .views-exposed-form
  .form-submit {
    width: 100%;
  }
}


@media (max-width: 600px) {

  .media-library-widget-modal > .ui-dialog-titlebar {
    min-height: 62px;

    padding: 0 16px !important;
  }


  .media-library-widget-modal .ui-dialog-title {
    font-size: 18px;
  }


  .media-library-widget-modal
  #media-library-add-form-wrapper {
    padding: 17px 16px;
  }


  .media-library-widget-modal
  #media-library-add-form-wrapper
  > form
  > .form-item-image-source {
    display: block;

    max-width: none;
  }


  .media-library-widget-modal
  #media-library-add-form-wrapper
  > form
  > .form-item-image-source
  > label {
    display: block;

    margin-bottom: 7px;
  }


  .media-library-widget-modal #media-library-view {
    padding: 16px;
  }


  .media-library-widget-modal
  #media-library-view
  .views-exposed-form
  .solo-block {
    grid-template-columns: 1fr;
  }


  .media-library-widget-modal
  #media-library-view
  .views-exposed-form
  .form-actions {
    grid-column: auto;
  }


  .media-library-widget-modal
  #media-library-view
  .view-content
  .views-form
  > form {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 11px;
  }


  .media-library-widget-modal > .ui-dialog-buttonpane {
    min-height: 66px;

    padding: 10px 16px !important;
  }


  .media-library-widget-modal
  .media-library-selected-count {
    font-size: 12px;
  }
}

.media-library-widget-modal .ui-dialog-buttonpane .button--primary {
    position: relative;
    top: -10px;
}

.media-library-widget-modal #media-library-view .views-exposed-form .solo-block .contains-submit {
    margin-bottom: -7px;
}