/*
Theme Name: Advisorator
Description: Newsletter-first block theme for Advisorator: member-aware header (Memberful), signup section, latest issue, featured stories, and a Substack-style archive with infinite scroll.
Version: 1.8.3
Requires at least: 6.6
Tested up to: 7.2
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: advisorator
*/

/* ---------- Basics ---------- */
:root {
	--cc-gutter: clamp(16px, 4vw, 24px);
	--cc-radius: 12px;
}
body { -webkit-font-smoothing: antialiased; }
.wp-site-blocks > * { margin-block-start: 0; }
.cc-kicker {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.cc-section {
	padding: 44px var(--cc-gutter);
}
.cc-section__title { margin: 0 0 20px; }
.wp-block-post-title a:hover,
.cc-card__title a:hover { text-decoration: underline; color: var(--wp--preset--color--accent); }

/* ---------- Header ---------- */
.cc-header {
	/* Matches the logo image's own background (#587A6C) so no box shows around it */
	background: #587A6C;
	padding: 0 var(--cc-gutter);
}
.cc-header .cc-logo { margin: 0; line-height: 0; }
.cc-header .cc-logo a { display: inline-block; }
.cc-header .cc-logo img {
	display: block;
	height: 44px; /* same height as the Subscribe button */
	width: auto;
	max-width: 100%;
	/* If the logo can't load, the alt text shows in the site-name style */
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.375rem;
	line-height: 44px;
	color: #FFFFFF;
}
.cc-header__bar {
	min-height: 60px;
	gap: 0 36px !important;
}
.cc-header .wp-block-site-title { margin: 0; white-space: nowrap; }
.cc-header .cc-nav { gap: 28px; }
.cc-header .cc-nav .wp-block-navigation-item__content {
	display: inline-block;
	padding: 8px 0;
	color: #FFFFFF;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}
.cc-header .cc-nav .wp-block-navigation-item__content:hover { color: #FFFFFF; }
.cc-header .cc-nav .current-menu-item > .wp-block-navigation-item__content {
	color: #FFFFFF;
	border-bottom-color: #FFFFFF;
}
.cc-header nav.cc-nav { margin-left: auto; }
.cc-header__cta { margin-left: 0 !important; }
.cc-header__cta .wp-block-button__link {
	padding: 10px 20px;
	font-size: 0.9375rem;
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--ink);
}
.cc-header__cta .wp-block-button__link:hover,
.cc-header__cta .wp-block-button__link:focus {
	background: #FFFFFF;
	color: var(--wp--preset--color--ink);
}

/* Tablets and phones: logo + Subscribe on one row, menu on its own row below */
@media (max-width: 1120px) {
	.cc-header { padding-top: 12px; }
	.cc-header__bar { gap: 0 12px !important; min-height: 0; }
	.cc-header__cta { margin-left: auto !important; }
	.cc-header nav.cc-nav {
		order: 3;
		flex-basis: 100%;
		margin-left: 0;
		margin-top: 10px;
		overflow-x: auto;
		scrollbar-width: none;
		border-top: 1px solid rgba(255, 255, 255, 0.2);
		gap: 24px;
	}
	.cc-header .cc-nav .wp-block-navigation-item__content { padding: 12px 0; }
	/* A grid rather than flexbox here: Safari on iPhone didn't let the logo
	   shrink in the flex row, which made the whole page wider than the screen.
	   Row 1: logo (takes whatever room is left, up to full size), search,
	   Subscribe. Row 2: the menu. */
	.cc-header__bar {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) auto auto;
		align-items: center;
	}
	.cc-header .cc-logo { grid-column: 1; grid-row: 1; min-width: 0; }
	.cc-header .cc-search-toggle { grid-column: 2; grid-row: 1; }
	.cc-header__cta { grid-column: 3; grid-row: 1; }
	.cc-header nav.cc-nav { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
	.cc-header .cc-logo a { display: block; max-width: 380px; }
	.cc-header .cc-logo img {
		height: auto;
		width: 100%;
		line-height: 1.2;
	}
}
@media (max-width: 640px) {
	.cc-header__bar { gap: 0 10px !important; }
	.cc-header__cta .wp-block-button__link { padding: 8px 12px; font-size: 0.875rem; }
	.cc-header nav.cc-nav, .cc-header ul.cc-nav { gap: 20px; }
	.cc-header .cc-nav .wp-block-navigation-item__content { white-space: nowrap; }
	.cc-header .cc-logo img { font-size: 1.125rem; }
}

/* ---------- Hero / subscribe ---------- */
.cc-hero {
	background: #F7F7F7;
	border-bottom: 1px solid #E6E6E6;
	padding: 48px var(--cc-gutter) 44px;
	text-align: center;
}
.cc-hero > * { margin-left: auto !important; margin-right: auto !important; }
.cc-hero__title { margin-top: 0 !important; }
.cc-hero__lede {
	max-width: 620px;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--body);
}
.cc-subscribe-form { max-width: 540px; margin-top: 20px !important; }
.cc-form-placeholder {
	padding: 18px;
	border: 2px dashed var(--wp--preset--color--accent);
	border-radius: 8px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	font-size: 0.9375rem;
	text-align: center;
}
@media (max-width: 640px) {
	.cc-hero { padding-top: 32px; padding-bottom: 32px; }
	.cc-hero__lede { font-size: 1rem; }
}

/* ---------- Latest newsletter ---------- */
.cc-latest { padding-top: 40px; padding-bottom: 8px; }
.cc-latest .wp-block-post-template { margin-top: 0; }
.cc-latest__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 28px;
	align-items: center;
}
.cc-latest__item > * { margin: 0 !important; }
.cc-latest__item .wp-block-post-featured-image img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--cc-radius);
	width: 100%;
	height: auto;
}
.cc-latest__body > * + * { margin-top: 10px !important; }
.cc-latest__title { font-size: 1.75rem !important; line-height: 1.2; }
.cc-latest__body .wp-block-post-excerpt__excerpt { font-size: 1.0625rem; margin: 0; }
.cc-latest__body .wp-block-post-excerpt__more-text { margin-top: 10px; }
.cc-latest__body .wp-block-post-excerpt__more-link { font-weight: 600; text-decoration: none; }
.cc-latest__item:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 1fr; }
@media (max-width: 760px) {
	.cc-latest__item { grid-template-columns: 1fr; gap: 16px; }
	.cc-latest__title { font-size: 1.5rem !important; }
}

