/* ==========================================================================
   AIM KS theme — hand-written layer on top of design.css (generated Tailwind).
   Everything is scoped to .aim-scope (header, footer, design canvas).
   ========================================================================== */

/* ---- Page shell ------------------------------------------------------- */
body.aim-site { --aim-maroon:#4c121d; --aim-maroon-hover:#5e1825; --aim-gold:#c4a15a; --aim-cream:#fffdf8; --aim-paper:#f6f1e8; --aim-ink:#161311; }
body.aim-design { background: var(--aim-paper); color: var(--aim-ink); }
body.aim-site #wrapper { overflow: visible; overflow-x: clip; }
body.aim-design #inner-wrap { display: block; background: transparent; padding: 0; }
.aim-scope { font-family: var(--font-sans); line-height: 1.55; color: var(--color-ink); -webkit-text-size-adjust: 100%; }
.aim-main { width: 100%; background: var(--color-paper); overflow-wrap: break-word; }
.aim-scope h1, .aim-scope h2, .aim-scope h3, .aim-scope h4 { line-height: 1.15; color: inherit; letter-spacing: normal; text-transform: none; }
/* !important: the "Use Any Font" plugin forces its Kirsty font on every h1/h2 with !important. */
.aim-scope h1, .aim-scope h2, .aim-scope h3, .aim-scope h4 { font-family: var(--font-display) !important; }
.aim-scope h5, .aim-scope h6 { font-family: inherit; color: inherit; }
.aim-scope button, .aim-scope input[type=submit] { box-shadow: none; text-shadow: none; background-image: none; border-radius: 0; min-height: 0; }
.aim-scope button:where(:not([class*="bg-"])) { background: transparent; }
.aim-scope button:where(:not([class*="bg-"])):hover, .aim-scope button:where(:not([class*="bg-"])):focus { background: transparent; }
.aim-scope a:focus-visible, .aim-scope button:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.aim-scope ::selection { color: #fffdf8; background: #4c121d; }

/* ---- Header (own box styles; utilities style its children) ------------ */
.aim-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgb(196 161 90 / .6); background: var(--color-maroon); color: var(--color-cream); }
.admin-bar .aim-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .aim-header { top: 0; } }
.aim-header img { display: block; }
.aim-header .aim-mobile-menu a { color: var(--color-cream); }
.aim-header .aim-mobile-menu a.bg-gold { color: var(--color-ink); }
.aim-header .aim-menu-toggle { padding: 0; background: transparent; color: var(--color-cream); border: 1px solid rgb(196 161 90 / .5); cursor: pointer; }
.aim-header .aim-menu-toggle span { display: inline-flex; }
.aim-header .aim-menu-toggle span[hidden] { display: none; }
.aim-header .aim-mobile-menu { max-height: calc(100vh - 80px); overflow-y: auto; }
.aim-header nav > a, .aim-header nav button { min-height: 36px; }

/* ---- Footer ------------------------------------------------------------ */
.aim-footer { margin-top: 4rem; background: var(--color-maroon); color: var(--color-cream); }
.aim-footer a { color: inherit; }
.aim-footer a.bg-gold { color: var(--color-ink); }
.aim-footer img { display: block; }
body.aim-site #colophon, body.aim-site .site-footer:not(.aim-footer) { display: none; }

/* ---- Block wrappers inside the design canvas --------------------------- */
.aim-scope .wp-block-group { box-sizing: border-box; }
.aim-scope :where(.wp-block-group.is-layout-flow) > * { margin-block-start: 0; }
.aim-scope p:empty { display: none; }
.aim-scope .wp-block-html { display: contents; }

/* Images: classes on the <figure> carry the box (size/aspect/border); the <img> fills it. */
.aim-scope figure.wp-block-image { margin: 0; }
.aim-scope figure.wp-block-image.aim-img { display: block; }
.aim-scope figure.wp-block-image.aim-img > img,
.aim-scope figure.wp-block-image.aim-img > a > img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: inherit; object-position: inherit; border: 0; }
.aim-scope figure.wp-block-image.aim-img[class*="aspect-"] > img { position: static; }
.aim-scope figure.wp-block-image figcaption { margin: .5rem 0 0; font-size: .875rem; color: var(--color-muted); }
.aim-scope .article-img > img { width: 100%; height: auto; }
.aim-scope .flier-preview-stack .wp-block-image.article-img { width: 100%; }

