/* ==========================================================================
   iTimePress v3.0 — Strict Reference-Only Irish Times Replication
   ========================================================================== */

:root {
	--itp-primary: #2c5472;
	--itp-secondary: #1b6fa6;
	--itp-accent: #d53f3f;
	--itp-bg: #ffffff;
	--itp-text: #191919;
	--itp-muted: #575757;
	--itp-border: #dadada;
	--itp-surface: #f6f6f6;
	--itp-surface-alt: #eff2f4;
	--itp-black: #000000;
	--itp-container: 1440px;
	--itp-font-size-base: 16px;
	--itp-font-serif: "Noto Serif JP", Georgia, "Times New Roman", Times, serif;
	--itp-font-sans: Roboto, Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: var(--itp-font-size-base);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--itp-bg);
	color: var(--itp-text);
	font-family: var(--itp-font-sans);
	line-height: 1.5;
	overflow-x: clip;
}

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

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

a:hover,
a:focus-visible {
	text-decoration: underline;
}

:focus-visible {
	outline: 2px solid var(--itp-secondary);
	outline-offset: 2px;
}

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

.itp-container {
	width: 100%;
	max-width: var(--itp-container);
	margin-inline: auto;
	padding-inline: 16px;
}

/* ==========================================================================
   1. Solid Black Sticky Top Bar (.b-it-header-nav-chain)
   ========================================================================== */

.itp-nav-chain {
	background-color: var(--itp-black);
	color: #ffffff;
	position: sticky;
	top: 0;
	z-index: 60;
}

.itp-nav-chain__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 48px;
}

.itp-nav-chain__left,
.itp-nav-chain__right {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.itp-nav-chain__btn,
.itp-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	color: inherit;
	padding: 6px;
	cursor: pointer;
}

.itp-drawer__close {
	color: var(--itp-text);
}

.itp-nav-chain__links {
	display: none;
}

.itp-nav-chain__list {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 16px;
	font-size: 0.8rem;
	font-weight: 700;
}

.itp-nav-chain__list a {
	color: #ffffff;
}

.itp-nav-chain__logo {
	font-family: var(--itp-font-serif);
	font-size: 1.35rem;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: -0.02em;
}

.itp-nav-chain__logo:hover {
	text-decoration: none;
}

.itp-social {
	display: flex;
	align-items: center;
	gap: 8px;
}

.itp-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: #ffffff;
	opacity: 0.85;
}

.itp-social__link:hover {
	opacity: 1;
	text-decoration: none;
}

/* Search Bar */
.itp-search-bar {
	background: #161616;
	border-top: 1px solid #2e2e2e;
	padding-block: 12px;
}

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

.search-form label {
	flex: 1;
	min-width: 0;
}

.search-field {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--itp-border);
	background: #ffffff;
	color: var(--itp-text);
	font-size: 0.92rem;
	font-family: inherit;
}

.search-submit,
.itp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 18px;
	border: 0;
	background: var(--itp-primary);
	color: #ffffff;
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	text-decoration: none;
}

/* ==========================================================================
   2. Homepage White Centered Masthead & Solid Black Section Bar
   ========================================================================== */

.itp-hp-masthead {
	background: #ffffff;
	padding-block: 18px 14px;
	text-align: center;
}

.itp-hp-masthead .custom-logo-link {
	display: inline-block;
}

.itp-hp-masthead .custom-logo {
	max-height: 62px;
	width: auto;
	margin-inline: auto;
}

.itp-hp-masthead__title {
	display: inline-block;
	font-family: var(--itp-font-serif);
	font-size: clamp(2.1rem, 5vw, 3.6rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.05;
	color: var(--itp-black);
}

.itp-hp-masthead__title:hover {
	text-decoration: none;
}

.itp-hp-nav {
	background-color: var(--itp-black);
	color: #ffffff;
}

.itp-hp-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 4px;
	overflow-x: auto;
	scrollbar-width: none;
}

.itp-hp-nav__list::-webkit-scrollbar {
	display: none;
}

.itp-hp-nav__list a {
	display: block;
	padding: 11px 10px;
	font-size: 0.8rem;
	font-weight: 700;
	color: #ffffff;
	white-space: nowrap;
}

