/* ==========================================================================
   Asyana Gardens — Blog (listing, category/tag archives, search, articles)

   Reuses the Bridge framework for everything it already provides:
   layout (.container_inner + .two_columns_66_33), buttons (.qbutton),
   sidebar widgets (.widget > h5), search form (#searchform), pagination
   (bridge_qode_pagination), article typography (theme h2–h6/p/blockquote)
   and the newsletter form style (Bridge CF7 custom style 2).

   This file only styles components Bridge has no equivalent for: hero,
   post cards, CTA boxes, share bar, prev/next. Colours and font come from
   brand-tokens.css. Everything is scoped under .ag-blog.
   ========================================================================== */

.ag-blog {
	--ag-radius: 4px;
	/* Same font stack as the rest of the site (Bridge theme options and
	   custom-styles.css use 'NexaLight', sans-serif), so blog pages match. */
	--ag-font: 'NexaLight', sans-serif;
	font-family: var(--ag-font);
	/* 400 like the site's body text: with no NexaLight font file loaded,
	   300 would render as a thinner fallback (e.g. Helvetica Light) in lists. */
	font-weight: 400;
	color: var(--ag-text);
	background: var(--ag-white);
}

/* Brand font on text elements; beats the site's element rules
   (e.g. h3 { font-family: NexaBold }) without !important. */
.ag-blog :where(h1, h2, h3, h4, h5, h6, p, a, li, span, time, label, blockquote, figcaption, td, th, input, button, textarea) {
	font-family: var(--ag-font);
}

/* The site sets NexaLight !important on every CF7 submit button. */
.ag-blog .ag-newsletter input.wpcf7-form-control.wpcf7-submit {
	font-family: var(--ag-font) !important;
}

.ag-section {
	padding: 64px 0 72px;
}

.ag-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Bridge .qbutton is configured site-wide for dark backgrounds (white text and
   border). On light panels keep Bridge's button, only switch it to ink. */
.ag-blog .qbutton.ag-qbutton-ink {
	color: var(--ag-ink);
	border-color: var(--ag-ink);
}
.ag-blog .qbutton.ag-qbutton-ink:hover {
	color: var(--ag-white);
	background-color: var(--ag-ink);
}

/* Full-bleed photo with a dark overlay (hero + CTA banner) ----------------- */
.ag-hero,
.ag-cta {
	position: relative;
	overflow: hidden;
	background: var(--ag-surface-dark);
	color: var(--ag-white);
}
.ag-cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ag-hero::before,
.ag-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgb(var(--ag-ink-rgb) / 0.8) 0%, rgb(var(--ag-ink-rgb) / 0.5) 50%, rgb(var(--ag-ink-rgb) / 0.2) 100%);
}

/* Hero --------------------------------------------------------------------- */
.ag-hero {
	display: flex;
	align-items: flex-end;
	min-height: 560px;
}
.ag-single .ag-hero::before {
	background: linear-gradient(0deg, rgb(var(--ag-ink-rgb) / 0.82) 0%, rgb(var(--ag-ink-rgb) / 0.3) 100%);
}
.ag-hero__content {
	position: relative;
	z-index: 2;
	padding: 200px 0 64px; /* clears the transparent site header + social bar */
}
.ag-blog .ag-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
	font-size: 13px;
}
.ag-blog .ag-breadcrumb,
.ag-blog .ag-breadcrumb a {
	color: rgb(var(--ag-white-rgb) / 0.8);
}
.ag-blog .ag-breadcrumb a:hover {
	color: var(--ag-white);
}
.ag-eyebrow {
	margin-bottom: 12px;
	font-size: 13px;
	font-weight: var(--ag-weight-bold);
	letter-spacing: 3px;
	text-transform: uppercase;
}
.ag-blog .ag-hero__title {
	max-width: 760px;
	margin: 0 0 16px;
	font-size: clamp(30px, 4.4vw, 54px);
	font-weight: var(--ag-weight-bold);
	line-height: 1.1;
	color: var(--ag-white);
}
.ag-hero__lead {
	max-width: 560px;
	font-size: 17px;
	line-height: 1.65;
	color: rgb(var(--ag-white-rgb) / 0.9);
}
.ag-hero .ag-meta {
	color: rgb(var(--ag-white-rgb) / 0.85);
}

