/* Client portal — standalone management UI
   ========================================================================== */

.portal-body {
	margin: 0;
	background: #f4f2ee;
	color: #1c1916;
	font-family: "Zen Old Mincho", "游明朝", YuMincho, serif;
}

.portal {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.portal__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	padding: 1rem 1.25rem;
	background: #1c1916;
	color: #f7f4ef;
}

.portal__brand {
	flex: 0 0 auto;
}

.portal__brand a {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	color: inherit;
	text-decoration: none;
	font-weight: 700;
	letter-spacing: 0.08em;
	font-size: clamp(0.95rem, 2vw, 1.1rem);
}

.portal__brand-crest {
	display: block;
	width: 1.55em;
	height: 1.55em;
	flex-shrink: 0;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

.portal__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.35rem 1rem;
	font-size: 0.88rem;
	letter-spacing: 0.04em;
}

.portal__nav a {
	color: rgb(247 244 239 / 0.78);
	text-decoration: none;
}

.portal__nav a:hover,
.portal__nav a.is-active {
	color: #fff;
}

.portal__main {
	flex: 1;
	width: min(100% - 2rem, 44rem);
	margin: 0 auto;
	padding: 1.75rem 0 3rem;
}

.portal__title {
	margin: 0 0 1rem;
	font-size: clamp(1.35rem, 3vw, 1.75rem);
	letter-spacing: 0.08em;
}

.portal__lead {
	margin: 0 0 1rem;
	line-height: 1.8;
	color: #4a453f;
}

.portal__footer {
	padding: 1rem;
	text-align: center;
	font-size: 0.8rem;
	color: #8a837a;
}

.portal__footer p {
	margin: 0;
}

.portal-cards {
	display: grid;
	gap: 1rem;
	margin-top: 1.5rem;
}

@media (min-width: 640px) {
	.portal-cards {
		grid-template-columns: 1fr 1fr;
	}
}

.portal-card {
	display: grid;
	gap: 0.35rem;
	padding: 1.35rem 1.25rem;
	background: #fff;
	border: 1px solid #ddd6cc;
	color: inherit;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-card:hover {
	border-color: #1c1916;
	box-shadow: 0 8px 24px rgb(28 25 22 / 0.08);
}

.portal-card__label {
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.portal-card__desc {
	font-size: 0.9rem;
	color: #6b645c;
}

.portal-login,
.portal-form,
.portal-panel {
	background: #fff;
	border: 1px solid #ddd6cc;
	padding: 1.25rem 1.2rem;
}

.portal-panel + .portal-panel {
	margin-top: 1.25rem;
}

.portal-panel__title {
	margin: 0 0 1rem;
	font-size: 1.1rem;
	letter-spacing: 0.06em;
}

.portal-panel__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.portal-panel__head .portal-panel__title {
	margin: 0;
}

.portal-orbit-readonly .myoujyou-terabasu-orbit-remove {
	display: none;
}

.portal-login p,
.portal-form p {
	margin: 0 0 1rem;
}

.portal-login label,
.portal-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
}

.portal-login input[type="text"],
.portal-login input[type="password"],
.portal-form input[type="text"],
.portal-form input[type="number"],
.portal-form textarea,
.portal-form select {
	box-sizing: border-box;
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid #cfc7bc;
	background: #fff;
	font: inherit;
	color: inherit;
}

.portal-form textarea::placeholder,
.portal-form input::placeholder {
	color: #c4bdb4;
	opacity: 1;
}

.portal-login__remember label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.portal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1.2rem;
	border: 1px solid #1c1916;
	background: #1c1916;
	color: #fff;
	font: inherit;
	letter-spacing: 0.08em;
	cursor: pointer;
	text-decoration: none;
}

.portal-btn--ghost {
	background: #fff;
	color: #1c1916;
}

.portal-btn:hover {
	opacity: 0.9;
}

.portal-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	align-items: center;
}

.portal-editor {
	margin: 0 0 1.25rem;
}

.portal-help {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	line-height: 1.7;
	color: #6b645c;
}

.portal-editor > label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
}

.portal-editor .wp-editor-wrap {
	margin-top: 0.35rem;
}

