/*
 * OneTrader New — main stylesheet.
 *
 * Vanilla CSS only, mobile-first, no framework. Organized in sections:
 * 1. Design tokens   2. Reset/base   3. Layout & type   4. Header/nav
 * 5. Mobile menu/search   6. Ticker   7. Hero   8. Latest+Trending
 * 9. Article cards   10. Category grid   11. Newsletter   12. Footer
 * 13. Single article   14. Category/archive   15. Comments/forms
 * 16. 404/search   17. Utilities   18. Responsive breakpoints
 *
 * Palette and layout take direction from the approved black/white/gold
 * visual guide (spacing, hierarchy, cards, header, hero, category
 * presentation, newsletter, footer, mobile layout) — not a pixel clone,
 * and not a reskin of the previous theme's markup/classes (all new BEM-ish
 * class names below, "onetrader-*").
 */

/* 1. Design tokens ----------------------------------------------------- */
:root {
	--ot-black: #0b0b0d;
	--ot-black-soft: #17181c;
	--ot-white: #ffffff;
	--ot-bg: #f8f7f4;
	--ot-border: #e7e5df;
	--ot-text: #17181c;
	--ot-text-muted: #6b6b70;
	--ot-text-on-dark: #f3f2ee;
	--ot-text-on-dark-muted: #a9a9ad;
	--ot-gold: #c79a3e;
	--ot-gold-dark: #a67d2c;
	--ot-gold-contrast: #1a1400;

	--ot-badge-0: #b3452c;
	--ot-badge-1: #2c5f8a;
	--ot-badge-2: #3f7d4a;
	--ot-badge-3: #7a4f9e;
	--ot-badge-4: #b3892c;

	--ot-ticker-positive: #35b06a;
	--ot-ticker-negative: #e2564c;

	--ot-radius-sm: 4px;
	--ot-radius-md: 10px;
	--ot-radius-lg: 16px;
	--ot-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 1px rgba(0, 0, 0, 0.04);
	--ot-shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);

	--ot-container: 1240px;
	--ot-gutter: 20px;

	--ot-font-display: Georgia, 'Times New Roman', Times, serif;
	--ot-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	--ot-header-h: 76px;
}

/* 2. Reset / base -------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	/* !important is a deliberate, scoped exception: some pages (e.g. the
	 * homepage) carry an Elementor-generated per-page rule such as
	 * "body.elementor-page-42 { background-color: #fff }" in their own
	 * uploads/elementor/css/post-<id>.css file. That selector's higher
	 * specificity (0,2,1) beats this plain "body" rule (0,0,1), which is
	 * what kept the homepage pure white while every other template already
	 * showed the intended warm cream canvas. This wins that conflict
	 * site-wide without editing any Elementor page setting or generated
	 * file. */
	background: var(--ot-bg) !important;
	color: var(--ot-text);
	font-family: var(--ot-font-body);
	font-size: 16px;
	line-height: 1.6;
	overflow-x: hidden;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
	cursor: pointer;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

h1,
h2,
h3,
h4 {
	font-family: var(--ot-font-display);
	line-height: 1.2;
	margin: 0 0 0.5em;
	color: var(--ot-text);
}

p {
	margin: 0 0 1em;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	top: -60px;
	left: 0;
	z-index: 10000;
	background: var(--ot-black);
	color: var(--ot-white);
	padding: 12px 20px;
	transition: top 0.2s ease;
}

.skip-link:focus {
	top: 0;
}

:focus-visible {
	outline: 2px solid var(--ot-gold);
	outline-offset: 2px;
}

/* 3. Layout & type -------------------------------------------------------- */
.onetrader-container {
	max-width: var(--ot-container);
	margin-inline: auto;
	padding-inline: var(--ot-gutter);
}

.onetrader-section-empty,
.onetrader-no-results {
	color: var(--ot-text-muted);
	font-style: italic;
	padding: 24px 0;
}

.onetrader-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 22px;
	border-radius: var(--ot-radius-sm);
	font-weight: 600;
	font-size: 0.95rem;
	border: 1px solid transparent;
}

.onetrader-btn--primary {
	background: var(--ot-gold);
	color: var(--ot-gold-contrast);
}

.onetrader-btn--primary:hover,
.onetrader-btn--primary:focus-visible {
	background: var(--ot-gold-dark);
}

.onetrader-section-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--ot-black);
}

.onetrader-section-heading h2 {
	font-size: 1.5rem;
	margin: 0;
}

.onetrader-section-heading__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.onetrader-section-heading__desc {
	margin: 0;
	font-size: 0.9rem;
	color: var(--ot-text-muted);
	font-weight: 400;
}

.onetrader-view-all {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ot-gold-dark);
	white-space: nowrap;
}

.onetrader-homepage > * + * {
	margin-top: 56px;
}

.onetrader-homepage {
	padding-bottom: 56px;
}

