/* Shared archive notes component. The active theme supplies all paint. */
.mx-archive-summary-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.mx-archive-summary-copy .mx-archive-summary-meta .mx-archive-panel-id {
  margin: 0;
}
.mx-archive-record { scroll-margin-top: 1rem; }
@media screen and (min-width: 737px) and (max-width: 1280px) {
  .mx-archive-record { scroll-margin-top: calc(var(--mx-tablet-bar-height) + 1rem); }
}
.mx-directors-cut-dialog {
  width: min(46rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--mx-divider-strong);
  background: var(--mx-surface);
  color: var(--mx-text);
}
.mx-directors-cut-dialog::backdrop { background: var(--mx-archive-overlay); }
.mx-directors-cut-inner { padding: 1.5rem; }
.mx-notes-toolbar { display: contents; }
.mx-notes-close { float: right; margin: 0 0 0.75rem 0.75rem; }
.mx-notes-kicker { margin: 0 0 0.5rem; color: var(--mx-detail-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.mx-directors-cut-dialog h2 { clear: both; margin: 0 0 1.5rem; font-size: 1.6rem; text-transform: uppercase; overflow-wrap: anywhere; }
.mx-directors-cut-dialog h3 { margin: 0 0 0.75rem; font-size: 1.1rem; color: var(--mx-detail-accent); }
.mx-directors-cut-dialog h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.mx-directors-cut-dialog section + section { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--mx-divider); }
.mx-directors-cut-dialog p { margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.mx-notes-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.5rem 1.25rem; margin: 0; }
.mx-notes-facts dt { color: var(--mx-text-secondary); font-weight: 600; }
.mx-notes-facts dd { margin: 0; }
.mx-notes-facts p:last-child { margin: 0; }
.mx-notes-footer { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--mx-divider); }
.mx-notes-footer p { margin-top: 0.75rem; font-size: 0.9rem; }
@media screen and (max-width: 736px) {
  .mx-directors-cut-inner { padding: 1.1rem; }
  .mx-directors-cut-dialog h2 { font-size: 1.35rem; }
  .mx-notes-facts { gap: 0.5rem 0.75rem; }
}