/* Category badge + logo-dot accent ------------------------------------------ */
.ag-blog .ag-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
	padding: 6px 12px;
	font-size: 11px;
	font-weight: var(--ag-weight-bold);
	letter-spacing: 1.5px;
	line-height: 1;
	text-transform: uppercase;
	color: var(--ag-white);
	background: var(--ag-ink);
}
.ag-blog .ag-badge:hover {
	background: var(--ag-ink-hover);
}
.ag-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ag-blue);
}
.ag-dot--1 { background: var(--ag-orange); }
.ag-dot--2 { background: var(--ag-maroon); }
.ag-dot--3 { background: var(--ag-green); }

/* Date · reading time (cards and article hero) */
.ag-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
	margin-bottom: 12px;
	font-size: 11px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--ag-muted);
}

/* Post cards ---------------------------------------------------------------- */
.ag-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}
.ag-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--ag-white);
	border: 1px solid var(--ag-line);
	border-radius: var(--ag-radius);
	transition: box-shadow 0.25s ease;
}
.ag-card:hover {
	box-shadow: 0 12px 30px rgb(var(--ag-ink-rgb) / 0.08);
}
.ag-card__media {
	display: block;
	aspect-ratio: 3 / 2;
	background: var(--ag-soft);
}
.ag-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ag-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	padding: 22px;
}
.ag-grid .ag-badge {
	position: relative;
	margin-top: -36px; /* badge overlaps the image edge, as in the design */
}
.ag-blog .ag-card__title {
	margin: 0 0 8px;
	font-size: 19px;
	font-weight: var(--ag-weight-bold);
	font-style: normal;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}
.ag-blog .ag-card__title a {
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	color: var(--ag-ink);
}
.ag-blog .ag-card__excerpt {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.65;
}
.ag-blog .ag-readmore {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	font-size: 12px;
	font-weight: var(--ag-weight-bold);
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--ag-ink);
}
.ag-blog .ag-readmore:hover {
	text-decoration: underline;
}

/* Featured (first) post */
.ag-card--featured {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	margin-bottom: 24px;
	background: var(--ag-soft);
	border-color: var(--ag-soft);
}
.ag-card--featured .ag-card__media {
	aspect-ratio: auto;
	min-height: 320px;
}
.ag-card--featured .ag-card__body {
	justify-content: center;
	padding: 36px;
}
.ag-blog .ag-card--featured .ag-card__title {
	font-size: clamp(22px, 2.2vw, 28px);
}

/* Empty state */
.ag-empty {
	padding: 56px 40px;
	text-align: center;
	background: var(--ag-soft);
	border-radius: var(--ag-radius);
}
.ag-empty .ag-actions {
	justify-content: center;
	margin-top: 24px;
}

/* Sidebar: Bridge widgets; only the newsletter panel is custom ------------- */
.ag-newsletter {
	padding: 28px 24px;
	background: var(--ag-ink);
	border-radius: var(--ag-radius);
}
.ag-blog .ag-newsletter .ag-newsletter__title {
	margin: 0 0 8px;
	color: var(--ag-white);
}
.ag-newsletter__text {
	margin-bottom: 18px;
	font-size: 14px;
	line-height: 1.6;
	color: rgb(var(--ag-white-rgb) / 0.8);
}
.ag-blog .ag-newsletter .wpcf7-not-valid-tip {
	color: var(--ag-orange); /* 6.2:1 on --ag-ink */
}

/* CTA banner ---------------------------------------------------------------- */
.ag-cta-wrap {
	padding-bottom: 80px;
}
.ag-cta {
	border-radius: var(--ag-radius);
}
.ag-cta__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 52px 56px;
}
.ag-blog .ag-cta__title {
	margin: 0 0 8px;
	color: var(--ag-white);
}
.ag-cta__text {
	max-width: 520px;
	color: rgb(var(--ag-white-rgb) / 0.85);
}

/* Article ------------------------------------------------------------------- */
.ag-blog .ag-article__lead {
	margin-bottom: 28px;
	padding-bottom: 24px;
	font-size: 19px;
	line-height: 1.6;
	border-bottom: 1px solid var(--ag-line);
}
/* Typography comes from Bridge; only media needs constraining. */
.ag-prose img {
	max-width: 100%;
	height: auto;
}
.ag-prose figure,
.ag-prose .wp-caption {
	max-width: 100%;
	margin: 2em 0;
	text-align: center;
}
.ag-prose figcaption,
.ag-prose .wp-caption-text {
	margin-top: 8px;
	font-size: 13px;
	color: var(--ag-muted);
}
.ag-prose iframe,
.ag-prose video {
	max-width: 100%;
}

/* Article body: spacing, headings, lists, tables and the "In this article"
   table of contents (built in include/blog.php). */
