/*
 * Osano's consent widget is injected into the page, so its CSS and ours share one
 * cascade with no boundary. Four of Flickr's bare element selectors reach inside it:
 *
 *   flickr_zeus.css:35 / flickr.css:276   a:link / :visited / :hover / :active
 *   flickr.css                            li { font-size; line-height }
 *   flickr.css                            p  { font-size }
 *   YUI-style reset (bundled globally)    ... p ... { margin: 0 }
 *
 * Everything below is Selectors Level 3 or older -- deliberately no :where(), no
 * :focus-visible and no `revert`, so the whole file parses back to IE9. Each rule
 * sits above the (0,1,1) Flickr rule it neutralises, so it wins on specificity
 * alone, independent of load order. That matters: this file is emitted next to the
 * Osano script from two different head includes, and the templates around them
 * differ in where they emit their own CSS.
 *
 * Where Osano owns a declaration we stay OUT of its way rather than outranking it.
 * Do not "simplify" the guards below; each one is load-bearing.
 */

/*
 * Resting state only. Osano's :hover and :active rules are (0,2,0) and must keep
 * winning -- they carry its hover contrast colour -- so this rule declines to match
 * those states rather than outranking them. :link never matches a visited link, so
 * Osano's :visited rule is untouched too.
 *
 * Known trade-off: there is no :not(:focus-visible) guard here, because keeping this
 * rule order-independent requires more weight than Osano's own (0,2,0) state rules.
 * A keyboard-focused link therefore shows Osano's base link colour rather than its
 * contrast colour; the bold and focus ring Osano sets still apply, since we set
 * neither. Adding :focus-visible back would fix that but raise the floor for the
 * whole file to March 2022.
 *
 * The literal comes first so browsers without custom-property support still get a
 * sensible colour; the var() line overrides it everywhere else, tracking the palette
 * configured in the Osano dashboard.
 */
.osano-cm-window a.osano-cm-link:link:not(:hover):not(:active) {
	color: #ff0084;
	color: var(--osano-link-color, #ff0084);
}

/*
 * Safe in every state: Osano sets no background on its links, and the underline it
 * does set is the one being restored. The purpose/feature variants are excluded
 * because Osano deliberately gives those no underline. The :not() chain has to stay
 * on one line -- whitespace between the parts would make it a descendant selector.
 */
.osano-cm-window a.osano-cm-link:not(.osano-cm-link--type_purpose):not(.osano-cm-link--type_specialPurpose):not(.osano-cm-link--type_feature):not(.osano-cm-link--type_specialFeature) {
	background-color: transparent;
	text-decoration: underline;
}

/*
 * flickr.css pins an absolute 12px/18px on bare `li`, which breaks the em scale the
 * widget's own type is built on (Osano sizes everything relative to the widget root,
 * e.g. 0.75em) and cascades into every descendant. Restoring inheritance is enough.
 *
 * Deliberately (0,1,1): Osano's own `.osano-cm-disclosure__list > .osano-cm-list-item`
 * line-height is (0,2,0) and still wins, so the disclosure rows keep its 1.25 while
 * the drawer rows -- which Osano leaves alone -- get the inherited value back.
 */
.osano-cm-window li {
	font-size: inherit;
	line-height: inherit;
}

/*
 * `1em 0` is the UA default for <p>, which is what Osano relies on here; our reset
 * zeroes it and flickr.css overrides the size. Correct for horizontal writing modes,
 * which is all Flickr uses.
 *
 * `:not([class])` is what keeps this off the paragraphs Osano *does* style --
 * .osano-cm-description, .osano-cm-header and .osano-cm-additional-label all carry a
 * class and their own em-relative sizing.
 */
.osano-cm-window .osano-cm-list-item__description > p:not([class]) {
	margin: 1em 0;
	font-size: inherit;
}