/* Lists (core/list keeps the review-site classes on the <ul>/<ol>). */
.aim-scope ol.list-decimal { list-style: decimal; }
.aim-scope ul.list-disc { list-style: disc; }

/* Buttons block: behaves like the review site's flex rows. */
.aim-scope .wp-block-buttons { display: flex; flex-wrap: wrap; align-items: stretch; gap: .75rem; margin-left: 0; margin-right: 0; }
.aim-scope .wp-block-buttons:not([class*="mt-"]):not([class*="my-"]) { margin-top: 0; }
.aim-scope .wp-block-buttons:not([class*="mb-"]):not([class*="my-"]) { margin-bottom: 0; }
.aim-scope .wp-block-buttons.flex-col { flex-direction: column; }
@media (width >= 40rem) { .aim-scope .wp-block-buttons.sm\:flex-row { flex-direction: row; } }
.aim-scope .wp-block-buttons > .wp-block-button { margin: 0; display: flex; }
.aim-scope .wp-block-button .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
	padding: .75rem 1.25rem; border-radius: 0; border: 1px solid transparent; box-shadow: none;
	font-family: var(--font-sans); font-size: .875rem; line-height: 1.25rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; text-decoration: none; text-align: center;
	transition: background-color .15s, color .15s, border-color .15s;
}
.aim-scope .wp-block-button.is-style-aim-gold .wp-block-button__link { background: var(--color-gold); color: var(--color-ink); border-color: var(--color-gold); }
.aim-scope .wp-block-button.is-style-aim-gold .wp-block-button__link:hover { background: var(--color-cream); border-color: var(--color-cream); color: var(--color-ink); }
.aim-scope .wp-block-button.is-style-aim-outline-light .wp-block-button__link { background: transparent; color: var(--color-cream); border-color: rgb(255 253 248 / .4); }
.aim-scope .wp-block-button.is-style-aim-outline-light .wp-block-button__link:hover { border-color: var(--color-gold); color: var(--color-gold); }
.aim-scope .wp-block-button.is-style-aim-maroon .wp-block-button__link { background: var(--color-maroon); color: var(--color-cream); border-color: var(--color-maroon); padding: .75rem 1rem; }
.aim-scope .wp-block-button.is-style-aim-maroon .wp-block-button__link:hover { background: #5e1825; border-color: #5e1825; }
.aim-scope .wp-block-button.is-style-aim-outline-dark .wp-block-button__link { background: var(--color-cream); color: var(--color-ink); border-color: var(--color-ink); padding: .75rem 1rem; }
.aim-scope .wp-block-button.is-style-aim-outline-dark .wp-block-button__link:hover { background: var(--color-ink); color: var(--color-gold); }
.aim-scope .wp-block-button.is-style-aim-tag .wp-block-button__link { background: var(--color-cream); color: var(--color-maroon); border-color: var(--color-line); padding: .5rem .75rem; font-size: .75rem; line-height: 1rem; }
.aim-scope .wp-block-button.is-style-aim-tag .wp-block-button__link:hover { border-color: var(--color-maroon); }
.aim-scope .wp-block-button.is-content-justification-left .wp-block-button__link, .aim-scope .wp-block-button.aim-inline .wp-block-button__link { width: auto; }
/* Contact page big gold Donate */
.aim-scope .wp-block-button.contact-donate { display: inline-block; padding: 0; box-shadow: none; }
.aim-scope .wp-block-button.contact-donate .wp-block-button__link { padding: 1rem 3.5rem; font-size: 1.25rem; line-height: 1.5; box-shadow: 4px 4px 0 #4c121d; background: var(--color-gold); color: var(--color-ink); border: 0; }
.aim-scope .wp-block-button.contact-donate .wp-block-button__link:hover { background: var(--color-ink); color: var(--color-gold); }
/* Icons on buttons (CSS masks so editors never touch SVG) */
.aim-scope .wp-block-button.aim-icon-arrow .wp-block-button__link::after,
.aim-scope .wp-block-button.aim-icon-download .wp-block-button__link::before,
.aim-scope .aim-arrow-link::after {
	content: ""; display: inline-block; width: 1rem; height: 1rem; flex: none; background: currentColor;
	-webkit-mask: var(--aim-icon) center / contain no-repeat; mask: var(--aim-icon) center / contain no-repeat;
}
.aim-scope .wp-block-button.aim-icon-arrow, .aim-scope .aim-arrow-link { --aim-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E"); }
.aim-scope .wp-block-button.aim-icon-download { --aim-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
.aim-scope .aim-arrow-link a { display: inline-flex; align-items: center; gap: .5rem; }
.aim-scope p.aim-arrow-link { display: inline-flex; align-items: center; gap: .5rem; }

/* Whole-card links: the first link inside the card stretches over the card. */
.aim-scope .aim-linkcard { position: relative; }
.aim-scope .aim-linkcard a.aim-stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.aim-scope .aim-linkcard a.aim-stretch { color: inherit; text-decoration: none; }

/* Home hero (core/cover with background video). */
.aim-scope .wp-block-cover.aim-hero { padding: 0; min-height: 78vh; align-items: stretch; background: var(--color-ink); color: var(--color-cream); }
.aim-scope .wp-block-cover.aim-hero .wp-block-cover__video-background { opacity: .7; }
.aim-scope .wp-block-cover.aim-hero .wp-block-cover__background { background-color: #4c121d !important; opacity: .55 !important; }
.aim-scope .wp-block-cover.aim-hero .wp-block-cover__inner-container { width: 100%; color: inherit; z-index: 1; display: flex; }
.aim-scope .wp-block-cover.aim-hero .wp-block-cover__inner-container > .wp-block-group { width: 100%; }

/* Embeds placed in Custom HTML blocks (YouTube, Donorbox). */
.aim-scope iframe { max-width: 100%; border: 0; display: block; }

/* Dynamic blocks from the AIM KS Toolkit plugin flow into the parent grid. */
.aim-scope .aim-card-list { display: contents; }

/* Phones: never allow sideways scrolling from long URLs/words. */
.aim-scope .article-sources-list, .aim-scope .article-sources-list a { overflow-wrap: anywhere; }
.aim-main table { max-width: 100%; }
@media (max-width: 40rem) {
	.aim-main pre, .aim-main table { display: block; overflow-x: auto; }
}

/* Membership questionnaire ([aimks_join_form]) */
.aim-scope .aim-radio:has(input:checked) { border-color: var(--color-maroon); background: var(--color-maroon); color: var(--color-cream); }
.aim-scope .aim-radio:focus-within { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.aim-scope .aim-join input { font-size: 1rem; }
.aim-scope .aim-join button[type=submit]:hover { background: var(--color-maroon); color: var(--color-cream); }

/* Keep Tailwind space-y-* rhythm for button rows (our .wp-block-buttons reset above would zero it). */
.aim-scope .space-y-2 > .wp-block-buttons:not(:last-child) { margin-bottom: 0.5rem; }
.aim-scope .space-y-3 > .wp-block-buttons:not(:last-child) { margin-bottom: 0.75rem; }
.aim-scope .space-y-4 > .wp-block-buttons:not(:last-child) { margin-bottom: 1rem; }
.aim-scope .space-y-5 > .wp-block-buttons:not(:last-child) { margin-bottom: 1.25rem; }
.aim-scope .space-y-6 > .wp-block-buttons:not(:last-child) { margin-bottom: 1.5rem; }
.aim-scope .space-y-8 > .wp-block-buttons:not(:last-child) { margin-bottom: 2rem; }
.aim-scope .space-y-12 > .wp-block-buttons:not(:last-child) { margin-bottom: 3rem; }

/* Review-site rules whose selectors start at <body> (cannot be auto-scoped). */
body:has(.aim-scope .contact-donate) .aim-scope .footer-donate { display: none; }
@media (width >= 48rem) { .aim-scope .wp-block-buttons.contact-social { flex-wrap: nowrap; white-space: nowrap; } }
