/*  Second line for News+ theme, where links are in Secondary Menu */
a[data-drupal-link-system-path="user/login"],
#block-secondarymenu-2 a[href="/user/login"] {
  display: none!important;
  visibility: hidden;
}

#block-weatherwidget iframe {
  max-width: 100%;
}

/* DFP Ads - class needs added to ad blocks */
.dfp-ad {
  text-align: center;
}

.region-leaderboard .dfp-ad {
  margin-bottom: 1.5rem;
}

/* Simple Ads */
.block-simpleads {
  display: flex;
  justify-content: center;
}

/* Userway */
body .uwy.userway_p3 .userway_buttons_wrapper {
  bottom: 19px !important;
  right: -45px !important;
  width: fit-content;
  left: auto!important;
}

/* Hide Klaro's "(opt-out)" badge.
   The Google service has to carry BOTH required AND opt_out, because
   klaro_js_alter() only skips server-side blocking when both are TRUE — with
   required alone the script stays decorated and never fires. Klaro then prints
   both badges, so the row reads "(always required)(opt-out)", which
   contradicts itself. "(always required)" is the accurate one; the service
   description spells the rest out. Revisit if a service ever legitimately
   needs a working opt-out badge. */
#klaro .cm-opt-out {
  display: none;
}

/* Keep the Klaro toggle above everything else. Klaro ships it at z-index 99,
   which is low enough for ordinary page furniture to cover it — the privacy
   footer links sit at 100, for one. The toggle is how a reader reopens the
   consent dialog to change their mind, so it must stay clickable. */
.klaro_toggle_dialog {
  z-index: 9999;
}

/* ...but hide it entirely while the consent dialog is open. The toggle is
   fixed bottom-right and lands ON TOP of the dialog's Accept button, so at
   z-index 9999 it swallows clicks meant for Accept. It has no purpose while
   the dialog is already showing. Same treatment, and the same hook, as the
   Userway rule below. */
body:has(#klaro-cookie-notice) .klaro_toggle_dialog {
  display: none !important;
}

/* Hide the Userway widget while the Klaro cookie dialog is visible so the
   two fixed-position controls don't collide on mobile. */
body:has(#klaro-cookie-notice) .uwy,
body:has(#klaro-cookie-notice) .userway_buttons_wrapper {
  display: none !important;
}

/* When Klaro or Userway is on screen, flip the scroll-to-top button to the
   left edge so it doesn't overlap either widget in the bottom-right corner. */
body:has(#klaro-cookie-notice) #toTop,
body:has(.uwy) #toTop,
body:has(.userway_buttons_wrapper) #toTop {
  right: auto;
  left: 30px;
}

/* Klaro */

/* Klaro's own CSS assumes border-box. Most themes give it that via a global
   reset, but cni's normalize.css predates border-box, so there the widget falls
   back to content-box and two things break: the `width: 100%` below resolves to
   100% PLUS the 40px of padding, so the notice overflows the viewport and
   shoves its right-hand padding and the close button off-screen; and
   klaro-extend.css's 24px min-height on `.klaro a` adds to the button padding
   instead of being absorbed by it, so "Customize" renders 8px taller than
   Decline/Accept. Scope the reset to the widget — a no-op wherever the theme
   already sets it. */
.klaro,
.klaro *,
.klaro *::before,
.klaro *::after {
  box-sizing: border-box;
}

/* Container for the notice */
.klaro .cookie-notice {
  width: 100% !important;
  max-width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  border-radius: 0 !important; /* Removes rounded corners for a clean edge */
  padding: 10px 20px !important; /* Reduces vertical height */
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1); /* Subtle shadow on top edge */
}