/* No html { scroll-behavior: smooth }: it slows Bridge's jQuery scroll
   animations (back-to-top button) to a crawl. TOC links scroll smoothly via
   a small script in include/blog.php instead. */
.ag-prose h2,
.ag-prose h3 {
	scroll-margin-top: 120px; /* clear the fixed header on jump links */
}
.ag-blog .ag-prose > p {
	margin: 0 0 1.1em;
}
.ag-blog .ag-prose > h2 {
	margin: 1.8em 0 0.6em;
}
.ag-blog .ag-prose > h3 {
	margin: 1.5em 0 0.5em;
	font-style: normal;
	font-weight: var(--ag-weight-bold);
	color: var(--ag-ink);
}
.ag-blog .ag-prose > ul,
.ag-blog .ag-prose > ol {
	margin: 0 0 1.4em;
	padding-left: 26px;
}
.ag-blog .ag-prose > ul {
	list-style: disc outside;
}
.ag-blog .ag-prose > ol {
	list-style: decimal outside;
}
.ag-blog .ag-prose > ul > li,
.ag-blog .ag-prose > ol > li {
	margin: 0 0 8px;
	padding-left: 6px;
	line-height: 1.6;
}

.ag-blog .ag-toc {
	margin: 28px 0 36px;
	padding: 22px 26px;
	background: var(--ag-soft);
	border-left: 4px solid var(--ag-ink);
}
.ag-blog .ag-toc__title {
	margin: 0 0 10px;
	font-size: 17px;
	font-weight: var(--ag-weight-bold);
	color: var(--ag-ink);
}
.ag-blog .ag-toc ol {
	margin: 0;
	padding-left: 22px;
	list-style: decimal outside;
}
.ag-blog .ag-toc li {
	margin: 6px 0;
	padding-left: 4px;
}
.ag-blog .ag-toc a {
	text-decoration: none;
}
.ag-blog .ag-toc a:hover {
	text-decoration: underline;
}

.ag-table-wrap {
	margin: 24px 0 28px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}
.ag-blog .ag-prose table {
	width: 100%;
	min-width: 560px; /* narrower screens scroll the wrapper sideways */
	margin: 0;
	/* separate (not collapse): collapsed outer borders spill ~0.5px past
	   width:100%, which made the wrapper scrollable on desktop and flashed
	   a scrollbar under the table while scrolling the page. */
	border-collapse: separate;
	border-spacing: 0;
	border-top: 1px solid var(--ag-line);
	border-left: 1px solid var(--ag-line);
	font-size: 15px;
	line-height: 1.5;
}
.ag-blog .ag-prose caption {
	caption-side: top;
	padding: 0 0 8px;
	text-align: left;
	font-weight: var(--ag-weight-bold);
	color: var(--ag-ink);
}
.ag-blog .ag-prose th,
.ag-blog .ag-prose td {
	padding: 12px 14px;
	border: 0;
	border-right: 1px solid var(--ag-line);
	border-bottom: 1px solid var(--ag-line);
	text-align: left;
	vertical-align: top;
}
.ag-blog .ag-prose th {
	background: var(--ag-ink);
	border-bottom-color: var(--ag-ink);
	color: var(--ag-white);
	font-weight: var(--ag-weight-bold);
}
.ag-blog .ag-prose tbody tr:nth-child(even) td {
	background: var(--ag-soft);
}
.ag-blog .ag-prose td:first-child {
	font-weight: var(--ag-weight-bold);
	color: var(--ag-ink);
}

