/* ==========================================================================
   AutoPulse — automotive news design system
   Built on top of News Magazine X (news-magazine-x).
   ========================================================================== */

:root {
  --ap-red: #e10600;
  --ap-red-dark: #b30500;
  --ap-ink: #0b0e14;
  --ap-ink-2: #151a24;
  --ap-body: #3d4655;
  --ap-muted: #6b7686;
  --ap-line: #e6e9ee;
  --ap-bg: #f3f5f8;
  --ap-white: #ffffff;
  --ap-ev: #0a84ff;
  --ap-motorsport: #ff6b00;
  --ap-tech: #7c3aed;
  --ap-reviews: #0e9f6e;
  --ap-trucks: #b45309;
  --ap-font-head: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --ap-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ap-radius: 12px;
  --ap-radius-sm: 8px;
  --ap-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 18px 36px -22px rgba(16, 24, 40, .35);
  --ap-shadow-sm: 0 1px 2px rgba(16, 24, 40, .08);
}

/* --------------------------------------------------------------------------
   Global type + surfaces
   -------------------------------------------------------------------------- */

body.ap-theme,
body.ap-theme button,
body.ap-theme input,
body.ap-theme select,
body.ap-theme textarea {
  font-family: var(--ap-font-body);
}

body.ap-theme h1, body.ap-theme h2, body.ap-theme h3,
body.ap-theme h4, body.ap-theme h5, body.ap-theme h6,
body.ap-theme .newsx-grid-title a,
body.ap-theme .newsx-widget-title-text {
  font-family: var(--ap-font-head);
  letter-spacing: .01em;
}

/* :where() keeps this at element specificity so component colour rules win. */
:where(body.ap-theme) a { color: var(--ap-red); }
:where(body.ap-theme) a:hover { color: var(--ap-red-dark); }

.ap-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

body.ap-theme .newsx-site-header { box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }

body.ap-theme .newsx-top-section-wrap { background: var(--ap-red); }
body.ap-theme .newsx-news-ticker .news-ticker-heading { font-family: var(--ap-font-head); letter-spacing: .06em; text-transform: uppercase; }
body.ap-theme .newsx-news-ticker a.newsx-news-ticker-title { font-family: var(--ap-font-body); }

body.ap-theme .newsx-middle-section-wrap .newsx-nav-menu > .menu-item > a,
body.ap-theme .newsx-nav-menu a {
  font-family: var(--ap-font-head);
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

body.ap-theme .newsx-header-menu-primary .newsx-nav-menu > .menu-item > a { font-size: 20px; }

body.ap-theme .newsx-site-title-tagline .site-title a {
  font-family: var(--ap-font-head);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
}

body.ap-theme .newsx-site-title-tagline .site-title a { display: inline-flex; align-items: center; gap: 12px; }

body.ap-theme .newsx-site-title-tagline .site-title a::before {
  content: '';
  flex: 0 0 auto;
  width: 40px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 40'%3E%3Cpath d='M2 22 H16 L22 8 L31 34 L38 18 L44 22 H62' fill='none' stroke='%23e10600' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

body.ap-theme .newsx-site-title-tagline .site-description {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ap-red);
}

/* Custom logo sizing */
body.ap-theme .newsx-site-logo img,
body.ap-theme .custom-logo { max-height: 52px; width: auto; }

/* --------------------------------------------------------------------------
   Section headings
   -------------------------------------------------------------------------- */

.ap-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ap-ink);
}

.ap-section-head__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--ap-ink);
}

.ap-section-head__bar {
  display: inline-block;
  width: 6px;
  height: 24px;
  border-radius: 2px;
  background: var(--ap-red);
}

.ap-section-head__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ap-muted);
  text-decoration: none;
  white-space: nowrap;
}

.ap-section-head__link:hover { color: var(--ap-red); }

/* --------------------------------------------------------------------------
   Homepage shell
   -------------------------------------------------------------------------- */