/* ---------- Feature cards ---------- */
.cc-features {
	background: var(--wp--preset--color--tint-soft);
	border-top: 1px solid var(--wp--preset--color--line);
	border-bottom: 1px solid var(--wp--preset--color--line);
	margin-top: 40px !important;
	padding-top: 40px;
}
.cc-features__grid { gap: 20px !important; margin-bottom: 0; }
.cc-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--cc-radius);
	overflow: hidden;
}
.cc-card > * { margin: 0 !important; }
.cc-card__img img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.cc-card__title { padding: 16px 18px 0; }
.cc-card__title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.cc-card__text {
	padding: 6px 18px 18px;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--muted);
}

/* ---------- Meet your guide ---------- */
.cc-guide { gap: 28px; }
.cc-guide__row { gap: 28px !important; align-items: center !important; }
.cc-guide__photo { flex: 0 0 96px; margin: 0 !important; }
.cc-guide__photo img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.cc-guide__text > * + * { margin-top: 10px !important; }
.cc-guide__text p:not(.cc-kicker) { margin: 0; color: var(--wp--preset--color--body); }
@media (max-width: 640px) {
	.cc-guide__row { flex-direction: column; align-items: flex-start !important; }
}

/* ---------- Archive ---------- */
.cc-archive { padding-top: 36px; padding-bottom: 8px; }
.cc-archive__head { margin-bottom: 24px !important; gap: 16px !important; }
.cc-archive__title { margin: 0; font-size: 1.625rem; }
.cc-archive .wp-block-search { flex: 0 1 300px; }
.cc-archive .wp-block-search__input {
	border: 1px solid #A9BBB3;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 0.9375rem;
}
.cc-archive .wp-block-search__button { border-radius: 8px; margin-left: 8px; }
.cc-archive__list .wp-block-post-template { margin: 0; }
.cc-archive__list .wp-block-post { margin: 0 !important; }

.cc-item {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); /* thumbnail ≈ 30% of the row */
	gap: 16px 24px;
	align-items: center;
	padding: 20px 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.cc-item > * { margin: 0 !important; }
.cc-item .wp-block-post-featured-image { grid-column: 2; grid-row: 1; }
.cc-item .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 8px;
	height: auto;
}
.cc-item__body { grid-column: 1; grid-row: 1; }
.cc-item__body > * + * { margin-top: 6px !important; }
.cc-item__body .wp-block-post-title { font-size: 1.25rem; line-height: 1.25; margin: 0; }
.cc-item__body .wp-block-post-excerpt__excerpt { margin: 0; font-size: 0.9375rem; color: var(--wp--preset--color--muted); }
.cc-item:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 1fr; }