.itp-hp-nav__list a:hover,
.itp-hp-nav__list li.current-menu-item > a {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Flyout Drawer */
.itp-drawer {
	position: fixed;
	inset: 0;
	z-index: 999;
	pointer-events: none;
	visibility: hidden;
}

.itp-drawer.is-open {
	pointer-events: auto;
	visibility: visible;
}

.itp-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.itp-drawer.is-open .itp-drawer__backdrop {
	opacity: 1;
}

.itp-drawer__panel {
	position: relative;
	width: min(320px, 88vw);
	height: 100%;
	background: #ffffff;
	padding: 18px;
	overflow-y: auto;
	transform: translateX(-100%);
	transition: transform 0.22s ease;
}

.itp-drawer.is-open .itp-drawer__panel {
	transform: translateX(0);
}

.itp-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	margin-bottom: 14px;
	border-bottom: 2px solid var(--itp-black);
}

.itp-drawer__title {
	font-family: var(--itp-font-serif);
	font-weight: 700;
	font-size: 1.2rem;
}

.itp-drawer__search {
	margin-bottom: 16px;
}

.itp-drawer__list,
.itp-drawer__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.itp-drawer__nav li a {
	display: block;
	padding: 9px 4px;
	border-bottom: 1px solid var(--itp-border);
	color: var(--itp-text);
	font-weight: 700;
	font-size: 0.9rem;
}

/* ==========================================================================
   3. Homepage Broadsheet Chains (9+3, 3-Col, 4+4+2+2, 4-Col, Latest+MostRead)
   ========================================================================== */

.itp-hp {
	padding-block: 22px 44px;
}

.itp-chain {
	margin-bottom: 28px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--itp-border);
}

.itp-chain:last-child {
	border-bottom: 0;
}

.itp-chain__header {
	border-top: 2px solid var(--itp-black);
	padding-top: 8px;
	margin-bottom: 16px;
}

.itp-chain__title {
	margin: 0;
	font-family: var(--itp-font-sans);
	font-size: 0.9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--itp-text);
}

.itp-teaser {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.itp-teaser--opinion {
	background: var(--itp-surface-alt);
	padding: 12px;
	border-top: 2px solid var(--itp-primary);
}

.itp-teaser__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--itp-surface);
	margin-bottom: 10px;
}

.itp-teaser__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.itp-kicker {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--itp-primary);
	margin-bottom: 4px;
}

.itp-teaser__headline {
	margin: 0 0 6px;
	font-family: var(--itp-font-serif);
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.24;
	color: var(--itp-text);
}

.itp-teaser--lead .itp-teaser__headline {
	font-size: clamp(1.55rem, 2.8vw, 2.25rem);
	line-height: 1.15;
}

.itp-teaser__summary {
	margin: 0 0 8px;
	font-size: 0.88rem;
	color: var(--itp-muted);
	line-height: 1.45;
}

.itp-teaser__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 0.76rem;
	color: var(--itp-muted);
}

.itp-hero-lead {
	padding-bottom: 18px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--itp-border);
}

.itp-chain--9-3,
.itp-grid-3col,
.itp-grid-4col,
.itp-chain--4-4-2-2,
.itp-chain--latest-most-read,
.itp-cat-archive-grid,
.itp-posts,
.itp-right-rail-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.itp-chain__span-9,
.itp-chain__span-3,
.itp-latest-col,
.itp-mostread-col,
.itp-main,
.itp-sidebar {
	min-width: 0;
}