.ap-home { background: var(--ap-bg); padding-bottom: 60px; }

.ap-home .ap-hero { padding-top: 26px; }

.ap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: start;
  margin-top: 40px;
}

.ap-block { margin-bottom: 46px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.ap-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 20px;
}

.ap-hero__lead {
  position: relative;
  min-height: 480px;
  border-radius: var(--ap-radius);
  overflow: hidden;
  background: var(--ap-ink);
  box-shadow: var(--ap-shadow);
}

.ap-hero__media,
.ap-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ap-hero__media img { object-fit: cover; }

.ap-hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 8, 12, .05) 0%, rgba(6, 8, 12, .35) 45%, rgba(6, 8, 12, .92) 100%);
}

.ap-hero__overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 28px 30px 30px;
  color: #fff;
}

.ap-hero__kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--ap-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ap-hero__title {
  margin: 12px 0 10px;
  font-size: 40px;
  line-height: 1.06;
  font-weight: 700;
  color: #fff;
}

.ap-hero__title a { color: #fff; text-decoration: none; }
.ap-hero__title a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--ap-red); text-underline-offset: 4px; }

.ap-hero__excerpt {
  margin: 0 0 14px;
  max-width: 62ch;
  font-size: 15.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
}

.ap-hero .ap-meta { color: rgba(255, 255, 255, .72); }
.ap-hero .ap-meta__sep { opacity: .5; }

.ap-hero__side {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.ap-hero__item {
  display: grid;
  grid-template-columns: 44% 1fr;
  gap: 0;
  border-radius: var(--ap-radius);
  overflow: hidden;
  background: var(--ap-white);
  box-shadow: var(--ap-shadow-sm);
}

.ap-hero__item-media,
.ap-hero__item-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.ap-hero__item-media img { object-fit: cover; }

.ap-hero__item-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ap-hero__item-title {
  margin: 10px 0 10px;
  font-size: 21px;
  line-height: 1.15;
  font-weight: 700;
}

.ap-hero__item-title a { color: var(--ap-ink); text-decoration: none; }
.ap-hero__item-title a:hover { color: var(--ap-red); }

/* --------------------------------------------------------------------------
   Chips + meta
   -------------------------------------------------------------------------- */

.ap-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--chip, #e10600);
  color: #fff !important;
  font-family: var(--ap-font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.5;
}

.ap-chip:hover { filter: brightness(1.12); color: #fff !important; }

.ap-chip--overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .6);
}

.ap-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ap-muted);
}

.ap-meta__sep { color: #c3cad4; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.ap-grid { display: grid; gap: 24px; }
.ap-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ap-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Sparse rails stretch instead of leaving empty columns. */
.ap-grid--auto { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.ap-card {
  display: flex;
  flex-direction: column;
  background: var(--ap-white);
  border-radius: var(--ap-radius);
  overflow: hidden;
  box-shadow: var(--ap-shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.ap-card:hover { transform: translateY(-3px); box-shadow: var(--ap-shadow); }

.ap-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ap-ink-2);
}

.ap-card__media-link { display: block; width: 100%; height: 100%; }

.ap-card__media img,
.ap-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.ap-card:hover .ap-card__img { transform: scale(1.05); }

.ap-card__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--chip, #e10600), var(--ap-ink));
  color: rgba(255, 255, 255, .92);
  font-family: var(--ap-font-head);
  font-size: 72px;
  font-weight: 700;
}

.ap-card__body { padding: 18px 20px 20px; }

.ap-card__title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.16;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-card__title a { color: var(--ap-ink); text-decoration: none; }
.ap-card__title a:hover { color: var(--ap-red); }

.ap-card__excerpt {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ap-body);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-card--sm { flex-direction: row; }
.ap-card--sm .ap-card__media { aspect-ratio: 4 / 3; width: 42%; flex: 0 0 42%; }
.ap-card--sm .ap-card__body { padding: 14px 16px; }
.ap-card--sm .ap-card__title { font-size: 18px; -webkit-line-clamp: 2; margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   Sidebar panels
   -------------------------------------------------------------------------- */

.ap-layout__side { position: sticky; top: 20px; display: grid; gap: 24px; }

.ap-panel {
  background: var(--ap-white);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-sm);
  padding: 22px;
}

.ap-panel__title {
  margin: 0 0 16px;
  font-size: 21px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ap-ink);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ap-line);
  position: relative;
}