/* FAQ accordion: [asyana_faq] (include/blog.php) */
.ag-faq {
	margin: 2.4em 0;
}
.ag-blog .ag-faq__title {
	margin: 0 0 0.8em;
}
.ag-faq__item {
	background: var(--ag-white);
	border: 1px solid var(--ag-line);
	border-radius: var(--ag-radius);
}
.ag-faq__item + .ag-faq__item {
	margin-top: 10px;
}
.ag-faq__item[open] {
	border-color: var(--ag-ink);
}
.ag-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	cursor: pointer;
	list-style: none;
}
.ag-faq__q::-webkit-details-marker {
	display: none;
}
.ag-faq__q:focus-visible {
	outline: 2px solid var(--ag-ink);
	outline-offset: 2px;
}
.ag-blog .ag-faq__question {
	margin: 0;
	font-size: 17px;
	font-style: normal;
	font-weight: var(--ag-weight-bold);
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ag-ink);
}
/* Plus that turns into a minus when open */
.ag-faq__icon {
	position: relative;
	flex: none;
	width: 14px;
	height: 14px;
}
.ag-faq__icon::before,
.ag-faq__icon::after {
	content: '';
	position: absolute;
	top: 6px;
	left: 0;
	width: 14px;
	height: 2px;
	background: var(--ag-ink);
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.ag-faq__icon::after {
	transform: rotate(90deg);
}
.ag-faq__item[open] .ag-faq__icon::after {
	transform: rotate(0deg);
	opacity: 0;
}
.ag-faq__a {
	padding: 0 20px 18px;
}
.ag-faq__a > :last-child {
	margin-bottom: 0;
}
@media (prefers-reduced-motion: reduce) {
	.ag-faq__icon::before,
	.ag-faq__icon::after {
		transition: none;
	}
}

/* End-of-article / [asyana_cta] box; newsletter via [asyana_newsletter] */
.ag-inline-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	margin: 40px 0;
	padding: 28px 32px;
	background: var(--ag-soft);
	border-left: 4px solid var(--ag-ink);
}
.ag-inline-cta__body {
	flex: 1 1 300px;
}
.ag-inline-cta__title {
	margin-bottom: 6px;
	font-size: 20px;
	font-weight: var(--ag-weight-bold);
	line-height: 1.3;
	color: var(--ag-ink);
}
.ag-prose .ag-newsletter {
	margin: 40px 0;
}

/* Tags + share */
.ag-article__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 0;
	border-top: 1px solid var(--ag-line);
	border-bottom: 1px solid var(--ag-line);
}
.ag-tags,
.ag-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ag-blog .ag-tags a {
	display: inline-block;
	padding: 6px 12px;
	font-size: 13px;
	color: var(--ag-text);
	background: var(--ag-soft);
}
.ag-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-left: auto;
}
.ag-share__label {
	font-size: 12px;
	font-weight: var(--ag-weight-bold);
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--ag-ink);
}
.ag-blog .ag-share__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: var(--ag-ink);
	background: var(--ag-white);
	border: 1px solid var(--ag-line);
	border-radius: 50%;
	cursor: pointer;
}
.ag-blog .ag-share__btn:hover,
.ag-blog .ag-share__btn:focus-visible {
	color: var(--ag-white);
	background: var(--ag-ink);
	border-color: var(--ag-ink);
}
.ag-share__status {
	font-size: 13px;
	color: var(--ag-muted);
}

/* Previous / next */
.ag-post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 32px;
}
.ag-blog .ag-post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 20px 22px;
	border: 1px solid var(--ag-line);
}
.ag-blog .ag-post-nav__link:hover {
	border-color: var(--ag-ink);
}
.ag-post-nav__link--next {
	grid-column: 2;
	text-align: right;
}
.ag-post-nav__dir {
	font-size: 12px;
	font-weight: var(--ag-weight-bold);
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--ag-muted);
}
.ag-post-nav__title {
	font-weight: var(--ag-weight-bold);
	color: var(--ag-ink);
}

.ag-related {
	margin-top: 56px;
}
.ag-blog .widget #searchform {
	border: 1px solid var(--ag-line);
	border-radius: var(--ag-radius);
}
.ag-blog .widget #searchform:focus-within {
	border-color: var(--ag-ink);
}
.ag-blog .ag-prose h2 {
	font-family: var(--ag-font);
	font-weight: var(--ag-weight-bold);
	font-size: 24px;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ag-ink);
	margin: 36px 0 12px;
}
@media (max-width: 600px) {
	.ag-blog .ag-prose h2 { font-size: 20px; }
}

/* Responsive (Bridge stacks .two_columns_66_33 at 600px) --------------------- */
@media (max-width: 1000px) {
	.ag-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.ag-card--featured {
		grid-template-columns: 1fr;
	}
	.ag-card--featured .ag-card__media {
		aspect-ratio: 16 / 9;
		min-height: 0;
	}
}

@media (max-width: 600px) {
	.ag-hero {
		min-height: 460px;
	}
	.ag-hero__content {
		padding: 200px 0 44px; /* mobile header + social icon row */
	}
	.ag-section {
		padding: 44px 0 56px;
	}
	.ag-grid,
	.ag-post-nav {
		grid-template-columns: minmax(0, 1fr);
	}
	.ag-post-nav__link--next {
		grid-column: auto;
	}
	.ag-card--featured .ag-card__body,
	.ag-cta__content,
	.ag-inline-cta {
		padding: 28px 20px;
	}
	.ag-share {
		margin-left: 0;
	}
	.ag-cta-wrap {
		padding-bottom: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ag-card {
		transition: none;
	}
}
