/*
 * page-photo.css
 * photo.php専用のスタイル（写メ日記/ブログ）
 * 作成日: 2026-01-29
 */

/* ========================================
   会員限定オーバーレイ
   ======================================== */
.photo-member-only-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-align: center;
}
.photo-member-only-overlay i {
	margin-bottom: 10px;
}
.photo-member-only-overlay p {
	margin: 0;
	font-size: 16px;
	font-weight: bold;
}
.photo-blog-image {
	position: relative;
}
.photo-blog-image a {
	position: relative;
	display: block;
}
.photo-full-width-image {
	position: relative;
}
.photo-full-width-image a {
	position: relative;
	display: block;
}

/* ========================================
   フィルター行
   ======================================== */
.photo-filter-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
}
.photo-filter-form {
	flex: 1;
	min-width: 0;
}
.photo-filter-form .form-inline {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	align-items: center;
}
.photo-filter-form .form-inline .form-control {
	flex-shrink: 1;
	min-width: 80px;
}
/* PC版セレクトボックス */
.photo-filter-form .form-inline select.form-control {
	min-width: 180px;
	width: auto;
}
.photo-filter-form .form-inline input[type="text"] {
	flex: 1;
	max-width: 150px;
}

/* ========================================
   表示切り替えボタン
   ======================================== */
.photo-view-toggle {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}
.btn-view-toggle {
	width: 40px;
	height: 40px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #ddd;
	background: #fff;
	color: #666;
	border-radius: 8px;
	transition: all 0.2s ease;
}
.btn-view-toggle:hover {
	border-color: #005A9C;
	color: #005A9C;
	background: #f8f9fa;
}
.btn-view-toggle.active {
	border-color: #005A9C;
	background: #005A9C;
	color: #fff;
}
.btn-view-toggle i {
	font-size: 16px;
}

/* ========================================
   グリッド表示
   ======================================== */
.photo-grid-container {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}
.photo-grid-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	background: #f0f0f0;
}
.photo-grid-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.photo-grid-link {
	display: block;
	position: relative;
	text-decoration: none;
}
.photo-grid-image {
	position: relative;
	width: 100%;
	padding-bottom: 133.33%; /* 3:4 アスペクト比 */
	background: #f0f0f0;
	overflow: hidden;
}
.photo-grid-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.3s ease;
}
.photo-grid-item:hover .photo-grid-image img {
	transform: scale(1.05);
}
.photo-grid-info {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	padding: 30px 10px 10px;
	color: #fff;
}
.photo-grid-name {
	display: block;
	font-size: 12px;
	font-weight: bold;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.photo-grid-time {
	display: block;
	font-size: 10px;
	opacity: 0.8;
	margin-top: 2px;
}
.photo-grid-locked {
	position: relative;
}
.photo-grid-lock-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #fff;
	z-index: 2;
}
.photo-grid-lock-overlay i {
	font-size: 24px;
	margin-bottom: 5px;
}
.photo-grid-lock-overlay span {
	font-size: 12px;
}
.photo-grid-member-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #dc3545;
	color: #fff;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	z-index: 2;
}

/* ========================================
   スマホ版グリッド
   ======================================== */
