/*
Theme Name: Havey News
Theme URI: https://havey.org
Description: Child theme of Evermag for Havey News (Urdu RTL news). Free GPL stack; no paid activation.
Author: Havey News
Author URI: https://havey.org
Template: evermag
Version: 1.0.9
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: havey-news
Tags: news, magazine, rtl-language-support, custom-logo, translation-ready
*/

/* -------------------------------------------------------------------------
   Phase 04C — Professional newspaper header
   Urdu UI: Noto Nastaliq Urdu (OFL, local)
   English UI: Source Sans 3 (OFL, local)
--------------------------------------------------------------------------- */

:root {
	--havey-black: #0b0b0b;
	--havey-white: #ffffff;
	--havey-border: #e4e4e4;
	--havey-accent: #c62828;
	--havey-muted: #6b6b6b;
	--havey-font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Alvi Nastaleeq", "Urdu Typesetting", Tahoma, serif;
	--havey-font-en: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
	--havey-utility-h: 36px;
	--havey-masthead-h: 78px;
}

body.havey-news {
	font-family: var(--havey-font-urdu);
	line-height: 1.9;
}

/* Override prior Phase 04B red header rule from inline styles when present. */
body.havey-news .site-header.havey-site-header {
	border-bottom: 0;
	background: var(--havey-white);
}

.havey-site-header {
	position: relative;
	z-index: 40;
	width: 100%;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ---- Black utility bar ---- */
.havey-utility-bar {
	background: var(--havey-black);
	color: var(--havey-white);
	font-family: var(--havey-font-en);
	font-size: 13px;
	line-height: 1.3;
	direction: ltr;
}

.havey-utility-bar__inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 20px;
	min-height: var(--havey-utility-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.havey-utility-bar__date {
	flex: 0 1 auto;
	white-space: nowrap;
	font-weight: 400;
	letter-spacing: 0.01em;
	opacity: 0.95;
}

.havey-utility-bar__links ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 4px 18px;
}

.havey-utility-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--havey-white) !important;
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.havey-utility-link:hover,
.havey-utility-link:focus {
	opacity: 0.85;
}

.havey-utility-link.is-pending {
	opacity: 0.72;
	cursor: default;
}

.havey-pending-badge {
	display: inline-block;
	margin-inline-start: 4px;
	padding: 1px 5px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 2px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.9;
}

.havey-icon-tv {
	display: inline-block;
	vertical-align: -3px;
}

/* ---- White masthead ---- */
.havey-masthead {
	background: var(--havey-white);
	border-bottom: 1px solid var(--havey-border);
	direction: ltr; /* physical LTR chrome: hamburger left, logo right */
}

.havey-masthead__inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 10px 20px;
	min-height: var(--havey-masthead-h);
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 18px;
}

.havey-masthead__start {
	display: flex;
	align-items: center;
	gap: 6px;
	justify-self: start;
}

.havey-hamburger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	padding: 6px;
	color: var(--havey-black);
	cursor: pointer;
}

.havey-header-search {
	position: relative;
}

.havey-header-search__toggle {
	background: transparent;
	border: 0;
	padding: 6px;
	color: var(--havey-black);
	cursor: pointer;
}

.havey-header-search__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 50;
	min-width: min(320px, 80vw);
	padding: 12px;
	background: var(--havey-white);
	border: 1px solid var(--havey-border);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.havey-header-search:not(.is-open) .havey-header-search__panel[hidden] {
	display: none;
}

/* Category nav — RTL reading order, tucked against the logo */
.havey-cat-nav {
	justify-self: end;
	max-width: 100%;
	overflow: hidden;
	direction: rtl;
	font-family: var(--havey-font-urdu);
}

.havey-cat-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-start;
	gap: 4px 22px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.havey-cat-nav__list a,
.havey-cat-nav__missing {
	display: inline-block;
	color: #111 !important;
	text-decoration: none;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 2.1;
	padding: 2px 0;
	white-space: nowrap;
}

.havey-cat-nav__list a:hover,
.havey-cat-nav__list a:focus {
	color: var(--havey-accent) !important;
}