/* 4. Header / nav ---------------------------------------------------- */
.onetrader-header {
	position: sticky;
	top: 0;
	z-index: 200;
	background: var(--ot-black);
	color: var(--ot-text-on-dark);
	border-bottom: 1px solid var(--ot-gold);
}

.onetrader-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: var(--ot-header-h);
}

.onetrader-header__branding {
	flex-shrink: 0;
}

.onetrader-header__branding img {
	max-height: 44px;
	width: auto;
}

.onetrader-site-title a {
	display: flex;
	align-items: center;
	gap: 10px;
}

.onetrader-site-title__mark {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 22px;
}

.onetrader-site-title__mark span {
	display: block;
	width: 5px;
	background: var(--ot-gold);
	border-radius: 1px;
}

.onetrader-site-title__mark span:nth-child(1) { height: 45%; }
.onetrader-site-title__mark span:nth-child(2) { height: 75%; }
.onetrader-site-title__mark span:nth-child(3) { height: 100%; }

.onetrader-site-title__text-group {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.onetrader-site-title__text {
	font-family: var(--ot-font-display);
	font-weight: 700;
	font-size: 1.3rem;
	letter-spacing: 0.02em;
	color: var(--ot-white);
}

.onetrader-site-title__tagline {
	font-size: 0.62rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ot-gold);
}

.onetrader-primary-nav {
	flex-grow: 1;
	display: flex;
	justify-content: center;
}

.onetrader-primary-menu {
	display: flex;
	align-items: center;
	gap: 26px;
	flex-wrap: wrap;
}

.onetrader-primary-menu a {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--ot-text-on-dark);
	padding: 8px 2px;
	position: relative;
}

.onetrader-primary-menu a:hover,
.onetrader-primary-menu a:focus-visible,
.onetrader-primary-menu .current-menu-item > a {
	color: var(--ot-gold);
}

.onetrader-primary-menu .menu-item-has-children {
	position: relative;
}

.onetrader-primary-menu .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: var(--ot-black-soft);
	min-width: 200px;
	padding: 8px 0;
	border-radius: var(--ot-radius-sm);
	box-shadow: var(--ot-shadow-md);
	z-index: 10;
}

.onetrader-primary-menu .menu-item-has-children:hover > .sub-menu,
.onetrader-primary-menu .menu-item-has-children:focus-within > .sub-menu {
	display: block;
}

.onetrader-primary-menu .sub-menu a {
	display: block;
	padding: 8px 16px;
}

.onetrader-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.onetrader-search-toggle,
.onetrader-nav-toggle {
	background: transparent;
	border: 0;
	color: var(--ot-text-on-dark);
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--ot-radius-sm);
}

.onetrader-search-toggle:hover,
.onetrader-nav-toggle:hover {
	background: rgba(255, 255, 255, 0.08);
}

.onetrader-search-toggle__icon {
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-radius: 50%;
	position: relative;
	display: inline-block;
}

.onetrader-search-toggle__icon::after {
	content: '';
	position: absolute;
	width: 8px;
	height: 2px;
	background: currentColor;
	transform: rotate(45deg);
	right: -6px;
	bottom: 0;
}

.onetrader-nav-toggle {
	flex-direction: column;
	gap: 4px;
	display: none;
}