/* First story on page one: bigger image on the left, headline and summary on the right */
body:not(.paged) .cc-archive__list .wp-block-post:first-child .cc-item {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 28px;
	padding-top: 0;
	padding-bottom: 24px;
}
body:not(.paged) .cc-archive__list .wp-block-post:first-child .wp-block-post-featured-image { grid-column: 1; grid-row: 1; }
body:not(.paged) .cc-archive__list .wp-block-post:first-child .cc-item__body { grid-column: 2; grid-row: 1; text-align: center; }
body:not(.paged) .cc-archive__list .wp-block-post:first-child .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	border-radius: var(--cc-radius);
}
body:not(.paged) .cc-archive__list .wp-block-post:first-child .wp-block-post-title { font-size: 1.625rem; line-height: 1.2; }
body:not(.paged) .cc-archive__list .wp-block-post:first-child .wp-block-post-excerpt__excerpt { font-size: 1.0625rem; color: var(--wp--preset--color--body); }
body:not(.paged) .cc-archive__list .wp-block-post:first-child .cc-item:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 1fr; }
body:not(.paged) .cc-archive__list .wp-block-post:first-child .cc-item:not(:has(.wp-block-post-featured-image)) .cc-item__body { grid-column: 1; text-align: left; }
@media (max-width: 640px) {
	body:not(.paged) .cc-archive__list .wp-block-post:first-child .cc-item { grid-template-columns: 1fr; gap: 16px; padding-bottom: 28px; }
	body:not(.paged) .cc-archive__list .wp-block-post:first-child .cc-item__body { grid-column: 1; grid-row: 2; text-align: left; }
}

.cc-archive .wp-block-query-pagination { margin: 28px 0 36px; font-weight: 600; gap: 20px; }
.cc-archive .wp-block-query-pagination-numbers { display: flex; gap: 6px; }
.cc-archive .wp-block-query-pagination a,
.cc-archive .wp-block-query-pagination .page-numbers { text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.cc-archive .wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--tint); color: var(--wp--preset--color--ink); }
.cc-archive .wp-block-query-pagination a:hover { background: var(--wp--preset--color--tint); }

@media (max-width: 640px) {
	.cc-archive { padding-top: 24px; }
	.cc-archive__title { font-size: 1.5rem; }
	.cc-archive .wp-block-search { flex-basis: 100%; }
	.cc-item { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 14px; padding: 20px 0; align-items: start; }
	.cc-item .wp-block-post-featured-image img { aspect-ratio: 1 / 1; }
	.cc-item__body .wp-block-post-title { font-size: 1.125rem; }
	.cc-item__body .wp-block-post-excerpt__excerpt { font-size: 0.875rem; }
}

/* ---------- Single posts and pages ---------- */
.cc-single { padding-top: 36px; }
.cc-single .wp-block-post-title { margin-top: 10px; font-size: clamp(1.625rem, 3.5vw, 2rem); line-height: 1.2; }
.cc-single h1.wp-block-heading { font-size: clamp(1.625rem, 3.5vw, 2rem); }
.cc-single .wp-block-post-content { margin-top: 24px; }
.cc-single .wp-block-post-content img { border-radius: 8px; height: auto; }