.havey-masthead__branding {
	justify-self: end;
}

.havey-branding {
	display: flex;
	align-items: center;
	margin: 0;
}

.havey-site-header .custom-logo-link {
	display: inline-block;
	line-height: 0;
	max-width: 100%;
}

.havey-site-header .custom-logo-link img,
.havey-site-header img.custom-logo {
	display: block;
	width: auto;
	height: auto;
	max-width: min(220px, 28vw);
	max-height: 64px;
	object-fit: contain;
}

/* Hide parent Evermag header rows superseded by this override */
body.havey-news .header-main,
body.havey-news .navbar {
	display: none !important;
}

/* Off-canvas extras */
.havey-offcanvas-nav,
.havey-offcanvas-utility {
	font-family: var(--havey-font-urdu);
	margin: 0 0 1.25rem;
}

.havey-offcanvas-nav ul,
.havey-offcanvas-utility ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.havey-offcanvas-nav a,
.havey-offcanvas-utility a {
	display: block;
	padding: 0.65rem 0;
	border-bottom: 1px solid #eee;
	color: #111 !important;
	text-decoration: none;
	font-size: 1.15rem;
	line-height: 2;
}

.havey-offcanvas-utility {
	font-family: var(--havey-font-en);
	direction: ltr;
	text-align: left;
}

.havey-offcanvas-utility a {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.5;
}

.havey-offcanvas-search {
	margin-bottom: 1.25rem;
}

/* Page/post titles — Evermag uses .single-title; force approved Nastaliq stack */
body.havey-news .entry-title,
body.havey-news .single-title,
body.havey-news .page-title {
	font-family: var(--havey-font-urdu);
	line-height: 1.9;
	font-weight: 700;
}

/* Sidebar widget titles for Havey TV / Latest E-Paper */
body.havey-news .widget_havey_tv_widget .widget-title,
body.havey-news .widget_havey_latest_epaper_widget .widget-title {
	font-family: var(--havey-font-urdu);
	line-height: 1.9;
	font-weight: 700;
}

/* ---- Tablet ---- */
@media (max-width: 1100px) {
	.havey-cat-nav__list {
		gap: 4px 14px;
	}

	.havey-cat-nav__list a,
	.havey-cat-nav__missing {
		font-size: 0.98rem;
	}

	.havey-site-header .custom-logo-link img,
	.havey-site-header img.custom-logo {
		max-width: min(180px, 26vw);
		max-height: 56px;
	}
}

@media (max-width: 991.98px) {
	.havey-masthead__inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
		column-gap: 12px;
		padding: 8px 16px;
	}

	.havey-cat-nav {
		display: none; /* compact: categories live in hamburger */
	}

	.havey-masthead__inner {
		grid-template-columns: auto 1fr;
	}

	.havey-masthead__branding {
		justify-self: end;
	}

	.havey-site-header .custom-logo-link img,
	.havey-site-header img.custom-logo {
		max-width: min(160px, 46vw);
		max-height: 52px;
	}

	.havey-utility-bar__inner {
		padding: 6px 16px;
		flex-wrap: wrap;
		min-height: 0;
		row-gap: 6px;
	}

	.havey-utility-bar__date {
		font-size: 12px;
	}

	.havey-utility-bar__links ul {
		gap: 4px 12px;
	}
}

/* ---- Mobile ---- */
@media (max-width: 767.98px) {
	.havey-utility-bar {
		font-size: 12px;
	}

	.havey-utility-bar__inner {
		padding: 8px 12px;
	}

	.havey-utility-bar__links ul {
		width: 100%;
		justify-content: flex-start;
		gap: 8px 12px;
	}

	.havey-pending-badge {
		display: none;
	}

	.havey-masthead__inner {
		padding: 8px 12px;
		min-height: 64px;
	}

	.havey-site-header .custom-logo-link img,
	.havey-site-header img.custom-logo {
		max-width: min(148px, 52vw);
		max-height: 46px;
	}
}

@media (max-width: 480px) {
	.havey-utility-bar__date {
		width: 100%;
	}
}