.onetrader-nav-toggle__bar {
	width: 20px;
	height: 2px;
	background: currentColor;
	display: block;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hamburger <-> close (×) icon: reuses the toggle's own aria-expanded
 * state to restyle the same 3 bars in place — no second/duplicate
 * toggle control is added. */
.onetrader-nav-toggle[aria-expanded="true"] .onetrader-nav-toggle__bar--top {
	transform: translateY(6px) rotate(45deg);
}

.onetrader-nav-toggle[aria-expanded="true"] .onetrader-nav-toggle__bar--mid {
	opacity: 0;
}

.onetrader-nav-toggle[aria-expanded="true"] .onetrader-nav-toggle__bar--bottom {
	transform: translateY(-6px) rotate(-45deg);
}

/* 5. Mobile menu / search --------------------------------------------- */
.onetrader-header-search {
	background: var(--ot-black-soft);
	padding: 16px 0;
}

.onetrader-header-search[hidden] {
	display: none;
}

.onetrader-header-search .search-form {
	display: flex;
	gap: 8px;
}

.onetrader-header-search .search-field {
	flex-grow: 1;
	padding: 10px 14px;
	border-radius: var(--ot-radius-sm);
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: var(--ot-black);
	color: var(--ot-white);
}

.onetrader-header-search .search-submit {
	padding: 10px 18px;
	border-radius: var(--ot-radius-sm);
	border: 0;
	background: var(--ot-gold);
	color: var(--ot-gold-contrast);
	font-weight: 600;
}

/* 6. Ticker ------------------------------------------------------------ */
.onetrader-ticker {
	background: var(--ot-black);
	color: var(--ot-text-on-dark);
	border-top: 2px solid var(--ot-gold);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.onetrader-ticker__placeholder {
	margin: 0;
	padding: 10px var(--ot-gutter);
	text-align: center;
	font-size: 0.85rem;
	color: var(--ot-text-on-dark-muted);
}

/* Theme-level skin for the OneTrader Market Indices Ticker plugin's own
 * markup ([market_indices]). Scoped entirely under .onetrader-ticker so
 * the plugin's default styling elsewhere (if the shortcode is ever used
 * outside this section) is untouched, and no plugin files are modified.
 * The plugin's own inline <style> block still loads with the shortcode
 * output, so these rules win the cascade purely on selector specificity
 * (an extra ancestor class) rather than !important. Data, shortcode,
 * refresh behaviour and JS are all untouched — visual only. */
.onetrader-ticker .omt-ticker-wrap {
	background: transparent;
	border-radius: 0;
	padding: 9px 0;
}

.onetrader-ticker .omt-ticker-item {
	font-family: var(--ot-font-body);
	font-size: 0.75rem;
	padding: 0 14px;
	color: var(--ot-text-on-dark);
	border-right-color: rgba(255, 255, 255, 0.14);
}

.onetrader-ticker .omt-ticker-item .omt-t-name {
	color: var(--ot-gold);
	font-weight: 700;
}

.onetrader-ticker .omt-ticker-up {
	color: var(--ot-ticker-positive);
}

.onetrader-ticker .omt-ticker-down {
	color: var(--ot-ticker-negative);
}

/* 7. Hero ---------------------------------------------------------------- */
.onetrader-hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.onetrader-hero__link {
	position: relative;
	display: block;
	border-radius: var(--ot-radius-lg);
	overflow: hidden;
	background: var(--ot-black);
	min-height: 320px;
}

.onetrader-hero__image {
	position: absolute;
	inset: 0;
}

.onetrader-hero__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.75;
}

.onetrader-hero__overlay {
	position: relative;
	z-index: 1;
	padding: 28px;
	color: var(--ot-white);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 10%, rgba(0, 0, 0, 0.15) 75%, transparent 100%);
	min-height: 320px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 12px;
}

.onetrader-hero__title {
	font-size: 1.6rem;
	color: var(--ot-white);
	max-width: 34ch;
}

.onetrader-hero__excerpt {
	color: var(--ot-text-on-dark-muted);
	max-width: 50ch;
	margin: 0;
}

.onetrader-hero__side {
	display: grid;
	gap: 12px;
}

.onetrader-hero__side-item {
	display: flex;
	gap: 12px;
	align-items: center;
	background: var(--ot-black);
	border-radius: var(--ot-radius-md);
	padding: 10px;
	color: var(--ot-text-on-dark);
}

.onetrader-hero__side-thumb {
	flex-shrink: 0;
	width: 64px;
	height: 48px;
	border-radius: var(--ot-radius-sm);
	overflow: hidden;
}

.onetrader-hero__side-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.onetrader-hero__side-title {
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.35;
}

/* 8. Category-archive sidebar trending list ------------------------------ */
.onetrader-trending-list {
	display: grid;
	gap: 16px;
}

.onetrader-trending-list__item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--ot-border);
}

.onetrader-trending-list__item:last-child {
	border-bottom: 0;
}

.onetrader-trending-list__rank {
	font-family: var(--ot-font-display);
	font-weight: 700;
	font-size: 1.2rem;
	color: var(--ot-gold-dark);
	flex-shrink: 0;
	width: 1.4em;
}

.onetrader-trending-list__item a {
	font-weight: 600;
	line-height: 1.4;
}

.onetrader-trending-list__item a:hover {
	color: var(--ot-gold-dark);
}

/* 9. Article cards --------------------------------------------------- */
.onetrader-article-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

.onetrader-article-card {
	background: var(--ot-white);
	border: 1px solid var(--ot-border);
	border-radius: var(--ot-radius-md);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.onetrader-article-card:hover {
	box-shadow: var(--ot-shadow-md);
	transform: translateY(-2px);
}

.onetrader-article-card__thumb {
	display: block;
	aspect-ratio: 3 / 2;
	background: var(--ot-border);
}

.onetrader-article-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.onetrader-article-card__thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--ot-border), var(--ot-bg));
}

.onetrader-article-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
}

.onetrader-category-badge {
	display: inline-flex;
	align-self: flex-start;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 999px;
	color: var(--ot-white);
}

.onetrader-category-badge--0 { background: var(--ot-badge-0); }
.onetrader-category-badge--1 { background: var(--ot-badge-1); }
.onetrader-category-badge--2 { background: var(--ot-badge-2); }
.onetrader-category-badge--3 { background: var(--ot-badge-3); }
.onetrader-category-badge--4 { background: var(--ot-badge-4); }

.onetrader-article-card .entry-title {
	font-size: 1.05rem;
	margin: 0;
}

.onetrader-article-card .entry-title a:hover {
	color: var(--ot-gold-dark);
}

.onetrader-article-card__excerpt {
	color: var(--ot-text-muted);
	font-size: 0.9rem;
	margin: 0;
}