/* ---------- Subscribe band ---------- */
.cc-cta {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	text-align: center;
	padding: 40px var(--cc-gutter);
}
.cc-cta > * { margin-left: auto !important; margin-right: auto !important; }
.cc-cta h2 { color: var(--wp--preset--color--base); }
.cc-cta > p { color: #FFFFFF; }
.cc-subscribe-form { color: var(--wp--preset--color--ink); }
.cc-cta .cc-subscribe-form { margin-top: 20px !important; }
.cc-cta .cc-form-placeholder { color: var(--wp--preset--color--ink); }

/* ---------- Footer ---------- */
.cc-footer {
	border-top: 1px solid var(--wp--preset--color--line);
	padding: 24px var(--cc-gutter) 28px;
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
}
.cc-footer__row { gap: 16px 32px !important; }
.cc-footer .wp-block-site-title { font-size: 1.125rem; }
.cc-footer p { margin: 0; }
.cc-footer__links a { color: var(--wp--preset--color--muted); text-decoration: none; margin-right: 24px; }
.cc-footer__links a:last-child { margin-right: 0; }
.cc-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.cc-footer__links a { margin-right: 0; }
.cc-footer__links a:hover { color: var(--wp--preset--color--accent); }

/* ---------- Home page (content lives in the Home page, edited under Pages) ---------- */
.cc-home .wp-block-post-content > * { margin-block-start: 0; margin-block-end: 0; }
.cc-whats {
	background: var(--wp--preset--color--tint-soft);
	border-top: 1px solid var(--wp--preset--color--line);
}
.cc-whats__grid { gap: 28px !important; margin-bottom: 8px; }
.cc-whats__grid .wp-block-column > * { margin: 0; }
.cc-whats__grid .wp-block-column > * + * { margin-top: 6px; }
.cc-whats__title { font-size: 1.0625rem; }
.cc-whats__grid p { font-size: 0.9375rem; color: var(--wp--preset--color--body); }
.cc-whats .cc-subscribe-form { margin-left: auto !important; margin-right: auto !important; margin-top: 28px !important; }

@media (max-width: 359px) {
	.cc-header nav.cc-nav, .cc-header ul.cc-nav { gap: 14px; }
}

/* Subscribe band added inside a page or post (via the "Subscribe band" pattern):
   stretch it edge to edge and drop the white gap before the footer. */
.wp-site-blocks { overflow-x: clip; }
.wp-block-post-content .cc-cta-inline {
	width: 100vw;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	margin-top: 40px;
}
.cc-single:has(.wp-block-post-content > .cc-cta-inline:last-child) { padding-bottom: 0; }

/* Breathing room above headings inside posts and pages */
.cc-single .wp-block-post-content > :is(h2, h3, h4, h5, h6):not(:first-child) { margin-top: 2.25rem; }
.cc-single .wp-block-post-content > :is(h2, h3, h4, h5, h6) + * { margin-top: 0.75rem; }

/* Image and embed captions: smaller, italic, centered (matches the old site) */
.wp-element-caption,
figcaption {
	text-align: center;
	font-style: italic;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--body);
	margin-top: 10px;
	margin-bottom: 0;
}

/* ---------- "Cards" style for the Columns block (Styles → Cards) ----------
   Gives any row of columns the look of the home page's guide cards. */
.wp-block-columns.is-style-cc-cards { gap: 20px; }
.wp-block-columns.is-style-cc-cards > .wp-block-column {
	background: var(--wp--preset--color--base) !important;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--cc-radius);
	overflow: hidden;
	padding: 0 !important;
	text-align: left;
	align-self: stretch !important; /* equal-height cards in a row */
}
.is-style-cc-cards > .wp-block-column > * { margin: 0 !important; }
.is-style-cc-cards > .wp-block-column > .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 0;
}
/* Text placed straight in the column */
.is-style-cc-cards > .wp-block-column > :not(.wp-block-image) { padding-left: 18px; padding-right: 18px; }
.is-style-cc-cards > .wp-block-column > :not(.wp-block-image):nth-child(2) { padding-top: 16px; }
.is-style-cc-cards > .wp-block-column > :not(.wp-block-image):last-child { padding-bottom: 18px; }
/* Text wrapped in a box (e.g. a Newsletter Glue callout or a Group) */
.is-style-cc-cards > .wp-block-column > :is(section, .wp-block-group) {
	background: transparent !important;
	border: 0 !important;
	padding: 16px 18px 18px !important;
	text-align: left !important;
}
.is-style-cc-cards .wp-block-column :is(h2, h3, h4) {
	font-size: 1.1875rem;
	line-height: 1.25;
	text-align: left !important;
	margin: 0 !important;
}
.is-style-cc-cards .wp-block-column :is(h2, h3, h4) a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.is-style-cc-cards .wp-block-column :is(h2, h3, h4) a:hover { color: var(--wp--preset--color--accent); text-decoration: underline; }
.is-style-cc-cards .wp-block-column p {
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
	text-align: left !important;
	margin: 6px 0 0 !important;
}

/* "Edit" link for signed-in editors (added by functions.php) */
.cc-edit-link {
	max-width: 720px;
	margin: 32px auto 0 !important;
	font-size: 0.875rem;
}
.cc-home + .cc-edit-link, .cc-home .cc-edit-link { padding: 0 var(--cc-gutter) 24px; max-width: 1120px; }
.cc-edit-link a {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}
.cc-edit-link a:hover { color: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); }

/* ---------- Search button (opens the Cord Cutter Search plugin) ---------- */
.cc-search-toggle { display: none; }
.has-cc-search .cc-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0 -14px 0 -16px; /* tuck it closer to the menu and Subscribe */
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #FFFFFF;
	cursor: pointer;
}
.has-cc-search .cc-search-toggle:hover,
.has-cc-search .cc-search-toggle:focus-visible { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); }
@media (max-width: 1120px) {
	.has-cc-search .cc-search-toggle { margin: 0 0 0 auto; }
	.has-cc-search .cc-header__cta { margin-left: 0 !important; }
}
@media (max-width: 640px) {
	.has-cc-search .cc-search-toggle { width: 32px; margin-right: -4px; }
}