@media (max-width: 767px) {
	.photo-filter-row {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 8px;
	}
	.photo-filter-form {
		flex: 1;
		min-width: 0;
	}
	.photo-filter-form .form-inline {
		display: flex;
		flex-direction: row;
		gap: 6px;
		align-items: center;
	}
	.photo-filter-form .form-inline select.form-control {
		flex: 0 0 85px;
		width: 85px !important;
		font-size: 11px;
		padding: 8px 2px 8px 6px;
		border-radius: 6px;
		height: 38px;
		box-sizing: border-box;
		background-position: right 2px center;
		background-size: 12px;
	}
	.photo-filter-form .form-inline input[type="text"] {
		flex: 1;
		min-width: 0;
		font-size: 13px;
		padding: 8px 10px;
		border-radius: 6px;
		height: 38px;
		box-sizing: border-box;
	}
	.photo-view-toggle {
		flex: 0 0 auto;
		display: flex;
		gap: 4px;
		align-items: center;
	}
	.photo-view-toggle .btn-view-toggle {
		width: 38px;
		height: 38px;
	}
	.photo-grid-container {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}
	.photo-grid-info {
		padding: 20px 8px 8px;
	}
	.photo-grid-name {
		font-size: 11px;
	}
	.photo-grid-time {
		font-size: 9px;
	}

	/* Instagram風スタイル */
	.photo-insta-style {
		border-radius: 0;
		overflow: visible;
		margin-bottom: 20px;
		background: #fff;
		box-shadow: none;
	}
	.photo-insta-style .photo-full-width-image {
		width: 100vw !important;
		position: relative !important;
		left: 50% !important;
		margin-left: -50vw !important;
		margin-right: 0 !important;
		margin-bottom: 0 !important;
	}
	.photo-insta-style .photo-full-width-image a {
		display: block;
		overflow: hidden;
		background: #f5f5f5;
	}
	.photo-insta-style .photo-full-width-image img {
		width: 100%;
		height: auto;
		display: block;
	}
	.photo-cast-info {
		display: flex;
		align-items: center;
		padding: 12px 15px;
		gap: 12px;
		border-bottom: 1px solid #f0f0f0;
	}
	.photo-cast-figure {
		flex-shrink: 0;
		margin: 0;
	}
	.photo-cast-figure img {
		border-radius: 50%;
		width: 50px;
		height: 50px;
		object-fit: cover;
		border: 2px solid #e0e0e0;
	}
	.photo-cast-details {
		flex: 1;
		min-width: 0;
	}
	.photo-cast-name-row {
		display: flex;
		align-items: center;
		gap: 6px;
		flex-wrap: wrap;
	}
	.photo-cast-name {
		font-weight: 600;
		font-size: 14px;
		color: #262626;
		text-decoration: none;
	}
	.photo-cast-name:hover {
		color: #005A9C;
		text-decoration: none;
	}
	.photo-syukin-today {
		display: inline-block;
		font-size: 11px;
		color: #fff;
		background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
		padding: 2px 8px;
		border-radius: 10px;
		font-weight: 500;
	}
	.photo-syukin-today i {
		margin-right: 3px;
	}
	.photo-syukin-next {
		display: inline-block;
		font-size: 11px;
		color: #fff;
		background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
		padding: 2px 8px;
		border-radius: 10px;
		font-weight: 500;
	}
	.photo-syukin-next i {
		margin-right: 3px;
	}
	.photo-post-date {
		display: block;
		font-size: 12px;
		color: #8e8e8e;
		margin-top: 2px;
	}
	.photo-member-badge {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
		padding: 3px 8px;
		border-radius: 12px;
		color: #fff;
		font-size: 10px;
		font-weight: 600;
		flex-shrink: 0;
		text-shadow: 0 1px 2px rgba(0,0,0,0.2);
		box-shadow: 0 2px 4px rgba(255, 165, 0, 0.3);
	}
	.photo-member-badge i {
		font-size: 10px;
	}
	.photo-syukin-row {
		display: flex;
		align-items: center;
		gap: 6px;
		flex-wrap: wrap;
	}
	.photo-insta-style .row {
		padding: 12px 15px;
	}
	.photo-insta-style .col-xs-12 p {
		font-size: 14px;
		line-height: 1.6;
		color: #262626;
		margin-bottom: 10px;
	}
	.photo-insta-style .col-xs-12 img {
		border-radius: 10px;
		max-width: 100%;
		height: auto;
		margin: 8px 0;
	}
	.photo-insta-style .badge-primary {
		background: #e4e6eb;
		color: #050505;
		font-weight: 500;
		padding: 5px 10px;
		border-radius: 12px;
		margin-right: 5px;
		margin-bottom: 5px;
		display: inline-block;
	}
}

/* ========================================
   PC版ブログスタイル
   ======================================== */