.entry-meta {
	font-size: 0.8rem;
	color: var(--ot-text-muted);
}

/* 10. Top Viewed Articles (ranked list) --------------------------------- */
.onetrader-top-viewed-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.onetrader-top-viewed-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--ot-border);
}

.onetrader-top-viewed-item:first-child {
	padding-top: 0;
}

.onetrader-top-viewed-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.onetrader-top-viewed-item__rank {
	flex: 0 0 auto;
	width: 2.2em;
	font-family: var(--ot-font-display);
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--ot-gold-dark);
	line-height: 1;
}

.onetrader-top-viewed-item__thumb {
	flex: 0 0 auto;
	display: block;
	width: 88px;
	aspect-ratio: 3 / 2;
	border-radius: var(--ot-radius-sm);
	overflow: hidden;
	background: var(--ot-border);
}

.onetrader-top-viewed-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.onetrader-top-viewed-item__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.onetrader-top-viewed-item__title {
	font-weight: 600;
	line-height: 1.35;
}

.onetrader-top-viewed-item__title:hover {
	color: var(--ot-gold-dark);
}

.onetrader-top-viewed-item__views {
	font-size: 0.8rem;
	color: var(--ot-text-muted);
}

/* 10b. Main category sections -------------------------------------------- */
.onetrader-category-section__placeholder {
	color: var(--ot-text-muted);
	font-style: italic;
	margin: 0;
}

/* 11. Newsletter ----------------------------------------------------- */
.onetrader-newsletter {
	background: var(--ot-black);
	color: var(--ot-text-on-dark);
}

.onetrader-newsletter__inner {
	padding-block: 44px;
	display: grid;
	gap: 24px;
	align-items: center;
}

.onetrader-newsletter__text h2 {
	color: var(--ot-white);
	font-size: 1.4rem;
	margin-bottom: 8px;
}

.onetrader-newsletter__text p {
	color: var(--ot-text-on-dark-muted);
	margin: 0;
}

.onetrader-newsletter__form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.onetrader-newsletter__form input[type="email"] {
	flex-grow: 1;
	min-width: 200px;
	padding: 12px 16px;
	border-radius: var(--ot-radius-sm);
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: var(--ot-black-soft);
	color: var(--ot-white);
}

.onetrader-newsletter__note {
	width: 100%;
	color: var(--ot-gold);
	font-size: 0.82rem;
	margin: 6px 0 0;
}

.onetrader-newsletter__social {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.onetrader-newsletter__social-label {
	font-weight: 700;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ot-text-on-dark-muted);
}

.onetrader-social-links {
	display: flex;
	gap: 10px;
}

.onetrader-social-links a {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--ot-black-soft);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* 12. Footer ---------------------------------------------------------- */
.onetrader-footer {
	background: var(--ot-black);
	color: var(--ot-text-on-dark-muted);
}

.onetrader-footer__grid {
	padding-block: 44px 28px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 30px;
}

.onetrader-footer__col--brand {
	display: flex;
	flex-direction: column;
}

.onetrader-site-title--footer .onetrader-site-title__text {
	color: var(--ot-white);
}

.onetrader-footer__blurb {
	margin: 14px 0 0;
	max-width: 34em;
	font-size: 0.85rem;
	line-height: 1.6;
	color: var(--ot-text-on-dark-muted);
}

.onetrader-footer__social {
	display: flex;
	gap: 10px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.onetrader-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--ot-black-soft);
	color: var(--ot-text-on-dark-muted);
	transition: color 0.15s ease, background-color 0.15s ease;
}

.onetrader-footer__social a:hover,
.onetrader-footer__social a:focus-visible {
	color: var(--ot-gold-contrast);
	background: var(--ot-gold);
}

.onetrader-footer__heading {
	margin: 0 0 14px;
	font-family: var(--ot-font-body);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ot-white);
}

