/**
 * OM Editing Top — design enhancement layer.
 *
 * Loaded after style.css, so it only needs to override what changes. The
 * theme's markup and class names are untouched; everything here is styling.
 */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
	/* Brand: violet → fuchsia, warm amber accent. */
	--om-brand:       #7c3aed;
	--om-brand-600:   #6d28d9;
	--om-brand-500:   #8b5cf6;
	--om-brand-soft:  #f3efff;
	--om-accent:      #f59e0b;
	--om-pink:        #ec4899;

	--om-ink:         #14131a;
	--om-muted:       #5c5a6b;
	--om-faint:       #8d8b9c;

	--om-bg:          #ffffff;
	--om-bg-soft:     #f8f7fc;
	--om-line:        #e9e7f0;
	--om-line-soft:   #f1eff7;

	--om-r:           16px;
	--om-r-sm:        11px;
	--om-r-pill:      999px;

	--om-sh-sm:       0 1px 2px rgba(20,19,35,.05);
	--om-sh:          0 6px 20px rgba(20,19,35,.08);
	--om-sh-lg:       0 18px 44px rgba(20,19,35,.16);

	--om-ease:        cubic-bezier(.22,1,.36,1);

	color-scheme: light;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

body {
	font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont,
		"Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--om-ink);
	background: var(--om-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* The fixed bottom bar is mobile-only now (see section 9), so the reserved
   space has to be mobile-only too. */
body { padding-bottom: 0; }

::selection { background: var(--om-brand-500); color: #fff; }

:focus-visible {
	outline: 2px solid var(--om-brand-500);
	outline-offset: 2px;
	border-radius: 6px;
}

/* ==========================================================================
   3. Header
   ========================================================================== */

.site-header {
	background: rgba(255, 255, 255, .82);
	backdrop-filter: saturate(180%) blur(16px);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	border-bottom: 1px solid var(--om-line);
}

.site-logo {
	background: linear-gradient(100deg, var(--om-brand) 0%, var(--om-pink) 55%, var(--om-accent) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	letter-spacing: -.04em;
	font-weight: 800;
}

.main-nav a {
	color: var(--om-muted);
	font-weight: 550;
	padding: 8px 2px;
	position: relative;
	transition: color .18s var(--om-ease);
}

.main-nav a:not(.btn-join):hover { color: var(--om-brand); }

/* Underline that grows from the centre on hover. */
.main-nav a:not(.btn-join)::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 0;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--om-brand), var(--om-pink));
	transform: translateX(-50%);
	transition: width .22s var(--om-ease);
}

.main-nav a:not(.btn-join):hover::after { width: 100%; }

.btn-join {
	background: linear-gradient(100deg, var(--om-brand) 0%, var(--om-pink) 100%);
	box-shadow: 0 6px 18px rgba(124, 58, 237, .32);
	transition: transform .18s var(--om-ease), box-shadow .18s var(--om-ease);
}

.btn-join:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(124, 58, 237, .42);
}

.nav-toggle { color: var(--om-ink); border-radius: 8px; }

/* The nav is the flexible half of the header; let it shrink and keep the
   CTA fully inside the container instead of clipping at the right edge. */
.site-header .container { gap: 24px; }
.main-nav { flex: 0 1 auto; min-width: 0; gap: 22px; }
.btn-join { flex: none; white-space: nowrap; }

/* ==========================================================================
   4. Search
   ========================================================================== */

.search-bar {
	border-bottom: 0;
	padding: 22px 0 6px;
}

.search-bar form {
	background: var(--om-bg-soft);
	border: 1px solid var(--om-line);
	border-radius: var(--om-r);
	padding: 13px 20px;
	box-shadow: var(--om-sh-sm);
	transition: border-color .18s var(--om-ease), box-shadow .18s var(--om-ease);
}

.search-bar form:focus-within {
	border-color: var(--om-brand-500);
	box-shadow: 0 0 0 4px rgba(139, 92, 246, .14);
}

.search-bar input { color: var(--om-ink); }
.search-bar input::placeholder { color: var(--om-faint); }

/* ==========================================================================
   5. Filter chips
   ========================================================================== */

.filters { padding: 16px 0 10px; }

.chip {
	border-color: var(--om-line);
	color: var(--om-muted);
	background: var(--om-bg);
	transition: all .18s var(--om-ease);
}

.chip:hover {
	border-color: var(--om-brand-500);
	color: var(--om-brand);
	background: var(--om-brand-soft);
	transform: translateY(-1px);
}

.chip.active {
	background: linear-gradient(100deg, var(--om-brand) 0%, var(--om-pink) 100%);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 4px 14px rgba(124, 58, 237, .3);
}

