/*
Theme Name: CTE Native
Theme URI: https://www.ctemag.com/
Author: CTE
Description: First-party CTE magazine theme without Kadence or builder dependencies.
Version: 0.1.0
Text Domain: cte-native
Requires at least: 6.5
*/

:root {
  --cte-ink: #14171a;
  --cte-muted: #5b6673;
  --cte-line: #d8dde3;
  --cte-soft: #f3f6f8;
  --cte-paper: #ffffff;
  --cte-accent: #b9242a;
  --cte-accent-dark: #86171d;
  --cte-blue: #174c75;
  --cte-max: var(--cte-site-width, 1290px);
  --cte-page-gutter: clamp(12px, 2.2vw, 24px);
  --cte-mobile-page-pad: 12px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: #f7f8fa;
  color: var(--cte-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: var(--cte-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  color: var(--cte-accent-dark);
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

button,
input {
  font: inherit;
}

.cte-native-skip {
  background: var(--cte-ink);
  color: #fff;
  left: 12px;
  padding: 10px 14px;
  position: absolute;
  top: -80px;
  z-index: 100000;
}

.cte-native-skip:focus {
  top: 12px;
}

.cte-native-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cte-native-main {
  flex: 1 0 auto;
}

.cte-native-wrap {
  margin: 0 auto;
  max-width: var(--cte-max);
  padding: clamp(24px, 3.4vw, 42px) var(--cte-page-gutter);
  width: 100%;
}

.cte-native-header {
  background: #fff;
  border-bottom: 1px solid rgba(20, 23, 26, 0.08);
  position: relative;
  z-index: 99990;
}

.cte-native-header__slab {
  background: #fff;
  width: 100%;
}

.cte-native-header__inner,
.cte-native-header__shortcutsInner {
  margin: 0 auto;
  max-width: var(--cte-max);
  padding-left: var(--cte-page-gutter);
  padding-right: var(--cte-page-gutter);
  width: 100%;
}

.cte-native-header__inner {
  display: grid;
  gap: 10px;
  padding-bottom: 11px;
  padding-top: 12px;
}

.cte-native-header__top,
.cte-native-header__navRow,
.cte-native-header__tools,
.cte-native-header__utility,
.cte-native-header__nav,
.cte-native-header__search {
  align-items: center;
  display: flex;
}

.cte-native-header__top {
  gap: 18px;
  justify-content: space-between;
  min-width: 0;
}

.cte-native-header__brand {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  text-decoration: none;
}

.cte-native-header__logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.cte-native-header__logo--desktop {
  width: clamp(300px, 30vw, 430px);
}

.cte-native-header__logo--mobile {
  display: none;
  width: 92px;
}

.cte-native-header__tools {
  flex: 1 1 auto;
  gap: 12px;
  justify-content: flex-end;
  min-width: 0;
}

.cte-native-header__utility {
  gap: 12px;
}

.cte-native-header__utility a,
.cte-native-header__nav a,
.cte-native-header__drawerNav a {
  text-decoration: none;
}

.cte-native-header__utility a {
  border-radius: 6px;
  color: #303944;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 6px 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.cte-native-header__utility a:hover,
.cte-native-header__utility a:focus {
  color: var(--cte-accent-dark);
}

.cte-native-header__search {
  background: #fff;
  border: 1px solid rgba(20, 23, 26, 0.16);
  border-radius: 999px;
  height: 40px;
  overflow: hidden;
}

.cte-native-header__search:focus-within {
  border-color: rgba(23, 76, 117, 0.5);
  box-shadow: 0 0 0 3px rgba(23, 76, 117, 0.12);
}

.cte-native-header__search--desktop {
  flex: 0 1 300px;
  max-width: 320px;
  min-width: 200px;
}

.cte-native-header__searchInput {
  background: transparent;
  border: 0;
  color: var(--cte-ink);
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  outline: 0;
  padding: 0 6px 0 14px;
}

.cte-native-header__searchSubmit,
.cte-native-header__iconButton {
  align-items: center;
  background: transparent;
  border: 0;
  color: #303944;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
}

.cte-native-header__searchSubmit {
  height: 40px;
  width: 42px;
}

.cte-native-header__icon {
  display: block;
  height: 21px;
  width: 21px;
}

.cte-native-header__iconButton {
  border: 1px solid rgba(20, 23, 26, 0.16);
  border-radius: 10px;
  display: none;
  flex: 0 0 42px;
  height: 42px;
  position: relative;
  width: 42px;
}

.cte-native-header__iconButton:hover,
.cte-native-header__iconButton:focus {
  background: var(--cte-soft);
  color: var(--cte-accent-dark);
}

.cte-native-header__iconClose {
  display: none;
}

.cte-native-header__iconButton.is-active .cte-native-header__iconOpen {
  display: none;
}

.cte-native-header__iconButton.is-active .cte-native-header__iconClose {
  display: inline-flex;
}

.cte-native-header__navRow {
  border-top: 1px solid rgba(20, 23, 26, 0.08);
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
  padding-top: 10px;
}

.cte-native-header__nav {
  gap: clamp(6px, 1.3vw, 14px);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  white-space: nowrap;
}

.cte-native-header__nav::-webkit-scrollbar {
  display: none;
}

.cte-native-header__nav a {
  border-radius: 6px;
  color: #242b33;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 8px 2px;
  text-transform: uppercase;
}

.cte-native-header__nav a:hover,
.cte-native-header__nav a:focus,
.cte-native-header__nav a.is-active {
  color: var(--cte-accent-dark);
}

.cte-native-header__nav a.is-active {
  box-shadow: inset 0 -3px 0 var(--cte-accent);
}

.cte-native-header__subscribe {
  align-items: center;
  background: var(--cte-accent);
  border-radius: 999px;
  color: #fff !important;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 900;
  justify-content: center;
  letter-spacing: 0.02em;
  line-height: 1;
  min-height: 38px;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}

.cte-native-header__subscribe:hover,
.cte-native-header__subscribe:focus {
  background: var(--cte-accent-dark);
}

.cte-native-header__subscribe--mobile {
  display: none;
}

.cte-native-header__drawer {
  background: #fff;
  border-top: 1px solid rgba(20, 23, 26, 0.08);
  box-shadow: 0 18px 30px rgba(15, 20, 26, 0.12);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease;
}

.cte-native-header__drawer[hidden] {
  display: none;
}

.cte-native-header.is-open .cte-native-header__drawer,
.cte-native-header.is-closing .cte-native-header__drawer {
  max-height: 74vh;
}

.cte-native-header__drawerInner {
  margin: 0 auto;
  max-width: var(--cte-max);
  padding: 14px var(--cte-page-gutter) 18px;
  width: 100%;
}

.cte-native-header__drawerPanel {
  display: none;
}

.cte-native-header[data-cte-native-header-state="search"] .cte-native-header__drawerPanel[data-cte-native-header-panel="search"],
.cte-native-header[data-cte-native-header-state="menu"] .cte-native-header__drawerPanel[data-cte-native-header-panel="menu"],
.cte-native-header.is-closing[data-cte-native-header-state="search"] .cte-native-header__drawerPanel[data-cte-native-header-panel="search"],
.cte-native-header.is-closing[data-cte-native-header-state="menu"] .cte-native-header__drawerPanel[data-cte-native-header-panel="menu"] {
  display: block;
}

.cte-native-header__search--drawer {
  width: 100%;
}

.cte-native-header__drawerNav {
  display: grid;
  gap: 8px;
}

.cte-native-header__drawerNav a {
  background: var(--cte-soft);
  border: 1px solid rgba(20, 23, 26, 0.08);
  border-radius: 8px;
  color: #222a32;
  font-weight: 850;
  padding: 11px 12px;
}

.cte-native-header__drawerNav a.is-active {
  background: #fff3f3;
  border-color: rgba(185, 36, 42, 0.25);
  color: var(--cte-accent-dark);
}

.cte-native-header__drawerNav a.is-meta {
  background: #fff;
  color: var(--cte-muted);
  font-size: 0.92rem;
}

.cte-native-header__shortcuts {
  background: #fff;
  border-top: 4px solid var(--cte-accent);
}

#masthead.cte-native-header .cte-native-header__shortcuts .cte-hot-topics__wrap {
  border-bottom: 0 !important;
  border-radius: 0 !important;
  border-top: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#masthead.cte-native-header .cte-native-header__shortcuts .cte-hot-topics__label {
  color: var(--cte-muted) !important;
}

#masthead.cte-native-header .cte-native-header__shortcutsInner {
  padding-left: var(--cte-page-gutter);
  padding-right: var(--cte-page-gutter);
}

.cte-native-content {
  background: var(--cte-paper);
  border: 1px solid var(--cte-line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 44px);
}

.cte-native-layout {
  align-items: start;
  display: grid;
  gap: 28px;
}

.cte-native-layout--with-rail {
  grid-template-columns: minmax(0, 1fr) 300px;
  max-width: var(--cte-native-layout-width, min(1288px, calc(100vw - 24px)));
}

.cte-native-primary,
.cte-native-front,
.cte-native-layout--with-rail .cte-native-content {
  min-width: 0;
  width: 100%;
}

.cte-native-primary .cte-homepage-display .cte-hp__wrap {
  max-width: 100%;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.cte-native-rail {
  align-self: stretch;
  display: block;
  width: 300px;
}

.cte-native-rail[hidden] {
  display: none !important;
}

.cte-native-layout--with-rail:has(.cte-native-rail[hidden]) {
  display: block;
  max-width: var(--cte-max);
}

.cte-native-rail__inner {
  align-content: start;
  display: grid;
  gap: 22px;
  height: 100%;
  position: static;
}

.cte-native-rail__slotWrap,
.cte-native-rail__slot {
  width: 300px;
}

.cte-native-rail__slot {
  background: #eef2f6;
  display: flex;
  justify-content: center;
  line-height: 0;
  min-height: 250px;
}

.cte-native-rail__slot--skyscraper {
  min-height: 600px;
}

@media (min-width: 981px) {
  .cte-native-rail__slotWrap--skyscraper {
    position: sticky;
    top: 16px;
    z-index: 2;
  }
}

body.thankmy-transparency-route .ad-billboard,
body.thankmy-transparency-route .cte-footer-top-ad,
body.thankmy-transparency-route .cte-native-rail {
  display: none !important;
}

.cte-native-page-title,
.cte-native-archive-title {
  font-size: clamp(2rem, 5vw, 4.25rem);
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0 0 18px;
}

.cte-native-entry-title {
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0 0 14px;
}

.cte-native-entry-meta,
.cte-native-card__meta {
  color: var(--cte-muted);
  font-size: 0.9rem;
}

.cte-native-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.cte-native-card {
  background: var(--cte-paper);
  border: 1px solid var(--cte-line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

.cte-native-card__thumb {
  aspect-ratio: 16 / 10;
  background: var(--cte-soft);
  display: block;
  overflow: hidden;
}

.cte-native-card__thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.cte-native-card__body {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.cte-native-card__title {
  font-size: 1.18rem;
  line-height: 1.2;
  margin: 0;
}

.cte-native-card__excerpt {
  color: #2e3742;
  font-size: 0.95rem;
}

.cte-native-fallback-header {
  background: #0f141a;
  border-bottom: 4px solid var(--cte-accent);
  color: #fff;
}

.cte-native-fallback-header__inner {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--cte-max);
  padding: 16px 20px;
}

.cte-native-brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.cte-native-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cte-native-nav a {
  color: #fff;
  font-size: 0.9rem;
  text-decoration: none;
}

.cte-native-fallback-footer {
  background: #111820;
  color: #dbe2ea;
  margin-top: 40px;
}

.cte-native-fallback-footer__inner {
  margin: 0 auto;
  max-width: var(--cte-max);
  padding: 28px 20px;
}

.wp-block-kadence-rowlayout,
.wp-block-kadence-column,
[class*="wp-block-kadence"] {
  border: 0;
  padding: 0;
}

@media (max-width: 1299px) {
  html.cte-rails-on .wallpaper-rail,
  html.cte-rails-on #wallpaper-left,
  html.cte-rails-on #wallpaper-right,
  .wallpaper-rail,
  #wallpaper-left,
  #wallpaper-right {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

@media (max-width: 760px) {
  .cte-native-wrap {
    padding: 22px var(--cte-page-gutter);
  }

  .cte-native-content {
    border-radius: 0;
    margin-left: calc(-1 * var(--cte-page-gutter));
    margin-right: calc(-1 * var(--cte-page-gutter));
    padding: 20px var(--cte-page-gutter);
  }

  .cte-native-fallback-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 980px) {
  .cte-native-header__inner {
    gap: 0;
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .cte-native-header__top {
    gap: 10px;
  }

  .cte-native-header__logo--desktop,
  .cte-native-header__utility,
  .cte-native-header__search--desktop,
  .cte-native-header__navRow {
    display: none;
  }

  .cte-native-header__logo--mobile {
    display: block;
    width: clamp(68px, 18vw, 86px);
  }

  .cte-native-header__brand {
    flex: 0 1 auto;
  }

  .cte-native-header__tools {
    flex: 0 0 auto;
    gap: 8px;
  }

  .cte-native-header__iconButton,
  .cte-native-header__subscribe--mobile {
    display: inline-flex;
  }

  .cte-native-header__shortcuts .cte-hot-topics__wrap {
    grid-template-columns: 1fr !important;
    row-gap: 7px !important;
  }

  .cte-native-header__shortcuts .cte-hot-topics__label {
    height: auto !important;
  }
}

@media (max-width: 430px) {
  .cte-native-header__tools {
    gap: 6px;
  }

  .cte-native-header__iconButton {
    flex-basis: 40px;
    height: 40px;
    width: 40px;
  }

  .cte-native-header__subscribe {
    font-size: 0.76rem;
    min-height: 40px;
    padding-left: 11px;
    padding-right: 11px;
  }
}

@media (max-width: 980px) {
  .cte-native-layout--with-rail {
    display: block;
    max-width: var(--cte-max);
  }

  .cte-native-rail {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cte-native-header__drawer {
    transition: none;
  }
}