.itp-chain__span-3 {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.itp-latest-list {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.itp-teaser--list {
	padding-bottom: 16px;
	border-bottom: 1px solid var(--itp-border);
}

.itp-most-read {
	margin: 0;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.itp-most-read__item {
	padding-bottom: 10px;
	border-bottom: 1px solid var(--itp-border);
	font-family: var(--itp-font-serif);
	font-weight: 700;
	font-size: 0.96rem;
	line-height: 1.3;
}

.itp-most-read__link {
	color: var(--itp-text);
}

/* ==========================================================================
   4. Single Post, Right Rail & Archives
   ========================================================================== */

.itp-main-wrap {
	padding-block: 22px 44px;
}

.itp-breadcrumbs {
	font-size: 0.78rem;
	color: var(--itp-muted);
	margin-bottom: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.itp-article__title {
	margin: 6px 0 12px;
	font-family: var(--itp-font-serif);
	font-size: clamp(1.85rem, 3.8vw, 2.75rem);
	line-height: 1.12;
}

.itp-article__standfirst {
	margin: 0 0 16px;
	font-size: 1.14rem;
	line-height: 1.45;
	color: var(--itp-muted);
}

.itp-byline-block {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-block: 10px;
	margin-bottom: 14px;
	border-top: 1px solid var(--itp-border);
	border-bottom: 1px solid var(--itp-border);
}

.itp-byline-block__avatar img {
	border-radius: 50%;
}

.itp-byline-block__meta {
	font-size: 0.84rem;
}

.itp-meta-author a {
	font-weight: 700;
}

.itp-byline-block__sub {
	font-size: 0.78rem;
	color: var(--itp-muted);
}

.itp-share {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block: 14px;
}

.itp-share__btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	font-size: 0.76rem;
	font-weight: 600;
	border: 1px solid var(--itp-border);
	background: #ffffff;
	color: var(--itp-text);
	cursor: pointer;
}

.itp-article__figure {
	margin: 0 0 22px;
}

.itp-article__featured-img {
	width: 100%;
}

.itp-article__caption {
	margin-top: 6px;
	font-size: 0.78rem;
	color: var(--itp-muted);
}

.itp-article__content {
	font-size: 1.05rem;
	line-height: 1.75;
	max-width: 72ch;
}

.itp-article__tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-block: 20px;
}

.itp-article__tags a {
	padding: 3px 10px;
	font-size: 0.78rem;
	background: var(--itp-surface);
	border: 1px solid var(--itp-border);
}

.itp-author-box {
	display: flex;
	gap: 16px;
	padding: 18px;
	background: var(--itp-surface);
	border: 1px solid var(--itp-border);
	margin-block: 24px;
}

.itp-author-box__avatar img {
	border-radius: 50%;
}

.itp-author-box__name {
	margin: 0 0 6px;
	font-family: var(--itp-font-serif);
	font-size: 1.02rem;
}

.itp-post-nav .nav-links {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	margin-block: 24px;
	padding-block: 14px;
	border-top: 1px solid var(--itp-border);
	border-bottom: 1px solid var(--itp-border);
}

.itp-rail-box {
	margin-bottom: 28px;
}

.itp-rail-box__title {
	margin: 0 0 14px;
	padding-top: 8px;
	border-top: 2px solid var(--itp-black);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.05em;
}

.itp-rail-box__list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.itp-teaser--rail {
	flex-direction: row;
	gap: 10px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--itp-border);
}

.itp-teaser--rail .itp-teaser__media {
	flex: 0 0 88px;
	aspect-ratio: 4 / 3;
	margin-bottom: 0;
}

.itp-teaser--rail .itp-teaser__headline {
	font-size: 0.92rem;
}

.itp-archive-header {
	padding-bottom: 14px;
	margin-bottom: 22px;
	border-bottom: 2px solid var(--itp-black);
}

.itp-archive-header__kicker {
	font-size: 0.74rem;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--itp-primary);
}

.itp-archive-header__title {
	margin: 4px 0 6px;
	font-family: var(--itp-font-serif);
	font-size: clamp(1.75rem, 3.2vw, 2.4rem);
}

.itp-author-header {
	display: flex;
	align-items: center;
	gap: 18px;
}

.itp-author-header__avatar img {
	border-radius: 50%;
}

.itp-pagination {
	margin-top: 24px;
}

.itp-pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	gap: 6px;
	margin: 0;
	padding: 0;
}

.itp-pagination a.page-numbers,
.itp-pagination span.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding-inline: 10px;
	border: 1px solid var(--itp-border);
	font-size: 0.85rem;
	font-weight: 700;
}

