/* Shared colour review: header navigation, footer surfaces, links and marks.
   Third-party marks keep their original colour artwork; dark-mode legibility comes
   from a paper-coloured mount, never from inverting the image. */

/* -------------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------------- */

/* The theme paints sub-menu panels white. In dark appearance the same panel
   must follow the scheme, otherwise light-grey links sit on a white sheet. */
:root[data-afilms-scheme="dark"] #header .nav-links ul.sub-menu,
:root[data-afilms-scheme="dark"] #header .nav-links .sub-menu {
    background: #1c1c1c;
    border: 1px solid #2c2c2c;
}

:root[data-afilms-scheme="dark"] #header .nav-links .sub-menu li {
    border-left-color: #2c2c2c !important;
    border-bottom-color: #2c2c2c !important;
}

:root[data-afilms-scheme="dark"] #header .nav-links .sub-menu a {
    color: #e4e4e4;
}

:root[data-afilms-scheme="dark"] #header .nav-links .sub-menu a:hover,
:root[data-afilms-scheme="dark"] #header .nav-links .sub-menu a:focus-visible {
    color: #ffffff;
    background: #2c2c2c;
}

/* The trigger and utility links are part of the same navigation row at desktop
   widths and sit in the open menu at narrower widths, so no fixed offsets are
   needed to reach them. */
#header .logo:focus-visible,
#header .mobile-menu-icon:focus-visible,
#header .close-menu-icon:focus-visible,
#header .header-utility-link:focus-visible,
#header .afilms-scheme-trigger:focus-visible {
    outline: 2px solid var(--main-gray);
    outline-offset: 3px;
    border-radius: 2px;
}

/* The theme's mobile close glyph carries a hard-coded dark fill. On the dark
   appearance that ink disappears into the menu canvas, so the icon needs the
   same light paint as the rest of the navigation while keeping its own ring. */
:root[data-afilms-scheme="dark"] #header #mobile-menu-close path {
    fill: #e4e4e4;
}

/* The footer column headings are links that do not carry the list-link class;
   the ring is drawn on the heading block so an inline anchor does not collapse
   the outline geometry. */
.talk a:has(> .social-title):focus-visible {
    outline: none;
}

.talk a:focus-visible > .social-title {
    outline: 2px solid var(--main-gray);
    outline-offset: 4px;
}

/* The chooser paints its own surfaces, so the menu light/dark text tokens stay
   on those surfaces instead of the old three-button label rules. */
#header .afilms-scheme-trigger {
    color: var(--main-gray);
}

/* -------------------------------------------------------------------------
   Footer surface
   ------------------------------------------------------------------------- */

/* The sitemap footer section carries an inline white background in footer.php.
   On dark routes that inline paint leaves white wings around the content. */
:root[data-afilms-scheme="dark"] section.talk[style*="background:white"],
:root[data-afilms-scheme="dark"] section.talk[style*="background: white"] {
    background-color: #121212 !important;
}

/* Keep footer text links neutral without repainting navigation or buttons. */
:is(.talk, .contact-editorial-footer) {
    --footer-link: #4d4d4d;
    --footer-link-visited: #6c6c6c;
}

:root[data-afilms-scheme="dark"] :is(.talk, .contact-editorial-footer) {
    --footer-link: #e4e4e4;
    --footer-link-visited: #bcbcbc;
}

:is(.talk :is(.contact-info .info a, a.social-link, a:has(> .social-title)), .contact-editorial-footer a) {
    color: var(--footer-link);
}

:is(.talk :is(.contact-info .info a, a.social-link, a:has(> .social-title)), .contact-editorial-footer a):visited {
    color: var(--footer-link-visited);
}

