/*
Theme Name: Perdita
Theme URI: https://perdita.ericrosenberg.com
Author: Eric Rosenberg
Author URI: https://ericrosenberg.com
Description: An AI-first theme framework for WordPress. Describe what you want in the Customizer and AI tunes your site's design, layout, and SEO from one structured token document. Generate an activated child theme in a click. Core version free and open source, forever.
Version: 0.16.1-alpha
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: perdita
Domain Path: /languages
Tags: ai, customizer, full-width-template, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, blog
*/

/* ---------------------------------------------------------------------------
   Structural scaffolding only. Colors, fonts, type scale, radius, header and
   footer colors come from the generated token CSS that Perdita injects in the
   <head> (see Perdita_CSS). Edit your design in Appearance > Customize, not here.
--------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Sticky footer: body fills the viewport, content grows, footer pins to the
   bottom with no empty block beneath it on short pages. */
body { margin: 0; display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
img, svg, video { max-width: 100%; height: auto; }
a img { border: 0; }

.perdita-container {
	width: 100%;
	max-width: var(--perdita-content-width, 1200px);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Skip link + screen-reader text (accessibility) */
.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: .6rem 1rem; background: #fff; }
.skip-link:focus { left: 0; }

/* Header */
.site-header { padding-block: clamp(.75rem, 2vw, 1.25rem); }
.site-header .perdita-container {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.site-branding { display: flex; align-items: center; gap: .6rem; }
.site-title { font-size: 1.25rem; margin: 0; }
.site-title a { text-decoration: none; }
.site-description { margin: 0; opacity: .75; font-size: .9rem; }
.custom-logo { max-height: 48px; width: auto; }

.main-navigation ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
.main-navigation a { text-decoration: none; }
.menu-toggle { display: none; }

.perdita-header-logo-center .site-header .perdita-container { flex-direction: column; text-align: center; }
.perdita-header-logo-right .site-header .perdita-container { flex-direction: row-reverse; }

/* Site content layout */
.site-content { padding-block: clamp(2rem, 6vw, 4rem); }
.perdita-has-sidebar .site-content .perdita-container {
	display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: clamp(1.5rem, 4vw, 3rem);
}
.perdita-sidebar-left .site-content .perdita-container { grid-template-columns: 18rem minmax(0, 1fr); }
.perdita-sidebar-left .primary-sidebar { order: -1; }

/* Posts and pages */
.entry { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.entry-title { margin: 0 0 .5rem; }
.entry-title a { text-decoration: none; }
.entry-meta { font-size: .9rem; color: var(--perdita-color-muted, #6b7280); margin-bottom: 1rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.entry-content > * + * { margin-top: 1.1rem; }
.entry-content img { border-radius: var(--perdita-radius, 8px); }
.post-thumbnail { display: block; margin-bottom: 1.25rem; }
.post-thumbnail img { border-radius: var(--perdita-radius, 8px); width: 100%; object-fit: cover; }
.read-more { font-weight: 600; }

.page-header { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.pagination { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }
.pagination .page-numbers { padding: .4rem .8rem; border: 1px solid var(--perdita-color-border, #e5e7eb); border-radius: var(--perdita-radius, 8px); text-decoration: none; }
.pagination .current { background: var(--perdita-color-primary, #2563eb); color: #fff; border-color: transparent; }

/* Widgets / sidebar */
.primary-sidebar .widget { margin-bottom: 2rem; }
.primary-sidebar ul { list-style: none; padding: 0; margin: 0; }
.primary-sidebar li { margin-bottom: .4rem; }

/* Forms */
input[type=text], input[type=search], input[type=email], input[type=url], textarea, select {
	max-width: 100%; padding: .55rem .7rem;
	border: 1px solid var(--perdita-color-border, #e5e7eb);
	border-radius: var(--perdita-radius, 8px); font: inherit; background: var(--perdita-color-surface, #f9fafb);
}

/* Footer */
.site-footer { padding-block: clamp(2rem, 5vw, 3rem); margin-top: clamp(2rem, 6vw, 4rem); }
.site-footer .perdita-container { display: flex; flex-direction: column; gap: 1rem; }

/* Comments */
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }

/* Mobile */
@media (max-width: 782px) {
	.perdita-has-sidebar .site-content .perdita-container,
	.perdita-sidebar-left .site-content .perdita-container { grid-template-columns: 1fr; }
	.main-navigation ul { gap: .9rem; }
}

/* Block pattern sections (token-aware helpers used by the pattern library) */
.perdita-section { padding-block: clamp(2rem, 6vw, 4rem); }
.perdita-section--surface { background: var(--perdita-color-surface); }
.perdita-section--primary { background: var(--perdita-color-primary); color: #fff; }
.perdita-section--primary :is(h1, h2, h3, p, a) { color: #fff; }
.perdita-card { background: var(--perdita-color-surface); border: 1px solid var(--perdita-color-border); border-radius: var(--perdita-radius); padding: 1.5rem; }

/* Header builder: CTA button + search */
.perdita-header__extra { display: flex; align-items: center; gap: 1rem; }
.perdita-header__cta { background: var(--perdita-color-primary); color: #fff; padding: .5rem 1rem; border-radius: var(--perdita-radius); text-decoration: none; font-weight: 600; }
.perdita-header__search input { padding: .4rem .6rem; border: 1px solid var(--perdita-color-border); border-radius: var(--perdita-radius); font: inherit; }

/* Footer builder: widget columns */
.perdita-footer__widgets { display: grid; gap: 2rem; margin-bottom: 1.5rem; }
.perdita-footer__widgets.cols-2 { grid-template-columns: repeat(2, 1fr); }
.perdita-footer__widgets.cols-3 { grid-template-columns: repeat(3, 1fr); }
.perdita-footer__widgets.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Blog / archive grid layout */
.perdita-posts--grid { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); }
.perdita-posts--grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.perdita-posts--grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.perdita-posts--grid .entry { margin-bottom: 0; }

@media (max-width: 782px) {
	.perdita-footer__widgets, .perdita-posts--grid { grid-template-columns: 1fr !important; }
}
