/*
Theme Name: Popline
Theme URI: https://www.apexcellar.com.hk
Author: apexcellar editorial
Author URI: https://www.apexcellar.com.hk
Description: Charcoal pop magazine theme for www.apexcellar.com.hk. Skin: Charcoal Pop.
Template: astra
Version: 1.0.3
License: GNU General Public License v2 or later
Text Domain: popline
*/

:root {
	--ap-char: #262626;
	--ap-char-deep: #1a1a1a;
	--ap-pop: #ff5a47;
	--ap-bg: #ececec;
	--ap-card: #ffffff;
	--ap-ink: #232323;
	--ap-ink-soft: #6e6e6e;
	--ap-line: #dcdcdc;
	--ap-radius: 10px;
	--ap-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	--ap-font-head: 'Noto Sans TC', 'PingFang HK', sans-serif;
	--ap-font-body: 'Noto Sans HK', 'PingFang HK', sans-serif;
}

html {
	font-size: 16px;
}

body,
button,
input,
select,
textarea {
	font-family: var(--ap-font-body);
	color: var(--ap-ink);
	background: var(--ap-bg);
}

h1, h2, h3, h4, h5, h6,
.entry-title, .page-title, .widget-title {
	font-family: var(--ap-font-head);
	font-weight: 800;
	color: var(--ap-ink);
	letter-spacing: -0.01em;
}

a {
	color: var(--ap-ink);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover,
a:focus {
	color: var(--ap-pop);
	border-bottom-color: var(--ap-pop);
}

.cj-wrap,
.ap-wrap {
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 20px;
}

.ast-container {
	max-width: 1440px;
}

/* ---- Narrow-container override (SPEC §4, v2 with vars) ---- */
@media (min-width: 922px) {
	.ast-narrow-container .site-content > .ast-container,
	.ast-separate-container.ast-narrow-container .site-content > .ast-container {
		max-width: 1440px !important;
		margin-left: auto;
		margin-right: auto;
	}
}

.ast-narrow-container {
	--ast-content-width-size: 920px;
	--ast-narrow-container-width: 1440px;
	--wp--custom--ast-content-width-size: 920px;
	--wp--custom--ast-wide-width-size: 920px;
}

/* ---- Header: H5 minimal ---- */
.site-header {
	background: #ffffff;
	border-bottom: 1px solid var(--ap-line);
}

.site-title,
.site-title a {
	font-family: var(--ap-font-head) !important;
	font-weight: 900;
	letter-spacing: -0.02em;
	color: var(--ap-char) !important;
	border-bottom: none !important;
}

.site-title a:hover {
	color: var(--ap-pop) !important;
}

/* ---- Category bar: light, left-aligned, underline links ---- */
.ap-catbar {
	background: var(--ap-char);
	padding: 9px 0;
}

.ap-catbar ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
	margin: 0;
	padding: 0;
	justify-content: flex-start;
}

.ap-catbar a {
	color: #e8e8e8;
	font-size: 0.84rem;
	font-weight: 500;
	padding: 3px 0;
	border-bottom: 2px solid transparent !important;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.ap-catbar a:hover {
	color: var(--ap-pop);
	border-bottom-color: var(--ap-pop) !important;
}

/* ---- Magazine home (variant C: blocks first, no hero) ---- */
.ap-mag {
	padding: 30px 0 44px;
}

.ap-sec {
	margin-bottom: 42px;
}

.ap-sec-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 14px;
}

.ap-sec-num {
	font-family: var(--ap-font-head);
	font-weight: 900;
	font-size: 1.5rem;
	color: var(--ap-pop);
	margin-right: 8px;
}

.ap-sec-title {
	font-family: var(--ap-font-head);
	font-weight: 800;
	font-size: 1.25rem;
	color: var(--ap-char);
}

.ap-sec-more {
	font-size: 0.84rem;
	color: var(--ap-ink-soft) !important;
	white-space: nowrap;
}

.ap-sec-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

/* overlay cards */
.ap-card {
	position: relative;
	height: 240px;
	border-radius: var(--ap-radius);
	overflow: hidden;
	background: var(--ap-char);
}

.ap-card-media {
	display: block;
	position: absolute;
	inset: 0;
	border-bottom: none !important;
}

.ap-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease-out;
}

.ap-card:hover .ap-card-media img {
	transform: scale(1.04);
}

.ap-card-noimg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ap-char-deep);
	color: var(--ap-pop);
	font-size: 0.9rem;
	letter-spacing: 0.1em;
}

.ap-card-ovl {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(20, 20, 20, 0) 32%, rgba(20, 20, 20, 0.88) 100%);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 16px;
	gap: 6px;
}

.ap-card-tag {
	align-self: flex-start;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--ap-pop) !important;
	background: rgba(255, 255, 255, 0.14);
	border-radius: 4px;
	padding: 2px 10px;
	border-bottom: none !important;
}

.ap-card-title {
	font-family: var(--ap-font-head);
	font-size: 1.02rem;
	font-weight: 800;
	line-height: 1.4;
	margin: 0;
}

