/* TechnologyNews footer layer: loads last. 1) former late <head>/<body> inline CSS, 2) modernisation + dark mode. */

/* ---- Former template refinements (ex ASE 9155, printed late in <head>) ---- */
@media(min-width:1024px){
      header .tn-site-header .tn-primary-nav .wp-block-navigation__responsive-container-open,
      header .tn-site-header .tn-primary-nav .wp-block-navigation__responsive-container-close{display:none!important}
      header .tn-site-header .tn-primary-nav .wp-block-navigation__responsive-container:not(.is-menu-open){display:block!important;position:relative;inset:auto;width:auto;height:auto;overflow:visible}
    }
    .tn-description-small{display:none}
    @media(max-width:600px){
      body.page.page-id-4982 main.wp-block-group{padding-inline:12px!important}
      body.page.page-id-4982 .entry-content.wp-block-post-content{width:100%;max-width:none}
      body.page.page-id-4982 .entry-content .tn-next-home{padding-inline:0!important;margin-inline:0!important}
      body.page.page-id-4982 .entry-content .tn-next-intro{padding-inline:18px}
      .tn-description-wide{display:none}
      .tn-description-small{display:block}
      .tn-description-small p{margin-block:.5rem}
      .tn-description-small summary{cursor:pointer;text-decoration:underline;text-underline-offset:.2em;padding-block:.6rem;color:inherit;font-weight:600}
    }
    body.page-id-276:not(.logged-in) .cgp-form-container>div:first-child{margin-bottom:1rem}

/* ---- Former <style> inside the header navigation (wp_navigation 4834) ---- */
/* Keep the painted utility row flush with the navbar as its height collapses. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    header .tn-site-header .tn-header-brand {
      transform: none !important;
      opacity: 1 !important;
    }
  }
}
/* Breadcrumb surface inside the sticky header */
.tn-site-header > .wp-block-template-part:has(nav.custom-breadcrumbs) {
  background-color: #fff;
  background-image: linear-gradient(105deg, #e8f1ea, #f7faf5);
}
.tn-site-header nav.custom-breadcrumbs { min-width: 0; }
.tn-site-header nav.custom-breadcrumbs ol { opacity: 1 !important; align-items: baseline; }
@keyframes tn-breadcrumb-surface {
  from { background-size: 100% 0%; }
  to { background-size: 100% 100%; }
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .tn-site-header > .wp-block-template-part:has(nav.custom-breadcrumbs) {
      background-repeat: no-repeat;
      animation: tn-breadcrumb-surface linear both;
      animation-duration: auto;
      animation-timeline: scroll(root block);
      animation-range: 0px 90px;
    }
  }
}
@media (max-width:600px) {
  .tn-site-header nav.custom-breadcrumbs { width: 100%; }
  .tn-site-header nav.custom-breadcrumbs ol { flex-wrap: nowrap !important; }
  .tn-site-header nav.custom-breadcrumbs li { flex: none; }
  .tn-site-header nav.custom-breadcrumbs li[aria-current="page"] {
    flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}
/* Header menu link spacing */
@media (min-width:1024px) {
  header .tn-site-header .tn-primary-nav .wp-block-navigation__container > li > .wp-block-navigation-item__content {
    padding: .65rem clamp(.45rem, .8vw, .85rem) !important;
  }
  header .tn-site-header .tn-primary-nav .wp-block-navigation__submenu-container a.wp-block-navigation-item__content {
    box-sizing: border-box;
    min-height: 46px;
    padding: .8rem 1.1rem !important;
  }
}
@media (max-width:1023px) {
  header .tn-site-header .tn-primary-nav .is-menu-open .wp-block-navigation__container > li > a.wp-block-navigation-item__content {
    box-sizing: border-box;
    min-height: 48px;
    padding: .8rem 1rem !important;
  }
  header .tn-site-header .tn-primary-nav .is-menu-open .wp-block-navigation__submenu-container a.wp-block-navigation-item__content {
    min-height: 44px !important;
    padding: .65rem 1rem !important;
  }
}

/* ==== Modernisation layer (2026-11-26) — appended to tni-foot.css, loads last on purpose ==== */

/* Modern typography: balanced headlines, nicer paragraph rag. */
:where(h1,h2,h3,.wp-block-post-title){text-wrap:balance}
:where(.wp-block-post-content,.tn-story-copy,.tn-utility-page-content) p{text-wrap:pretty}

/* Cross-document view transitions: archive thumbnails morph into the article hero (names set in functions.php). */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.22s}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}

