/* ============================================================
   Home page (front-page.php)
   Featured Guides grid + Latest News + Popular Guides.
   Scoped to .acw-home; enqueued only on the front page so it
   never touches the rest of the theme.
   ============================================================ */

/* The base theme turns <main> into a 2-column flexbox on desktop.
   The home page manages its own layout, so reset it to block. */
body.home main.acw-home {
	display: block;
}

/* Section headers reuse the theme's green Isabelle banner. */
.acw-home h1 {
	color: #ffffff;
	font-family: 'Roboto Slab', sans-serif;
	font-weight: 500;
	font-size: 22px;
	line-height: 24px;
	text-shadow: 2px 2px 1px #1f1f1f26;
	margin: 0;
	padding: 15px 5px 15px 70px;
	background: url('img/heading-h1-isabelle-nh.png'), #1eae55 url('img/heading-h1-bg.png');
	background-repeat: no-repeat, repeat-x;
	background-position: 10px 0px, top center;
	background-size: 50px 84px, auto;
	border-radius: 10px 10px 0px 0px;
}

/* ============================================================
   1. Featured Guides
   ============================================================ */
.acw-featured {
	margin: 0 0 20px 0;
	/* Below 500px <main> has no side padding, so inset the featured grid by the
	   same 14px the news/popular cards use internally, to line up their edges. */
	padding: 0 14px;
}

/* At 500px <main> itself gains side padding, so drop the featured inset to 0
   and let the grid align to the same content box as the other cards. */
@media only screen and (min-width: 500px) {
	.acw-featured {
		padding: 0;
	}
}

.acw-feat-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.acw-feat-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	text-decoration: none;
	color: #20331f;
	/* Soft per-guide colour tint over a faint dot pattern. */
	background-color: #ffffff;
	background-image:
		linear-gradient(var(--acw-tint, rgba(91,184,91,0.16)), var(--acw-tint, rgba(91,184,91,0.16))),
		radial-gradient(circle, rgba(31,51,31,0.05) 1px, transparent 1.2px);
	background-size: auto, 15px 15px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.07);
	border: 2px solid var(--acw-border, rgba(0,0,0,0.08));
	transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.acw-feat-card:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgba(0,0,0,0.09);
	/* Subtle, hue-preserving darken shared by every card (incl. Tomodachi). */
	filter: brightness(0.96);
}

.acw-feat-badge {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	/* Soft light fill + colored ring, with the icon in the guide colour
	   (concept "soft badge" look) rather than a saturated disc. */
	background-color: var(--acw-badge-bg, #eef3ee);
	border: 2px solid var(--acw-badge-ring, rgba(0,0,0,0.10));
}

.acw-feat-badge img,
.acw-feat-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
	display: block;
}

/* Placeholder icon: the leaf SVG masked so it takes the guide colour. */
.acw-feat-icon {
	background-color: var(--acw-badge, #5BB85B);
	-webkit-mask: var(--acw-icon) no-repeat center / contain;
	        mask: var(--acw-icon) no-repeat center / contain;
}

.acw-feat-label {
	font-family: 'Roboto Slab', sans-serif;
	font-weight: 500;
	font-size: 17px;
	line-height: 1.2;
	color: #20331f;
	min-width: 0;
}

/* Full-width Tomodachi Catalog bar card. */
.acw-tomodachi-card {
	width: 100%;
	margin-top: 10px;
	position: relative;
	overflow: hidden;
	background-color: #feb;
	background-image: none;
	border: 2px solid #ffb75c;
}

.acw-tomodachi-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ffb75c;
	-webkit-mask-image: url('https://tomo-cdn2.animalcrossingworld.com/ui-assets/images/face-parts.svg');
	mask-image: url('https://tomo-cdn2.animalcrossingworld.com/ui-assets/images/face-parts.svg');
	-webkit-mask-size: 220px;
	mask-size: 220px;
	-webkit-mask-repeat: repeat;
	mask-repeat: repeat;
	pointer-events: none;
	z-index: 0;
	opacity: 0.25;
}

.acw-tomodachi-logo,
.acw-tomodachi-text,
.acw-tomodachi-arrow {
	position: relative;
	z-index: 1;
}