.chip.active:hover { color: #fff; transform: translateY(-1px); }

/* The AI-tool row reads as secondary. */
.chip.tool {
	font-size: 13px;
	padding: 7px 15px;
	background: var(--om-bg-soft);
}

.chip.tool.active { background: linear-gradient(100deg, var(--om-brand-600), var(--om-brand)); }

/* ==========================================================================
   6. Gallery grid + cards

   The theme uses CSS multi-column for the masonry effect. Multi-column fills
   column-by-column, so card 2 lands *below* card 1 instead of beside it —
   which makes pinned prompts look like they climb up from the bottom. A real
   grid fills row-by-row, so reading order matches DOM order (pinned first).
   ========================================================================== */

.gallery { padding: 14px 0 70px; }

.grid {
	columns: auto;                    /* cancel the theme's multi-column */
	column-gap: normal;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 18px;
	align-items: start;
}

/* Uniform tiles: every card is the same 3:4 portrait box, so rows line up. */
.card {
	margin-bottom: 0;                 /* the grid gap handles spacing now */
	aspect-ratio: 3 / 4;
}

.card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.card {
	border-radius: var(--om-r);
	background: var(--om-bg-soft);
	box-shadow: var(--om-sh-sm);
	transition: transform .26s var(--om-ease), box-shadow .26s var(--om-ease);
}

.card:hover {
	transform: translateY(-4px);
	box-shadow: var(--om-sh-lg);
}

/* Gradient scrim so the badge and the hover label stay readable on any image. */
.card::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(to bottom,
		rgba(0, 0, 0, .16) 0%,
		rgba(0, 0, 0, .04) 14%,
		rgba(0, 0, 0, 0) 32%,
		rgba(0, 0, 0, 0) 66%,
		rgba(0, 0, 0, .40) 100%);
	opacity: 0;
	transition: opacity .26s var(--om-ease);
}

.card:hover::before { opacity: 1; }

/* The pinned badge carries its own contrast, so the resting card can stay
   completely clean. */

.card img { border-radius: var(--om-r); }

/* "View prompt" cue that slides up from the bottom edge on hover. */
.card::after {
	content: "View prompt →";
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 4;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -.01em;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .24s var(--om-ease), transform .24s var(--om-ease);
	pointer-events: none;
}

.card:hover::after { opacity: 1; transform: translateY(0); }

