/* Altius Workspace front-end styles.
   Scoped under .amp-wrap so theme styles and these coexist peacefully. */

.amp-wrap {
	--amp-ink: #1c2733;
	--amp-ink-soft: #5b6b7b;
	--amp-line: #e3e8ee;
	--amp-bg-card: #ffffff;
	--amp-accent: #0f4c81;      /* deep workshop blue */
	--amp-accent-ink: #ffffff;
	--amp-warm: #e8a33d;        /* Altius amber */
	--amp-image: #2f7d5c;
	--amp-video: #a04b8f;
	--amp-audio: #b3672b;
	--amp-document: #0f4c81;
	--amp-radius: 14px;
	max-width: 1040px;
	/* Default breathing room below the theme header; themes that already
	   pad their content area simply add this on top. */
	margin: 20px auto 0;
	color: var(--amp-ink);
	font-size: 16px;
	line-height: 1.55;
}
.amp-wrap * { box-sizing: border-box; }
.amp-wrap a { text-decoration: none; }

/* ---------- Cards & layout ---------- */
.amp-card {
	background: var(--amp-bg-card);
	border: 1px solid var(--amp-line);
	border-radius: var(--amp-radius);
	padding: 28px;
	margin: 0 0 24px;
	box-shadow: 0 1px 3px rgba(28, 39, 51, .06);
}
.amp-section-title { margin: 0 0 14px; font-size: 1.25rem; }
.amp-muted { color: var(--amp-ink-soft); }
.amp-small { font-size: .875rem; }
.amp-locked { text-align: center; padding: 48px 28px; }

/* ---------- Buttons ---------- */
.amp-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 999px;
	border: 1px solid transparent;
	font-weight: 600;
	font-size: .95rem;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.amp-btn:hover { transform: translateY(-1px); }
