/*
Theme Name: CodeRao News
Theme URI: https://news.coderao.com/
Description: PaperMag-style newspaper layout for CodeRao News. Child theme of ColorMag — hero story, trending strip, category blocks and latest news list.
Author: CodeRao
Template: colormag
Version: 1.1.5
License: GNU General Public License v3
Text Domain: coderao-news
*/

/* ---------- PaperMag-style homepage (v2: demo-faithful) ---------- */

/* Header logo: the uploaded lockup is 2736px wide and renders huge.
   Keep the masthead compact on all layouts (same header everywhere). */
.cm-site-branding .custom-logo {
	max-width: min(420px, 88vw);
	height: auto;
}

/* Site width: the parent theme caps the whole site (#page) at 1200px,
   which leaves huge white margins on wide screens. Widen the page,
   the theme containers and the homepage wrapper together — still centered. */
#page { max-width: 1440px; }
.cm-container { max-width: 1408px; }

/* Text pages (About, Contact, Privacy, Corrections): keep the reading
   column narrow and centered instead of stretching to 1400px. */
body.page.cm-no-sidebar .cm-primary { max-width: 880px; margin-left: auto; margin-right: auto; }

.pm2-wrap { max-width: 1408px; margin: 0 auto; padding: 24px 16px 40px; display: flex; gap: 32px; align-items: flex-start; }
.pm2-main { flex: 1 1 auto; min-width: 0; }
.pm2-side { flex: 0 0 300px; min-width: 0; }
.pm2-side .widget { margin-bottom: 28px; }
.pm2-side .widget-title { font-size: 15px; letter-spacing: 1px; text-transform: uppercase; border-bottom: 3px solid #d9232e; padding-bottom: 8px; margin-bottom: 14px; }
.pm2-wrap h1, .pm2-wrap h2, .pm2-wrap h3, .pm2-wrap h4, .pm2-wrap h5 { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-weight: 700; }
.pm2-wrap a { text-decoration: none; color: #111; }
.pm2-wrap a:hover { color: #d9232e; }
.pm2-meta { font-size: 12px; color: #888; margin-top: 6px; }
.pm2-cat { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #fff; background: #d9232e; padding: 3px 8px; margin-bottom: 8px; }
.pm2-sec { margin-bottom: 40px; }
.pm2-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 3px solid #111; margin-bottom: 18px; padding-bottom: 8px; flex-wrap: wrap; }
.pm2-sec-title { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin: 0; }
.pm2-sec-title span { color: #d9232e; }

/* Hero: big image story + 2 cards (PaperMag demo layout) */
.pm2-hero { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; margin-bottom: 36px; align-items: stretch; }
.pm2-hero-big { position: relative; min-height: 440px; overflow: hidden; }
.pm2-hero-big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.pm2-hero-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 18px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.pm2-hero-overlay .pm2-cat { margin-bottom: 10px; }
.pm2-hero-overlay h1 { font-size: 30px; line-height: 1.25; margin: 0 0 12px; }
.pm2-hero-overlay h1 a { color: #fff; }
.pm2-hero-byline { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.9); font-size: 13px; }
.pm2-hero-byline img.avatar { border-radius: 50%; width: 40px; height: 40px; }
.pm2-hero-card { display: flex; flex-direction: column; }
.pm2-hero-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.pm2-hero-card-top .pm2-cat { margin: 0; }
.pm2-hero-comments { color: #777; font-weight: 700; white-space: nowrap; }
.pm2-hero-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: top center; display: block; }
.pm2-hero-card h3 { margin: 12px 0 6px; font-size: 20px; line-height: 1.3; }
/* No-image fallback: a dark text card instead of a white void. */
.pm2-hero-big.pm2-noimg, .pm2-recent-big.pm2-noimg { background: #111; }
.pm2-hero-big.pm2-noimg .pm2-hero-overlay, .pm2-recent-big.pm2-noimg .pm2-overlay { position: static; }

/* Recently Added + tabs */
.pm2-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pm2-tab { border: 0; background: none; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #777; padding: 6px 10px; text-transform: uppercase; }
.pm2-tab.active { color: #fff; background: #d9232e; }
.pm2-panel { display: none; }
.pm2-panel.active { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.pm2-recent-big { position: relative; }
.pm2-recent-big img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: top center; display: block; }
.pm2-recent-big .pm2-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 50px 16px 14px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.pm2-recent-big h3 { margin: 0; font-size: 22px; line-height: 1.3; }
.pm2-recent-big h3 a { color: #fff; }
.pm2-recent-big .pm2-meta { color: rgba(255,255,255,.85); }
.pm2-recent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pm2-recent-grid img { width: 100%; height: 130px; object-fit: cover; object-position: top center; display: block; }
.pm2-recent-grid h4 { margin: 8px 0 4px; font-size: 16px; line-height: 1.35; }

/* Duo: 2 text stories + 1 big image story */
.pm2-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.pm2-duo-left { display: flex; flex-direction: column; gap: 24px; }
.pm2-textstory { display: flex; gap: 16px; }
.pm2-textstory img { width: 150px; height: 110px; object-fit: cover; flex: 0 0 150px; }
.pm2-textstory h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.pm2-textstory p { margin: 0 0 6px; color: #555; font-size: 14px; line-height: 1.55; }
.pm2-duo-right img { width: 100%; height: 280px; object-fit: cover; object-position: top center; display: block; }
.pm2-duo-right h3 { margin: 12px 0 4px; font-size: 22px; line-height: 1.3; }

/* 5-story strip */
.pm2-strip5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.pm2-strip5 article { display: flex; flex-direction: column; gap: 8px; }
.pm2-strip5 img { width: 100%; height: 150px; object-fit: cover; object-position: top center; display: block; }
.pm2-strip5 h4 { margin: 0; font-size: 14px; line-height: 1.35; }

/* Category trios */
.pm2-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.pm2-triotitle { font-size: 18px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 3px solid #d9232e; padding-bottom: 8px; margin: 0 0 14px; }
.pm2-triobig { width: 100%; height: 170px; object-fit: cover; object-position: top center; display: block; }
.pm2-triocol h4 { margin: 10px 0 4px; font-size: 17px; line-height: 1.35; }
.pm2-triocol ul { list-style: none; margin: 12px 0 0; padding: 0; }
.pm2-triocol ul li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid #eee; align-items: flex-start; }
.pm2-triocol ul li img { width: 84px; height: 64px; object-fit: cover; flex: 0 0 84px; }
.pm2-triocol ul li h5 { margin: 0; font-size: 14px; line-height: 1.35; }

/* Famous Columns: text only */
.pm2-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.pm2-cols article { border-top: 3px solid #111; padding-top: 12px; }
.pm2-cols h4 { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }

/* Latest list */
.pm2-latest article { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid #eee; }
.pm2-latest article img { width: 220px; height: 150px; object-fit: cover; object-position: top center; flex: 0 0 220px; }
.pm2-latest h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.pm2-latest p { margin: 0; color: #555; font-size: 14px; line-height: 1.55; }
.pm2-latest .pm2-noimg { flex: 1; }
.pm2-pagination { margin-top: 24px; text-align: center; }
.pm2-pagination .page-numbers { display: inline-block; padding: 8px 14px; border: 1px solid #ddd; margin: 0 3px; font-weight: 700; color: #222; }
.pm2-pagination .page-numbers.current { background: #d9232e; border-color: #d9232e; color: #fff; }

@media (max-width: 900px) {
  .pm2-wrap { flex-direction: column; }
  .pm2-side { flex-basis: auto; width: 100%; }
  .pm2-hero { grid-template-columns: 1fr; }
  .pm2-hero-big { min-height: 320px; }
  .pm2-hero-overlay h1 { font-size: 24px; }
  .pm2-panel.active { grid-template-columns: 1fr; }
  .pm2-duo { grid-template-columns: 1fr; }
  .pm2-strip5 { grid-template-columns: repeat(2, 1fr); }
  .pm2-trio { grid-template-columns: 1fr; }
  .pm2-cols { grid-template-columns: repeat(2, 1fr); }
  .pm2-latest article img { width: 120px; height: 90px; flex-basis: 120px; }
  .pm2-latest h3 { font-size: 16px; }
}

/* ---------- PaperMag-style homepage (v1, kept for compatibility) ---------- */
.pm-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; display: flex; gap: 32px; align-items: flex-start; }
.pm-main { flex: 1 1 auto; min-width: 0; }
.pm-side { flex: 0 0 300px; min-width: 0; }
.pm-side .widget { margin-bottom: 28px; }
.pm-side .widget-title { font-size: 15px; letter-spacing: 1px; text-transform: uppercase; border-bottom: 3px solid #d9232e; padding-bottom: 8px; margin-bottom: 14px; }

.pm-sec { margin-bottom: 36px; }
.pm-sec-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 3px solid #111; margin-bottom: 16px; padding-bottom: 6px; }
.pm-sec-title { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin: 0; }
.pm-sec-title span { color: #d9232e; }
.pm-sec-link { font-size: 13px; color: #d9232e; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

/* Hero */
.pm-hero { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 28px; }
.pm-hero-main { position: relative; }
.pm-hero-main img { width: 100%; height: 420px; object-fit: cover; display: block; }
.pm-hero-main .pm-hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 18px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.pm-hero-main h2 { margin: 0; font-size: 28px; line-height: 1.25; }
.pm-hero-main h2 a { color: #fff; }
.pm-hero-side { display: flex; flex-direction: column; gap: 20px; }
.pm-hero-side article { display: flex; gap: 12px; }
.pm-hero-side img { width: 120px; height: 90px; object-fit: cover; flex: 0 0 120px; }
.pm-hero-side h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.pm-cat { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #fff; background: #d9232e; padding: 3px 8px; margin-bottom: 8px; }
.pm-hero-main .pm-cat { position: absolute; top: 14px; left: 14px; z-index: 2; }
.pm-meta { font-size: 12px; color: #888; margin-top: 6px; }
.pm-hero-main .pm-meta { color: rgba(255,255,255,.85); }
.pm-meta a { color: inherit; }

/* Trending strip */
.pm-trend { border-top: 3px solid #d9232e; border-bottom: 1px solid #e5e5e5; padding: 12px 0; margin-bottom: 32px; display: flex; gap: 24px; align-items: center; overflow: hidden; }
.pm-trend-label { flex: 0 0 auto; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #d9232e; }
.pm-trend-list { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.pm-trend-list::-webkit-scrollbar { display: none; }
.pm-trend-list a { white-space: nowrap; font-size: 14px; font-weight: 600; color: #222; }
.pm-trend-list a b { color: #d9232e; margin-right: 6px; }

/* Category blocks */
.pm-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.pm-catblock article.pm-big img { width: 100%; height: 220px; object-fit: cover; display: block; }
.pm-catblock article.pm-big h3 { font-size: 19px; line-height: 1.3; margin: 10px 0 4px; }
.pm-catblock ul { list-style: none; margin: 12px 0 0; padding: 0; }
.pm-catblock ul li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid #eee; }
.pm-catblock ul li img { width: 84px; height: 64px; object-fit: cover; flex: 0 0 84px; }
.pm-catblock ul li h4 { margin: 0; font-size: 14px; line-height: 1.35; font-weight: 600; }

/* Latest list */
.pm-latest article { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid #eee; }
.pm-latest article img { width: 220px; height: 150px; object-fit: cover; flex: 0 0 220px; }
.pm-latest h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.pm-latest p { margin: 0; color: #555; font-size: 14px; line-height: 1.55; }
.pm-latest .pm-noimg { flex: 1; }

.pm-pagination { margin-top: 24px; text-align: center; }
.pm-pagination .page-numbers { display: inline-block; padding: 8px 14px; border: 1px solid #ddd; margin: 0 3px; font-weight: 700; color: #222; }
.pm-pagination .page-numbers.current { background: #d9232e; border-color: #d9232e; color: #fff; }

.pm-wrap a { text-decoration: none; }
.pm-wrap a:hover { color: #d9232e; }
.pm-wrap h2 a, .pm-wrap h3 a, .pm-wrap h4 a { color: #111; }

@media (max-width: 900px) {
  .pm-wrap { flex-direction: column; }
  .pm-side { flex-basis: auto; width: 100%; }
  .pm-hero { grid-template-columns: 1fr; }
  .pm-hero-main img { height: 260px; }
  .pm-hero-main h2 { font-size: 22px; }
  .pm-cats { grid-template-columns: 1fr; }
  .pm-latest article img { width: 120px; height: 90px; flex-basis: 120px; }
  .pm-latest h3 { font-size: 16px; }
}

/* ---------- Text logo, tech-style ("News CodeRao", v1.0.8) ---------- */
/* The circle lockup image is replaced by a two-tone text logo via the
   get_custom_logo filter in functions.php. Hide the parent header's
   site-title/tagline block — the new logo carries its own tagline. */
.cm-site-info { display: none; }
.cm-site-branding .logo {
	font-size: 26px;
	font-weight: 800;
	letter-spacing: .5px;
	color: #111;
	white-space: nowrap;
	text-decoration: none;
}
.cm-site-branding .logo b {
	background: linear-gradient(90deg, #f92a28, #d61f1f);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.cm-site-branding .logo small {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 3px;
	color: #888;
}

/* ---------- One-row header with menu, tech-style (v1.0.9) ---------- */
/* Desktop only (min-width 1025px): logo + primary menu in a single white
   row like the tech site, instead of the dark nav bar below the logo. */
@media (min-width: 1025px) {
	.cm-header-builder .cm-desktop-row.cm-main-header {
		display: flex;
		align-items: center;
		max-width: 1408px;
		margin-left: auto;
		margin-right: auto;
		padding-left: 16px;
		padding-right: 16px;
		gap: 24px;
	}
	.cm-header-builder .cm-desktop-row .cm-header-main-row {
		flex: 0 0 auto;
	}
	.cm-header-builder .cm-desktop-row .cm-header-bottom-row {
		flex: 1 1 auto;
		background: transparent;
		border-top: none;
		box-shadow: none;
	}
	.cm-header-builder .cm-desktop-row .cm-header-main-row .cm-container,
	.cm-header-builder .cm-desktop-row .cm-header-bottom-row .cm-container {
		max-width: none;
		padding-left: 0;
		padding-right: 0;
	}
	.cm-header-builder .cm-desktop-row .cm-header-bottom-row .cm-bottom-row {
		background: transparent;
		border-top: none;
		box-shadow: none;
	}
	/* Menu links dark on white, like tech (were white on the dark bar). */
	.cm-header-builder .cm-desktop-row .cm-primary-nav a {
		color: #111;
	}
	.cm-header-builder .cm-desktop-row .cm-primary-nav a:hover {
		color: #f92a28;
	}
	.cm-header-builder .cm-desktop-row .cm-primary-nav ul li.current-menu-item,
	.cm-header-builder .cm-desktop-row .cm-primary-nav ul li.current_page_item,
	.cm-header-builder .cm-desktop-row .cm-primary-nav ul li.current_page_ancestor,
	.cm-header-builder .cm-desktop-row .cm-primary-nav ul li:hover {
		background-color: rgba(249, 42, 40, .08);
		border-radius: 8px;
	}
	.cm-header-builder .cm-desktop-row .cm-primary-nav ul li.current-menu-item > a,
	.cm-header-builder .cm-desktop-row .cm-primary-nav ul li.current_page_item > a {
		color: #f92a28;
	}
}

/* ---------- Black UPDATE ticker strip above the header (v1.1.0) ---------- */
.news-ticker {
	background: #000;
	color: #fff;
	display: flex;
	align-items: stretch;
	height: 38px;
	overflow: hidden;
	font-size: 14px;
}
.news-ticker .ticker-label {
	background: #f92a28;
	color: #fff;
	font-weight: 800;
	letter-spacing: 1px;
	display: flex;
	align-items: center;
	padding: 0 14px;
	flex: 0 0 auto;
}
.news-ticker .ticker-viewport {
	overflow: hidden;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
}
.news-ticker .ticker-track {
	display: flex;
	align-items: center;
	white-space: nowrap;
	animation: ticker-scroll 45s linear infinite;
	will-change: transform;
}
.news-ticker:hover .ticker-track {
	animation-play-state: paused;
}
.news-ticker .ticker-track a {
	color: #fff;
	text-decoration: none;
	padding: 0 8px;
}
.news-ticker .ticker-track a:hover {
	color: #f92a28;
}
.news-ticker .ticker-sep {
	color: #f92a28;
	padding: 0 4px;
}
@keyframes ticker-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

/* Single post: show the full featured image, never crop a portrait (head cut off, 11 Nov 2026). */
.single-post .cm-post-content > .cm-featured-image img { aspect-ratio: auto; height: auto; object-fit: contain; }

/* ---------- Mobile logo fix (v1.1.5, 14 Nov 2026) ---------- */
/* The tagline inside the text logo is ~540px wide (11px + 3px letter
   spacing, nowrap) so it overflowed the phone viewport and pushed the
   logo off the left edge. On phones let the tagline wrap and shrink
   the logo so the whole lockup fits the screen. */
@media (max-width: 768px) {
	.cm-site-branding .logo {
		font-size: 22px;
		white-space: normal;
		display: inline-block;
		max-width: calc(100vw - 32px);
	}
	.cm-site-branding .logo small {
		white-space: normal;
		letter-spacing: 2px;
		font-size: 10px;
		line-height: 1.6;
	}
}