/* dark-factories revision patch: clickable picture cards + research deep-dive */

/* picture cards become real controls */
.pic-card { cursor: pointer; }
.pic-card:focus-visible { outline: 2px solid var(--flare); outline-offset: 3px; border-radius: 18px; }
.pic-card .pic-card-plus { transition: transform .3s cubic-bezier(.22,1,.36,1), background .3s; }
.pic-card:hover .pic-card-plus, .pic-card:focus-visible .pic-card-plus { transform: rotate(90deg); background: var(--flare); color: #fff; }

/* overlay */
.dfx-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10, 28, 19, 0.78);
  display: grid; place-items: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.dfx-overlay.dfx-open { opacity: 1; pointer-events: auto; }
.dfx-dialog {
  background: var(--surface); color: var(--ink);
  border-radius: 22px; max-width: 1020px; width: 100%;
  max-height: calc(100vh - 48px); overflow: auto;
  display: grid; grid-template-columns: 1.15fr 1fr;
  transform: translateY(14px) scale(.98);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.dfx-overlay.dfx-open .dfx-dialog { transform: none; }
.dfx-media { position: relative; min-height: 320px; background: var(--forest); }
.dfx-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dfx-body { padding: 40px 38px 34px; display: flex; flex-direction: column; gap: 14px; }
.dfx-kicker { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--flare); }
.dfx-title { font-family: var(--font-display); font-weight: 560; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
.dfx-text { font-size: 15.5px; line-height: 1.65; color: var(--muted); }
.dfx-link { margin-top: 6px; font-size: 14.5px; font-weight: 500; color: var(--flare-deep); text-decoration: none; border-bottom: 1px solid currentColor; align-self: flex-start; padding-bottom: 1px; }
.dfx-link:hover { color: var(--flare); }
.dfx-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--cream); color: var(--ink); font-size: 20px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.dfx-close:hover { background: var(--flare); color: #fff; }
.dfx-close:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }

/* research deep-dive inside the sources section */
.dfx-research { margin-top: 34px; }
.dfx-research-title { font-family: var(--font-display); font-weight: 480; font-size: 26px; line-height: 1.2; color: var(--cream); margin-bottom: 6px; }
.dfx-research-intro { font-size: 14.5px; color: #f4f2e49e; max-width: 720px; margin-bottom: 8px; }
.dfx-paper { border-top: 1px solid rgba(244,242,228,.18); }
.dfx-paper:last-child { border-bottom: 1px solid rgba(244,242,228,.18); }
.dfx-paper summary {
  display: grid; grid-template-columns: 1fr 40px; gap: 26px; align-items: baseline;
  padding: 20px 10px; cursor: pointer; list-style: none;
  transition: background .25s, padding-left .25s;
}
.dfx-paper summary::-webkit-details-marker { display: none; }
.dfx-paper summary:hover { background: #f4f2e40f; padding-left: 22px; }
.dfx-paper summary:focus-visible { outline: 2px solid var(--butter); outline-offset: -2px; }
.dfx-paper summary > * { min-width: 0; }
.dfx-paper-name { font-family: var(--font-display); font-weight: 480; font-size: 21px; line-height: 1.25; color: var(--cream); overflow-wrap: break-word; }
.dfx-paper-venue { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--butter); margin-top: 6px; }
.dfx-paper-plus { justify-self: end; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #fffdf8eb; color: var(--ink); font-size: 18px; transition: transform .3s cubic-bezier(.22,1,.36,1); }
.dfx-paper[open] .dfx-paper-plus { transform: rotate(45deg); background: var(--flare); color: #fff; }
.dfx-paper-body { padding: 0 10px 26px; display: grid; gap: 14px; max-width: 860px; }
.dfx-paper-body p { font-size: 14.5px; line-height: 1.65; color: #f4f2e4bf; }
.dfx-paper-body p strong { color: var(--cream); font-weight: 600; }
.dfx-paper-link { font-size: 14px; font-weight: 500; color: var(--butter); text-decoration: none; border-bottom: 1px solid currentColor; justify-self: start; padding-bottom: 1px; }
.dfx-paper-link:hover { color: var(--flare); }

@media (max-width: 860px) {
  .dfx-dialog { grid-template-columns: 1fr; }
  .dfx-media { min-height: 0; height: 34vh; }
  .dfx-media img { position: static; height: 100%; }
  .dfx-body { padding: 26px 24px 28px; }
  .dfx-paper summary { grid-template-columns: 1fr 34px; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .dfx-overlay, .dfx-dialog, .pic-card .pic-card-plus, .dfx-paper-plus { transition: none; }
}