.amp-btn:focus-visible { outline: 3px solid var(--amp-warm); outline-offset: 2px; }
.amp-btn-primary { background: var(--amp-accent); color: var(--amp-accent-ink) !important; }
.amp-btn-primary:hover { background: #0c3d68; box-shadow: 0 3px 10px rgba(15, 76, 129, .3); }
.amp-btn-ghost { background: transparent; color: var(--amp-accent) !important; border-color: var(--amp-line); }
.amp-btn-ghost:hover { border-color: var(--amp-accent); }
.amp-btn-small { padding: 7px 14px; font-size: .85rem; }
.amp-btn-wide { width: 100%; }

/* ---------- Messages ---------- */
.amp-msg { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; font-size: .95rem; }
.amp-msg-error { background: #fdeeee; color: #8a1f1f; border: 1px solid #f3c8c8; }
.amp-msg-success { background: #ecf7ef; color: #1d5c33; border: 1px solid #c5e6cf; }

/* ---------- Dashboard hero ---------- */
.amp-hero {
	background: linear-gradient(120deg, #0f4c81 0%, #16639f 55%, #1c73b5 100%);
	color: #fff;
	border-radius: var(--amp-radius);
	padding: 32px;
	margin: 0 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	position: relative;
	overflow: hidden;
}
.amp-hero::after {
	content: "";
	position: absolute;
	right: -60px; top: -60px;
	width: 220px; height: 220px;
	border-radius: 50%;
	background: rgba(232, 163, 61, .18); /* soft amber glow, the Altius signature */
	pointer-events: none;
}
.amp-hero-id { display: flex; align-items: center; gap: 18px; }
.amp-hero-title { margin: 0; font-size: 1.6rem; color: #fff; line-height: 1.2; }
.amp-hero-sub { margin: 4px 0 0; color: rgba(255, 255, 255, .82); }
.amp-hero-actions { display: flex; gap: 10px; }
.amp-hero .amp-btn-ghost { color: #fff !important; border-color: rgba(255, 255, 255, .45); }
.amp-hero .amp-btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .1); }

.amp-avatar { border-radius: 50%; object-fit: cover; display: inline-flex; flex: 0 0 auto; border: 3px solid rgba(255,255,255,.6); }
.amp-card .amp-avatar { border-color: var(--amp-line); }
.amp-avatar-fallback {
	align-items: center; justify-content: center;
	background: var(--amp-warm); color: #fff; font-weight: 700;
}

/* ---------- Resource type cards ---------- */
.amp-type-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
	margin: 0 0 24px;
}
.amp-type-card {
	background: var(--amp-bg-card);
	border: 1px solid var(--amp-line);
	border-radius: var(--amp-radius);
	padding: 24px 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--amp-ink) !important;
	transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
	border-top: 4px solid var(--amp-line);
}
.amp-type-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(28, 39, 51, .1); }
.amp-type-image    { border-top-color: var(--amp-image); }
.amp-type-video    { border-top-color: var(--amp-video); }
.amp-type-audio    { border-top-color: var(--amp-audio); }
.amp-type-document { border-top-color: var(--amp-document); }
.amp-type-icon svg { width: 34px; height: 34px; fill: var(--amp-ink-soft); }
.amp-type-image .amp-type-icon svg    { fill: var(--amp-image); }
.amp-type-video .amp-type-icon svg    { fill: var(--amp-video); }
.amp-type-audio .amp-type-icon svg    { fill: var(--amp-audio); }
.amp-type-document .amp-type-icon svg { fill: var(--amp-document); }
.amp-type-name { font-weight: 700; font-size: 1.1rem; }
.amp-type-count { color: var(--amp-ink-soft); font-size: .875rem; }

/* ---------- Recently added ---------- */
.amp-recent { list-style: none; margin: 0; padding: 0; }
.amp-recent li {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 0; border-bottom: 1px solid var(--amp-line);
	flex-wrap: wrap;
}
.amp-recent li:last-child { border-bottom: 0; }
.amp-recent-title { flex: 1; min-width: 160px; font-weight: 600; }
.amp-recent-actions a { margin-left: 12px; color: var(--amp-accent); font-weight: 600; font-size: .9rem; }
.amp-pill {
	font-size: .72rem; font-weight: 700; letter-spacing: .04em;
	text-transform: uppercase; padding: 3px 10px; border-radius: 999px; color: #fff;
}
.amp-pill-image    { background: var(--amp-image); }
.amp-pill-video    { background: var(--amp-video); }
.amp-pill-audio    { background: var(--amp-audio); }
.amp-pill-document { background: var(--amp-document); }

/* ---------- Resource pages ---------- */
.amp-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.amp-search { display: flex; gap: 10px; margin: 0 0 20px; flex-wrap: wrap; }
.amp-search input[type="search"] {
	flex: 1; min-width: 200px; padding: 10px 14px;
	border: 1px solid var(--amp-line); border-radius: 999px; font-size: 1rem;
}
.amp-res-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}
.amp-res-card {
	background: var(--amp-bg-card);
	border: 1px solid var(--amp-line);
	border-radius: var(--amp-radius);
	overflow: hidden;
	display: flex; flex-direction: column;
}
.amp-res-preview { background: #f2f5f8; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.amp-res-preview img { width: 100%; height: 190px; object-fit: cover; display: block; }
.amp-res-preview video { width: 100%; max-height: 220px; display: block; background: #000; }
.amp-res-preview audio { width: 92%; margin: 24px 0; }
.amp-doc-icon svg { width: 52px; height: 52px; fill: var(--amp-document); opacity: .55; margin: 28px 0; }
.amp-res-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.amp-res-title { margin: 0 0 6px; font-size: 1.05rem; }
.amp-res-desc { color: var(--amp-ink-soft); font-size: .92rem; }
.amp-res-desc p { margin: 0 0 8px; }
.amp-res-actions { margin: auto 0 0; padding-top: 10px; display: flex; gap: 8px; }

.amp-pagination { margin: 24px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.amp-pagination a, .amp-pagination strong {
	padding: 8px 14px; border-radius: 8px; border: 1px solid var(--amp-line);
	color: var(--amp-accent); font-weight: 600;
}
.amp-pagination strong { background: var(--amp-accent); color: #fff; border-color: var(--amp-accent); }

/* ---------- Forms (login, profile) ---------- */
.amp-login-card { max-width: 440px; margin: 32px auto; }
.amp-login-title { margin: 0 0 4px; }
.amp-wrap input[type="text"],
.amp-wrap input[type="email"],
.amp-wrap input[type="password"],
.amp-wrap textarea {
	width: 100%; padding: 10px 14px;
	border: 1px solid var(--amp-line); border-radius: 8px; font-size: 1rem;
	background: #fff; color: var(--amp-ink);
}
.amp-wrap input:focus-visible, .amp-wrap textarea:focus-visible {
	outline: 2px solid var(--amp-accent); outline-offset: 1px; border-color: var(--amp-accent);
}
.amp-wrap label { font-weight: 600; font-size: .92rem; }
.amp-check { font-weight: 400; }
.amp-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 20px; }
.amp-profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }

/* ---------- Responsive & motion ---------- */
@media (max-width: 640px) {
	.amp-hero { padding: 24px 20px; }
	.amp-hero-title { font-size: 1.3rem; }
	.amp-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.amp-btn, .amp-type-card { transition: none; }
	.amp-btn:hover, .amp-type-card:hover { transform: none; }
}

/* ---------- Weblinks library ---------- */
.amp-wrap { --amp-weblink: #1d7a7a; }
.amp-type-weblink { border-top-color: var(--amp-weblink); }
.amp-type-weblink .amp-type-icon svg { fill: var(--amp-weblink); }
.amp-wrap .amp-letter {
	margin: 22px 0 8px;
	font-size: 1rem;
	color: var(--amp-weblink);
	border-bottom: 2px solid var(--amp-line);
	padding-bottom: 4px;
	letter-spacing: .06em;
}
.amp-wrap .amp-card .amp-letter:first-child { margin-top: 0; }
/* Specific selectors and explicit resets so theme list styling cannot win. */
.amp-wrap ul.amp-links { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.amp-wrap ul.amp-links > li {
	list-style: none !important;
	display: block;
	margin: 0;
	padding: 14px 0;
	border-bottom: 1px solid var(--amp-line);
}
.amp-wrap ul.amp-links > li::marker { content: none; }
.amp-wrap ul.amp-links > li:last-child { border-bottom: 0; }
.amp-wrap a.amp-link-name {
	display: block;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--amp-accent);
	border: 0;
	box-shadow: none;
	text-decoration: none;
}
.amp-wrap a.amp-link-name:hover { text-decoration: underline; }
.amp-wrap a.amp-link-url {
	display: block;
	margin-top: 2px;
	font-size: .9rem;
	color: var(--amp-weblink);
	border: 0;
	box-shadow: none;
	text-decoration: none;
	word-break: break-all;
}
.amp-wrap a.amp-link-url:hover { text-decoration: underline; }
.amp-wrap .amp-link-desc {
	display: block;
	margin-top: 4px;
	color: var(--amp-ink-soft);
	font-size: .95rem;
}

/* ---------- Member Forum ---------- */
.amp-wrap { --amp-forum: #6a5aa8; }
.amp-type-forum { border-top-color: var(--amp-forum); }
.amp-type-forum .amp-type-icon svg { fill: var(--amp-forum); }
.amp-wrap .amp-select {
	padding: 10px 14px; border: 1px solid var(--amp-line);
	border-radius: 999px; font-size: 1rem; background: #fff; color: var(--amp-ink);
}
.amp-forum-list { padding: 6px 28px; }
.amp-forum-row {
	display: flex; align-items: center; gap: 16px;
	padding: 16px 0; border-bottom: 1px solid var(--amp-line);
}
.amp-forum-row:last-child { border-bottom: 0; }
.amp-forum-main { flex: 1; min-width: 0; }
.amp-wrap a.amp-forum-title {
	display: block; font-weight: 700; font-size: 1.05rem;
	color: var(--amp-ink); text-decoration: none; border: 0; box-shadow: none;
}
.amp-wrap a.amp-forum-title:hover { color: var(--amp-forum); }
.amp-forum-meta { color: var(--amp-ink-soft); font-size: .85rem; margin: 4px 0 0; }
.amp-board-pill {
	display: inline-block; font-size: .72rem; font-weight: 700;
	letter-spacing: .04em; text-transform: uppercase;
	padding: 2px 10px; border-radius: 999px;
	background: var(--amp-forum); color: #fff; margin-right: 6px;
}
.amp-board-general { background: var(--amp-ink-soft); }
.amp-forum-count {
	text-align: center; min-width: 64px;
	font-weight: 700; font-size: 1.15rem; color: var(--amp-forum);
}
.amp-forum-count span { display: block; font-weight: 400; font-size: .75rem; color: var(--amp-ink-soft); }
.amp-answered { color: #1d7a3a; font-weight: 800; margin-right: 4px; }
.amp-topic-title { margin: 0 0 6px; font-size: 1.35rem; }
.amp-topic-body { margin-top: 10px; }
.amp-topic-body p { margin: 0 0 10px; }
.amp-reply { padding: 20px 24px; margin-bottom: 14px; }
.amp-reply-answer { border: 2px solid #1d7a3a; }
.amp-answer-badge {
	display: inline-block; background: #ecf7ef; color: #1d5c33;
	font-weight: 700; font-size: .8rem; padding: 3px 12px;
	border-radius: 999px; margin-bottom: 8px;
}
.amp-wrap a.amp-danger { color: #b32d2e; }

/* ---------- Staff-only replies ---------- */
.amp-reply-staff { border: 2px solid var(--amp-warm); background: #fffaf1; }
.amp-staff-badge {
	display: inline-block; background: #fdf1dc; color: #8a5a12;
	font-weight: 700; font-size: .8rem; padding: 3px 12px;
	border-radius: 999px; margin: 0 8px 8px 0;
}

/* ---------- Events calendar ---------- */
.amp-wrap { --amp-event: #b3423a; }
.amp-type-event { border-top-color: var(--amp-event); }
.amp-type-event .amp-type-icon svg { fill: var(--amp-event); }
.amp-cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.amp-cal-month { margin: 0; font-size: 1.2rem; }
.amp-cal-scroll { overflow-x: auto; }
.amp-wrap table.amp-cal { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; margin: 0; }
.amp-wrap .amp-cal th {
	padding: 8px 6px; font-size: .78rem; text-transform: uppercase;
	letter-spacing: .05em; color: var(--amp-ink-soft);
	border-bottom: 2px solid var(--amp-line); text-align: left;
}
.amp-wrap .amp-cal td {
	vertical-align: top; height: 84px; padding: 6px;
	border: 1px solid var(--amp-line);
}
.amp-cal-empty { background: #f6f8fa; }
.amp-cal-day { font-weight: 700; font-size: .85rem; color: var(--amp-ink-soft); display: block; margin-bottom: 4px; }
.amp-cal-today { background: #fdf6e9; }
.amp-cal-today .amp-cal-day { color: var(--amp-warm); }
.amp-wrap a.amp-cal-chip {
	display: block; margin: 2px 0; padding: 3px 8px;
	border-radius: 6px; font-size: .78rem; font-weight: 600;
	color: #fff !important; text-decoration: none;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	background: var(--amp-accent);
}
.amp-chip-public { background: var(--amp-image); }
.amp-chip-member { background: var(--amp-accent); }
.amp-chip-editor { background: var(--amp-warm); color: #4a3407 !important; }
.amp-chip-public-pill { background: var(--amp-image); }
.amp-chip-member-pill { background: var(--amp-accent); }
.amp-chip-editor-pill { background: var(--amp-warm); color: #4a3407; }

.amp-upcoming { list-style: none; margin: 0; padding: 0; }
.amp-upcoming li {
	display: flex; align-items: center; gap: 16px;
	padding: 14px 0; border-bottom: 1px solid var(--amp-line);
}
.amp-upcoming li:last-child { border-bottom: 0; }
.amp-up-date {
	min-width: 64px; text-align: center; font-weight: 800;
	color: var(--amp-event); font-size: 1.02rem;
}
.amp-up-date em { display: block; font-style: normal; font-weight: 400; font-size: .75rem; color: var(--amp-ink-soft); }
.amp-up-main { flex: 1; min-width: 0; }
.amp-wrap a.amp-up-title { font-weight: 700; color: var(--amp-ink); text-decoration: none; }
.amp-wrap a.amp-up-title:hover { color: var(--amp-event); }
.amp-up-rsvp { text-align: center; min-width: 70px; font-weight: 700; color: var(--amp-event); }
.amp-up-rsvp span { display: block; font-weight: 400; font-size: .72rem; color: var(--amp-ink-soft); }
.amp-event-when { font-size: 1.02rem; }
.amp-wrap table.amp-attendees { width: 100%; border-collapse: collapse; }
.amp-wrap .amp-attendees th, .amp-wrap .amp-attendees td {
	text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--amp-line);
	font-size: .95rem;
}
.amp-wrap .amp-attendees th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--amp-ink-soft); }

/* ---------- Member directory (staff only) ---------- */
.amp-wrap { --amp-dir: #45566b; }
.amp-type-directory { border-top-color: var(--amp-dir); }
.amp-type-directory .amp-type-icon svg { fill: var(--amp-dir); }
.amp-dir-row {
	display: flex; gap: 18px; align-items: flex-start;
	padding: 18px 0; border-bottom: 1px solid var(--amp-line);
}
.amp-dir-row:last-child { border-bottom: 0; }
.amp-dir-avatar { flex: 0 0 auto; }
.amp-dir-main { flex: 1; min-width: 0; }
.amp-dir-name { margin: 0 0 2px; font-weight: 700; font-size: 1.08rem; }
.amp-dir-name .amp-board-pill { vertical-align: middle; margin-left: 6px; }
.amp-pill-suspended { background: #b32d2e; }
.amp-dir-bio { margin: 8px 0 0; color: var(--amp-ink); font-size: .95rem; max-width: 65ch; }

/* ---------- Messages ---------- */
.amp-wrap { --amp-message: #2b7a78; }
.amp-type-message { border-top-color: var(--amp-message); }
.amp-type-message .amp-type-icon svg { fill: var(--amp-message); }
.amp-type-icon { position: relative; display: inline-block; }
.amp-card-badge {
	position: absolute; top: -6px; right: -12px;
	min-width: 20px; height: 20px; padding: 0 5px;
	background: #d63638; color: #fff; border-radius: 999px;
	font-size: .72rem; font-weight: 800; line-height: 20px; text-align: center;
}
.amp-inbox { padding: 6px 28px; }
.amp-wrap a.amp-inbox-row {
	display: flex; align-items: center; gap: 14px;
	padding: 15px 0; border-bottom: 1px solid var(--amp-line);
	color: var(--amp-ink); text-decoration: none;
}
.amp-wrap a.amp-inbox-row:last-child { border-bottom: 0; }
.amp-inbox-dot {
	width: 10px; height: 10px; border-radius: 50%;
	background: var(--amp-line); flex: 0 0 auto;
}
.amp-inbox-unread .amp-inbox-dot { background: #d63638; }
.amp-inbox-main { flex: 1; min-width: 0; }
.amp-inbox-subject { display: block; font-weight: 600; }
.amp-inbox-unread .amp-inbox-subject { font-weight: 800; }
.amp-inbox-new {
	background: #d63638; color: #fff; font-size: .72rem; font-weight: 800;
	padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.amp-dm { padding: 18px 22px; margin-bottom: 12px; }
.amp-dm-team { border-left: 4px solid var(--amp-message); }
.amp-dm-mine { background: #f6f9f9; }

/* Floating unread badge, bottom-right of portal pages */
a.amp-msg-badge {
	position: fixed; right: 22px; bottom: 22px; z-index: 9999;
	background: #d63638; color: #fff !important;
	padding: 10px 16px; border-radius: 999px;
	font-weight: 800; font-size: .95rem; text-decoration: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
a.amp-msg-badge:hover { background: #b32d2e; }

/* ---------- Manage Resources (approved uploaders) ---------- */
.amp-wrap { --amp-manage: #8a5a12; }
.amp-type-manage { border-top-color: var(--amp-manage); }
.amp-type-manage .amp-type-icon svg { fill: var(--amp-manage); }

/* CC attention pill */
.amp-inbox-cc {
	background: #fdf1dc; color: #8a5a12; font-size: .72rem; font-weight: 800;
	padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}

/* ---- v1.6.0: message attachments ---- */
.amp-dm-attachment {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin: 10px 0 0;
	padding: 8px 12px;
	background: rgba(15, 76, 129, 0.06);
	border: 1px solid rgba(15, 76, 129, 0.15);
	border-radius: 6px;
}
.amp-dm-clip {
	width: 16px;
	height: 16px;
	fill: #0f4c81;
	flex: 0 0 auto;
}
.amp-attach-box {
	margin: 12px 0;
	padding: 10px 14px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
}