/* Editorial body: structure is authored in Markdown, paint remains theme-owned. */
.mx-notes-standfirst { color: var(--mx-text-secondary); font-size: 1.1rem; line-height: 1.5; }
.mx-notes-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; padding: 1.15rem 0; border-top: 1px solid var(--mx-divider); border-bottom: 1px solid var(--mx-divider); }
.mx-notes-meta dt { color: var(--mx-detail-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.mx-notes-meta dd { margin: 0.35rem 0 0; overflow-wrap: anywhere; }
.mx-notes-prose { line-height: 1.65; }
.mx-notes-prose p { margin: 0 0 1.15rem; }
.mx-notes-prose h3 { margin: 2.1rem 0 0.85rem; font-size: 1.3rem; }
.mx-notes-prose h3:first-child { margin-top: 0; }
.mx-notes-prose h4 { margin: 1.6rem 0 0.6rem; font-size: 1.05rem; color: var(--mx-text); }
.mx-notes-prose h5 { margin: 1.25rem 0 0.5rem; font-size: 1rem; color: var(--mx-text-secondary); }
.mx-notes-prose blockquote { margin: 1.5rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 3px solid var(--mx-detail-accent); color: var(--mx-text-secondary); font-style: italic; }
.mx-notes-prose blockquote p:last-child { margin-bottom: 0; }
.mx-notes-prose ul, .mx-notes-prose ol { margin-bottom: 1.15rem; padding-left: 1.4rem; }
.mx-notes-prose li { padding-left: 0.2rem; }
.mx-notes-prose a { color: var(--mx-text); text-decoration: underline; text-underline-offset: 0.15em; border: 0; overflow-wrap: anywhere; }
.mx-notes-prose pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0.75rem; border: 1px solid var(--mx-divider); }
.mx-notes-prose pre, .mx-notes-prose code { font-family: inherit; }
.mx-notes-prose hr { border: 0; border-top: 1px solid var(--mx-divider); margin: 2rem 0; }
@media screen and (max-width: 736px) {
  .mx-notes-meta { gap: 0.7rem; }
  .mx-notes-meta dt { font-size: 0.65rem; letter-spacing: 0.08em; }
  .mx-notes-meta dd { font-size: 0.9rem; }
}

.mx-notes-footer button { margin: 0.25rem 0.5rem 0.25rem 0; }

/* Director’s Cut occupies a free shared action slot; full toolbars gain one row. */
.mx-archive-summary-actions [data-mx-directors-cut] { grid-column: 2; grid-row: 1; }
.mx-archive-summary-actions:has(.mx-archive-theme-action) [data-mx-directors-cut] { grid-column: 1; grid-row: 2; }
.mx-archive-summary-actions:has(.mx-archive-theme-action):has([data-mx-archive-game]) [data-mx-directors-cut] { grid-column: 1; grid-row: 3; }
.mx-archive-summary-actions:has([data-mx-archive-trailer]):has(.mx-archive-theme-action):has([data-mx-archive-game]):has(.mx-archive-unlock-action) [data-mx-directors-cut] { grid-column: 1 / -1; width: 100%; flex-basis: 100%; }
.mx-archive-summary-actions:has(.mx-archive-theme-action):has([data-mx-archive-game]):has([data-mx-directors-cut]) .mx-archive-trailer-credit { grid-row: 4; }

/* One bounded poster frame for every uploaded size and orientation. */
.mx-notes-prose .mx-notes-movie {
  display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
  gap: 1.1rem; margin: 1.75rem 0; padding: 1rem;
  border: 1px solid var(--mx-divider); border-left: 3px solid var(--mx-detail-accent);
  background: var(--mx-surface-raised); min-width: 0;
}
.mx-notes-movie-art { grid-column: 1; grid-row: 1; width: 100%; min-width: 0; margin: 0; }
.mx-notes-poster-frame { position: relative; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: var(--mx-surface); }
.mx-notes-poster-frame > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.mx-notes-movie-copy { grid-column: 2; grid-row: 1; min-width: 0; overflow-wrap: anywhere; }
.mx-notes-movie-copy > :first-child { margin-top: 0; }
.mx-notes-movie-copy > :last-child { margin-bottom: 0; }
.mx-notes-prose .mx-notes-movie-copy > h4 { margin: 0 0 .25rem; font-size: 1.5rem; line-height: 1.2; font-weight: 800; color: var(--mx-detail-accent); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; }
.mx-notes-movie-year { display: block; color: var(--mx-text-muted); font-size: .85rem; font-weight: 400; }
.mx-notes-prose .mx-notes-movie-role { margin: .45rem 0 0; color: var(--mx-text-secondary); font-size: .9rem; }
.mx-notes-movie-role > span { font-weight: 600; color: var(--mx-text-muted); }
.mx-notes-movie-notes { margin-top: 1.15rem; }
.mx-notes-movie-notes > :last-child { margin-bottom: 0; }
.mx-notes-prose .mx-notes-movie--right { grid-template-columns: minmax(0, 1fr) minmax(0, 10rem); }
.mx-notes-movie--right > .mx-notes-movie-art { grid-column: 2; }
.mx-notes-movie--right > .mx-notes-movie-copy { grid-column: 1; }
.mx-notes-prose .mx-notes-justwatch { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .6rem .2rem; margin-top: 0; text-decoration: none; }
/* Previously published cards may still contain the old redundant caption. */
.mx-notes-justwatch > span { display: none; }
.mx-notes-justwatch > img { display: block; width: min(100%, 110px); height: 24px; object-fit: contain; }
.mx-notes-justwatch:focus-visible { outline: 2px solid var(--mx-detail-accent); outline-offset: 3px; }
@media screen and (max-width: 736px) {
  .mx-notes-prose .mx-notes-movie, .mx-notes-prose .mx-notes-movie--right { grid-template-columns: minmax(0, 1fr); gap: .9rem; padding: .8rem; }
  .mx-notes-movie > .mx-notes-movie-art { grid-column: 1; grid-row: 1; width: min(100%, 10rem); justify-self: center; }
  .mx-notes-movie > .mx-notes-movie-copy { grid-column: 1; grid-row: 2; }
}

/* Persistent dismissal on touch layouts; the dialog remains the only scroller. */
@media screen and (max-width: 1280px) {
  .mx-notes-toolbar { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 2; margin: -1.5rem -1.5rem 1rem; padding: .6rem 1.5rem; background: var(--mx-surface); border-bottom: 1px solid var(--mx-divider); }
  .mx-notes-toolbar .mx-notes-close { float: none; margin: 0; min-height: 44px; }
}
@media screen and (max-width: 736px) {
  .mx-notes-toolbar { margin: -1.1rem -1.1rem 1rem; padding-inline: 1.1rem; }
}

.mx-notes-movie-tag { display: inline-flex; align-items: center; justify-content: center; text-align: center; max-width: 100%; padding: .35em .6em; border: 1px solid var(--mx-detail-accent); color: var(--mx-text-secondary); font-size: .6rem; font-weight: 700; line-height: 1; letter-spacing: .06em; text-transform: uppercase; }

/* Article photographs retain their own ratio; HTML dimensions reserve space before decoding. */
.mx-notes-photo { margin: 1.75rem auto; width: fit-content; max-width: 100%; overflow: hidden; border: 1px solid var(--mx-divider); background: var(--mx-surface-raised); }
.mx-notes-photo-frame { display: flex; justify-content: center; max-width: 100%; }
.mx-notes-photo-frame > img { display: block; width: auto; height: auto; max-width: 100%; max-height: min(65vh, 36rem); object-fit: contain; }
.mx-notes-photo figcaption { margin: 0; padding: .75rem 1rem; text-align: center; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.5; }
.mx-notes-photo-caption, .mx-notes-photo-credit { display: block; }
.mx-notes-photo-caption { color: var(--mx-text-secondary); }
.mx-notes-photo-credit { color: var(--mx-text-muted); font-size: .8rem; }
.mx-notes-photo-caption + .mx-notes-photo-credit { margin-top: .25rem; }
