/* Neurohaven v109 — mixed media/file cards + front-end layout/template controls. */
.article-figure--document {
  margin-block: 1rem;
}
.article-figure__direct-link--document {
  display: block;
  color: inherit !important;
  text-decoration: none !important;
}
.article-document-file {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: .85rem;
  min-width: 0;
  padding: .9rem 1rem;
  border: .0625rem solid var(--line-strong);
  border-radius: .9rem;
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.article-figure__direct-link--document:hover .article-document-file,
.article-figure__direct-link--document:focus-visible .article-document-file {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line-strong));
  background: linear-gradient(145deg, rgba(52,215,238,.1), rgba(255,255,255,.035));
  transform: translateY(-1px);
}
.article-document-file__type {
  display: grid;
  place-items: center;
  width: 3.2rem;
  min-height: 3.2rem;
  padding: .35rem;
  border-radius: .72rem;
  background: rgba(52,215,238,.1);
  border: .0625rem solid rgba(52,215,238,.24);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.article-document-file__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .16rem;
}
.article-document-file__copy strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.3;
}
.article-document-file__copy small {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-document-file__open {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  color: var(--accent);
}
[data-theme="light"] .article-document-file {
  background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(235,242,247,.86));
}
[data-theme="light"] .article-document-file__type {
  color: #087c82;
  background: rgba(8,124,130,.08);
  border-color: rgba(8,124,130,.2);
}