.onetrader-footer__links {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.onetrader-footer__links a,
.onetrader-footer-menu a {
	font-size: 0.85rem;
	color: var(--ot-text-on-dark-muted);
	transition: color 0.15s ease;
}

.onetrader-footer__links a:hover,
.onetrader-footer-menu a:hover {
	color: var(--ot-gold);
}

.onetrader-footer-menu {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.onetrader-footer__widgets {
	padding-block: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.onetrader-footer__meta {
	padding-block: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.onetrader-footer__meta-inner {
	display: flex;
	justify-content: center;
}

.onetrader-footer__meta p {
	margin: 0;
	font-size: 0.82rem;
	text-align: center;
}

.onetrader-footer__meta a:hover {
	color: var(--ot-gold);
}

@media (min-width: 768px) {
	.onetrader-footer__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 36px 24px;
		padding-block: 48px 30px;
	}

	.onetrader-footer__blurb {
		max-width: 28em;
	}
}

@media (min-width: 1024px) {
	.onetrader-footer__grid {
		grid-template-columns: 1.3fr 1fr 1fr 1fr;
		gap: 32px;
		padding-block: 56px 34px;
	}

	.onetrader-footer__col--brand {
		grid-column: auto;
	}

	.onetrader-footer__blurb {
		max-width: 26em;
	}
}

/* 13. Single article --------------------------------------------------- */
.onetrader-single__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	padding-block: 32px;
}

/* Single-article main/sidebar tracks need the same min-width: 0 safety net
 * already proven for .onetrader-archive-layout below -- a plain CSS Grid
 * item defaults to min-width: auto, so either track's own content (a wide
 * embed, a third-party widget, an unbroken string) can force it -- and the
 * whole layout -- wider than intended instead of shrinking to fit. This
 * template never had that fix applied, which is the exact "different
 * templates use different sidebar structures" gap this task's audit found. */
.onetrader-single__main {
	min-width: 0;
	max-width: 100%;
}

.onetrader-sidebar {
	min-width: 0;
	max-width: 100%;
}

.onetrader-sidebar .widget {
	max-width: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.onetrader-sidebar img,
.onetrader-sidebar iframe,
.onetrader-sidebar video,
.onetrader-sidebar table,
.onetrader-sidebar embed,
.onetrader-sidebar object {
	max-width: 100%;
	height: auto;
}

.onetrader-single .entry-header {
	margin-bottom: 20px;
}

.onetrader-single .entry-title {
	font-size: 2rem;
	margin-top: 12px;
}

.onetrader-breadcrumbs {
	font-size: 0.82rem;
	color: var(--ot-text-muted);
	margin-bottom: 10px;
}

.onetrader-featured-image {
	border-radius: var(--ot-radius-lg);
	overflow: hidden;
	margin-bottom: 24px;
}

.entry-content {
	font-size: 1.05rem;
	line-height: 1.75;
}

.entry-content > * {
	max-width: 72ch;
}

/* Elementor-built custom pages (Share Market, Stocks Research, etc.) are full-width
 * page-builder layouts, not prose — the 72ch reading-width clamp above must not
 * apply to them, or the whole page layout gets squeezed into a narrow column. */
.entry-content > .elementor,
.entry-content > .elementor-section,
.entry-content > div[class*="elementor"],
.entry-content > .onetrader-hub-sections {
	max-width: none;
}

/* Content-hub pages (Stocks Research, Share Market, Indian Market,
 * Personal Finance, US Markets): theme-native sections re-rendered from
 * existing Elementor pages' real categories — reuses the same featured
 * card / article-grid / section-heading components as category.php and
 * the homepage, just spaced like a stack of homepage sections since a
 * hub page has no outer section wrapper of its own. */
.onetrader-hub-sections {
	margin-top: 8px;
}

.onetrader-hub-sections > * + * {
	margin-top: 56px;
}

.entry-content img {
	max-width: 100%;
	border-radius: var(--ot-radius-md);
}

.onetrader-article-tags {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--ot-border);
	font-size: 0.85rem;
	color: var(--ot-text-muted);
}

.onetrader-article-tags a {
	color: var(--ot-gold-dark);
}

.onetrader-ad-slot {
	margin-block: 20px;
	max-width: 100%;
	overflow: hidden;
}

.onetrader-ad-slot img,
.onetrader-ad-slot iframe {
	max-width: 100%;
	height: auto;
}

/* 14. Category archive / generic archive ------------------------------- */
.page-header {
	padding-block: 28px 20px;
}

.page-title {
	font-size: 1.9rem;
}

.onetrader-category-header {
	position: relative;
}

.onetrader-category-header__accent {
	display: inline-block;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	margin-bottom: 12px;
}

.archive-description {
	color: var(--ot-text-muted);
	max-width: 60ch;
}

.onetrader-archive-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	padding-bottom: 40px;
	/* Both grid tracks below get an explicit min-width: 0 — a plain CSS
	 * Grid item defaults to min-width: auto, which means its OWN content's
	 * intrinsic width (a long unbroken string, a fixed-width embed, a
	 * third-party widget that assumes a wide column) can force the track,
	 * and therefore this whole layout and the page around it, wider than
	 * the viewport instead of shrinking to fit. That was the actual root
	 * cause of the category archive's horizontal overflow — see
	 * .onetrader-archive-layout__main / .onetrader-category-aside below —
	 * not something a page-level `overflow-x: hidden` band-aid would have
	 * genuinely fixed. */
}

.onetrader-archive-layout__main {
	min-width: 0;
	max-width: 100%;
}

.onetrader-category-featured {
	background: var(--ot-white);
	border: 1px solid var(--ot-border);
	border-radius: var(--ot-radius-lg);
	overflow: hidden;
	margin-bottom: 28px;
}

.onetrader-category-featured__link {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.onetrader-category-featured__thumb {
	display: block;
	aspect-ratio: 16 / 9;
	/* Without this, the image's own natural width becomes this grid
	 * track's content-based automatic minimum size, which can outweigh
	 * the sibling __body track's fair 1fr share at the two-column
	 * (>=768px) breakpoint and squeeze the text content down to a few
	 * pixels wide (clipped by the card's overflow: hidden) — the same
	 * class of min-width:auto grid blowout fixed above for
	 * .onetrader-archive-layout, one level deeper. */
	min-width: 0;
}

.onetrader-category-featured__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.onetrader-category-featured__body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.onetrader-category-featured__eyebrow-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.onetrader-category-featured__eyebrow {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ot-gold-dark);
}

.onetrader-category-featured__title {
	font-family: var(--ot-font-display);
	font-size: 1.4rem;
	overflow-wrap: break-word;
}

.onetrader-category-featured__excerpt {
	color: var(--ot-text-muted);
}

.onetrader-category-aside {
	background: var(--ot-white);
	border: 1px solid var(--ot-border);
	border-radius: var(--ot-radius-md);
	padding: 20px;
	align-self: start;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
}

.onetrader-category-aside__widgets {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--ot-border);
	min-width: 0;
	max-width: 100%;
}

