/* App content styling — theme-agnostic, layered on top of whichever LCARS theme CSS is active. */

:root {
	--app-gold: #ffcc66;
	--app-orange: #eb943a;
	--app-red: #cf4f4f;
	--app-line: rgba(255, 255, 255, 0.25);
	--app-panel-bg: rgba(255, 255, 255, 0.06);

	/*
	 * Each theme's corner accent (.right-frame::before, at the seam between
	 * the sidebar and content area) is themed to its own palette by default.
	 * Home (c0, first sidebar button) and the adjacent horizontal divider bar
	 * are both --app-red, so recolor the accent to match and read as one
	 * continuous shape instead of a clash.
	 */
	--corner-color-bottom: var(--app-red);
}

.app-content {
	max-width: 960px;
}

.app-content a { color: var(--app-gold); }
.app-content a:hover { color: var(--app-orange); }

/*
 * Some themes (classic, nemesis-blue, lower-decks) draw a decorative black
 * ::before block absolutely-positioned over the top of .left-frame, sized to
 * match the original template's panel-3 button. Positioned elements paint
 * after static siblings regardless of DOM order, so it now covers our nav
 * buttons instead of sitting behind them — remove it.
 */
.left-frame::before { content: none; }

/*
 * Sidebar navigation — lives inside each theme's own .left-frame column
 * (replacing the template's decorative placeholder buttons), styled as
 * stacked LCARS color blocks rather than a generic web nav bar.
 */
.app-sidenav {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 3px;
	background: #000;
}

.app-sidenav a,
.app-sidenav .app-navbtn {
	display: flex;
	flex: 1;
	min-height: 2.1rem;
	align-items: center;
	justify-content: flex-end;
	padding: 0.35rem 1rem;
	text-align: right;
	text-decoration: none;
	text-transform: uppercase;
	font-weight: bold;
	letter-spacing: 0.02em;
	color: #000;
	border: none;
	cursor: pointer;
	font: inherit;
	width: 100%;
	box-sizing: border-box;
}

/*
 * The template's first sidebar panel (originally panel-3) carries a large
 * swept corner that continues the curve started by the header above it.
 * --radius-bottom is defined per-theme at :root; themes without it (Picard)
 * just stay a plain rectangle.
 */
.app-sidenav > a:first-child,
.app-sidenav > form:first-child .app-navbtn {
	border-radius: var(--radius-bottom, 0);
}

.app-sidenav form { display: contents; }

/*
 * A cohesive warm palette (red -> orange -> gold -> rust -> tan) so the
 * sidebar blends with the red horizontal divider bar it sits beside — Home
 * (c0) matches that bar's red exactly — instead of cycling through unrelated
 * hues (blue/purple) that clash with it.
 */
.app-sidenav .c0 { background: var(--app-red); color: #fff; }
.app-sidenav .c1 { background: var(--app-orange); }
.app-sidenav .c2 { background: var(--app-gold); }
.app-sidenav .c3 { background: #a8433f; color: #fff; }
.app-sidenav .c4 { background: #d9a066; }
.app-sidenav .c5 { background: #e0c9a6; }

.app-sidenav a.active,
.app-sidenav .app-navbtn.active {
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.app-flash {
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border-radius: 0.5rem;
	border: 1px solid var(--app-gold);
	background: rgba(255, 204, 102, 0.12);
}

.app-flash.error {
	border-color: var(--app-red);
	background: rgba(207, 79, 79, 0.15);
}

.app-content h1, .app-content h2, .app-content h3 {
	color: var(--app-gold);
}

.app-card {
	border: 1px solid var(--app-line);
	border-radius: 0.75rem;
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
	background: var(--app-panel-bg);
}

.app-card-list .app-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/*
 * Real LCARS pill buttons for navigational index lists (people, stories,
 * timeline, projects) — matches the reference site's own .buttons/.buttons
 * button pattern (fixed-size capsules, border-radius:100vmax) instead of
 * plain list rows.
 */
.app-button-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 1rem 0;
}

a.app-pill-btn {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-end;
	width: 224px;
	min-height: 80px;
	padding: 0.6rem 1.75rem;
	border-radius: 100vmax;
	border: none;
	text-align: right;
	text-decoration: none;
	text-transform: uppercase;
	line-height: 1.2;
	font-weight: bold;
	color: #000;
	cursor: pointer;
	box-sizing: border-box;
}

.app-pill-btn .app-pill-meta {
	display: block;
	font-size: 0.75rem;
	font-weight: normal;
	opacity: 0.8;
	text-transform: none;
}

.app-pill-btn.c0 { background: var(--app-gold); }
.app-pill-btn.c1 { background: var(--app-orange); }
.app-pill-btn.c2 { background: var(--app-red); color: #fff; }
.app-pill-btn.c3 { background: #a8433f; color: #fff; }
.app-pill-btn.c4 { background: #d9a066; }
.app-pill-btn.c5 { background: #e0c9a6; }
.app-pill-btn.c6 { background: #b79fe0; }
.app-pill-btn.c7 { background: #8fb2d9; }

.app-meta {
	font-size: 0.8rem;
	opacity: 0.75;
}

.app-form label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	opacity: 0.85;
}

.app-form .field { margin-bottom: 1rem; }

.app-form input[type="text"],
.app-form input[type="email"],
.app-form input[type="password"],
.app-form input[type="date"],
.app-form input[type="number"],
.app-form select,
.app-form textarea {
	width: 100%;
	max-width: 480px;
	box-sizing: border-box;
	padding: 0.5rem 0.65rem;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid var(--app-line);
	border-radius: 0.4rem;
	color: inherit;
	font: inherit;
}

.app-form textarea { max-width: 100%; min-height: 8rem; }

.app-form .checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.app-form .checkbox-row input { width: auto; }

.app-btn {
	display: inline-block;
	padding: 0.5rem 1.1rem;
	border-radius: 0.4rem;
	border: 1px solid var(--app-gold);
	background: rgba(255, 204, 102, 0.15);
	color: var(--app-gold);
	font: inherit;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	text-decoration: none;
}

.app-btn:hover { background: rgba(255, 204, 102, 0.3); }

.app-btn.danger {
	border-color: var(--app-red);
	color: var(--app-red);
	background: rgba(207, 79, 79, 0.12);
}

.app-btn.small { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

table.app-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
}

.app-table th, .app-table td {
	text-align: left;
	padding: 0.5rem 0.6rem;
	border-bottom: 1px solid var(--app-line);
}

.app-table th {
	text-transform: uppercase;
	font-size: 0.8rem;
	opacity: 0.8;
}

.app-photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 0.75rem;
	margin: 1rem 0;
}

.app-photo-grid figure {
	margin: 0;
	border: 1px solid var(--app-line);
	border-radius: 0.5rem;
	overflow: hidden;
	background: var(--app-panel-bg);
}

.app-photo-grid img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	display: block;
}

.app-photo-grid figcaption {
	padding: 0.4rem 0.5rem;
	font-size: 0.75rem;
	opacity: 0.85;
}

.app-tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.5rem 0 1rem;
}

.app-tag {
	padding: 0.15rem 0.6rem;
	border: 1px solid var(--app-line);
	border-radius: 999px;
	font-size: 0.8rem;
}

.app-login-wrap {
	max-width: 360px;
	margin: 3rem auto;
}

.app-login-wrap .app-card { padding: 1.5rem; }
