/**
 * 自訂覆寫：header 白底、logo 置中與固定尺寸
 */

/* 文章正文：整區統一字級／行高，避免編輯器在圖片後留下裸文字時繼承 body 16px */
.posts .entry-post {
	font-size: 20px;
	line-height: 32px;
	letter-spacing: 1px;
	/* 長 URL、連續英數字不換行時會撐出視窗寬度 → 整頁可左右滑動 */
	overflow-wrap: break-word;
	word-wrap: break-word;
}

/* 內文中的連結（多為超長網址）允許任意位置斷行 */
.posts .entry-post a {
	overflow-wrap: anywhere;
	word-break: break-all;
}

.posts .entry-post p {
	overflow-wrap: anywhere !important;
	word-wrap: break-word;
	max-width: 100%;
}

/* 內文圖／嵌入物不超出版心（避免 width 屬性很大時撐版） */
.posts .entry-post img,
.posts .entry-post video {
	max-width: 100%;
	height: auto;
}

.posts .entry-post iframe {
	max-width: 100%;
}

/* 文章主欄在窄螢幕上避免子元素 min-content 撐破欄寬 */
.post-single .main-post {
	min-width: 0;
	max-width: 100%;
}

/* 文章內圖片 caption 說明（編輯器上傳圖片的說明文字） */
.posts .entry-post figure figcaption,
.posts .main-post figure figcaption {
	display: block;
	font-size: 0.9rem;
	color: #666;
	margin-top: 0.5rem;
	margin-bottom: 1rem;
}

/* Footer logo 固定寬度（桌機）；手機改為不超出視窗，避免整頁橫向捲動 */
#footer .footer-widgets .widget-brand .logo img {
	width: 1080px;
	max-width: 100%;
	height: auto;
	display: block;
}

@media only screen and (max-width: 767px) {
	#footer .footer-widgets .widget-brand .logo img {
		width: 100%;
	}
}

/* Footer 第一欄（品牌區）加大右側間距 */
#footer .footer-widgets .col-md-4 .widget-brand {
	padding-right: 1rem;
}

/* Header logo 放大 */
#header .top-wrap .logo img {
	width: 300px;
	height: auto;
}

/* Header 背景改為白色（覆寫 color1 的紅色） */
#header .top-wrap {
	background-color: #ffdddd !important;
}

/* 白底時 header 內文字與連結改為深色 */
#header .top-wrap .member-area,
#header .top-wrap .login-popup a,
#header .top-wrap .signup-popup a,
#header .top-wrap .follow-title {
	color: #181818;
}
#header .top-wrap .login-popup a:hover,
#header .top-wrap .signup-popup a:hover {
	color: #a33234;
}

/* 手機版：top-wrap 上 padding */
@media only screen and (max-width: 767px) {
	#header .top-wrap {
		padding-top: 1.5rem;
		padding-bottom: 1rem;
	}
}

/* 手機版：漢堡按鈕改為三條線（深色）、樣式柔和 */
@media only screen and (max-width: 767px) {
	#header .top-wrap .row .col-md-6:last-child {
		display: flex;
		align-items: self-start;
		justify-content: flex-end;
		min-height: 50px;
	}
	#header .btn-menu {
		position: relative;
		top: auto;
		right: auto;
		width: 44px;
		height: 44px;
		min-width: 44px;
		background-color: transparent;
		border: none;
		border-radius: 8px;
		transition: background-color 0.2s ease;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	#header .btn-menu:before {
		content: "";
		display: block;
		width: 22px;
		height: 2px;
		background: #181818;
		box-shadow: 0 6px 0 0 #181818, 0 12px 0 0 #181818;
		left: auto;
		top: auto;
		transform: none;
		background-image: none !important;
		background-size: auto;
	}
	#header .btn-menu:hover {
		background-color: transparent;
	}
}
@media only screen and (max-width: 479px) {
	#header .btn-menu {
		height: 40px;
		width: 40px;
		min-width: 40px;
	}
	#header .btn-menu:before {
		width: 20px;
		height: 2px;
		box-shadow: 0 5px 0 0 #181818, 0 10px 0 0 #181818;
	}
}

/* 小螢幕：main 區塊 margin */
@media only screen and (max-width: 479px) {
	#main {
		margin: 1rem 0 10px !important;
	}
}

/* 手機版：文章內頁留言區（表單 input 固定 368px 會撐出橫向捲動） */
@media only screen and (max-width: 767px) {
	.post-single .comment-post {
		max-width: 100%;
		box-sizing: border-box;
	}

	.post-single .comment-post .comment-form,
	.post-single .comment-post .comment-respond {
		max-width: 100%;
		box-sizing: border-box;
	}

	.post-single .comment-respond .name-comment,
	.post-single .comment-respond .message-comment,
	.post-single .comment-respond .email-comment {
		max-width: 100%;
	}

	.post-single .comment-respond .name-comment input,
	.post-single .comment-respond .email-comment input {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}

	.post-single .comment-respond .message-comment textarea {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}
}