/* Every sidebar widget is wrapped in a real, guaranteed <section class="widget">
 * by register_sidebar() (inc/setup.php) regardless of which plugin (or the
 * site owner's own text/HTML widget) supplies its content, so this is a
 * reliable containment boundary for arbitrary third-party widget markup —
 * confirmed live on staging to include a custom "Allotment Servers" links
 * widget and a YouTube-feed plugin widget, neither of which the theme
 * controls or should assume is responsive. This clips/contains any such
 * widget to the sidebar column instead of letting its native width expand
 * the whole archive layout (and the page) horizontally.
 */
.onetrader-category-aside .widget {
	max-width: 100%;
	overflow-x: hidden;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.onetrader-category-aside img,
.onetrader-category-aside iframe,
.onetrader-category-aside video,
.onetrader-category-aside table,
.onetrader-category-aside embed,
.onetrader-category-aside object {
	max-width: 100%;
	height: auto;
}

/* Market News (delivered as raw HTML/CSS/JS through sidebar-1, not theme
 * markup -- see .ocn-widget / .ocn-fn-grid) sizes its own 3-column grid
 * from a *viewport*-width media query baked into its own stored markup,
 * not from how wide the sidebar column it renders inside actually is.
 * This sidebar measures ~290-390px at every desktop breakpoint (nowhere
 * near full viewport width), so that assumption forces 3 columns into a
 * box that only fits 1-2 -- on the category archive, .widget's own
 * overflow-x: hidden safety net above then visibly clips whatever doesn't
 * fit, which is the "Market News crops a card" bug. A container query
 * measuring the sidebar's own rendered width -- not the viewport, and
 * without editing the widget's own stored HTML/CSS -- gives it the column
 * count that genuinely fits. Gated to the same >=1024px breakpoint where
 * these two layouts switch from a single stacked column to a real side
 * column (see .onetrader-single__layout / .onetrader-archive-layout
 * above): below it the sidebar is a full-width stacked block, not a
 * narrow column, and should read as one mobile column regardless of its
 * pixel width, matching the rest of the stacked layout. */
.onetrader-sidebar .ocn-fn-grid,
.onetrader-category-aside .ocn-fn-grid {
	grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
	.onetrader-sidebar,
	.onetrader-category-aside__widgets {
		container-type: inline-size;
	}

	.onetrader-sidebar .ocn-fn-grid,
	.onetrader-category-aside .ocn-fn-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	@container (max-width: 339px) {
		.onetrader-sidebar .ocn-fn-grid,
		.onetrader-category-aside .ocn-fn-grid {
			grid-template-columns: 1fr;
		}
	}

	@container (min-width: 560px) {
		.onetrader-sidebar .ocn-fn-grid,
		.onetrader-category-aside .ocn-fn-grid {
			grid-template-columns: repeat(3, minmax(0, 1fr));
		}
	}
}

.the-posts-pagination,
.pagination {
	margin-top: 24px;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	margin-right: 6px;
	border-radius: var(--ot-radius-sm);
	border: 1px solid var(--ot-border);
	background: var(--ot-white);
}

.page-numbers.current {
	background: var(--ot-black);
	color: var(--ot-white);
	border-color: var(--ot-black);
}

/* 15. Comments / forms ------------------------------------------------- */
.onetrader-comments {
	padding-block: 32px;
	border-top: 1px solid var(--ot-border);
	margin-top: 32px;
}

.comments-title {
	font-size: 1.3rem;
}

.comment-list .comment-body {
	padding: 16px 0;
	border-bottom: 1px solid var(--ot-border);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--ot-border);
	border-radius: var(--ot-radius-sm);
	font: inherit;
	margin-bottom: 14px;
}

.comment-form .form-submit input {
	background: var(--ot-gold);
	color: var(--ot-gold-contrast);
	border: 0;
	padding: 12px 24px;
	border-radius: var(--ot-radius-sm);
	font-weight: 600;
}