.ap-panel__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 54px;
  height: 2px;
  background: var(--ap-red);
}

.ap-trending { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }

.ap-trending__item { display: flex; gap: 14px; align-items: flex-start; }

.ap-trending__rank {
  flex: 0 0 auto;
  font-family: var(--ap-font-head);
  font-size: 30px;
  line-height: .9;
  font-weight: 700;
  color: var(--ap-line);
}

.ap-trending__item:first-child .ap-trending__rank { color: var(--ap-red); }

.ap-trending__body h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 600;
}

.ap-trending__body h3 a { color: var(--ap-ink); text-decoration: none; }
.ap-trending__body h3 a:hover { color: var(--ap-red); }

.ap-catlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.ap-catlist a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ap-line);
  color: var(--ap-ink);
  text-decoration: none;
  font-weight: 500;
}

.ap-catlist li:last-child a { border-bottom: 0; }
.ap-catlist a:hover { color: var(--ap-red); }

.ap-catlist__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, #e10600); flex: 0 0 auto; }
.ap-catlist__name { flex: 1; }
.ap-catlist__count { color: var(--ap-muted); font-size: 13px; }

.ap-panel--about p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.65; color: var(--ap-body); }

.ap-button {
  display: inline-block;
  padding: 11px 20px;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-red);
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.ap-button:hover { background: var(--ap-red-dark); color: #fff !important; }

/* --------------------------------------------------------------------------
   Article (single post)
   -------------------------------------------------------------------------- */

body.ap-theme .newsx-single-wrap { padding-top: 26px; }

.ap-theme .newsx-single-post-header .newsx-breadcrumbs {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ap-theme .newsx-breadcrumbs > span:last-child {
  display: inline-block;
  max-width: 34ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.ap-theme .newsx-single-post-header h1 { font-size: 46px; line-height: 1.06; font-weight: 700; }
.ap-theme .newsx-single-post-header { padding-bottom: 18px; }

.ap-theme .newsx-post-content {
  font-size: 17px;
  line-height: 1.78;
  color: #2b3442;
  text-align: left;
  hyphens: auto;
}

.ap-theme .newsx-post-content > * { max-width: 72ch; margin-left: auto; margin-right: auto; }
.ap-theme .newsx-post-content > .wp-block-image,
.ap-theme .newsx-post-content > figure,
.ap-theme .newsx-post-content > .wp-block-gallery { max-width: 100%; }

.ap-theme .newsx-post-content p { margin-bottom: 1.35em; }

.ap-theme .newsx-post-content h2 { font-size: 30px; margin-top: 1.6em; }
.ap-theme .newsx-post-content h3 { font-size: 24px; margin-top: 1.4em; }

.ap-theme .newsx-post-content img { border-radius: var(--ap-radius-sm); }

.ap-theme .newsx-post-content figcaption,
.ap-theme .newsx-single-post-media .image-caption {
  font-size: 13px;
  color: var(--ap-muted);
  text-align: left;
  font-style: normal;
}

/* Better end-of-article modules */
.ap-theme .newsx-related-posts-wrap .newsx-grid-title a { font-size: 19px; }
.ap-theme .newsx-post-navigation { font-family: var(--ap-font-head); text-transform: uppercase; letter-spacing: .04em; }

/* Header bits */
body.ap-theme .newsx-mobile-menu-toggle { white-space: nowrap; }

/* Parent category chips must stay white on their coloured background. */
body.ap-theme .newsx-post-categories a,
body.ap-theme .newsx-post-categories.newsx-s0 a,
body.ap-theme .newsx-post-categories.newsx-s1 a {
  color: #fff;
}

/* Keep article measure comfortable. */
.ap-theme .newsx-post-content { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Ticker fades at the right edge instead of hard-clipping. */
.ap-theme .news-ticker-wrapper {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 93%, transparent 100%);
}

/* Byline */
.ap-theme .newsx-single-post-header .newsx-post-author-avatar img { border-radius: 50%; }
.ap-theme .newsx-post-meta-inn-group { align-items: center; gap: 16px; row-gap: 6px; }
.ap-theme .newsx-post-reading-time { color: var(--ap-muted); font-size: 13px; }
.ap-theme .newsx-post-content + .newsx-static-sharing { margin-top: 34px; }

/* Sharing row gets branded */
.ap-theme .newsx-static-sharing .sharing-icons a,
.ap-theme .newsx-post-sharing .sharing-icons a { border-radius: 6px; }

/* --------------------------------------------------------------------------
   Blog / archive feed
   -------------------------------------------------------------------------- */

.ap-theme .newsx-posts-feed .newsx-list-layout-post,
.ap-theme .newsx-posts-feed article {
  background: var(--ap-white);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-sm);
}

.ap-theme .newsx-archive-page-header h1,
.ap-theme .newsx-blog-page-wrap h1 {
  font-family: var(--ap-font-head);
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.ap-theme .newsx-site-footer { background: var(--ap-ink); color: #aeb6c2; }
.ap-theme .newsx-site-footer .newsx-widget-title-text { color: #fff; }
.ap-theme .newsx-site-footer a { color: #cfd6df; }
.ap-theme .newsx-site-footer a:hover { color: var(--ap-red); }
.ap-theme .newsx-copyright { font-size: 13px; color: #8b95a3; }

/* --------------------------------------------------------------------------
   Off-canvas panel
   -------------------------------------------------------------------------- */

.newsx-offcanvas-widgets-area {
  background: var(--ap-white);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ap-offcanvas-head {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ap-ink);
}

.ap-offcanvas-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ap-red);
}

.ap-offcanvas-brand {
  display: block;
  font-family: var(--ap-font-head);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--ap-ink);
  text-decoration: none;
}

.ap-offcanvas-brand:hover { color: var(--ap-red); }

.ap-offcanvas-tagline {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ap-muted);
}

.ap-offcanvas-section { margin-bottom: 26px; }

.ap-offcanvas-title {
  margin: 0 0 10px;
  font-family: var(--ap-font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ap-muted);
}

.ap-offcanvas-menu,
.ap-offcanvas-catlist { list-style: none; margin: 0; padding: 0; }

.ap-offcanvas-menu li,
.ap-offcanvas-catlist li { border-bottom: 1px solid var(--ap-line); }

.ap-offcanvas-menu li:last-child,
.ap-offcanvas-catlist li:last-child { border-bottom: 0; }

.ap-offcanvas-menu a {
  display: block;
  padding: 11px 0;
  font-family: var(--ap-font-head);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--ap-ink);
  text-decoration: none;
}

.ap-offcanvas-catlist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ap-ink);
  text-decoration: none;
}

