/*
Theme Name:   Beanie Guide
Description:  Fast, ad-ready price-guide theme built for the Beanie Database plugin. Includes A–Z database, category and tag-generation archives, AdSense slots and affiliate-friendly layout.
Version:      1.1.1
Requires at least: 6.3
Requires PHP: 7.4
Author:       Your Name
License:      GPL-2.0-or-later
Text Domain:  beanie-guide
*/

:root {
	--bg: #fdfbfd;
	--surface: #ffffff;
	--ink: #1f2330;
	--muted: #6b7080;
	--line: #e9e4ec;
	--accent: #c2185b;
	--accent-dark: #8e0f41;
	--accent-soft: #fce4ef;
	--header: #2a1a3a;
	--radius: 12px;
	--wrap: 1180px;
	--font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	/* Hand colours to the plugin */
	--bdb-accent: var(--accent);
	--bdb-ink: var(--ink);
	--bdb-muted: var(--muted);
	--bdb-line: var(--line);
	--bdb-soft: #faf6fb;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.4em 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: 0; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
h3 { font-size: 1.2rem; }
table { max-width: 100%; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: #fff; padding: 8px 12px; width: auto; height: auto; clip: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--header); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.site-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 900; font-size: 1.25rem; margin-right: auto; }
.site-brand img { max-height: 48px; width: auto; }
.site-brand:hover { color: #fff; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.primary-nav a { display: block; color: #f1e9f5; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: .95rem; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a { background: rgba(255,255,255,.12); color: #fff; }
.primary-nav li { position: relative; }
.primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--header); min-width: 200px; flex-direction: column; padding: 6px; border-radius: 0 0 10px 10px; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: flex; }
.header-cta { background: var(--accent); color: #fff !important; padding: 10px 16px; border-radius: 999px; font-weight: 800; text-decoration: none; white-space: nowrap; font-size: .9rem; }
.header-cta:hover { background: #d81b60; }
.nav-toggle { display: none; background: none; border: 1.5px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 8px 12px; font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--header); padding: 8px 16px 16px; }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; }
	.primary-nav .sub-menu { display: flex; position: static; padding-left: 16px; }
	.header-cta { display: none; }
}

