/* =========================================================
   Shift Manager - style.css
   フロント（[todays_cast]）とゴージャス系トーン、
   管理画面（出勤管理テーブル）の軽量スタイルを1ファイルで提供。
   ========================================================= */

:root {
	--nsm-base: #0f0f12;
	--nsm-base-soft: #1a1a20;
	--nsm-gold: #d4af37;
	--nsm-pink: #ff007f;
	--nsm-text: #f5f1e6;
	--nsm-text-dim: #b9b4a8;
}

/* ---------------------------------------------------------
   フロント: [todays_cast] カードスライダー
   --------------------------------------------------------- */

.nsm-empty {
	padding: 24px;
	background: var(--nsm-base);
	color: var(--nsm-text-dim);
	border-radius: 12px;
	text-align: center;
	font-size: 14px;
}

.nsm-cast-slider {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 16px 12px 22px;
	margin: 0;
	background: linear-gradient( 180deg, var(--nsm-base) 0%, var(--nsm-base-soft) 100% );
	border-radius: 16px;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

.nsm-cast-slider::-webkit-scrollbar {
	height: 6px;
}

.nsm-cast-slider::-webkit-scrollbar-thumb {
	background: linear-gradient( 90deg, var(--nsm-gold), var(--nsm-pink) );
	border-radius: 6px;
}

.nsm-card {
	position: relative;
	flex: 0 0 auto;
	width: 168px;
	scroll-snap-align: start;
	display: block;
	text-decoration: none;
	color: var(--nsm-text);
	background: var(--nsm-base-soft);
	border-radius: 16px;
	padding: 3px;
	background-image: linear-gradient( var(--nsm-base-soft), var(--nsm-base-soft) ),
		linear-gradient( 135deg, var(--nsm-gold), rgba(212, 175, 55, 0.15) 40%, var(--nsm-pink) );
	background-origin: border-box;
	background-clip: padding-box, border-box;
	border: 1px solid transparent;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nsm-card:hover,
.nsm-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25), 0 4px 14px rgba(255, 0, 127, 0.15);
}

.nsm-card-photo {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
}

.nsm-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.nsm-photo-placeholder {
	width: 100%;
	height: 100%;
	background: radial-gradient( circle at 50% 30%, #2a2a33, #0f0f12 );
}

.nsm-card:hover .nsm-photo {
	transform: scale(1.06);
	filter: brightness(1.08) saturate(1.1);
}

.nsm-card-photo::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient( 0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 55% );
	pointer-events: none;
}

.nsm-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 4px 8px;
	border-radius: 999px;
	color: #1a1a20;
	background: linear-gradient( 90deg, var(--nsm-gold), #ffe9a8 );
	box-shadow: 0 0 10px rgba(212, 175, 55, 0.8), 0 0 18px rgba(255, 0, 127, 0.35);
	text-transform: uppercase;
}

.nsm-card-info {
	padding: 10px 8px 8px;
}

.nsm-name {
	font-size: 14px;
	font-weight: 700;
	color: var(--nsm-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nsm-time {
	margin-top: 4px;
	font-size: 12px;
	color: var(--nsm-gold);
	letter-spacing: 0.02em;
}

@media (min-width: 782px) {
	.nsm-cast-slider {
		flex-wrap: wrap;
		overflow-x: visible;
	}

	.nsm-card {
		width: 190px;
	}
}

/* ---------------------------------------------------------
   管理画面: 出勤管理テーブル（軽量スタイル、WP標準に合わせる）
   --------------------------------------------------------- */

.nsm-admin-wrap .nsm-date-nav {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0 16px;
	flex-wrap: wrap;
}

.nsm-admin-wrap .nsm-date-picker-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #555;
}

.nsm-admin-wrap .nsm-editing-date {
	color: #555;
}

.nsm-schedule-table .nsm-col-photo {
	width: 56px;
}

.nsm-schedule-table .nsm-col-on,
.nsm-schedule-table .nsm-col-trial {
	width: 80px;
	text-align: center;
}

.nsm-schedule-table .nsm-col-status {
	width: 100px;
}

.nsm-schedule-table input[type="checkbox"] {
	transform: scale(1.3);
}

.nsm-schedule-table .nsm-input-time {
	width: 100%;
	max-width: 220px;
}

.nsm-save-status {
	font-size: 12px;
	color: #d4af37;
	font-weight: 600;
}

.nsm-save-status.is-saving {
	color: #999;
}

.nsm-save-status.is-error {
	color: #d63638;
}

.nsm-bulk-save-wrap {
	margin-top: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
}

/* ---------------------------------------------------------
   管理画面: プロフィール写真ギャラリー（メタボックス）
   --------------------------------------------------------- */

.nsm-gallery-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
}

.nsm-gallery-item {
	position: relative;
	width: 120px;
	border-radius: 8px;
	border: 1px solid #ddd;
	background: #fff;
	padding-bottom: 2px;
}

.nsm-gallery-item-preview {
	position: relative;
	width: 100%;
	height: 120px;
	border-radius: 8px 8px 0 0;
	overflow: hidden;
	background-size: cover;
	background-repeat: no-repeat;
}

/* サムネイル上に重ねる3x3のトリミング位置ピッカー。ボタンは常時透明、
   ホバー/選択中のマスだけ視覚化する。 */
.nsm-focal-grid {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	grid-template-rows: repeat( 3, 1fr );
}

.nsm-focal-cell {
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(0, 0, 0, 0);
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease;
}

.nsm-focal-cell:hover {
	background: rgba(212, 175, 55, 0.35);
}

.nsm-focal-cell.is-active {
	background: rgba(212, 175, 55, 0.55);
	box-shadow: inset 0 0 0 2px var(--nsm-gold);
}