.ap-offcanvas-menu a:hover,
.ap-offcanvas-catlist a:hover { color: var(--ap-red); }

.ap-offcanvas-catlist .count { color: var(--ap-muted); font-size: 13px; }

.ap-offcanvas-search .search-form { display: flex; }
.ap-offcanvas-search .search-field { width: 100%; }

.ap-offcanvas-about p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ap-body);
}

/* --------------------------------------------------------------------------
   Team / masthead
   -------------------------------------------------------------------------- */

.ap-team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 26px 0 8px;
}

.ap-team__member {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
  background: #fff;
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-sm);
}

/* The avatar is a flex item: pin its size so it cannot be squeezed into an ellipse. */
body.ap-theme .ap-team__avatar {
  flex: 0 0 96px;
  align-self: flex-start;
}

/* Article content rounds every image, so this needs to win explicitly. */
body.ap-theme .newsx-post-content .ap-team__avatar img,
body.ap-theme .ap-team__avatar img {
  display: block;
  width: 96px;
  height: 96px;
  max-width: none;
  border-radius: 50% !important;
  object-fit: cover;
}

.ap-team__name { margin: 0 0 2px; font-size: 22px; font-weight: 700; }
.ap-team__name a { color: var(--ap-ink); text-decoration: none; }
.ap-team__name a:hover { color: var(--ap-red); }