/* 16. 404 / search ------------------------------------------------------- */
.onetrader-404__inner {
	text-align: center;
	padding-block: 80px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.onetrader-404__code {
	font-size: 4rem;
	color: var(--ot-gold-dark);
	margin: 0;
}

.onetrader-404__message {
	max-width: 50ch;
	color: var(--ot-text-muted);
}

.search-form {
	display: flex;
	gap: 8px;
	max-width: 420px;
	margin-inline: auto;
}

.search-field {
	flex-grow: 1;
	padding: 10px 14px;
	border: 1px solid var(--ot-border);
	border-radius: var(--ot-radius-sm);
}

.search-submit {
	padding: 10px 18px;
	border: 0;
	border-radius: var(--ot-radius-sm);
	background: var(--ot-black);
	color: var(--ot-white);
	font-weight: 600;
}

/* 17. Utilities ----------------------------------------------------------- */
.alignwide {
	max-width: calc(var(--ot-container) - var(--ot-gutter));
}

.alignfull {
	max-width: none;
}

/* 18. Responsive breakpoints -------------------------------------------- */

/* >= 375px small phones already covered by base mobile-first styles above. */

/* Tablet portrait and up */
@media (min-width: 768px) {
	.onetrader-ticker .omt-ticker-item {
		font-size: 0.8125rem;
		padding: 0 20px;
	}

	.onetrader-article-grid {
		/* minmax(0, 1fr), not a bare 1fr: keeps this grid itself from ever
		 * repeating the exact min-width: auto blowout its own container fix
		 * (below) corrects one level up — each column is now genuinely
		 * free to shrink to 0 before growing, rather than being floored by
		 * its content's natural/preferred width. */
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.onetrader-newsletter__inner {
		grid-template-columns: 1.4fr auto;
	}

	.onetrader-newsletter__form {
		flex-wrap: nowrap;
	}

	.onetrader-category-featured__link {
		grid-template-columns: 1fr 1fr;
	}

	.onetrader-hero {
		grid-template-columns: 2fr 1fr;
	}

	.onetrader-hero__side {
		grid-template-rows: repeat(3, 1fr);
	}
}

/* Small desktop / large tablet landscape */
@media (min-width: 1024px) {
	.onetrader-primary-nav {
		display: block;
	}

	.onetrader-article-grid--4 {
		grid-template-columns: repeat(4, 1fr);
	}

	.onetrader-article-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}

	.onetrader-single__layout {
		grid-template-columns: 2.2fr 1fr;
	}

	.onetrader-archive-layout {
		grid-template-columns: 2.2fr 1fr;
	}
}

/* Desktop */
@media (min-width: 1280px) {
	.onetrader-hero__overlay,
	.onetrader-hero__link {
		min-height: 400px;
	}

	/* "Large desktop" bump for plain (unmodified) .onetrader-article-grid —
	 * used only by category.php, archive.php, index.php and search.php,
	 * never the homepage. IMPORTANT: .onetrader-article-grid--3/--4 are
	 * single-class selectors with the SAME specificity (0,1,0) as this
	 * bare .onetrader-article-grid rule, so without the :not() exclusions
	 * below this rule (declared later in the file, inside a media query
	 * that comes after the --3/--4 block) would win the cascade on ties
	 * by source order and silently collapse the homepage's 4-column
	 * sections to 3 columns at >=1280px — verified live and corrected
	 * here, not just a theoretical concern. The :not() exclusions make
	 * this rule inert on any element also carrying a modifier class,
	 * regardless of source order, so the homepage is unaffected no
	 * matter how this file is reorganized later.
	 * Held off until 1280px rather than 1024px so the category archive's
	 * narrower 2.2fr main column (it shares the row with the sidebar) gets
	 * one extra breakpoint at a comfortable 2-column width before jumping
	 * to 3, instead of cramming 3 columns into that column right as the
	 * sidebar first appears. */
	.onetrader-article-grid:not(.onetrader-article-grid--3):not(.onetrader-article-grid--4) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Large desktop */
@media (min-width: 1440px) {
	:root {
		--ot-container: 1320px;
	}
}

/* Sidebar Ads safe zone --------------------------------------------- *
 * The onetrader-sidebar-ads plugin shows fixed 160px-wide ad rails at
 * >=1400px, inset 8px from each edge (so each rail's outer edge sits
 * 168px from the viewport edge). --ot-container is centered independently
 * of those rails, so above 1400px it can center content underneath them.
 * This keeps the container's own responsive width (1240px / 1320px) as
 * the natural upper bound, but never lets it get wide enough for its
 * centered edges to creep inside a 32px safety margin beyond each rail
 * (168px + 32px = 200px reserved per side, 400px total). Below 1400px the
 * plugin hides the rails entirely, so this rule doesn't apply there and
 * the container returns to its normal full responsive width. Placed after
 * the 1440px rule above so it also wins (same :root specificity, later
 * source order) at 1440px and up. */
@media (min-width: 1400px) {
	:root {
		--ot-container: clamp(960px, calc(100vw - 400px), 1320px);
	}
}

/* Below 1024px: collapse to the mobile/hamburger nav */
@media (max-width: 1023.98px) {
	/* #onetrader-primary-nav is a DOM child of <header>, and becomes a
	 * fixed, z-index:190 positioned box below (mobile overlay panel).
	 * Inside the header's own stacking context, that positioned z-index
	 * is compared against its siblings here — branding/actions — not
	 * against the <header> element's outer z-index:200 (that only
	 * governs the header as a whole against unrelated page elements).
	 * Without this, the opened nav panel paints over the still-static
	 * branding/toggle, hiding the × completely even though its state
	 * (aria-expanded, bar transforms) is correct — confirmed live via
	 * elementFromPoint at the toggle's own coordinates returning the nav
	 * panel, not the button. Raising these two above the panel's z-index
	 * keeps the toggle (and logo) visible and tappable above the opened
	 * menu regardless of where the sticky header currently sits (e.g. a
	 * page-top ad pushing it down before the user has scrolled). */
	.onetrader-header__branding,
	.onetrader-header__actions {
		position: relative;
		z-index: 201;
	}

	.onetrader-nav-toggle {
		display: inline-flex;
		width: 44px;
		height: 44px;
	}

	body.onetrader-nav-open {
		overflow: hidden;
	}

	.onetrader-primary-nav {
		position: fixed;
		inset: var(--ot-header-h) 0 0 0;
		background: var(--ot-black);
		padding: 20px var(--ot-gutter);
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform 0.25s ease;
		z-index: 190;
	}

	.onetrader-primary-nav.is-open {
		transform: translateX(0);
	}

	.onetrader-primary-menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}

	.onetrader-primary-menu a {
		display: block;
		padding: 14px 4px;
		width: 100%;
		border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	}

	.onetrader-primary-menu .sub-menu {
		display: block;
		position: static;
		background: transparent;
		box-shadow: none;
		padding-left: 16px;
	}

	.onetrader-primary-menu .menu-item-has-children:hover > .sub-menu,
	.onetrader-primary-menu .menu-item-has-children:focus-within > .sub-menu {
		display: block;
	}
}


/* OurPaisa Community CTA section (replaces newsletter placeholder) */
.onetrader-community {
	background: var(--ot-black);
	color: var(--ot-text-on-dark);
	overflow: hidden;
}
.onetrader-community__inner {
	padding-block: 48px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	align-items: center;
}
.onetrader-community__eyebrow {
	display: block;
	color: var(--ot-gold);
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin-bottom: 6px;
}
.onetrader-community__heading {
	color: var(--ot-white);
	font-size: 1.9rem;
	line-height: 1.15;
	margin: 0 0 8px;
}
.onetrader-community__subheading {
	color: var(--ot-gold);
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 14px;
}
.onetrader-community__desc {
	color: var(--ot-text-on-dark-muted);
	max-width: 46ch;
	margin: 0 0 22px;
	line-height: 1.6;
}
.onetrader-community__cta {
	margin-bottom: 28px;
}
.onetrader-community__focus {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 18px 12px;
}
.onetrader-community__focus li {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
}
.onetrader-community__focus-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(198, 155, 76, 0.4);
	color: var(--ot-gold);
}
.onetrader-community__focus-icon svg {
	width: 20px;
	height: 20px;
}
.onetrader-community__focus-label {
	font-size: 0.78rem;
	color: var(--ot-text-on-dark-muted);
	font-weight: 600;
}
.onetrader-community__visual {
	width: 100%;
}
.onetrader-community__visual img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--ot-radius-lg);
	box-shadow: var(--ot-shadow-sm);
}