.nsm-gallery-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	line-height: 18px;
	text-align: center;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	cursor: pointer;
	padding: 0;
	font-size: 14px;
	z-index: 2;
}

.nsm-gallery-remove:hover {
	background: var(--nsm-pink);
}

/* ---------------------------------------------------------
   フロント: キャスト詳細ページのギャラリー表示
   --------------------------------------------------------- */

.nsm-gallery-view {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax(160px, 1fr) );
	gap: 12px;
	margin-top: 28px;
}

.nsm-gallery-view-item {
	display: block;
	width: 100%;
	border: none;
	border-radius: 12px;
	overflow: hidden;
	background: var(--nsm-base);
	padding: 0;
	cursor: zoom-in;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nsm-gallery-view-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 22px rgba(212, 175, 55, 0.25);
}

.nsm-gallery-photo {
	width: 100%;
	height: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	display: block;
}

/* ---------------------------------------------------------
   フロント: ギャラリーのライトボックス
   --------------------------------------------------------- */

body.nsm-lightbox-locked {
	overflow: hidden;
}

.nsm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(8, 6, 10, 0.82);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nsm-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.nsm-lightbox-img {
	max-width: min(88vw, 720px);
	max-height: 84vh;
	border-radius: 16px;
	object-fit: contain;
	box-shadow:
		0 0 60px rgba(212, 175, 55, 0.35),
		0 0 140px rgba(255, 0, 127, 0.2);
	transform: scale(0.96);
	transition: transform 0.3s ease;
}

.nsm-lightbox.is-open .nsm-lightbox-img {
	transform: scale(1);
}

.nsm-lightbox-close,
.nsm-lightbox-prev,
.nsm-lightbox-next {
	position: absolute;
	border: 1px solid rgba(212, 175, 55, 0.4);
	background: rgba(15, 15, 18, 0.6);
	color: var(--nsm-gold);
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, color 0.2s ease;
}

.nsm-lightbox-close:hover,
.nsm-lightbox-prev:hover,
.nsm-lightbox-next:hover {
	background: var(--nsm-gold);
	color: #1a1a20;
}

.nsm-lightbox-close {
	top: 24px;
	right: 24px;
	width: 40px;
	height: 40px;
	font-size: 22px;
}

.nsm-lightbox-prev,
.nsm-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 26px;
}

.nsm-lightbox-prev {
	left: 20px;
}

.nsm-lightbox-next {
	right: 20px;
}

@media (max-width: 600px) {
	.nsm-lightbox-prev,
	.nsm-lightbox-next {
		width: 38px;
		height: 38px;
		font-size: 20px;
	}

	.nsm-lightbox-close {
		top: 14px;
		right: 14px;
	}
}

/* ---------------------------------------------------------
   フロント: [cast_week_schedule] 1人分の週間予定リスト
   --------------------------------------------------------- */

.nsm-week-schedule {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--nsm-base-soft);
	border-radius: 12px;
	padding: 14px;
	margin-top: 20px;
}

.nsm-week-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 13px;
	color: var(--nsm-text-dim);
}

.nsm-week-row.is-on {
	background: rgba( 212, 175, 55, 0.1 );
	color: var(--nsm-text);
}

.nsm-week-date {
	font-weight: 600;
	min-width: 80px;
}

.nsm-week-time {
	color: var(--nsm-gold);
	font-weight: 600;
}

.nsm-week-off {
	color: var(--nsm-text-dim);
}

.nsm-week-badge {
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 999px;
	background: linear-gradient( 90deg, var(--nsm-gold), #ffe9a8 );
	color: #1a1a20;
	margin-left: 8px;
}

/* ---------------------------------------------------------
   フロント: [weekly_schedule] 全キャストの週間出勤一覧
   --------------------------------------------------------- */

.nsm-weekly-grid {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding: 16px 12px 22px;
	background: linear-gradient( 180deg, var(--nsm-base) 0%, var(--nsm-base-soft) 100% );
	border-radius: 16px;
	-webkit-overflow-scrolling: touch;
}

.nsm-weekly-day {
	flex: 0 0 auto;
	width: 168px;
	background: rgba( 255, 255, 255, 0.03 );
	border: 1px solid rgba( 212, 175, 55, 0.25 );
	border-radius: 12px;
	padding: 10px;
}

.nsm-weekly-day-head {
	font-size: 13px;
	font-weight: 700;
	color: var(--nsm-gold);
	text-align: center;
	margin-bottom: 8px;
	padding-bottom: 6px;
	border-bottom: 1px solid rgba( 212, 175, 55, 0.2 );
}

.nsm-weekly-day-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.nsm-weekly-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border-radius: 8px;
	background: rgba( 255, 255, 255, 0.04 );
	text-decoration: none;
	color: var(--nsm-text);
	font-size: 11px;
	transition: background 0.2s ease;
}

.nsm-weekly-chip:hover {
	background: rgba( 212, 175, 55, 0.18 );
}

.nsm-weekly-chip-photo {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}

.nsm-weekly-chip-name {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 600;
}

.nsm-weekly-chip-time {
	color: var(--nsm-gold);
	font-size: 10px;
	white-space: nowrap;
}

.nsm-weekly-chip-badge {
	font-size: 9px;
	font-weight: 700;
	padding: 1px 5px;
	border-radius: 999px;
	background: linear-gradient( 90deg, var(--nsm-gold), #ffe9a8 );
	color: #1a1a20;
}

.nsm-weekly-empty {
	font-size: 11px;
	color: var(--nsm-text-dim);
	text-align: center;
	padding: 10px 0;
}

@media (min-width: 782px) {
	.nsm-weekly-grid {
		flex-wrap: nowrap;
	}
}