@media (min-width: 768px) {
	.photo-blog-post {
		background: #fff;
		border-radius: 12px;
		overflow: hidden;
		margin-bottom: 60px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
		transition: box-shadow 0.3s ease;
	}

	.photo-blog-post:hover {
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	}

	.photo-blog-image {
		width: 100%;
		overflow: hidden;
		background: #f5f5f5;
	}

	.photo-blog-image a {
		display: block;
		overflow: hidden;
	}

	.photo-blog-image img {
		width: 100%;
		height: auto;
		display: block;
		transition: transform 0.5s ease;
	}

	.photo-blog-post:hover .photo-blog-image img {
		transform: scale(1.05);
	}

	.photo-blog-content {
		padding: 24px;
	}

	/* PC版 Instagram風キャスト情報 */
	.photo-cast-info-pc {
		display: flex;
		align-items: center;
		padding-bottom: 16px;
		margin-bottom: 16px;
		border-bottom: 1px solid #f0f0f0;
		gap: 14px;
	}
	.photo-cast-figure-pc {
		flex-shrink: 0;
		margin: 0;
	}
	.photo-cast-figure-pc img {
		border-radius: 50%;
		width: 50px;
		height: 50px;
		object-fit: cover;
		border: 2px solid #e0e0e0;
		transition: border-color 0.2s ease;
	}
	.photo-cast-figure-pc a:hover img {
		border-color: #005A9C;
	}
	.photo-cast-details-pc {
		flex: 1;
		min-width: 0;
	}
	.photo-cast-name-row-pc {
		display: flex;
		align-items: center;
		gap: 10px;
		flex-wrap: wrap;
	}
	.photo-cast-name-pc {
		font-weight: 600;
		font-size: 15px;
		color: #262626;
		text-decoration: none;
	}
	.photo-cast-name-pc:hover {
		color: #005A9C;
		text-decoration: none;
	}
	.photo-cast-name-row-pc .photo-syukin-today {
		display: inline-block;
		font-size: 12px;
		color: #fff;
		background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
		padding: 4px 12px;
		border-radius: 12px;
		font-weight: 500;
	}
	.photo-cast-name-row-pc .photo-syukin-today i {
		margin-right: 4px;
	}
	.photo-cast-name-row-pc .photo-syukin-next {
		display: inline-block;
		font-size: 12px;
		color: #fff;
		background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
		padding: 4px 12px;
		border-radius: 12px;
		font-weight: 500;
	}
	.photo-cast-name-row-pc .photo-syukin-next i {
		margin-right: 4px;
	}
	.photo-post-date-pc {
		display: block;
		font-size: 13px;
		color: #8e8e8e;
		margin-top: 2px;
	}
	.photo-cast-actions-pc {
		display: flex;
		align-items: center;
		gap: 12px;
	}
	.photo-member-badge-pc {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
		padding: 5px 12px;
		border-radius: 15px;
		color: #fff;
		font-size: 12px;
		font-weight: 600;
		text-shadow: 0 1px 2px rgba(0,0,0,0.2);
		box-shadow: 0 2px 6px rgba(255, 165, 0, 0.3);
	}
	.photo-member-badge-pc i {
		font-size: 12px;
	}
	.photo-comment-count-pc {
		font-size: 14px;
		color: #8e8e8e;
	}
	.photo-comment-count-pc i {
		margin-right: 4px;
	}

	.photo-blog-text {
		font-size: 16px;
		line-height: 1.8;
		color: #212529;
		margin-bottom: 24px;
	}
	.photo-blog-text img {
		border-radius: 12px;
		max-width: 100%;
		height: auto;
		margin: 8px 0;
	}

	.photo-blog-tags {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		margin-bottom: 24px;
	}

	.photo-blog-tag {
		display: inline-block;
		padding: 6px 12px;
		background: #f0f0f0;
		border-radius: 16px;
		font-size: 13px;
		color: #005A9C;
		text-decoration: none;
		transition: all 0.2s ease;
	}

	.photo-blog-tag:hover {
		background: #005A9C;
		color: #fff;
		text-decoration: none;
	}

	.photo-blog-comments {
		border-top: 1px solid #e9ecef;
		padding-top: 24px;
		margin-top: 24px;
	}

	.photo-blog-comment-toggle {
		margin-bottom: 20px;
	}

	.photo-blog-comment-form {
		background: #f8f9fa;
		padding: 20px;
		border-radius: 8px;
		margin-bottom: 20px;
	}

	.photo-blog-comments-list {
		margin-top: 20px;
	}

	.photo-blog-comment-item {
		display: flex;
		gap: 16px;
		margin-bottom: 20px;
		padding-bottom: 20px;
		border-bottom: 1px solid #e9ecef;
	}

	.photo-blog-comment-item:last-child {
		border-bottom: none;
	}

	.photo-blog-comment-avatar {
		flex-shrink: 0;
		width: 48px;
		height: 48px;
		border-radius: 50%;
		background: #e9ecef;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #6c757d;
	}

	.photo-blog-comment-content {
		flex: 1;
	}

	.photo-blog-comment-meta {
		margin-bottom: 8px;
		font-size: 14px;
	}

	.photo-blog-comment-text {
		font-size: 15px;
		line-height: 1.6;
		color: #495057;
	}

	.photo-blog-read-more {
		padding: 8px 0;
		color: #005A9C;
		font-weight: 500;
		font-size: 14px;
		text-decoration: none;
		background: none;
		border: none;
		cursor: pointer;
		transition: color 0.2s ease;
	}

	.photo-blog-read-more:hover {
		color: #003d6b;
		text-decoration: none;
	}

	.photo-blog-read-more i {
		transition: transform 0.3s ease;
	}

	.photo-blog-read-more.expanded i {
		transform: rotate(180deg);
	}

	.photo-blog-text-full {
		animation: fadeIn 0.3s ease-in;
	}

	@keyframes fadeIn {
		from {
			opacity: 0;
			transform: translateY(-10px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}

/* ========================================
   スマホ版のスタイル
   ======================================== */
@media (max-width: 767px) {
	/* 投稿カード */
	.photo-post-mobile {
		border-radius: 0;
		margin-bottom: 30px;
		overflow: visible;
	}

	/* 写真だけを画面いっぱいに表示 */
	.photo-full-width-image {
		width: 100vw;
		position: relative;
		left: 50%;
		right: 50%;
		margin-left: -50vw;
		margin-right: -50vw;
		margin-bottom: 20px;
	}

	.photo-full-width-image a {
		display: block;
		overflow: hidden;
		background: #f5f5f5;
	}

	.photo-full-width-image img {
		width: 100%;
		height: auto;
		display: block;
	}

	/* テキストコンテンツには余白を保持 */
	.photo-post-mobile .post-header,
	.photo-post-mobile .row {
		padding-left: 15px;
		padding-right: 15px;
	}

	.photo-read-more-sp {
		padding: 8px 0;
		color: #005A9C;
		font-weight: 500;
		font-size: 14px;
		text-decoration: none;
		background: none;
		border: none;
		cursor: pointer;
		display: block;
		width: 100%;
		text-align: center;
	}

	.photo-read-more-sp:hover {
		color: #003d6b;
		text-decoration: none;
	}

	.photo-read-more-sp i {
		transition: transform 0.3s ease;
	}

	.photo-read-more-sp.expanded i {
		transform: rotate(180deg);
	}

	/* モーダルのスタイル調整 */
	.modal-content {
		border-radius: 12px;
		border: none;
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	}

	.modal-header {
		background: linear-gradient(135deg, #005A9C 0%, #003d6b 100%);
		color: #fff;
		border-radius: 12px 12px 0 0;
		padding: 16px 20px;
	}

	.modal-header .close {
		color: #fff;
		opacity: 0.8;
		text-shadow: none;
		font-size: 28px;
	}

	.modal-header .close:hover {
		opacity: 1;
	}

	.modal-title {
		font-size: 18px;
		font-weight: 600;
	}

	.modal-body {
		padding: 24px 20px;
	}

	.modal-body textarea {
		border-radius: 8px;
		border: 2px solid #e9ecef;
		padding: 12px;
		font-size: 15px;
	}

	.modal-body textarea:focus {
		border-color: #005A9C;
		box-shadow: 0 0 0 0.2rem rgba(0, 90, 156, 0.15);
	}

	.badge-primary {
		background-color: #f0f0f0;
		color: #005A9C;
		padding: 5px 10px;
		border-radius: 12px;
		margin-right: 5px;
		margin-bottom: 5px;
		display: inline-block;
	}
}

/* ========================================
   カスタムコメントモーダル（Bootstrap非依存）
   ======================================== */
.photo-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.photo-modal-overlay.is-active {
	display: flex;
	opacity: 1;
}

.photo-modal-container {
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 450px;
	max-height: 90vh;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.photo-modal-overlay.is-active .photo-modal-container {
	transform: scale(1);
}

.photo-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
}

.photo-modal-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #fff;
}

.photo-modal-title i {
	margin-right: 8px;
}

.photo-modal-close {
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.photo-modal-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.photo-modal-body {
	padding: 24px 20px;
}

.photo-modal-form-group {
	margin-bottom: 20px;
}

.photo-modal-textarea {
	width: 100%;
	padding: 14px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	font-size: 15px;
	resize: vertical;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.photo-modal-textarea:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.photo-modal-buttons {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.photo-modal-btn {
	padding: 12px 24px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.photo-modal-btn i {
	margin-right: 6px;
}

.photo-modal-btn-cancel {
	background: #f0f0f0;
	color: #666;
}

.photo-modal-btn-cancel:hover {
	background: #e0e0e0;
}

.photo-modal-btn-submit {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
}

.photo-modal-btn-submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.photo-modal-btn-login {
	width: 100%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff !important;
	padding: 14px 24px;
}

.photo-modal-btn-login:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
	color: #fff;
	text-decoration: none;
}

.photo-modal-login-prompt {
	text-align: center;
}

.photo-modal-login-prompt p {
	margin-bottom: 20px;
	color: #666;
	font-size: 15px;
}

.photo-modal-login-form {
	margin-bottom: 0;
}

.photo-modal-input {
	width: 100%;
	padding: 14px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	font-size: 15px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.photo-modal-input:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.photo-modal-input::placeholder {
	color: #aaa;
}

.photo-modal-divider {
	display: flex;
	align-items: center;
	margin: 20px 0;
}

.photo-modal-divider::before,
.photo-modal-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e0e0e0;
}

.photo-modal-divider span {
	padding: 0 15px;
	color: #999;
	font-size: 13px;
}

.photo-modal-btn-register {
	width: 100%;
	background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
	color: #fff !important;
	padding: 14px 24px;
}

.photo-modal-btn-register:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(238, 90, 90, 0.4);
	color: #fff;
	text-decoration: none;
}

/* 会員限定モーダルヘッダー */
.photo-modal-header-member {
	background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}