/* Archive: "Loading more issues…" while older issues load on scroll */
.cc-loadmore {
	margin: 0;
	padding: 24px 0 40px;
	text-align: center;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--muted);
}
.cc-loadmore:empty { padding: 0 0 40px; }

/* ---------- Advisorator ---------- */
/* Menu links are white on green; the current page gets an underline and bolder text */
.cc-header .cc-nav .wp-block-navigation-item__content { opacity: 0.92; }
.cc-header .cc-nav .wp-block-navigation-item__content:hover,
.cc-header .cc-nav .current-menu-item > .wp-block-navigation-item__content { opacity: 1; }
.cc-header .cc-nav .current-menu-item > .wp-block-navigation-item__content { font-weight: 600; }
/* Crete Round has a single weight; keep headings from being faux-bolded */
h1, h2, h3, h4, h5, h6, .wp-block-post-title, .wp-block-site-title { font-weight: 400; font-synthesis: none; }
/* The small print under the signup form */
.adv-fineprint { font-size: 0.8125rem; color: var(--wp--preset--color--muted); max-width: 540px; }
.adv-fineprint a { color: inherit; }

/* Footer menu (same items as the header) */
nav.adv-footer-nav ul { gap: 8px 24px; }
nav.adv-footer-nav a { color: var(--wp--preset--color--muted); text-decoration: none; }
nav.adv-footer-nav a:hover { color: var(--wp--preset--color--accent); }
nav.adv-footer-nav .current-menu-item > a { color: var(--wp--preset--color--ink); }
.adv-signin-link { margin-top: 12px !important; font-size: 0.9375rem; }

/* Phones: Advisorator's menu has more items than CCW's, so on very narrow
   screens it wraps to a second row instead of hiding items. */
@media (max-width: 640px) {
	.cc-header nav.cc-nav { overflow: visible; }
	.cc-header nav.cc-nav,
	.cc-header nav.cc-nav ul { flex-wrap: wrap !important; row-gap: 0 !important; column-gap: 14px !important; }
	.cc-header .cc-nav .wp-block-navigation-item__content { padding: 10px 0; }
}

/* Logo: the image (300×91) has a lot of green above and below the wordmark,
   so show only a band close around the lettering. The image's background is
   the same green as the header, so the edges don't show. */
.cc-header .adv-logo img {
	aspect-ratio: 300 / 62;
	object-fit: cover;
	object-position: 50% 62%;
}

/* Safety net: if anything on a page is wider than the screen (a wide table,
   embed or plugin block), trim it instead of letting iPhone Safari widen the
   whole page. */
.wp-site-blocks { overflow-x: clip; }
.cc-hero > :first-child { margin-top: 0 !important; }
.cc-cta > .cc-subscribe-form:first-child { margin-top: 0 !important; }

/* Narrow sign-in banner under the menu on the signup page */
.adv-signin-bar { background: #333333; color: #FFFFFF; padding: 9px var(--cc-gutter); margin: 0 !important; }
.adv-signin-bar p { margin: 0; font-size: 0.9375rem; line-height: 1.4; }
.adv-signin-bar a { color: #FFFFFF; text-decoration: underline; text-underline-offset: 2px; }
.adv-signin-bar a:hover { text-decoration: none; }

/* Small lock on paywalled story thumbnails: give the image block the class
   "adv-locked" (Advanced → Additional CSS class). */
.adv-locked { position: relative; }
.adv-locked::after {
	content: "";
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 22px;
	height: 22px;
	/* Solid white padlock with a soft shadow so it shows on light photos too */
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='2.6' d='M7.5 11V7.5a4.5 4.5 0 0 1 9 0V11'/%3E%3Crect x='4' y='10' width='16' height='12' rx='2.5' fill='white'/%3E%3C/svg%3E") center / contain no-repeat;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
	pointer-events: none;
}
.cc-card__title:last-child { padding-bottom: 18px; }

/* ---------- Guides page: category pills + tiles ---------- */
.adv-guides { margin-top: 28px; }
.adv-guides__pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 8px;
	/* Same width and left edge as the intro paragraph above */
	margin: 0 auto 28px;
	max-width: var(--wp--style--global--content-size, 720px);
}
.adv-pill {
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.2;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent-dark);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.adv-pill:hover { background: var(--wp--preset--color--tint); }
.adv-pill:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.adv-pill.is-active,
.adv-pill.is-active:hover { background: var(--wp--preset--color--accent); color: #FFFFFF; }

.adv-guides__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	max-width: 1000px;
	margin: 0 auto;
}
.adv-guide[hidden] { display: none; }
.adv-guide__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--cc-radius);
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	transition: box-shadow 0.15s, transform 0.15s;
}
.adv-guide__link:hover { box-shadow: 0 6px 20px rgba(30, 43, 38, 0.12); transform: translateY(-2px); }
.adv-guide__link:hover .adv-guide__title { color: var(--wp--preset--color--accent); }
.adv-guide__media { display: block; position: relative; }
.adv-guide__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: var(--wp--preset--color--tint);
}
.adv-guide__body { display: block; padding: 14px 18px 18px; }
.adv-guide__title {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.1875rem;
	line-height: 1.25;
	color: var(--wp--preset--color--ink);
}
.adv-guide__text { display: block; margin-top: 6px; font-size: 0.9375rem; line-height: 1.5; color: var(--wp--preset--color--muted); }
@media (max-width: 1000px) {
	.adv-guides__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.adv-guides__grid { grid-template-columns: 1fr; gap: 16px; }
	.adv-guides__pills { justify-content: flex-start; gap: 6px; }
	.adv-pill { font-size: 0.875rem; padding: 7px 13px; }
}