:is(.talk :is(.contact-info .info a, a.social-link, a:has(> .social-title)), .contact-editorial-footer a):is(:hover, :focus-visible) {
    color: var(--main-gray);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Some site map headings contain a block inside the link. Use the anchor's
   accessible ink rather than the heading default, and keep its focus ring. */
.talk a > .social-title {
    color: inherit;
}

.talk a:is(:hover, :focus-visible) > .social-title {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* -------------------------------------------------------------------------
   Client marks in the footer
   ------------------------------------------------------------------------- */

/* Seven client marks are dark-ink artwork. They sit on a paper rectangle so
   the original pixels stay untouched. */
:root[data-afilms-scheme="dark"] .footer-logos .footer-logo {
    filter: none !important;
    background-color: #ffffff;
    border-radius: 3px;
    box-sizing: border-box;
    padding: 2px;
}

/* VICE is a wide wordmark on a transparent canvas. It uses the same logo box
   as the other seven client marks; the darker appearance paints a matching
   plate behind the wrapper, then fits the artwork inside a real inset so the
   wordmark keeps clear white space at both sides. The light appearance keeps
   the original transparent mark. */
.footer-logo-plate-vice {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 5rem;
    height: 3rem;
}

.footer-logo-vice {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 0;
    background-color: transparent;
    object-fit: contain;
}

:root[data-afilms-scheme="dark"] .footer-logos .footer-logo-plate-vice {
    background-color: #ffffff;
    border-radius: 3px;
}

:root[data-afilms-scheme="dark"] .footer-logos .footer-logo-vice {
    background-color: transparent;
    box-sizing: border-box;
    padding: 6px 9px;
}

@media screen and (max-width: 850px) {
    :root[data-afilms-scheme="dark"] .footer-logos .footer-logo-vice {
        padding: 7px 13px;
    }
}

:root[data-afilms-scheme="dark"] .footer-logos .footer-logo[src*="vice-logosmall"],
:root[data-afilms-scheme="dark"] .footer-logos .footer-logo[alt="VICE logo"]:not(.footer-logo-vice) {
    background-color: transparent;
    padding: 0;
}

/* -------------------------------------------------------------------------
   Award marks
   ------------------------------------------------------------------------- */
:root[data-afilms-scheme="dark"] .about-page .partners .footer-logo,
:root[data-afilms-scheme="dark"] .about-page .partners .footer-logo-sq {
    filter: none !important;
    background-color: #ffffff;
    border-radius: 3px;
    box-sizing: border-box;
    padding: 2px;
}

:root[data-afilms-scheme="dark"] .about-page .partners img[src*="vice-logosmall"],
:root[data-afilms-scheme="dark"] .about-page .partners img[src*="Osterreichischer"],
:root[data-afilms-scheme="dark"] .about-page .partners img[alt="VICE"],
:root[data-afilms-scheme="dark"] .about-page .partners img[alt="ORF"] {
    background-color: transparent;
    padding: 0;
}

/* -------------------------------------------------------------------------
   Award marks
   ------------------------------------------------------------------------- */

/* IDFA, Sundance, the Academy and Tribeca marks are dark-ink artwork. The
   mount follows the artwork instead of the light layout's reserved height, so
   the plate does not turn each mark into an oversized white square. */
:root[data-afilms-scheme="dark"] .awards-grid .award-img {
    filter: none !important;
    background-color: #ffffff;
    border-radius: 3px;
    box-sizing: border-box;
    padding: 6px 8px;
    height: auto;
    min-height: 0;
}

:root[data-afilms-scheme="dark"] .paid-awards-grid .paid-award-img {
    filter: none !important;
    background-color: #ffffff;
    border-radius: 3px;
    box-sizing: border-box;
    padding: 6px 8px;
    width: auto;
    max-width: 100%;
    margin-inline: auto;
}

/* The About route opens the awards block with a fixed 2px white rule, which
   reads as a bright band on the dark canvas. The home route already carries a
   dark rule for the same block, so the shared rule covers the other routes
   without touching the light appearance. */
:root[data-afilms-scheme="dark"] .about-page .awards {
    border-top-color: #2c2c2c;
}

/* -------------------------------------------------------------------------
   Shanghai paid landing: dark surfaces
   ------------------------------------------------------------------------- */

/* The light layout paints the hero band, ground copy panel, fit cards and
   inquiry sheet with warm paper surfaces. Dark appearance pairs the same
   regions with graphite surfaces so the shared dark text tokens stay legible.
   China keeps its own landing-scoped rules, so every selector below names the
   Shanghai body class. */
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-hero-band {
    background: #1c1c1c;
    border-color: #2c2c2c;
    box-shadow: none;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-hero-band-main {
    background: transparent;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-hero-band-side {
    background: #121212;
    border-color: #4a4a4a;
    box-shadow: none;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-hero-eyebrow,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-page-title-band,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-hero-copy,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-proof-line,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-method-label,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-value,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-notes p {
    color: #e4e4e4;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-hero-copy,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-notes p {
    color: #bcbcbc;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-proof-line {
    color: #9a9a9a;
    border-top-color: #2c2c2c;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-method-label {
    color: #9a9a9a;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-method,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-notes {
    border-top-color: #2c2c2c;
}

/* How support works: the image keeps its original colour; only the copy
   panel follows the dark surface. */
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-ground-band {
    background: #1c1c1c;
    border-color: #2c2c2c;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-ground-band-copy {
    background: transparent;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-ground-copy,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-ground-point-title {
    color: #e4e4e4;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-ground-point-detail {
    color: #bcbcbc;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-ground-points li {
    border-top-color: #2c2c2c;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-ground-points li:last-child {
    border-bottom-color: #2c2c2c;
}

/* Best suited for: four light cards become graphite cards in the dark page. */
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-fit-section > .section-surface-contained {
    --section-surface-background: #1c1c1c;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-fit-card {
    background: #232323;
    border-color: #4a4a4a;
    box-shadow: none;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-fit-card-title {
    color: #f5f5f5;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-fit-card-copy {
    color: #bcbcbc;
}

/* Tell us about the shoot: the paper sheet becomes graphite and the form card
   keeps a deeper separation from it. */
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-section > .section-surface-contained {
    --section-surface-background: #1c1c1c;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-section > .section-surface-contained::before {
    border-top-color: #2c2c2c;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-copy .paid-section-title {
    color: #f5f5f5;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-text {
    color: #bcbcbc;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-form-card {
    background: #121212;
    border-color: #4a4a4a;
    box-shadow: none;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-form-helper,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-form-label {
    color: #bcbcbc;
}

/* The field edge is the only resting control boundary on the graphite card,
   so it clears 3:1 against both the field and the card: #6b6b6b measures
   3.20:1 on #1c1c1c and 3.52:1 on #121212. */
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form input,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form textarea {
    background: #1c1c1c;
    border-color: #6b6b6b;
    color: #e4e4e4;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form input::placeholder,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form textarea::placeholder {
    color: #9a9a9a;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form input:focus,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form textarea:focus {
    background: #232323;
    border-color: #e4e4e4;
    color: #f5f5f5;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form [aria-invalid="true"] {
    border-color: #ff9b9b;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-field-error {
    color: #ffb4b4;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-form-submit {
    background: #e4e4e4;
    border-color: #e4e4e4;
    color: #121212;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-form-submit:hover,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-form-submit:focus {
    background: #f5f5f5;
    border-color: #f5f5f5;
    color: #121212;
}

:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-contact-action:focus-visible,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-copy-icon:focus-visible,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-form-submit:focus-visible,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form input:focus-visible,
:root[data-afilms-scheme="dark"] body.paid-landing-page-shanghai-production .paid-inquiry-form textarea:focus-visible {
    outline: 2px solid #f5f5f5;
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Shanghai paid landing: light appearance form edges and hints
   ------------------------------------------------------------------------- */

/* The resting edge measured #D2D2D1 on the #fafaf8 field, below the 3:1
   control boundary. The China page's verified edge, #808080, measures 3.78:1
   on the field and 3.95:1 on the white card, so the Shanghai fields take the
   same value. */
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form input,
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form textarea {
    border-color: #808080;
}

/* The blank-field hints are body copy against #fafaf8. #757575 measured
   4.43:1 on the field; #6c6c6c measures 5.0:1 there and 5.25:1 on the white
   card, matching the China page. */
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form input::placeholder,
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form textarea::placeholder {
    color: #6c6c6c;
    opacity: 1;
}

/* The edge already carries the resting boundary, so keyboard focus adds the
   same offset ring the China page uses instead of relying on a colour shift. */
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form input:focus-visible,
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form textarea:focus-visible {
    outline: 2px solid #373737;
    outline-offset: 2px;
}

/* Keep the validation edge distinct from the resting edge when a field is
   empty. #7d2727 measures 9.6:1 on the white card. */
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form input[aria-invalid="true"],
:root:not([data-afilms-scheme="dark"]) body.paid-landing-page-shanghai-production .paid-inquiry-form textarea[aria-invalid="true"] {
    border-color: #7d2727;
}

/* -------------------------------------------------------------------------
   Dark appearance separators outside the paid pages
   ------------------------------------------------------------------------- */

/* In dark appearance --main-gray resolves to the body ink #e4e4e4, so every
   border that used it as a rule reads as a bright line. The contact block on
   the home route and the client list on the About route take the same #2c2c2c
   separator as the rest of the dark layout. */
:root[data-afilms-scheme="dark"] body.home .talk .contact-info .info,
:root[data-afilms-scheme="dark"] body.home .talk .social-links {
    border-bottom-color: #2c2c2c;
}

:root[data-afilms-scheme="dark"] .about-page .clients-grid {
    border-top-color: #2c2c2c;
}
