/*
 * Appearance family: portfolio-archive
 * Source of truth: this file. Listing and older-project archive family.
 * Owner: the portfolio-archive appearance writer.
 * Loaded automatically by inc/appearance-route-loader.php.
 *
 * Scoping follows the portfolio markup, not WordPress page IDs: the older-project
 * archive and SVG-arrow templates reuse these grids and must receive the same
 * treatment when an archive page is assigned. The shared loader still has to map
 * those templates to this family before any of these rules can load.
 */

/* Listing card titles are small text at #858585 in light appearance, below the
   4.5:1 body-text threshold on white. Use the same graphite as the approved
   home listing; thumbnails and layout stay untouched. */
:root:not([data-afilms-scheme="dark"]) body .commercials-page .commercials-grid .commercial .title,
:root:not([data-afilms-scheme="dark"]) body .documentaries-page .documentaries-grid .documentary .title {
    color: #6c6c6c;
}

/* The theme's global anchor hover rule repaints card titles with the #858585
   muted token. On white that is 3.69:1, below the 4.5:1 target for these small
   captions. Keep the resting graphite through hover and focus on the cards. */
:root:not([data-afilms-scheme="dark"]) body .commercials-page .commercials-grid .commercial a:hover .title,
:root:not([data-afilms-scheme="dark"]) body .commercials-page .commercials-grid .commercial a:focus .title,
:root:not([data-afilms-scheme="dark"]) body .documentaries-page .documentaries-grid .documentary a:hover .title,
:root:not([data-afilms-scheme="dark"]) body .documentaries-page .documentaries-grid .documentary a:focus .title {
    color: #6c6c6c !important;
}

/* Keyboard focus on a card link uses the browser's thin default ring, which is
   hard to see over a bright thumbnail. Draw a two-pixel ring inside the card
   without changing the link's destination or hover colour. */
.commercials-page .commercials-grid a:focus-visible,
.documentaries-page .documentaries-grid a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

:root[data-afilms-scheme="dark"] .commercials-page .commercials-grid a:focus-visible,
:root[data-afilms-scheme="dark"] .documentaries-page .documentaries-grid a:focus-visible {
    outline-color: #ffffff;
}

/* The works, commercial and documentary listing grids keep a fixed #ededed
   top rule from theme.css. On the dark canvas it becomes the brightest line on
   the page, so these three listing routes use the dark divider instead. */
:root[data-afilms-scheme="dark"] .commercials-page .commercials-grid,
:root[data-afilms-scheme="dark"] .documentaries-page .documentaries-grid {
    border-top-color: #2c2c2c;
}

/* The backup commercial listing puts an inline SVG arrow after the summary.
   Its path only draws lines and the theme sets no stroke, so an unstyled SVG
   renders an invisible full-card-size block (506px tall at 1440). Give it a
   small inline size, make the path use the caption colour, and remove the
   filled default so the arrow is visible beside the summary. */
.commercials-page .commercials-grid .commercial .description .arrow-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 10;
    stroke-linecap: square;
    margin-left: 8px;
    vertical-align: -2px;
}

/* The path carries stroke-width="4" as a presentation attribute, which beats
   the inherited value; set it on the path so a 16px arrow has a visible line. */
.commercials-page .commercials-grid .commercial .description .arrow-icon path {
    stroke-width: 10;
}

/* Long documentary titles wrap into the thumbnail's lower edge on the all-works
   and documentary archive. Give the dark caption the same reading space as the
   approved home listing without changing the card width or image colours. */
:root[data-afilms-scheme="dark"] .documentaries-page .documentaries-grid .documentary .title {
    margin-top: 12px;
}

/* The portfolio action is already a real link with a 44px touch area from
   interaction-accessibility.css. Make the dark resting boundary quieter and
   give hover and keyboard focus distinct, scheme-aware cues. */
:root[data-afilms-scheme="dark"] .commercials-page a.portfolio-list-action,
:root[data-afilms-scheme="dark"] .documentaries-page a.portfolio-list-action {
    border-color: #4a4a4a;
    color: #e4e4e4;
}

:root[data-afilms-scheme="dark"] .commercials-page a.portfolio-list-action:hover,
:root[data-afilms-scheme="dark"] .documentaries-page a.portfolio-list-action:hover {
    background-color: #242424;
    border-color: #9a9a9a;
    color: #ffffff;
}

/* interaction-accessibility.css gives this link a 2px focus ring, but a global
   :focus-visible rule later in theme.css wins on specificity and reduces it to
   1px. Keep the stronger ring on these listing routes without editing the
   shared stylesheet owned by the integration pass. */
.commercials-page a.portfolio-list-action:focus-visible,
.documentaries-page a.portfolio-list-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

:root[data-afilms-scheme="dark"] .commercials-page a.portfolio-list-action:focus-visible,
:root[data-afilms-scheme="dark"] .documentaries-page a.portfolio-list-action:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}