/* ---------- Archives page: category pills + issue lists ---------- */
.adv-archives { margin-top: 8px; }
.adv-archive-pills { gap: 8px !important; margin-bottom: 20px !important; }
.adv-archive-pills .wp-block-button__link {
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.2;
	padding: 8px 18px;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent-dark);
}
.adv-archive-pills .wp-block-button__link:hover { background: var(--wp--preset--color--tint); color: var(--wp--preset--color--accent-dark); }
.adv-archive-pills .wp-block-button__link.is-active,
.adv-archive-pills .wp-block-button__link.is-active:hover { background: var(--wp--preset--color--accent); color: #FFFFFF; }
/* Once the page script is running, show one list at a time. */
.adv-archives.is-ready .adv-archive-panel:not(.is-active) { display: none; }
.adv-archive-panel + .adv-archive-panel { margin-top: 48px; }
.adv-archives.is-ready .adv-archive-panel + .adv-archive-panel { margin-top: 0; }
.adv-archive-intro { margin: 0 0 4px; color: var(--wp--preset--color--body); }
.adv-arch-list { list-style: none; margin: 0; padding: 0; }
.adv-arch-list .wp-block-post-title { font-size: 1.25rem; line-height: 1.25; margin: 0; }
.adv-arch-list .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.adv-arch-list .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); text-decoration: underline; }
.adv-arch-next { margin: 24px 0; font-weight: 600; text-align: center; }
@media (max-width: 640px) {
	.adv-arch-list .wp-block-post-title { font-size: 1.125rem; }
	.adv-archive-pills .wp-block-button__link { font-size: 0.875rem; padding: 7px 14px; }
}
.adv-arch-list .wp-block-post-date { color: var(--wp--preset--color--muted); font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; }
.adv-arch-list .wp-block-post-excerpt__excerpt { margin: 0; font-size: 0.9375rem; color: var(--wp--preset--color--muted); }

/* Phones: a slightly smaller menu fits all six items on one line on most
   phones; on the narrowest ones it becomes a tidy 3 × 2 block instead of
   leaving one item alone on a second line. */
@media (max-width: 480px) {
	.cc-header nav.cc-nav ul { column-gap: 11px !important; }
	.cc-header .cc-nav .wp-block-navigation-item__content { font-size: 13px; }
}
@media (max-width: 389px) {
	.cc-header nav.cc-nav ul {
		display: grid !important;
		grid-template-columns: repeat(3, auto);
		justify-content: space-between;
	}
	.cc-header .cc-nav .wp-block-navigation-item__content { padding: 8px 0; }
}

/* Archives page: the newest issue in each list gets the same big treatment */
.adv-arch-list .adv-arch-lead .cc-item {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 28px;
	padding-top: 0;
	padding-bottom: 24px;
}
.adv-arch-list .adv-arch-lead .wp-block-post-featured-image { grid-column: 1; grid-row: 1; }
.adv-arch-list .adv-arch-lead .cc-item__body { grid-column: 2; grid-row: 1; text-align: center; }
.adv-arch-list .adv-arch-lead .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	border-radius: var(--cc-radius);
}
.adv-arch-list .adv-arch-lead .wp-block-post-title { font-size: 1.625rem; line-height: 1.2; }
.adv-arch-list .adv-arch-lead .wp-block-post-excerpt__excerpt { font-size: 1.0625rem; color: var(--wp--preset--color--body); }
.adv-arch-list .adv-arch-lead .cc-item:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 1fr; }
.adv-arch-list .adv-arch-lead .cc-item:not(:has(.wp-block-post-featured-image)) .cc-item__body { grid-column: 1; text-align: left; }
@media (max-width: 640px) {
	.adv-arch-list .adv-arch-lead .cc-item { grid-template-columns: 1fr; gap: 16px; padding-bottom: 28px; }
	.adv-arch-list .adv-arch-lead .cc-item__body { grid-column: 1; grid-row: 2; text-align: left; }
}
.adv-arch-list { margin-top: 20px !important; }
.adv-archive-pills { justify-content: center !important; }