/* Layout */
.site-main { padding: 28px 0 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
.layout--full { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span[aria-hidden] { margin: 0 6px; }

.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 36px); }
.entry-meta { color: var(--muted); font-size: .9rem; margin: -4px 0 18px; }
.entry-hero { margin: 0 0 22px; border-radius: var(--radius); overflow: hidden; background: #faf6fb; text-align: center; }
.entry-hero img { display: block; margin: 0 auto; max-height: 520px; width: auto; object-fit: contain; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content img { border-radius: 8px; }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 18px; border-left: 4px solid var(--accent); color: #3c3f4c; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content td, .entry-content th { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-content .wp-block-image figcaption { font-size: .85rem; color: var(--muted); text-align: center; }

/* Sidebar */
.sidebar .widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.sidebar .widget-title { margin: 0 0 12px; font-size: 1.05rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sidebar li:last-child { border: 0; }
.sidebar .bdb-az a { min-width: 30px; padding: 4px 6px; font-size: .8rem; }
.sidebar .bdb-search { flex-direction: column; }
.sidebar-sticky { position: sticky; top: 90px; }

/* Cards (posts) */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card__img { aspect-ratio: 16/10; background: #f4eef7; display: block; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__body { padding: 16px 18px 20px; }
.post-card__title { font-size: 1.1rem; margin: 0 0 6px; }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--muted); font-size: .92rem; margin: 0; }
.post-card__date { font-size: .8rem; color: var(--muted); }

.pagination { margin: 30px 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #fff; }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Archive header */
.archive-head { margin-bottom: 20px; }
.archive-head p { color: var(--muted); margin: 0 0 12px; max-width: 760px; }
.archive-intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-top: 28px; }

/* Front page */
.hero { background: radial-gradient(1200px 400px at 20% -10%, #5a2b7a 0%, var(--header) 60%); color: #fff; padding: clamp(40px, 7vw, 80px) 0; }
.hero h1 { color: #fff; max-width: 780px; }
.hero p { color: #e7dcef; font-size: 1.15rem; max-width: 640px; margin: 0 0 22px; }
.hero .bdb-search { max-width: 640px; }
.hero .bdb-search input[type=search] { border-color: transparent; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; font-size: .95rem; color: #e7dcef; }
.hero-stats strong { display: block; color: #fff; font-size: 1.5rem; }
.home-section { padding: 36px 0 8px; }
.home-section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.home-section__head h2 { margin-top: 0; }
.home-section__head a { font-weight: 700; white-space: nowrap; }
.promo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .promo { grid-template-columns: 1fr; } }
.promo__card { background: var(--accent-soft); border-radius: var(--radius); padding: 26px; }
.promo__card h3 { margin-top: 0; }
.promo__card--dark { background: var(--header); color: #fff; }
.promo__card--dark h3 { color: #fff; }
.button { display: inline-block; background: var(--accent); color: #fff !important; padding: 11px 18px; border-radius: 999px; font-weight: 800; text-decoration: none; }
.button:hover { background: var(--accent-dark); }

/* Footer */
.site-footer { background: var(--header); color: #d9cfe0; padding: 40px 0 24px; font-size: .92rem; }
.site-footer a { color: #fff; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-cols h2 { font-size: 1rem; color: #fff; margin: 0 0 10px; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin: 4px 0; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; font-size: .8rem; color: #b9adc2; }

/* Search / 404 */
.search-form { display: flex; gap: 8px; }
.search-form input[type=search] { flex: 1; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; min-width: 0; }
.search-form button { padding: 10px 16px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }

/* Logo */
.custom-logo-link { display: flex; align-items: center; margin-right: auto; }
.custom-logo { max-height: 50px; width: auto; display: block; }
@media (max-width: 600px) { .custom-logo { max-height: 40px; } }

/* Elementor pages */
.elementor-page .site-main { padding: 0; }
.elementor-widget-text-editor a:not(.bdb-btn) { color: var(--accent); }
.elementor .bdb-search { margin: 0; }
.elementor .bdb-cats, .elementor .bdb-grid, .elementor .bdb-az { margin-bottom: 0; }
.elementor .post-grid { margin: 0; }
.bg-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 12px; }
.bg-faq summary { cursor: pointer; font-weight: 800; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.bg-faq summary::-webkit-details-marker { display: none; }
.bg-faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.bg-faq details[open] summary::after { content: "–"; }
.bg-faq details p { margin: 10px 0 0; color: #3c3f4c; }
.bg-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.bg-table th, .bg-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.bg-table th { background: #faf6fb; }
.bg-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.bg-checks li::before { content: "✓ "; color: #ff8fb8; font-weight: 900; }
.bg-legal h2 { font-size: 1.3rem; margin-top: 1.8em; }
.bg-inline-btn { display: inline-block; background: var(--accent); color: #fff !important; padding: 13px 24px; border-radius: 999px; font-weight: 800; text-decoration: none; }
a:hover > .bg-inline-btn { background: #d81b60; }

/* Contact Form 7 */
.wpcf7-form p { margin: 0 0 16px; font-weight: 700; font-size: .95rem; }
.wpcf7-form input[type=text], .wpcf7-form input[type=email], .wpcf7-form input[type=tel], .wpcf7-form textarea {
	width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font: 400 1rem var(--font); background: #fff; color: var(--ink); }
.wpcf7-form input:focus, .wpcf7-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wpcf7-form textarea { min-height: 150px; resize: vertical; }
.wpcf7-form .wpcf7-submit { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 13px 28px; font: 800 1rem var(--font); cursor: pointer; }
.wpcf7-form .wpcf7-submit:hover { background: var(--accent-dark); }
.wpcf7 .wpcf7-response-output { border-radius: 10px; margin: 12px 0 0; }

/* Placeholder mascot on beanies without a photo yet */
.bdb-card__img--placeholder { opacity: .55; padding: 18%; }