/* Forces the content (text and buttons) into a single horizontal row */
.klaro .cookie-notice .cn-body {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Let the text take the space the buttons don't, but give it a floor. A bare
   `flex: 1` is `flex: 1 1 0%`, and a basis of 0 means this shrinks toward
   min-content rather than letting .cn-body's flex-wrap fire — so between
   klaro's own 384px breakpoint and roughly 900px the buttons kept their full
   width and squeezed the text into a one-word-per-line column (at 500px: 90px
   wide, 269px tall, in a 310px notice). A real basis makes the row wrap
   instead, dropping the buttons onto their own line once both no longer fit. */
.klaro .cookie-notice .cn-body p {
  margin: 0;
  flex: 1 1 300px;
}

/* Adjusts the buttons to sit side-by-side */
.klaro .cookie-notice .cn-ok {
  display: flex;
  gap: 10px;
}

/* With `learn_more_as_button` on, "Customize" is an <a> sitting beside the
   <div class="cn-buttons"> that wraps Decline/Accept, and klaro.min.css
   baseline-aligns the two — which leaves the link off the buttons' line.
   Centre the row instead. Selector mirrors klaro's own so it outranks it;
   etype.css is in the `state` group, so it lands after klaro's base CSS. */
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-ok {
  align-items: center;
}

/* klaro opens vertical gaps for its stacked layout with a -0.5em/+0.5em margin
   dance: .cn-ok pulls up 0.5em, each child pushes down 0.5em, and .cn-buttons
   then pulls up another 0.5em on top of that. The extra pull on the wrapper is
   not mirrored on the "Customize" link beside it, so in the single horizontal
   row this block forces the two end up ~7px out of line. The `gap` rules above
   already do this spacing job — including when the row wraps on mobile — so
   zero the margins out and let the buttons wrapper lay out as a flex row.
   The buttons themselves carry the +0.5em too: leave that one in place and the
   wrapper stays 55px tall around its 48px buttons, which just moves the
   misalignment onto "Customize" as it centres in the taller line. */
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-ok,
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-ok a,
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-ok div,
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons,
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons button.cm-btn {
  margin-top: 0;
}

.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons {
  display: flex;
  align-items: center;
}

/* The close button is absolutely positioned flush into the notice's top-right
   corner, which reads as cramped once the notice itself is inset. Give it a
   little breathing room and keep the button row clear of it. Scoped to
   .klaro-close-enabled so sites without the ✕ keep their current inset. */
.klaro.klaro-close-enabled .cookie-notice .klaro-close {
  top: 8px;
  right: 12px;
}

.klaro.klaro-close-enabled .cookie-notice .cn-body {
  padding-right: 34px;
}

/* Once the row wraps, .cn-ok is alone on its line, so auto side margins centre
   it there. On the shared row the paragraph's flex-grow has already absorbed
   the free space, so these resolve to 0 and nothing moves. */
.klaro .cookie-notice .cn-body .cn-ok {
  margin-left: auto;
  margin-right: auto;
}

/* Below the wrap point the close button is no longer beside the buttons, so
   the reserve above would just shove that centred row ~10px off-centre. Hand
   the space back.

   Measured on cushingcitizen.com the row wraps at just under 800px but above
   700px, and the exact point moves with the button labels, so this breakpoint
   can only approximate it. 680px deliberately sits BELOW the wrap point: erring
   low means a site spends a narrow band wrapped-but-still-reserving, which is
   ~10px of off-centring and purely cosmetic. Erring high would drop the reserve
   while the row is still shared, putting the close button back on top of the
   Accept button — a real bug. Keep this number under the wrap point. */
@media (max-width: 680px) {
  .klaro.klaro-close-enabled .cookie-notice .cn-body {
    padding-right: 14px;
  }
}

/* klaro spaces the buttons with margin-right, including on the last one, which
   leaves the right gap 7px wider than the text's left inset. Drop it on the
   last button so the notice is inset evenly on both sides. */
.klaro .cookie-notice .cn-buttons button:last-child {
  margin-right: 0;
}

/* The old formalize.css reset (cni is the only theme still shipping it) styles
   a bare `button` with a white->grey gradient plus a white text-shadow. Klaro's
   klaro-override.css only sets background-color, so the gradient paints over the
   navy button and its white label lands on white. Different property, so
   specificity never settles it — reset both longhands here. */
.klaro .cookie-notice .cm-btn,
.klaro .cookie-modal .cm-btn,
.klaro .context-notice .cm-btn,
.klaro .klaro-close {
  background-image: none;
  text-shadow: none;
}

/* video_embed_field's ::after reserves 56.25% padding-bottom for a 16:9
   aspect-ratio slot. Klaro holds the iframe's src empty/absent until consent
   is given, so the slot renders as empty space below Klaro's contextual
   notice. Only reserve the slot when the iframe has a real (non-empty) src.
   :has() re-evaluates when Klaro sets src on accept, so the padding comes
   back and the video is visible. Klaro may keep data-src around even after
   accept, so don't key off data-src. */
.video-embed-field-responsive-video:not(:has(iframe[src]:not([src=""])))::after {
  display: none;
}