/* ---------- Member home (/members/): welcome, latest issue, quick links ---------- */
.adv-welcome { padding: 40px var(--cc-gutter) 4px; }
.adv-welcome__body { display: flow-root; }
.adv-welcome > * { margin-top: 0; }
.adv-welcome__title { margin-bottom: 18px !important; font-size: clamp(1.75rem, 4vw, 2.25rem); }
.adv-welcome p { margin: 0 0 14px; font-size: 1.0625rem; line-height: 1.6; color: var(--wp--preset--color--body); }
.adv-welcome .adv-welcome__photo { margin: 4px 18px 6px 0 !important; }
.adv-welcome .adv-welcome__photo img { border-radius: 50%; }

.adv-dash {
	max-width: 1120px;
	margin: 0 auto !important;
	padding: 28px var(--cc-gutter) 56px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 32px 48px;
	align-items: start;
}
.adv-dash > *, .adv-dash__latest > *, .adv-dash__links > * { margin-top: 0 !important; margin-bottom: 0; }
.adv-dash__title { font-size: 1.5rem; margin-bottom: 18px !important; }
.adv-dash .wp-block-post-featured-image { margin: 0; }
.adv-dash .wp-block-post-featured-image img { border-radius: var(--cc-radius); }
.adv-dash__issue-title { margin: 16px 0 4px !important; font-size: 1.5rem; line-height: 1.25; }
.adv-dash .wp-block-post-date { margin-top: 0; }
.adv-dash .wp-block-post-excerpt { margin-top: 10px; }
.adv-dash .wp-block-post-excerpt__excerpt { margin: 0; font-size: 1rem; }
.adv-dash .wp-block-post-excerpt__more-text { margin: 8px 0 0; }
.adv-dash .wp-block-post-excerpt__more-link { font-weight: 600; text-decoration: none; }
/* Same height as the issue picture next to it (both columns are equally wide
   and the picture is 3:2); grows taller if the links need more room. */
.adv-dash__box {
	aspect-ratio: 3 / 2;
	background: #F7F7F7;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--cc-radius);
	padding: 24px;
	gap: 16px !important;
	flex-wrap: nowrap !important;
}
.adv-dash__box p { margin: 0; line-height: 1.5; }
.adv-dash__box a { font-weight: 600; }
@media (max-width: 760px) {
	.adv-dash { grid-template-columns: 1fr; gap: 40px; padding-top: 20px; }
	.adv-dash__box { aspect-ratio: auto; }
}
@media (max-width: 640px) {
	.adv-welcome .adv-welcome__photo img { width: 64px !important; height: 64px !important; }
	.adv-welcome .adv-welcome__photo { margin-right: 14px !important; }
}