/* Pinned badge — smaller and glassy rather than a solid black slab. */
.card .pin {
	z-index: 5;
	top: 11px;
	left: 11px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 11px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	background: rgba(255, 255, 255, .92);
	color: var(--om-brand-600);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

.card .pin-toggle { z-index: 6; }
.card .pin-toggle.pinned { background: var(--om-pink); }

/* ==========================================================================
   7. Pagination
   ========================================================================== */

.page-numbers {
	border-color: var(--om-line);
	border-radius: var(--om-r-sm);
	color: var(--om-muted);
	padding: 9px 15px;
	transition: all .18s var(--om-ease);
}

.page-numbers:hover {
	border-color: var(--om-brand-500);
	color: var(--om-brand);
	background: var(--om-brand-soft);
}

.page-numbers.current {
	background: linear-gradient(100deg, var(--om-brand), var(--om-pink));
	border-color: transparent;
	color: #fff;
	box-shadow: 0 4px 14px rgba(124, 58, 237, .3);
}

/* ==========================================================================
   8. Single prompt
   ========================================================================== */

.back-link {
	color: var(--om-muted);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 15px;
	border: 1px solid var(--om-line);
	border-radius: var(--om-r-pill);
	background: var(--om-bg);
	font-size: 14px;
	transition: all .18s var(--om-ease);
}

.back-link:hover {
	color: var(--om-brand);
	border-color: var(--om-brand-500);
	background: var(--om-brand-soft);
	transform: translateX(-2px);
}

.single-image {
	background: var(--om-bg-soft);
	border: 1px solid var(--om-line);
	border-radius: var(--om-r);
	box-shadow: var(--om-sh);
}

.single-image img { border-radius: calc(var(--om-r) - 1px); }

.tool-badge {
	background: var(--om-brand-soft);
	color: var(--om-brand-600);
	border-radius: var(--om-r-pill);
	padding: 6px 14px;
	font-size: 13px;
}

.single-meta { color: var(--om-faint); }

.single-title {
	font-size: 30px;
	letter-spacing: -.03em;
	line-height: 1.22;
}

/* The prompt text itself is the point of the page — make it look like a
   proper code/copy surface instead of washed-out brown on grey. */
.prompt-box {
	position: relative;
	background:
		linear-gradient(180deg, rgba(124, 58, 237, .05), rgba(236, 72, 153, .04)),
		var(--om-bg-soft);
	border: 1px solid var(--om-line);
	border-left: 4px solid var(--om-brand-500);
	border-radius: var(--om-r);
	color: var(--om-ink);
	font-size: 15px;
	line-height: 1.75;
	padding: 22px 22px 22px 24px;
	box-shadow: var(--om-sh-sm);
}

.btn {
	border-radius: var(--om-r-sm);
	transition: transform .18s var(--om-ease), box-shadow .18s var(--om-ease), opacity .18s var(--om-ease);
}

.btn-primary {
	background: linear-gradient(100deg, var(--om-brand) 0%, var(--om-pink) 100%);
	border-color: transparent;
	box-shadow: 0 6px 20px rgba(124, 58, 237, .32);
}

.btn-primary:hover {
	opacity: 1;
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(124, 58, 237, .44);
}

.btn-outline {
	border-color: var(--om-line);
	color: var(--om-ink);
	background: var(--om-bg);
}

.btn-outline:hover {
	opacity: 1;
	transform: translateY(-2px);
	border-color: var(--om-brand-500);
	color: var(--om-brand);
	box-shadow: var(--om-sh);
}

.btn.copied {
	background: #16a34a;
	border-color: #16a34a;
	box-shadow: 0 6px 20px rgba(22, 163, 74, .32);
}

.single-article { border-top-color: var(--om-line); color: #3a3849; }
.single-article a { color: var(--om-brand); }
.single-article li::marker { color: var(--om-brand-500); }

.single-article h2,
.single-article h3 { letter-spacing: -.02em; }

/* ==========================================================================
   9. Bottom navigation — mobile only
   ========================================================================== */

/* On desktop the header already carries the same links, and a fixed bar
   floating over the gallery is just noise. */
.bottom-nav { display: none; }

@media (max-width: 900px) {
	.bottom-nav {
		display: flex;
		background: rgba(255, 255, 255, .93);
		backdrop-filter: saturate(180%) blur(16px);
		-webkit-backdrop-filter: saturate(180%) blur(16px);
		border-top: 1px solid var(--om-line);
		box-shadow: 0 -6px 24px rgba(20, 19, 35, .08);
	}

	body { padding-bottom: 68px; }

	.bn-item { color: var(--om-faint); }
	.bn-item.active { color: var(--om-brand); }

	.bn-item.active .bn-icon {
		transform: translateY(-1px) scale(1.08);
		transition: transform .2s var(--om-ease);
	}
}

/* ==========================================================================
   10. Footer
   ========================================================================== */

.site-footer {
	border-top: 1px solid var(--om-line);
	background: var(--om-bg-soft);
	padding: 38px 0;
}

.footer-links a {
	color: var(--om-muted);
	transition: color .18s var(--om-ease);
}

.footer-links a:hover { color: var(--om-brand); }
.footer-copy { color: var(--om-faint); }

/* ==========================================================================
   11. Community / static pages
   ========================================================================== */

.community-intro,
.comment-form {
	background: var(--om-bg-soft);
	border: 1px solid var(--om-line);
	border-radius: var(--om-r);
}

.comment-form input[type=text],
.comment-form input[type=email],
.comment-form textarea {
	border-color: var(--om-line);
	border-radius: var(--om-r-sm);
	background: var(--om-bg);
	transition: border-color .18s var(--om-ease), box-shadow .18s var(--om-ease);
}

.comment-form input[type=text]:focus,
.comment-form input[type=email]:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: var(--om-brand-500);
	box-shadow: 0 0 0 3px rgba(139, 92, 246, .15);
}

.comment-form .form-submit input,
.comment-form input#submit {
	background: linear-gradient(100deg, var(--om-brand), var(--om-pink));
	border-radius: var(--om-r-sm);
	box-shadow: 0 6px 18px rgba(124, 58, 237, .3);
	transition: transform .18s var(--om-ease);
}

.comment-form .form-submit input:hover,
.comment-form input#submit:hover { transform: translateY(-2px); }

.comment-avatar { background: linear-gradient(135deg, var(--om-brand), var(--om-pink)); }

.page-wrap h1,
.community-header h1,
.coming-soon h1 { letter-spacing: -.03em; }

.coming-soon h2 { color: var(--om-brand); }
.coming-soon p a { color: var(--om-brand); }

.no-prompts { color: var(--om-faint); }

/* ==========================================================================
   12. Toast
   ========================================================================== */

.toast {
	background: var(--om-ink);
	box-shadow: var(--om-sh-lg);
	bottom: 86px;
}

@media (min-width: 901px) {
	.toast { bottom: 30px; }
}

/* ==========================================================================
   13. Grid breakpoints
   ========================================================================== */

@media (max-width: 1200px) {
	.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 600px) {
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* ==========================================================================
   14. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}

	.card:hover,
	.btn:hover,
	.chip:hover,
	.btn-join:hover { transform: none; }
}