/* Tablet portrait and up */
@media (min-width: 768px) {
	.onetrader-community__focus {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Small desktop / large tablet landscape */
@media (min-width: 1024px) {
	.onetrader-community__inner {
		grid-template-columns: 1.15fr 1fr;
		gap: 40px;
		padding-block: 60px;
	}
	.onetrader-community__focus {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
	}
	.onetrader-community__focus li {
		align-items: flex-start;
		text-align: left;
		flex-direction: row;
	}
	.onetrader-community__focus-icon {
		width: 36px;
		height: 36px;
		flex-shrink: 0;
	}
	.onetrader-community__focus-icon svg {
		width: 17px;
		height: 17px;
	}
}

/* Desktop */
@media (min-width: 1280px) {
	.onetrader-community__inner {
		grid-template-columns: 1.2fr 1fr;
		gap: 56px;
		padding-block: 72px;
	}
	.onetrader-community__heading {
		font-size: 2.2rem;
	}
}

/* Large desktop */
@media (min-width: 1440px) {
	.onetrader-community__inner {
		gap: 72px;
	}
}

/* Front-page-only H1: the site branding link is wrapped in <h1> on the
 * homepage (see header.php) so the page has exactly one meaningful H1.
 * display:contents means this heading generates no box of its own, so
 * the branding renders pixel-identical to every other page — this is
 * purely a semantic/accessibility wrapper, not a visual change. */
.onetrader-site-heading {
	display: contents;
}