.itp-pagination span.current {
	background: var(--itp-black);
	border-color: var(--itp-black);
	color: #ffffff;
}

/* ==========================================================================
   5. Two-Tier Broadsheet Footer (.b-it-footer + .b-it-footer__bottom)
   ========================================================================== */

.itp-footer__top {
	background: var(--itp-surface);
	border-top: 1px solid var(--itp-border);
	padding-block: 28px;
}

.itp-footer__links-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 24px;
}

.itp-footer__heading {
	margin: 0 0 10px;
	font-size: 0.82rem;
	font-weight: 700;
	color: rgb(88, 88, 88);
}

.itp-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.84rem;
}

.itp-footer__menu li {
	margin-bottom: 6px;
}

.itp-footer__menu a {
	color: rgb(88, 88, 88);
}

.itp-footer__bottom {
	background: var(--itp-black);
	color: #ffffff;
	padding-block: 24px;
}

.itp-footer__bottom-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.itp-footer__wordmark {
	font-family: var(--itp-font-serif);
	font-size: 1.75rem;
	font-weight: 700;
	color: #ffffff;
}

.itp-footer__wordmark:hover {
	text-decoration: none;
}

.itp-footer__copyright {
	margin: 0;
	font-size: 0.8rem;
	color: #c2c2c2;
}

/* ==========================================================================
   6. Responsive Breakpoints (Tablet & Desktop Irish Times 12-Col Grid)
   ========================================================================== */

@media (min-width: 640px) {
	.itp-teaser--list {
		flex-direction: row;
		gap: 18px;
		align-items: flex-start;
	}

	.itp-teaser--list .itp-teaser__media {
		flex: 0 0 220px;
		margin-bottom: 0;
	}

	.itp-cat-archive-grid,
	.itp-grid-4col {
		grid-template-columns: repeat(2, 1fr);
	}

	.itp-cat-archive-grid > :first-child {
		grid-column: 1 / -1;
	}

	.itp-post-nav .nav-links {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 768px) {
	.itp-nav-chain__links {
		display: block;
	}

	.itp-hp-nav__list {
		justify-content: center;
	}

	/* Split Broadsheet Lead: Headline+Standfirst left, Image right */
	.itp-teaser--lead {
		display: grid;
		grid-template-columns: 1fr 1.25fr;
		gap: 20px;
		align-items: start;
	}

	.itp-teaser--lead .itp-teaser__media {
		order: 2;
		margin-bottom: 0;
	}

	.itp-teaser--lead .itp-teaser__body {
		order: 1;
	}

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

	.itp-grid-3col > .itp-teaser + .itp-teaser {
		padding-left: 18px;
		border-left: 1px solid var(--itp-border);
	}

	.itp-footer__bottom-container {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
	}
}

@media (min-width: 1024px) {
	/* Chain 1: 9 + 3 Columns */
	.itp-chain--9-3 {
		grid-template-columns: 9fr 3fr;
		gap: 24px;
	}

	.itp-chain__span-3 {
		padding-left: 20px;
		border-left: 1px solid var(--itp-border);
	}

	/* Chain 3: 4 + 4 + 2 + 2 Asymmetric Columns */
	.itp-chain--4-4-2-2 {
		grid-template-columns: 4fr 4fr 2fr 2fr;
	}

	.itp-chain--4-4-2-2 > .itp-teaser + .itp-teaser {
		padding-left: 16px;
		border-left: 1px solid var(--itp-border);
	}

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

	.itp-grid-4col > .itp-teaser + .itp-teaser {
		padding-left: 16px;
		border-left: 1px solid var(--itp-border);
	}

	/* Chain 12: Latest Stories + Most Read */
	.itp-chain--latest-most-read {
		grid-template-columns: 8fr 4fr;
		gap: 28px;
	}

	.itp-mostread-col {
		padding-left: 22px;
		border-left: 1px solid var(--itp-border);
	}

	/* Right Rail Single / Archive */
	.itp-right-rail-layout {
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 28px;
	}

	.itp-right-rail-layout .itp-sidebar {
		padding-left: 24px;
		border-left: 1px solid var(--itp-border);
	}
}