.portal-editor .wp-editor-area,
.portal-editor .mce-content-body {
	font-family: "Zen Old Mincho", "游明朝", YuMincho, serif;
	line-height: 1.8;
}

.portal-editor .wp-media-buttons .button {
	font-family: inherit;
}

.portal-featured {
	margin: 0 0 1rem;
}

.portal-featured__preview {
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(100%, 280px);
	aspect-ratio: 4 / 3;
	margin: 0.5rem 0 0.75rem;
	overflow: hidden;
	background: #f0ebe4;
	border: 1px dashed #cfc7bc;
}

.portal-featured__preview.has-image {
	border-style: solid;
}

.portal-featured__preview img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.portal-featured__placeholder {
	font-size: 0.9rem;
	color: #8a837a;
}

.portal-notice--ok {
	background: #eef6ea;
	border-color: #b7d4a8;
	color: #2f5a22;
}

.portal-notice--error {
	background: #f8ecec;
	border-color: #e0b4b4;
	color: #8a2b2b;
}

.portal-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.portal-list__item {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.65rem 1rem;
	padding: 0.85rem 0;
	border-top: 1px solid #ebe4da;
}

.portal-list__item:last-child {
	border-bottom: 1px solid #ebe4da;
}

.portal-list__meta {
	display: block;
	font-size: 0.8rem;
	color: #7a736b;
	margin-bottom: 0.2rem;
}

.portal-list__name {
	font-weight: 600;
}

.portal-list__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	font-size: 0.9rem;
}

.portal-list__actions a {
	color: #1c1916;
}

.portal-inline-form {
	display: inline;
	margin: 0;
}

.portal-link-danger {
	border: 0;
	background: none;
	padding: 0;
	color: #a33;
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
}

.portal-tabs {
	display: flex;
	gap: 0.5rem;
	margin: 0 0 1rem;
}

.portal-tabs a {
	padding: 0.5rem 0.9rem;
	border: 1px solid #ddd6cc;
	background: #fff;
	color: #1c1916;
	text-decoration: none;
	letter-spacing: 0.06em;
}

.portal-tabs a.is-active {
	background: #1c1916;
	border-color: #1c1916;
	color: #fff;
}

.portal-alumni-group {
	margin-bottom: 1.25rem;
	padding: 1rem;
	border: 1px solid #ebe4da;
	background: #faf8f5;
}

.portal-alumni-group__year {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 0;
}

.portal-alumni-group__year input[type="number"] {
	width: 7em;
	margin-left: 0.5rem;
	display: inline-block;
}

.myoujyou-terabasu-orbit-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 0 0 1rem;
	min-height: 40px;
}

.myoujyou-terabasu-orbit-preview__item {
	position: relative;
	width: 96px;
	height: 96px;
	flex-shrink: 0;
}

.myoujyou-terabasu-orbit-preview__media {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border: 1px solid #c3c4c7;
	border-radius: 50%;
	background: #e8e6e1;
}

.portal-orbit-edit .myoujyou-terabasu-orbit-preview__media {
	border-radius: 6px;
}

.myoujyou-terabasu-orbit-preview__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.myoujyou-terabasu-orbit-preview__missing {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: #eee;
	color: #888;
	font-size: 1.25rem;
	font-weight: 600;
}

.myoujyou-terabasu-orbit-preview__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgb(20 16 12 / 0.58);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.myoujyou-terabasu-orbit-preview__item.is-pending-remove .myoujyou-terabasu-orbit-preview__media::after {
	opacity: 1;
}

.myoujyou-terabasu-orbit-remove {
	position: absolute;
	top: -0.35rem;
	right: -0.35rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.7rem;
	height: 1.7rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.22);
	color: #8a2b2b;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
}

.myoujyou-terabasu-orbit-remove:hover,
.myoujyou-terabasu-orbit-remove:focus-visible {
	color: #6d1f1f;
	background: #faf7f2;
}

.myoujyou-terabasu-orbit-preview__item.is-pending-remove .myoujyou-terabasu-orbit-remove {
	background: #8a2b2b;
	color: #fff;
}

/* Hide public site chrome if accidentally loaded */
.portal-body .site-header,
.portal-body .site-footer,
.portal-body .opening {
	display: none !important;
}