/* ---------- Membership page ---------- */
.adv-plan-box {
	/* Text lines up with the 760px "Meet your guide" column:
	   760 + 2 × 32px padding + 2 × 1px border */
	max-width: 826px !important;
	margin: 0 auto 24px !important;
	padding: 28px 32px 22px;
	background: #F7F7F7;
	border: 1px solid #3A3A3A;
	border-radius: 8px;
}
.adv-plan-box > * { max-width: none !important; }
.adv-plan-box p { margin: 0; }
.adv-plan-buttons { gap: 20px !important; margin: 26px 0 !important; }
.adv-plan-buttons .wp-block-button__link {
	background: var(--wp--preset--color--accent);
	color: #FFFFFF;
	font-size: 1.0625rem;
	padding: 14px 24px;
	border-radius: 10px;
}
.adv-plan-buttons .wp-block-button__link:hover { background: var(--wp--preset--color--accent-dark); color: #FFFFFF; }
.adv-plan-fine { font-size: 0.875rem; color: var(--wp--preset--color--body); }

.adv-guide-band {
	/* Full width of the window, even inside the page's padded column */
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	max-width: 100vw !important;
	background: #333333;
	color: #FFFFFF;
	padding: 44px var(--cc-gutter) 48px !important;
	margin-top: 32px !important;
}
.adv-guide-band h2 { color: #FFFFFF; margin-top: 0 !important; margin-bottom: 28px !important; }
.adv-guide-band p { color: #FFFFFF; font-size: 1.0625rem; line-height: 1.7; margin: 0; }
.adv-guide-band a { color: #FFFFFF; }
.adv-guide-band__row { gap: 32px !important; margin-bottom: 28px !important; }
.adv-guide-band__photo { flex: 0 0 108px; margin: 0 !important; }
.wp-block-post-content .adv-guide-band__photo img { border-radius: 50%; }
@media (max-width: 640px) {
	.adv-guide-band__row { flex-direction: column; gap: 18px !important; }
	.adv-guide-band__row p { text-align: center; }
}

.adv-praise-title { margin-top: 44px !important; margin-bottom: 20px !important; }
/* Quotes line up with the 760px guide column; arrows sit just outside it
   (2 × 40px arrows + 2 × 12px gaps). */
.adv-testimonials { max-width: 864px !important; margin: 0 auto 36px !important; }
.adv-testimonial { margin: 0 0 28px; }
.adv-testimonial p { margin: 0; }
.adv-testimonial__quote { font-size: 1.1875rem; line-height: 1.55; color: var(--wp--preset--color--ink); }
.adv-testimonial__name { margin-top: 18px !important; font-weight: 700; font-size: 1.125rem; color: var(--wp--preset--color--ink); }
.adv-testimonial__since { margin-top: 4px !important; color: var(--wp--preset--color--muted); font-size: 0.9375rem; }
/* Carousel (added by the script) */
.adv-tm__row { display: flex; align-items: center; gap: 12px; }
.adv-tm__stage { flex: 1 1 auto; min-width: 0; display: grid; }
.adv-testimonials.is-carousel .adv-testimonial {
	grid-area: 1 / 1;
	margin: 0;
	padding: 0 8px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.45s ease, visibility 0.45s;
	align-self: center;
}
.adv-testimonials.is-carousel .adv-testimonial.is-current { opacity: 1; visibility: visible; }
.adv-tm__arrow {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}
.adv-tm__arrow:hover { background: var(--wp--preset--color--tint); }
.adv-tm__arrow:focus-visible { outline: 2px solid var(--wp--preset--color--accent); }
.adv-tm__dots { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.adv-tm__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #C9CFCC;
	cursor: pointer;
}
.adv-tm__dot.is-current { background: var(--wp--preset--color--ink); }
@media (max-width: 640px) {
	.adv-tm__row { gap: 2px; }
	.adv-tm__arrow { width: 32px; height: 32px; }
	.adv-testimonial__quote { font-size: 1.0625rem; }
}
@media (prefers-reduced-motion: reduce) {
	.adv-testimonials.is-carousel .adv-testimonial { transition: none; }
}

.adv-guide-band h2, .adv-praise-title { text-align: center !important; }
@media (max-width: 640px) {
	.adv-plan-box { padding: 24px 18px 20px; }
}

/* "Search" button at the end of the Guides and Archives pills */
.adv-search-pill {
	display: none;
	align-items: center;
	gap: 6px;
	flex: none;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.2;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent-dark);
	cursor: pointer;
	margin: 0;
}
.adv-search-pill svg { flex: none; }
.has-cc-search .adv-search-pill { display: inline-flex; }
.adv-search-pill:hover { background: var(--wp--preset--color--tint); }
.adv-search-pill:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.adv-archive-pills .adv-search-pill { align-self: center; padding: 8px 18px; }
@media (max-width: 640px) {
	.adv-search-pill { font-size: 0.875rem; padding: 7px 13px; }
	.adv-archive-pills .adv-search-pill { padding: 7px 14px; }
}

/* Desktop: search button sits just left of the menu (before "Guides") */
@media (min-width: 1121px) {
	.has-cc-search .cc-header .cc-search-toggle { order: 1; margin: 0 -14px 0 auto; }
	.has-cc-search .cc-header nav.cc-nav { order: 2; margin-left: 0; }
	.has-cc-search .cc-header .cc-header__cta { order: 3; }
}
/* Narrow phones: keep the two Archives pills and Search on one line (the
   button drops its "Search" label below 390px; it keeps its screen reader name) */
@media (max-width: 480px) {
	.adv-archive-pills { gap: 6px 4px !important; }
	.adv-archive-pills .wp-block-button__link,
	.adv-archive-pills .adv-search-pill { font-size: 0.8125rem !important; padding: 6px 11px !important; }
}
@media (max-width: 389px) {
	.adv-archive-pills .adv-search-pill span { display: none; }
	.adv-archive-pills .adv-search-pill { padding: 6px 9px !important; }
}