/* Reading progress bar on articles: pure CSS scroll-driven animation, no JavaScript. The header is sticky, so it is the containing block. */
@supports (animation-timeline:scroll()){
  body.single-post .wp-site-blocks>header.wp-block-template-part::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:linear-gradient(90deg,#f4d03f,#a9cd89);transform-origin:0 50%;transform:scaleX(0);animation:tni-read-progress linear both;animation-timeline:scroll(root block);pointer-events:none;z-index:2}
  @keyframes tni-read-progress{to{transform:scaleX(1)}}
}
@media (prefers-reduced-motion:reduce){body.single-post .wp-site-blocks>header.wp-block-template-part::after{display:none}}

/* Bigger tap targets on phones (WCAG 2.5.8: at least 24px, aim for ~44px on primary links). */
@media (max-width:781px){
  .tn-site-footer :is(.tn-footer-links,.tn-footer-nav) a{display:inline-block;padding-block:.45rem}
  .tn-site-footer .tn-footer-links li{margin-block:0}
  .tn-site-header .custom-breadcrumbs a{display:inline-block;padding-block:.55rem}
  .tn-archive .tn-archive-card .tn-archive-topics a,.tn-archive .tn-archive-card .tn-archive-meta a{display:inline-block;padding-block:.35rem}
  body.single-post .tn-story .tn-story-label a{display:inline-block;padding-block:.3rem}
}

/* Archive, blog, search, author and 404 cards: a clear hover state (lift, shadow, image zoom, underlined title). */
.tn-archive .tn-archive-card .wp-block-post-featured-image{overflow:hidden;border-radius:10px}
.tn-archive .tn-archive-card .wp-block-post-title a{text-decoration-line:underline;text-decoration-color:transparent;text-decoration-thickness:2px;text-underline-offset:.2em}
@media (hover:hover){
  .tn-archive .tn-archive-card:hover{box-shadow:0 12px 28px -10px rgb(23 59 44 / .28)}
  .tn-archive .tn-archive-card:hover .wp-block-post-title a{text-decoration-color:#f4d03f}
  :root[data-theme=dark] .tn-archive .tn-archive-card:hover{box-shadow:0 14px 30px -12px rgb(0 0 0 / .7)}
}
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .tn-archive .tn-archive-card{transition:transform .2s cubic-bezier(.2,.7,.2,1),box-shadow .2s ease,border-color .2s ease}
  .tn-archive .tn-archive-card .wp-block-post-featured-image img{transition:transform .45s cubic-bezier(.2,.7,.2,1)}
  .tn-archive .tn-archive-card .wp-block-post-title a{transition:text-decoration-color .2s ease}
  .tn-archive .tn-archive-card:hover{transform:translateY(-4px)}
  .tn-archive .tn-archive-card:hover .wp-block-post-featured-image img{transform:scale(1.045)}
}

/* Share buttons (Lightning Simple Social Share): brand hues darkened just enough for white 14px text to pass
 * WCAG AA (>= 4.5:1; WhatsApp was 1.98, Twitter 2.83, Reddit 3.44). Hover uses a darker shade (~7:1) instead of fading. */
.lsss-share-buttons .lsss-facebook{background-color:#0d6fed}
.lsss-share-buttons .lsss-twitter{background-color:#0b79bd}
.lsss-share-buttons .lsss-whatsapp{background-color:#178540}
.lsss-share-buttons .lsss-telegram{background-color:#007ab8}
.lsss-share-buttons .lsss-reddit{background-color:#d63a00}
.lsss-share-buttons .lsss-share-button:is(:hover,:focus-visible){opacity:1;color:#fff}
.lsss-share-buttons .lsss-facebook:is(:hover,:focus-visible){background-color:#0a55b5}
.lsss-share-buttons .lsss-twitter:is(:hover,:focus-visible){background-color:#085d92}
.lsss-share-buttons .lsss-linkedin:is(:hover,:focus-visible){background-color:#005e8f}
.lsss-share-buttons .lsss-pinterest:is(:hover,:focus-visible){background-color:#8f0615}
.lsss-share-buttons .lsss-whatsapp:is(:hover,:focus-visible){background-color:#116430}
.lsss-share-buttons .lsss-telegram:is(:hover,:focus-visible){background-color:#005d8d}
.lsss-share-buttons .lsss-reddit:is(:hover,:focus-visible){background-color:#a62d00}
.lsss-share-buttons .lsss-email:is(:hover,:focus-visible){background-color:#263646}
.lsss-share-buttons .lsss-share-button:focus-visible{outline:2px solid #f4d03f;outline-offset:2px}

/* Theme toggle (sun / moon), sits in the header tagline row. */
.tn-theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:24px;margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:#fff;cursor:pointer;transition:transform .35s cubic-bezier(.2,.7,.2,1),background-color .2s}
.tn-theme-toggle:hover{background:rgb(255 255 255 / .12)}
.tn-theme-toggle{border-radius:999px}
.tn-theme-toggle:focus-visible{outline:2px solid #f4d03f;outline-offset:2px}
.tn-theme-toggle:active{transform:rotate(-30deg) scale(.92)}
.tn-theme-toggle svg{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tn-theme-toggle .tni-i-moon{fill:currentColor;stroke:none}
.tn-theme-toggle .tni-i-sun,:root[data-theme=dark] .tn-theme-toggle .tni-i-moon{display:none}
:root[data-theme=dark] .tn-theme-toggle .tni-i-sun{display:block}
.tn-site-header .tn-header-brand-inner .tn-header-socials{margin-left:auto}
@media (max-width:1023px){
  .tn-site-header .tn-header-brand-inner{position:relative}
  .tn-site-header .tn-header-brand-inner .tn-header-tagline{padding-inline:40px}
  .tn-site-header .tn-header-brand-inner .tn-theme-toggle{position:absolute;right:-6px;top:50%;width:44px;height:44px;margin:0;transform:translateY(-50%)}
  .tn-site-header .tn-header-brand-inner .tn-theme-toggle:active{transform:translateY(-50%) rotate(-30deg) scale(.92)}
}

/* Light mode chosen with the toggle while the system is dark: keep native controls light too. */
:root[data-theme=light]{color-scheme:light}

/* ==== Dark mode ====
 * html[data-theme] is set before first paint by the head script (functions.php), following the system setting.
 * Smooth forest gradient, no texture. Header and footer are already dark green and stay as they are. */
:root[data-theme=dark]{
  color-scheme:dark;
  --tni-bg:#0e1813;--tni-surface:#14231c;--tni-surface-2:#1a2e24;--tni-line:#2a4437;--tni-text:#d5e2d9;--tni-muted:#a7bcae;--tni-strong:#f0f5f1;--tni-link:#9fd8b3;
  --wp--preset--color--base:#0e1813;
  --wp--preset--color--contrast:#f0f5f1;
  --wp--preset--color--accent-2:#1a2e24;
  --wp--preset--color--accent-4:#c3d3c8;
  --wp--preset--color--accent-5:#14231c;
  --wp--preset--color--accent-6:#f0f5f133;
}
:root[data-theme=dark],:root[data-theme=dark] body{background-color:var(--tni-bg)}
:root[data-theme=dark] body{
  background-image:
    radial-gradient(1200px 760px at 6% -8%,rgb(40 107 77 / .22),transparent 62%),
    radial-gradient(1000px 720px at 104% 30%,rgb(82 127 65 / .14),transparent 64%),
    radial-gradient(1100px 820px at 45% 115%,rgb(244 208 63 / .05),transparent 62%),
    linear-gradient(180deg,#10201a 0%,#0e1813 50%,#0b140f 100%);
  background-attachment:fixed;background-repeat:no-repeat;background-size:100% 100%;
}
:root[data-theme=dark] body.page.page-id-4982,:root[data-theme=dark] body.page-id-4982 .wp-site-blocks{background-color:transparent}
:root[data-theme=dark] body.page.page-id-4982{background-color:var(--tni-bg)}

/* Form fields */
:root[data-theme=dark] :where(input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),textarea,select){background-color:var(--tni-bg);color:var(--tni-strong);border-color:#3b5c4b}
:root[data-theme=dark] :is(input,textarea)::placeholder{color:#8fa697}

/* Header: search capsule and breadcrumb strip */
:root[data-theme=dark] header.wp-block-template-part .tn-site-header .tn-mobile-search .wp-block-search__inside-wrapper{background:#10201a;border-color:#3b5c4b}
:root[data-theme=dark] header.wp-block-template-part .tn-site-header .tn-mobile-search .wp-block-search__input{color:var(--tni-strong);background:transparent}
:root[data-theme=dark] .tn-site-header>.wp-block-template-part:has(nav.custom-breadcrumbs){background-color:#11201a;background-image:linear-gradient(105deg,#132a20,#0f1c16)}
:root[data-theme=dark] .tn-site-header .custom-breadcrumbs,:root[data-theme=dark] .tn-site-header .custom-breadcrumbs :is(a,li,li:last-child,span){color:#c9dacf}
:root[data-theme=dark] .tn-site-header .custom-breadcrumbs li:last-child{color:var(--tni-strong)}
:root[data-theme=dark] .tn-site-header .wp-block-template-part>.wp-block-group{border-bottom-color:var(--tni-line)!important}

/* Archive, blog, search, author, 404 cards (colours are inline in the templates, hence !important) */
:root[data-theme=dark] .tn-archive-card{background-color:var(--tni-surface)!important;color:var(--tni-text)!important;border-color:var(--tni-line)!important}
:root[data-theme=dark] .tn-archive .tn-archive-card .wp-block-post-title a{color:var(--tni-strong)}
:root[data-theme=dark] .tn-archive-meta{color:var(--tni-muted)!important}
:root[data-theme=dark] .tn-archive .tn-archive-card :is(.tn-archive-topics,.tn-archive-meta) a{color:var(--tni-link)}
:root[data-theme=dark] .tn-archive .tn-archive-card .tn-archive-topics a:is(:hover,:focus-visible){color:#173b2c}
:root[data-theme=dark] .tn-archive .tn-archive-card .wp-block-post-excerpt{color:var(--tni-text)}
:root[data-theme=dark] .tn-archive .tn-archive-pagination :is(a,.current){background:var(--tni-surface);border-color:var(--tni-line);color:var(--tni-text)}
:root[data-theme=dark] .tn-archive .tn-archive-pagination :is(.wp-block-query-pagination-previous,.wp-block-query-pagination-next){background:var(--tni-surface-2)}
:root[data-theme=dark] .tn-archive .tn-archive-pagination .current{background:#f4d03f;border-color:#f4d03f;color:#173b2c}
:root[data-theme=dark] .tn-archive .tn-archive-pagination a:hover{color:#173b2c}
:root[data-theme=dark] .tn-archive .tn-archive-pagination .dots{color:var(--tni-muted)}
:root[data-theme=dark] :is(.tn-archive-hero,.tn-utility-hero){box-shadow:inset 0 0 0 1px rgb(255 255 255 / .06)}

/* Utility pages (page, search, 404, author) */
:root[data-theme=dark] .tn-utility .tn-utility-page-content{background:var(--tni-surface);border-color:var(--tni-line);color:var(--tni-text)}
:root[data-theme=dark] .tn-utility .tn-utility-empty{background:var(--tni-surface-2);border-color:var(--tni-line);color:var(--tni-text)}
:root[data-theme=dark] .tn-utility .tn-utility-search-form .wp-block-search__input{background:var(--tni-bg);border-color:#3b5c4b;color:var(--tni-strong)}

/* Single posts */
:root[data-theme=dark] body.single-post .tn-story .tn-story-copy{background:var(--tni-surface);border-color:var(--tni-line)}
:root[data-theme=dark] body.single-post .tn-story .tn-story-copy .wp-block-post-content{color:var(--tni-text)}
:root[data-theme=dark] body.single-post .tn-story .tn-story-copy .wp-block-post-content :is(strong,b){color:var(--tni-strong)}
:root[data-theme=dark] body.single-post .tn-story .tn-story-tags a{background:var(--tni-surface);border-color:var(--tni-line);color:var(--tni-text)}
:root[data-theme=dark] body.single-post .tn-story .tn-story-tags a:is(:hover,:focus-visible){color:#173b2c}
:root[data-theme=dark] .tn-story-end .has-background{background-color:var(--tni-surface-2)!important;color:var(--tni-text)!important;border-color:var(--tni-line)!important}
:root[data-theme=dark] body.single-post .tn-story .tn-story-disclosure a{color:var(--tni-link)}
:root[data-theme=dark] .tn-story-topic-link{background-color:var(--tni-surface-2)!important;color:var(--tni-text)!important}
:root[data-theme=dark] .tn-story-topic-link a{color:var(--tni-strong)}
:root[data-theme=dark] .tn-card{--tn-card-background:var(--tni-surface-2);--tn-card-border:var(--tni-line);--tn-card-text:var(--tni-strong);--tn-card-muted:var(--tni-muted)}
:root[data-theme=dark] .tn-card-interactive>a:hover{background:#1f3a2d;border-color:#4f7d63}
:root[data-theme=dark] body.single-post .tn-story :is(.tn-story-author,.tn-story-disclosure):is(:has(a:hover),:focus-within){background:#1f3a2d!important;border-color:#4f7d63!important}
:root[data-theme=dark] .tn-article-guide{background:var(--tni-surface-2);border-color:var(--tni-line);color:var(--tni-strong)}
:root[data-theme=dark] .tn-article-guide a{color:var(--tni-link)}
:root[data-theme=dark] .wp-block-post-content :is(p,li,td,th,figcaption,blockquote,h2,h3,h4,h5,h6) a:not(.wp-element-button):not(.wp-block-button__link):not([class*=lsss]){color:var(--tni-link)}
:root[data-theme=dark] .tltn-author-box{--tltn-accent:#9fd8b3}
:root[data-theme=dark] .wp-block-post-content :is(table,th,td){border-color:var(--tni-line)}

/* Front page (its own CSS is in the page content; these selectors outrank it without !important) */
:root[data-theme=dark] .tn-next-home.wp-block-group.alignfull{--tn-next-ink:#e3ece6;--tn-next-mint:#1a2e24}
:root[data-theme=dark] .tn-next-home .tn-next-kicker{color:#8fd1a8}
:root[data-theme=dark] .tn-next-home .tn-next-lead{background:var(--tni-surface-2)}
:root[data-theme=dark] .tn-next-home .tn-next-card{background:var(--tni-surface);border-color:var(--tni-line)}
:root[data-theme=dark] .tn-next-home .tn-next-card:hover{border-color:#f4d03f}
:root[data-theme=dark] .tn-next-home .tn-next-card-body :is(.wp-block-post-date,.wp-block-post-author-name){color:var(--tni-muted)}
:root[data-theme=dark] body.page-id-4982 .entry-content .tn-next-home .tn-next-card-body h3 a{color:var(--tni-strong)}
:root[data-theme=dark] .tn-next-home .tn-next-topics a{background:var(--tni-surface-2);color:var(--tni-strong)}

/* Ads: only the auto-placed wrapper gets a quiet dark frame; Google's ad iframes are never restyled. */
:root[data-theme=dark] .google-auto-placed{background-color:rgb(255 255 255 / .03);border-radius:12px}