.acw-tomodachi-card .acw-feat-label {
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.acw-tomodachi-logo {
	flex: 0 0 auto;
	width: 40px;
	height: auto;
	object-fit: contain;
	display: block;
}

@media only screen and (min-width: 980px) {
	.acw-tomodachi-logo {
		width: 56px;
	}
}

.acw-tomodachi-text {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.acw-tomodachi-sub {
	font-size: 14px;
	font-weight: 500;
	color: #2a3c29;
	margin-top: 2px;
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.acw-tomodachi-arrow {
	flex: 0 0 auto;
	font-size: 28px;
	line-height: 1;
	color: #ffb75c;
	margin-left: 8px;
}

/* ============================================================
   2 + 3. Latest News / Popular Guides columns
   ============================================================ */
.acw-columns {
	display: block;
}

.acw-news,
.acw-popular {
	margin-bottom: 25px;
}

/* --- Shared list shell --- */
.acw-news-list,
.acw-popular-list {
	background-color: #ffffff;
	border-radius: 0 0 10px 10px;
	box-shadow: 0px 2px 5px -1px rgba(176,176,176,1);
	overflow: hidden;
}

/* --- Latest News --- */
/* Match the single-post article padding (section.left-classic article). */
.acw-news-list article {
	padding: 20px 15px 15px 15px;
	margin: 0;
	background: none;
	box-shadow: none;
	border-bottom: 1px solid #eeeeee;
	border-radius: 0;
}

.acw-news-list article:last-child {
	border-bottom: none;
}

.acw-news-list h2 {
	margin: 0 0 9px 0;
	font-size: 18px;
	line-height: 1.3; /* matches the theme's article h2 */
}

.acw-news-list h2 a {
	color: #1a1a1a;
	text-decoration: none;
}

.acw-news-list h2 a:hover {
	color: #1eae55;
}

.acw-news-list .meta {
	margin: 0;
	font-size: 13px;
}

/* Breathing room between the news card and the pagination links below it. */
.acw-news .pagination {
	margin-top: 22px;
}

/* Lead story: mirrors a single-post article (title + meta above a full image),
   using the theme's own article values so it reads identically. */
.acw-news-lead {
	display: flex;
	flex-direction: column;
}

.acw-news-lead .acw-news-body {
	order: 1;
}

.acw-news-lead .acw-news-thumb {
	order: 2;
}

.acw-news-lead .acw-news-thumb img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
}

/* Identical to the theme's article <h2> + title link. */
.acw-news-lead h2 {
	font-size: 26px;
	line-height: 1.3;
	margin: 0 0 15px 0;
}

.acw-news-lead h2 a {
	color: #000000;
}

.acw-news-lead .meta {
	margin: 0 0 20px 0;
}

/* Secondary stories: small thumbnail beside the title. */
.acw-news-item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.acw-news-item .acw-news-thumb {
	flex: 0 0 112px;
}

/* News-item + Popular thumbnails share one look: ~full 16:9 ratio. */
.acw-news-item .acw-news-thumb img,
.acw-popular-thumb img {
	width: 112px;
	aspect-ratio: 16 / 9;
	height: auto;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.acw-news-item .acw-news-body {
	flex: 1 1 auto;
	min-width: 0;
}

.acw-news-item h2 {
	font-size: 17px;
}

/* --- Popular Guides --- */
/* Distinct header character (Latest News keeps Isabelle). Overrides only the
   image layers from .acw-home h1; keeps the green colour + banner texture. */
.acw-popular h1 {
	background-image: url('img/heading-h1-girl2-nh.png'), url('img/heading-h1-bg.png');
}

/* Existing Community widget + AdThrive ad pulled in below Popular Guides;
   contain the theme sidebar's floated widget markup. */
.acw-home-aside {
	overflow: hidden;
}

.acw-popular-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-bottom: 1px solid #eeeeee;
	text-decoration: none;
	color: #1a1a1a;
}

.acw-popular-item:last-child {
	border-bottom: none;
}

.acw-popular-item:hover {
	background: #f4fbf4;
}

.acw-popular-thumb {
	flex: 0 0 auto;
}

.acw-popular-title {
	flex: 1 1 auto;
	min-width: 0;
	font-family: 'Roboto Slab', sans-serif;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.3;
}

.acw-popular-arrow {
	flex: 0 0 auto;
	color: #bbbbbb;
	font-size: 22px;
}

/* ============================================================
   Desktop ( matches the theme's 960px main breakpoint )
   ============================================================ */
@media only screen and (min-width: 980px) {

	.acw-feat-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 12px;
	}

	.acw-feat-card {
		padding: 16px;
		min-height: 78px;
	}

	.acw-feat-badge {
		width: 56px;
		height: 56px;
	}

	.acw-feat-badge img,
	.acw-feat-icon {
		width: 34px;
		height: 34px;
	}

	.acw-feat-label {
		font-size: 19px;
	}

	.acw-columns {
		display: flex;
		gap: 20px;
		align-items: flex-start;
	}

	.acw-news {
		flex: 1 1 auto;
		min-width: 0;
	}

	/* Match the single-post article padding on desktop (20px all sides). */
	.acw-news-list article {
		padding: 20px;
	}

	/* Match the theme's desktop article <h2> (28px / 32px). */
	.acw-news-lead h2 {
		font-size: 28px;
		line-height: 32px;
	}

	.acw-news-item h2 {
		font-size: 20px;
	}

	/* Larger sub-article thumbnails on desktop (popular thumbs unaffected). */
	.acw-news-item .acw-news-thumb {
		flex: 0 0 188px;
	}

	.acw-news-item .acw-news-thumb img {
		width: 188px;
	}

	.acw-side {
		/* 300px matches the theme sidebar's widget width so the Community /
		   AdThrive cards fill the column and line up with Popular Guides. */
		flex: 0 0 300px;
	}
}

/* Match the theme's wide-desktop article <h2> line-height. */
@media only screen and (min-width: 1210px) {
	.acw-news-lead h2 {
		line-height: 40px;
	}
}
