/* R102: preserve the archive finish; contain poster corners and touch feedback. */
.dd-archive-relative { position: relative; inset: auto; }
.dd-archive-box,
.dd-archive-bar { border-color: transparent !important; }
.dd-archive-box { outline-color: transparent !important; }
.diblet-hero.dd-archive-box::before { border-color: transparent; }
.dd-archive-target > .dd-archive-frame,
.dd-archive-external-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  overflow: visible;
  --dd-frame-edge: #751820;
  --dd-frame-corner: #8a2731;
  --dd-frame-inner: #9a774b;
  --dd-frame-highlight: #c4a064;
  --dd-frame-tab: #8f343b;
}

/* External overlays follow the existing element without adding a wrapper or
   changing its dimensions. Only the promotional poster edge is contained. */
.dd-archive-external-box { border-color: transparent !important; }
.dd-archive-external-frame { inset: auto; }
.dd-archive-image-clipped { clip-path: var(--dd-image-frame-clip); }

/* Replace the browser's rectangular touch flash only where a custom frame
   already supplies feedback. Links and controls keep their original actions. */
.dd-archive-box,
.dd-archive-external-target,
.dd-archive-box a,
.dd-archive-box button { -webkit-tap-highlight-color: transparent; }

/* Compact archive silhouettes for the existing buttons. The original fill is
   painted behind the text, while the glow remains free to follow the contour. */
.dd-archive-action {
  isolation: isolate;
  background: transparent !important;
}
.dd-archive-action::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-color: var(--dd-action-colour, transparent);
  background-image: var(--dd-action-image, none);
  clip-path: polygon(
    var(--dd-cut) 0,
    calc(50% - var(--dd-tab) - var(--dd-shoulder)) 0,
    calc(50% - var(--dd-tab)) var(--dd-depth),
    calc(50% + var(--dd-tab)) var(--dd-depth),
    calc(50% + var(--dd-tab) + var(--dd-shoulder)) 0,
    calc(100% - var(--dd-cut)) 0, 100% var(--dd-cut),
    100% calc(100% - var(--dd-cut)), calc(100% - var(--dd-cut)) 100%,
    var(--dd-cut) 100%, 0 calc(100% - var(--dd-cut)), 0 var(--dd-cut)
  );
}
.btn.dd-archive-action:hover::before { background: #700f20; }
.btn.gold.dd-archive-action:hover::before { background: #332715; }
.dd-hero-action--book.dd-archive-action:hover::before { background: #a7373e; }
.dd-hero-action--demo.dd-archive-action:hover::before { background: #32191c; }
.filter-btn.dd-archive-action::before { background: #100b0c; }
.filter-btn.dd-archive-action[aria-pressed="true"]::before { background: #661321; }
.dd-archive-action > .dd-archive-frame .file-corner { stroke-width: 2.5; }
.dd-archive-action > .dd-archive-frame .file-outer { stroke-width: 1.5; }

/* Keep the heading colour. A quiet gold rule defines the breadcrumb boundary. */
.site-shell main > .breadcrumbs { position: relative; }
.site-shell main > .breadcrumbs::after {
  content: '';
  position: absolute;
  left: var(--space, 20px);
  right: var(--space, 20px);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, #c4a06400, #c4a064 8%, #d3b973 50%, #c4a064 92%, #c4a06400);
  pointer-events: none;
}
.dd-archive-frame .file-outer { stroke: var(--dd-frame-edge); stroke-width: 2; }
.dd-archive-frame .file-inner { stroke: var(--dd-frame-inner); stroke-opacity: .55; stroke-width: .7; }
.dd-archive-frame .file-corner { stroke: var(--dd-frame-corner); stroke-width: 5; }
.dd-archive-frame .file-highlight { stroke: var(--dd-frame-highlight); stroke-opacity: .65; stroke-width: .75; }
.dd-archive-frame .file-tab { fill: #53131b; stroke: var(--dd-frame-tab); stroke-width: .7; }
.dd-archive-frame .file-wear { stroke: #171014; stroke-width: 1.3; }
.dd-archive-frame .file-side { stroke: var(--dd-frame-corner); stroke-width: 2; }
.dd-archive-frame .file-foot { stroke: var(--dd-frame-inner); stroke-opacity: .55; stroke-width: 1; }

/* The existing rectangular focus/hover shadow is replaced by this same SVG path.
   Child controls retain their own keyboard focus indicator. */
.dd-archive-box:is(:hover, :active, :focus-visible, :focus-within) {
  outline: none !important;
  box-shadow: none !important;
}
.gallery-item.dd-archive-box > button[data-full]:focus-visible,
.track-list > li.dd-archive-box > button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.dd-archive-box:is(:hover, :active, :focus-visible, :focus-within) > .dd-archive-frame,
.dd-archive-external-frame.dd-archive-lit {
  --dd-frame-edge: #e6c77f;
  --dd-frame-corner: #d9b96e;
  --dd-frame-inner: #eedaa2;
  --dd-frame-highlight: #fff0c5;
  --dd-frame-tab: #d9b96e;
}
.dd-archive-box:is(:hover, :active, :focus-visible, :focus-within) > .dd-archive-frame .file-outer,
.dd-archive-external-frame.dd-archive-lit .file-outer {
  filter: drop-shadow(0 0 2px #e3bb62) drop-shadow(0 0 4px #bc882b80);
}

/* Retire the stray title-art fragment below inner-page headings. The original
   homepage title and its decorative divider are not selected by these rules. */
.page-head::after,
.diblet-hero-copy h1::after { display: none; }

@media (forced-colors: active) {
  .dd-archive-box,
  .dd-archive-bar { border-color: CanvasText !important; }
  .dd-archive-box { outline-color: CanvasText !important; }
  .dd-archive-target > .dd-archive-frame,
  .dd-archive-external-frame { display: none; }
  .dd-archive-external-box { border-color: CanvasText !important; }
  .dd-archive-action { background: Canvas !important; }
  .dd-archive-action::before { display: none; }
  .dd-archive-image-clipped { clip-path: none; }
  .site-shell main > .breadcrumbs::after { background: CanvasText; }
  .dd-archive-box:focus-visible { outline: 2px solid Highlight !important; outline-offset: 2px; }
  .gallery-item.dd-archive-box > button[data-full]:focus-visible,
  .track-list > li.dd-archive-box > button:focus-visible {
    outline: 2px solid Highlight !important;
  }
}