.ap-team__job {
  display: block;
  margin-bottom: 8px;
  font-family: var(--ap-font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ap-red);
}

.ap-team__bio { margin: 0 0 12px; font-size: 14.5px; line-height: 1.6; color: var(--ap-body); }

.ap-team__link { font-size: 13px; font-weight: 600; color: var(--ap-muted); text-decoration: none; }

/* Author box job title: match the team cards and lift the contrast. */
body.ap-theme .newsx-post-author-box .author-job {
  color: var(--ap-red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 1;
}
.ap-team__link:hover { color: var(--ap-red); }

@media (max-width: 640px) {
  .ap-team__member { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */

.ap-contact-form { max-width: 640px; }

.ap-field { margin: 0 0 18px; }

.ap-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ap-ink);
}

.ap-field input[type="text"],
.ap-field input[type="email"],
.ap-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius-sm);
  background: #fff;
  color: var(--ap-body);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.ap-field input:focus,
.ap-field textarea:focus {
  outline: none;
  border-color: var(--ap-red);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, .12);
}

.ap-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ap-field--submit { margin: 6px 0 0; }
.ap-field--submit .ap-button { border: 0; cursor: pointer; font-family: inherit; font-size: 15px; }

/* Honeypot: hidden from people, visible to naive bots. */
.ap-hp { position: absolute !important; left: -9999px !important; }