.ap-card-title a {
	color: #ffffff;
	border-bottom: none !important;
}

.ap-card-title a:hover {
	color: var(--ap-pop);
}

.ap-card-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.74rem;
	color: #cfcfcf;
}

/* Z5 latest: numbered 2-col list */
.ap-latest-grid {
	background: var(--ap-card);
	border: 1px solid var(--ap-line);
	border-radius: var(--ap-radius);
	padding: 18px 22px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 34px;
}

.ap-latest-item {
	display: flex;
	gap: 10px;
	align-items: baseline;
	padding: 6px 0;
	border-bottom: 1px solid var(--ap-bg);
	font-size: 0.92rem;
	line-height: 1.55;
}

.ap-latest-num {
	font-family: var(--ap-font-head);
	font-weight: 900;
	color: var(--ap-pop);
	flex: 0 0 auto;
}

.ap-latest-item a {
	color: var(--ap-ink);
	border-bottom: none !important;
}

.ap-latest-item a:hover {
	color: var(--ap-pop);
}

/* Z6 picks: inline flow */
.ap-picks {
	background: var(--ap-card);
	border: 1px solid var(--ap-line);
	border-radius: var(--ap-radius);
	padding: 16px 22px;
	line-height: 2.1;
	font-size: 0.9rem;
}

.ap-picks a {
	color: var(--ap-ink) !important;
	border-bottom: none !important;
	margin-right: 4px;
}

.ap-picks a:hover {
	color: var(--ap-pop) !important;
}

.ap-picks .ap-dot {
	color: var(--ap-pop);
	margin: 0 6px;
}

/* ---- Content + LEFT sidebar ---- */
.site-content .ast-container {
	display: flex;
	flex-direction: row;
	gap: 32px;
	align-items: flex-start;
}

.site-content .ast-container #secondary {
	order: -1;
	flex: 0 0 320px;
	min-width: 320px;
}

.site-content .ast-container #primary {
	flex: 1 1 auto;
}

@media (max-width: 921px) {
	.site-content .ast-container {
		flex-direction: column;
	}
	.site-content .ast-container #secondary {
		order: 0;
		flex: 1 1 auto;
		min-width: 0;
		width: auto;
	}
}

#secondary .widget {
	background: var(--ap-card);
	border: 1px solid var(--ap-line);
	border-top: 3px solid var(--ap-pop);
	border-radius: var(--ap-radius);
	padding: 16px 18px;
	margin-bottom: 20px;
}

#secondary .widget-title {
	font-size: 0.92rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	margin-bottom: 10px;
}

#secondary ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

#secondary li {
	padding: 5px 0;
	border-bottom: 1px solid var(--ap-bg);
	font-size: 0.9rem;
}

/* ---- Single post ---- */
.single .site-content .ast-container #primary {
	max-width: 980px;
	margin-left: auto;
	margin-right: auto;
}

.single .entry-title {
	font-size: 1.7rem;
	line-height: 1.35;
}

.single .entry-content {
	font-size: 1.02rem;
	line-height: 1.85;
}

.single .entry-content h2 {
	font-size: 1.25rem;
	margin-top: 2em;
	padding-left: 14px;
	border-left: 4px solid var(--ap-pop);
}

blockquote {
	border-left: 4px solid var(--ap-pop);
	background: #ffffff;
	margin: 1.5em 0;
	padding: 14px 18px;
	color: var(--ap-ink-soft);
}

/* ---- Pagination ---- */
.ast-pagination .page-numbers,
.pagination .page-numbers {
	border: 1px solid var(--ap-line);
	border-radius: var(--ap-radius);
	padding: 6px 14px;
	color: var(--ap-ink);
	background: #ffffff;
}

.ast-pagination .page-numbers.current,
.pagination .page-numbers.current {
	background: var(--ap-char);
	color: #ffffff;
	border-color: var(--ap-char);
}

/* ---- Footer ---- */
.site-footer {
	background: var(--ap-char-deep);
	color: #b8b8b8;
	font-size: 0.8rem;
}

.site-footer a {
	color: #d6d6d6;
	border-bottom: none;
}

/* ---- Search ---- */
.search-form .search-field,
.widget_search .search-field {
	border: 1px solid var(--ap-line);
	border-radius: var(--ap-radius);
	background: #ffffff;
	padding: 8px 10px;
}

.search-form .search-submit,
.widget_search .search-submit {
	background: var(--ap-char);
	color: #ffffff;
	border: none;
	border-radius: var(--ap-radius);
	padding: 8px 16px;
	white-space: nowrap;
	cursor: pointer;
}

/* ---- Screen-reader safety ---- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

@media (max-width: 921px) {
	.ap-sec-row {
		grid-template-columns: repeat(2, 1fr);
	}

	.ap-latest-grid {
		grid-template-columns: 1fr;
	}

	.ap-card {
		height: 220px;
	}
}

@media (max-width: 544px) {
	.ap-sec-row {
		grid-template-columns: 1fr;
	}

	.ap-card {
		height: 200px;
	}
}
