/**
 * フロントエンドスタイル
 */

.stf-feeds-container {
	max-width: 600px;
	margin: 0 auto 10px;
}

/* 縦並びスタイル（デフォルト） */
.stf-style-vertical {
	display: block;
}

.stf-style-vertical .stf-tweet {
	width: 100%;
}

/* 横並びスタイル（スクロール） */
.stf-style-horizontal {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	gap: 16px;
	padding-bottom: 10px;
	max-width: 100%;
	padding-left: 10px;
	padding-right: 10px;
}

.stf-style-horizontal .stf-tweet {
	flex: 0 0 80%;
	min-width: 80%;
	margin-bottom: 0;
	scroll-snap-align: start;
}

/* デスクトップ表示時は固定幅 */
@media (min-width: 768px) {
	.stf-style-horizontal .stf-tweet {
		flex: 0 0 400px;
		min-width: 400px;
	}
}

.stf-style-horizontal .stf-tweet:last-child {
	margin-right: 0;
}

/* スライドスタイル（カルーセル） */
.stf-style-slider {
	position: relative;
	max-width: 100%;
}

.stf-style-slider .stf-slider-wrapper {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
}

.stf-style-slider .stf-slider-track {
	display: flex;
	transition: transform 0.3s ease;
}

.stf-style-slider .stf-tweet {
	flex: 0 0 100%;
	min-width: 100%;
	margin-bottom: 0;
	margin-right: 0;
}

.stf-style-slider .stf-slider-nav {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
}

.stf-style-slider .stf-slider-btn {
	background: #1da1f2;
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition: background 0.2s;
}

.stf-style-slider .stf-slider-btn:hover {
	background: #1a91da;
}

.stf-style-slider .stf-slider-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.stf-style-slider .stf-slider-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}

.stf-style-slider .stf-slider-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ccc;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s;
}

.stf-style-slider .stf-slider-dot.active {
	background: #1da1f2;
}

.stf-tweet {
	background: #fff;
	border: 1px solid #e1e8ed;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.2s;
}

.stf-tweet:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.stf-tweet-header {
	display: flex;
	align-items: center;
	margin-bottom: 12px;
}

.stf-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	margin-right: 12px;
}

.stf-user-info {
	display: flex;
	flex-direction: column;
}

.stf-user-name {
	font-size: 15px;
	font-weight: bold;
	color: #14171a;
	margin-bottom: 2px;
}

.stf-user-screen-name {
	font-size: 14px;
	color: #657786;
	text-decoration: none;
	transition: color 0.2s;
}

.stf-user-screen-name:hover {
	color: #1da1f2;
	text-decoration: underline;
}

.stf-tweet-content {
	font-size: 15px;
	line-height: 1.5;
	color: #14171a;
	margin-bottom: 12px;
	word-wrap: break-word;
}

.stf-tweet-content a {
	color: #1da1f2;
	text-decoration: none;
}

.stf-tweet-content a:hover {
	text-decoration: underline;
}

.stf-tweet-media {
	margin: 12px 0;
	border-radius: 8px;
	overflow: hidden;
	display: grid;
	gap: 2px;
}

/* 1枚の場合 */
.stf-media-1 {
	grid-template-columns: 1fr;
}

.stf-media-1 .stf-media-item {
	aspect-ratio: 16 / 9;
}

/* 2枚の場合: 横並び */
.stf-media-2 {
	grid-template-columns: 1fr 1fr;
}

.stf-media-2 .stf-media-item {
	aspect-ratio: 1 / 1;
}

/* 3枚の場合: 上段2列、下段1列 */
.stf-media-3 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
}

.stf-media-3 .stf-media-item:nth-child(1) {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	aspect-ratio: 1 / 1;
}

.stf-media-3 .stf-media-item:nth-child(2) {
	grid-column: 2 / 3;
	grid-row: 1 / 2;
	aspect-ratio: 1 / 1;
}

.stf-media-3 .stf-media-item:nth-child(3) {
	grid-column: 1 / 3;
	grid-row: 2 / 3;
	aspect-ratio: 2 / 1;
}

/* 4枚の場合: 2x2グリッド */
.stf-media-4 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
}

.stf-media-4 .stf-media-item {
	aspect-ratio: 1 / 1;
}

.stf-media-item {
	margin: 0;
	position: relative;
	overflow: hidden;
}

.stf-media-item:first-child {
	border-top-left-radius: 8px;
}

.stf-media-2 .stf-media-item:last-child,
.stf-media-3 .stf-media-item:nth-child(2),
.stf-media-4 .stf-media-item:nth-child(2) {
	border-top-right-radius: 8px;
}

.stf-media-3 .stf-media-item:last-child,
.stf-media-4 .stf-media-item:nth-child(3) {
	border-bottom-left-radius: 8px;
}

.stf-media-4 .stf-media-item:last-child {
	border-bottom-right-radius: 8px;
}

.stf-media-photo {
	width: 100%;
	height: 100%;
}

.stf-media-photo a {
	display: block;
	width: 100%;
	height: 100%;
}

.stf-media-image {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.stf-media-video {
	width: 100%;
	height: 100%;
	position: relative;
}

.stf-media-video-element {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.stf-tweet-footer {
	border-top: 1px solid #e1e8ed;
	padding-top: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.stf-tweet-link {
	font-size: 13px;
	color: #657786;
	text-decoration: none;
}

.stf-tweet-link:hover {
	color: #1da1f2;
	text-decoration: underline;
}

.stf-attribution {
	font-size: 12px;
	color: #657786;
}

.stf-attribution a {
	color: #657786;
	text-decoration: none;
	transition: color 0.2s;
}

.stf-attribution a:hover {
	color: #1da1f2;
	text-decoration: underline;
}

.stf-no-tweets {
	text-align: center;
	padding: 40px 20px;
	color: #657786;
	font-size: 16px;
}