.ap-notice {
  max-width: 640px;
  margin-bottom: 24px;
  padding: 14px 18px;
  border-left: 4px solid;
  border-radius: var(--ap-radius-sm);
  font-size: 15px;
}
.ap-notice--ok { background: #ecfdf5; border-color: #0e9f6e; color: #065f46; }
.ap-notice--err { background: #fef2f2; border-color: var(--ap-red); color: #7f1d1d; }

@media (max-width: 640px) {
  .ap-field-row { grid-template-columns: 1fr; gap: 0; }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

body.ap-theme .newsx-site-header { transition: box-shadow .25s ease; }
body.ap-theme .newsx-site-header.ap-scrolled { box-shadow: 0 8px 24px -16px rgba(11, 14, 20, .55); }

@media (prefers-reduced-motion: reduce) {
  .ap-card, .ap-card__img { transition: none; }
}

/* --------------------------------------------------------------------------
   Category colours for the parent's category chips (single + archive)
   -------------------------------------------------------------------------- */

body.ap-theme .newsx-post-categories a { color: #fff; }
body.ap-theme .newsx-post-categories a.newsx-cat-2   { background: #334155; }
body.ap-theme .newsx-post-categories a.newsx-cat-3   { background: #0e9f6e; }
body.ap-theme .newsx-post-categories a.newsx-cat-4   { background: #1d4ed8; }
body.ap-theme .newsx-post-categories a.newsx-cat-5   { background: #7c3aed; }
body.ap-theme .newsx-post-categories a.newsx-cat-6   { background: #c2410c; }
body.ap-theme .newsx-post-categories a.newsx-cat-108 { background: #b45309; }
body.ap-theme .newsx-post-categories a.newsx-cat-109 { background: #0f766e; }
body.ap-theme .newsx-post-categories a.newsx-cat-110 { background: #db2777; }

/* --------------------------------------------------------------------------
   Footer widgets
   -------------------------------------------------------------------------- */

.ap-theme .newsx-site-footer .widget_recent_entries li { margin-bottom: 14px; }

.ap-theme .newsx-site-footer .widget_recent_entries li a {
  display: block;
  font-weight: 600;
  line-height: 1.35;
  border: 0;
}

.ap-theme .newsx-site-footer .widget_recent_entries .post-date {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #8b95a3;
}

.ap-theme .newsx-site-footer .widget_nav_menu ul { list-style: none; margin: 0; padding: 0; }

.ap-theme .newsx-site-footer .widget_nav_menu li {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.ap-theme .newsx-site-footer .widget_nav_menu li:last-child { border-bottom: 0; }

.ap-theme .newsx-site-footer .widget_nav_menu a { display: block; padding: 9px 0; border: 0; }

/* --------------------------------------------------------------------------
   Sidebar widgets
   -------------------------------------------------------------------------- */

.ap-theme .newsx-sidebar .widget a { color: var(--ap-ink); }
.ap-theme .newsx-sidebar .widget a:hover { color: var(--ap-red); }
.ap-theme .newsx-sidebar .widget_recent_entries li { margin-bottom: 12px; }
.ap-theme .newsx-sidebar .widget_recent_entries .post-date {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ap-muted);
}

/* --------------------------------------------------------------------------
   Article furniture
   -------------------------------------------------------------------------- */

/* A single post at the top or bottom of the archive leaves an empty nav cell. */
.ap-theme .newsx-post-navigation:not(:has(.next-post)) .prev-post,
.ap-theme .newsx-post-navigation:not(:has(.prev-post)) .next-post { width: 100%; }

.ap-theme .newsx-post-navigation:not(:has(.next-post)) .newsx-divider,
.ap-theme .newsx-post-navigation:not(:has(.prev-post)) .newsx-divider { display: none; }

/* Sparse category rails: one card becomes a wide banner rather than a huge 16:9. */
.ap-grid--auto > .ap-card:only-child .ap-card__media { aspect-ratio: 21 / 9; }

/* --------------------------------------------------------------------------
   Off-canvas polish
   -------------------------------------------------------------------------- */

.newsx-offcanvas-overlay { background: rgba(11, 14, 20, .58); }

.newsx-offcanvas-widgets-area { border-right: 1px solid rgba(11, 14, 20, .08); }

.ap-offcanvas-title { color: #475569; font-size: 13px; }
.ap-offcanvas-tagline { color: #4b5563; }
.ap-offcanvas-menu .home-icon { display: none; }

.newsx-offcanvas-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(11, 14, 20, .07);
  color: var(--ap-ink);
  cursor: pointer;
}

.newsx-offcanvas-close-btn:hover { background: var(--ap-red); color: #fff; }
.newsx-offcanvas-close-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .ap-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; }
  .ap-hero__title { font-size: 34px; }
}

@media (max-width: 980px) {
  .ap-layout { grid-template-columns: 1fr; }
  .ap-layout__side { position: static; }
  .ap-hero { grid-template-columns: 1fr; }
  .ap-hero__lead { min-height: 380px; }
  .ap-hero__side { grid-template-rows: none; grid-template-columns: 1fr; }
  .ap-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body.ap-theme .newsx-site-title-tagline .site-title a { font-size: 34px; }
  .ap-home .ap-hero { padding-top: 16px; }
  .ap-hero__lead { min-height: 340px; }
  .ap-hero__overlay { padding: 20px; }
  .ap-hero__title { font-size: 27px; }
  .ap-hero__excerpt { display: none; }
  .ap-hero__item { grid-template-columns: 40% 1fr; }
  .ap-hero__item-title { font-size: 18px; }
  .ap-grid--3, .ap-grid--2 { grid-template-columns: 1fr; }
  .ap-section-head__title { font-size: 22px; }
  .ap-theme .newsx-single-post-header h1 { font-size: 31px; }
  .ap-theme .newsx-post-content { font-size: 16px; }
}