/* Front-end mixed media/file editor */
.nh-fe-document-tile,
.nh-fe-document-preview,
.nh-fe-library__document {
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: .8rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(52,215,238,.15), transparent 48%),
    linear-gradient(145deg, rgba(17,28,49,.98), rgba(8,14,29,.98));
  box-shadow: inset 0 0 0 .0625rem rgba(255,255,255,.08);
}
.nh-fe-document-tile {
  grid-template-columns: auto minmax(0,1fr);
  justify-items: stretch;
  gap: .8rem;
  padding: 1rem;
  min-height: 5.4rem;
}
.nh-fe-document-tile__type,
.nh-fe-library__document strong,
.nh-fe-document-preview strong {
  display: grid;
  place-items: center;
  min-width: 3rem;
  min-height: 3rem;
  padding: .35rem;
  border-radius: .65rem;
  color: #7fe6d0;
  background: rgba(127,230,208,.09);
  border: .0625rem solid rgba(127,230,208,.22);
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .08em;
}
.nh-fe-document-tile__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: .2rem;
}
.nh-fe-document-tile__copy strong,
.nh-fe-document-tile__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nh-fe-document-tile__copy strong { color: #eef7ff; font-size: .82rem; }
.nh-fe-document-tile__copy small { color: #94a9c8; font-size: .62rem; }
.nh-fe-document-preview { min-height: 8rem; gap: .6rem; padding: 1rem; color: #dce8f7; text-align: center; }
.nh-fe-document-preview span { max-width: 100%; overflow-wrap: anywhere; font-size: .72rem; }
.nh-fe-library__document { width: 100%; aspect-ratio: 4/3; align-content: center; gap: .45rem; }
.nh-fe-library__document span { color: #95aac9; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .09em; }
.nh-fe-library__item.is-document { text-align: left; }

/* Page layout + destructive template-reset controls */
.nh-page-settings-fields select,
.nh-page-template-reset select {
  width: 100%;
  min-height: 2.55rem;
  padding: .55rem .75rem;
  border: .0625rem solid rgba(255,255,255,.12);
  border-radius: .65rem;
  background: #0d172b;
  color: #eef7ff;
}
.nh-page-settings-fields label > small {
  display: block;
  margin-top: .35rem;
  color: #8fa4c4;
  font-size: .69rem;
  line-height: 1.4;
}
.nh-page-template-reset {
  display: grid;
  gap: .72rem;
  margin-top: .35rem;
  padding: .9rem;
  border: .0625rem solid rgba(242,106,112,.26);
  border-radius: .8rem;
  background: rgba(242,106,112,.055);
}
.nh-page-template-reset > div:first-child {
  display: flex;
  flex-direction: column;
  gap: .22rem;
}
.nh-page-template-reset strong { color: #f6f9ff; font-size: .78rem; }
.nh-page-template-reset small { color: #a9b8cf; font-size: .68rem; line-height: 1.4; }
.nh-page-template-reset__controls {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .55rem;
}
.nh-page-template-reset__controls button {
  min-height: 2.55rem;
  padding: 0 .85rem;
  border: .0625rem solid rgba(242,106,112,.45);
  border-radius: .65rem;
  background: rgba(242,106,112,.12);
  color: #ffd8da;
  cursor: pointer;
  font-weight: 700;
}
.nh-page-template-reset__controls button:hover,
.nh-page-template-reset__controls button:focus-visible {
  background: rgba(242,106,112,.22);
}
@media (max-width: 36rem) {
  .nh-page-template-reset__controls { grid-template-columns: 1fr; }
  .article-document-file { grid-template-columns: auto minmax(0,1fr); }
  .article-document-file__open { display: none; }
}
.nh-fe-library__entry {
  position: relative;
  min-width: 0;
}
.nh-fe-library__entry .nh-fe-library__item {
  width: 100%;
}
.nh-fe-library__delete {
  position: absolute;
  right: .48rem;
  bottom: .48rem;
  z-index: 2;
  min-height: 1.75rem;
  padding: 0 .55rem;
  border: .0625rem solid rgba(242,106,112,.35);
  border-radius: .55rem;
  background: rgba(8,14,29,.9);
  color: #ffc7ca;
  cursor: pointer;
  font-size: .58rem;
  font-weight: 700;
  box-shadow: 0 .35rem .9rem rgba(0,0,0,.25);
}
.nh-fe-library__delete:hover,
.nh-fe-library__delete:focus-visible {
  background: #38181f;
  border-color: rgba(242,106,112,.65);
}


/* v110 — direct document-box removal in front-end edit mode. */
.nh-fe-visual.article-figure--document .nh-fe-visual__actions {
  display: flex;
  align-items: center;
  gap: .38rem;
  flex-wrap: wrap;
}
.nh-fe-visual__remove-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-height: 2rem;
  padding: 0 .62rem;
  border: .0625rem solid rgba(242,106,112,.46) !important;
  border-radius: .58rem;
  background: rgba(49,14,22,.92) !important;
  color: #ffd9dc !important;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .035em;
  box-shadow: 0 .35rem .9rem rgba(0,0,0,.18);
}
.nh-fe-visual__remove-box:hover,
.nh-fe-visual__remove-box:focus-visible {
  border-color: rgba(255,126,133,.82) !important;
  background: #501923 !important;
  color: #fff !important;
}
.nh-fe-visual__remove-box > span:first-child {
  font-size: .9rem;
  line-height: 1;
}
@media (max-width: 36rem) {
  .nh-fe-visual__remove-box > span:last-child { display: none; }
  .nh-fe-visual__remove-box { width: 2rem; padding: 0; }
}

/* v111 — Documents and downloads panel is directly removable in edit mode. */
.nh-fe-document-panel {
  position: relative;
  overflow: visible;
}
.nh-fe-document-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .75rem;
}
.nh-fe-document-panel__head .article-card-kicker {
  margin: 0;
  min-width: 0;
}
.nh-fe-document-panel__remove {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 2rem;
  padding: 0 .66rem;
  border: .0625rem solid rgba(242,106,112,.5) !important;
  border-radius: .58rem;
  background: rgba(49,14,22,.94) !important;
  color: #ffd9dc !important;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .56rem;
  font-weight: 750;
  letter-spacing: .04em;
  white-space: nowrap;
}
.nh-fe-document-panel__remove:hover,
.nh-fe-document-panel__remove:focus-visible {
  border-color: rgba(255,126,133,.86) !important;
  background: #571923 !important;
  color: #fff !important;
}
.nh-fe-document-panel__remove > span:first-child {
  font-size: .88rem;
  line-height: 1;
}
.nh-fe-document-panel__grid {
  display: grid;
  gap: .72rem;
}
.nh-fe-document-panel__grid .nh-fe-visual {
  margin: 0;
}
@media (max-width: 34rem) {
  .nh-fe-document-panel__head {
    align-items: stretch;
    flex-direction: column;
  }
  .nh-fe-document-panel__remove {
    width: 100%;
  }
}
