/* =========================================================
   STATE A — Olfactory Perspective / Multi-Perspective Stack
   (folder stack, active perspective, search & case selector)
   ========================================================= */

/* --- Interactive manila folder stack --- */
.eg-folders {
  position: relative;
  height: 232px;
  margin: 4px 0 18px;
}

.eg-folder {
    position: absolute;
    left: 0;
    right: 0;
    height: 148px;
    display: flex;
    flex-direction: column;
    text-align: left;
    /* border: 1px solid rgba(74, 18, 26, 0.5); */
    /* border-radius: 10px; */
    overflow: hidden;
    /* background: linear-gradient(180deg, #e9e0cc, var(--khaki)); */
    /* color: var(--ink); */
    font-family: var(--serif);
    cursor: pointer;
    padding: 0;
    /* box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.3); */
    transition: transform 0.35s cubic-bezier(0.22, 0.9, 0.3, 1), box-shadow 0.35s ease, border-color 0.25s ease;
}
/*
.eg-folder.is-front {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  border-color: var(--oxblood-2);
}*/

.eg-folder__tab {
    flex: 0 0 58px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.05em;
    background: rgba(74, 18, 26, 0.08);
    border-bottom: 1px solid rgba(74, 18, 26, 0.35);
    overflow: hidden;
}

/* Manila file top edge (imported /assets/volumes/File.svg) */
.eg-folder__file {
width: 100%;
    height: 16px;
    object-fit: cover;
    object-position: top center;
    display: block;
    flex: 0 0 auto;
    opacity: 0.9;
    background: #ddd;
    border: none;
}

.eg-folder__tab-label {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eg-folder__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
}

.eg-folder__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.eg-folder__tag {
  font-style: italic;
  color: rgba(43, 11, 16, 0.72);
  letter-spacing: 0.03em;
}

/* --- Active perspective container (oxblood) --- */
.eg-perspective {
  background: var(--oxblood);
  color: var(--cream);
  border-radius: 14px;
  padding: 20px 20px 18px;
  margin: 6px 0 16px;
}

.eg-perspective__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.eg-perspective__title {
  margin: 0;
  font-size: clamp(1.3rem, 4.5vw, 1.8rem);
  color: var(--cream);
  letter-spacing: 0.01em;
}

.eg-perspective__tag {
  margin: 4px 0 0;
  font-style: italic;
  color: var(--khaki);
  letter-spacing: 0.04em;
}

.eg-perspective__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons reuse .eg-btn base; overrides for the oxblood surface */
.eg-perspective .eg-btn--ghost {
  color: var(--cream);
  border-color: rgba(213, 206, 190, 0.6);
}

.eg-perspective .eg-btn--ghost:hover {
  background: rgba(213, 206, 190, 0.14);
}

.eg-perspective .eg-btn--solid {
  background: var(--cream);
  color: var(--oxblood);
  border-color: var(--cream);
}

.eg-perspective .eg-btn--solid:hover {
  background: var(--khaki);
}

.eg-caret {
  display: inline-block;
  transition: transform 0.25s ease;
}

.eg-details-toggle[aria-expanded="true"] .eg-caret {
  transform: rotate(180deg);
}

/* Details accordion */
.eg-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(213, 206, 190, 0.28);
}

.eg-details__formula {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.eg-details__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(213, 206, 190, 0.1);
}

.eg-details__row strong {
  color: var(--khaki);
}

.eg-details__kicker {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--khaki);
}

.eg-saved {
  list-style: none;
  margin: 0;
  padding: 0;
}

.eg-saved li {
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(213, 206, 190, 0.1);
  margin-bottom: 8px;
  color: var(--cream);
}

.eg-saved li:empty {
  display: none;
}

/* --- Bottom search & case controls --- */
.eg-lower {
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.eg-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 12px;
  background: var(--khaki);
  color: var(--ink);
}

.eg-search__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.eg-search input {
  flex: 1;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.eg-search input:focus {
  outline: none;
}
.eg-search input::placeholder {
  color: rgba(43, 11, 16, 0.62);
}

.eg-case-selector {
margin-top: 1rem;
}

.eg-case-selector__label {
margin: 0 0 12px;
    color: #4a121a;
    /* font-style: italic; */
    text-align: center;
}

.eg-case-selector__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* gap: 34px; */
    margin-top: 2rem;

}

.eg-case-btn {
padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid #4a121a;
    background: transparent;
    color: #4a121a;
    font: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    min-height: 46px;
}

.eg-case-down {
  width: 46px;
  height: 46px;
  border: 1px solid var(--oxblood);
  border-radius: 10px;
  background: var(--oxblood);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.eg-case-down:hover {
  background: var(--oxblood-2);
}

/* Perspective search: hide non-matching folders */
.eg-folders.is-searching .eg-folder:not(.is-match) {
  display: none;
}
/*
.eg-folder.is-match {
  outline: 2px solid var(--khaki);
  outline-offset: 2px;
}*/

/* Static fallback stack (JS repositions these live via inline styles) 
.eg-folder:nth-of-type(1) {
  top: 84px;
  z-index: 40;
}*/
.eg-folder:nth-of-type(2) {
  top: 56px;
  z-index: 30;
}
.eg-folder:nth-of-type(3) {
  top: 28px;
  z-index: 20;
}
.eg-folder:nth-of-type(4) {
  top: 0;
  z-index: 10;
}

@media (max-width: 640px) {
  .eg-folders {
    height: 224px;
  }
  .eg-folder {
    height: 144px;
  }
  .eg-folder__tab {
    font-size: 0.82rem;
  }
  .eg-perspective__head {
    flex-direction: column;
  }
  .eg-perspective__controls {
    width: 100%;
  }
  .eg-perspective__controls .eg-btn {
    flex: 1;
  }
}

/* ---- OP search results + saved-case CRUD controls (3.3) ---- */
.eg-op-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--violet-2);
}
.eg-op-results[hidden] {
  display: none;
}
.eg-op-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(213, 206, 190, 0.12);
}
.eg-op-result:last-child {
  border-bottom: 0;
}
.eg-op-result__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.eg-op-result__name {
  color: var(--cream);
  font-weight: 700;
}
.eg-op-result__meta {
  color: var(--cream-dim);
  font-size: 0.8rem;
  font-style: italic;
}
.eg-op-result__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.eg-op-result__btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--khaki);
  background: transparent;
  color: var(--khaki);
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.eg-op-result__btn:hover {
  background: rgba(213, 206, 190, 0.14);
}
.eg-op-result__btn--save {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: #fff;
}

.eg-saved__item {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(213, 206, 190, 0.1);
  margin-bottom: 8px;
  color: var(--cream);
}
.eg-saved__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eg-saved__name {
  font-weight: 700;
}
.eg-saved__note {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(213, 206, 190, 0.4);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  font: inherit;
  font-size: 0.88rem;
}
.eg-saved__note:focus {
  outline: 2px solid var(--oxblood-2);
  outline-offset: 2px;
}
.eg-saved__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.eg-saved__btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(213, 206, 190, 0.5);
  background: transparent;
  color: var(--khaki);
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.eg-saved__btn:hover {
  background: rgba(213, 206, 190, 0.14);
}
.eg-saved__btn--danger {
  border-color: rgba(190, 60, 60, 0.65);
  color: #f0b9b9;
}

