﻿* {
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	--scanLineColor: #c1c1c1aa;
	font:
		20px/1.6 "system-ui",
		"Sans-serif";
	color: #333;
	text-align: center;
	letter-spacing: 1px;
	background: fixed #dbdbdb22 linear-gradient(to top, transparent 2px, var(--scanLineColor) 2px);
	background-size: 100% 4px;
}

/* Layout */
#wrapper {
	--wrapWidth: 1200px;
	max-width: var(--wrapWidth);
	min-width: 360px;
	margin-inline: auto;
	padding-top: 0.8rem;
}

#title {
	position: relative;
	display: block;
	width: min(84vw, 500px);
	font:
		990 clamp(1.2em, 2.2vw, 1.5em) / 1.3 "Playpen Sans",
		cursive;
	font-optical-sizing: auto;
	color: #c33;
	text-align: left;
	margin-inline: 1rem;
	margin-block: 0 0.8rem;
	user-select: none;
}

#title:hover {
	background: none;
}

#title::before {
	content: "Cliff's Photographs & Memory";
	position: absolute;
	top: 0;
	left: 0;
	-webkit-text-stroke: #fff 0.2em;
	z-index: -1;
}

#main {
	margin: 0;
	display: flex;
	background: #fff;
	margin: 0 0.5em;
	border-radius: 0.5em;
	box-shadow: 0 0 8px 0 #3333;
}

#content {
	position: relative;
	text-align: center;
	flex: 1 1 85%;
	border-radius: 0.5em;
	margin: 1em;
}

#goTop {
	position: fixed;
	right: calc(50vw - var(--wrapWidth) / 2 + 1rem);
	bottom: 160px;
	margin: 0;
	transform: translateY(220px);
	transition: transform ease-in 300ms;
}

#goTop.revealed {
	transform: translateY(0);
}

#goTop a {
	font-size: 0;
	display: block;
	height: 2rem;
	width: 2rem;
	background: center/200% url(/photomem/img/up.svg) no-repeat;
}
@media (max-width: 1200px) {
	#goTop {
		right: 0.25rem;
	}
}

#sidebar {
	background: #efefef;
	width: 15%;
	border-radius: 0 0.5em 0.5em 0;
	padding: 2rem 1rem;
	font-size: 0.8em;
}

@media (max-width: 990px) {
	#main {
		flex-wrap: wrap;
	}
	#content {
		display: contents;
	}

	#content > *:not(.photo) {
		margin-inline: 0.6rem;
		flex: 1 1 100%;
	}

	#content > ol li,
	#content > ul li {
		margin-left: 1.5em;
	}

	h1 {
		order: -2;
		margin-top: 1rem;
		flex: 1 1 100%;
	}

	#content > .date {
		order: -1;
		margin-left: auto;
	}

	#sidebar {
		flex: 1 1 100%;
		margin: 0.6rem;
		order: -1;
		width: auto;
		border-radius: 0;
		font-size: 1em;
	}

	#sidebar:not(:has(h2)) {
		padding: 0;
	}

	#sidebar h2,
	#sidebar p {
		font-size: 0.8em;
	}

	#content blockquote {
		background: none;
	}

	#disqus_thread {
		flex: 1 1 100%;
	}
}

#footer {
	font-size: 0.8em;
	margin: 1em;
}

#footer p {
	text-align: center;
	text-shadow: 0 0 1px #fff5;
	color: #333;
}

#footer span {
	display: inline-block;
}

/* Nav */
.menuBtn,
.navHide {
	display: none;
}

nav {
	display: contents;
}

@media (max-width: 990px) {
	.menuBtn {
		display: block;
		position: fixed;
		top: 0.8rem;
		right: 1rem;
		width: 28px;
		height: 36px;
		z-index: 10;
		background: none;
		border: 0;
		outline: 0;
		color: var(--hamburgerColor);
		--hamburgerColor: #900;
		--hamburgerHeight: 3px;
		cursor: pointer;
	}

	.menuBtn::after {
		content: "";
		position: absolute;
		inset: 4px -4px;
		background: #fff5;
		z-index: -1;
		border-radius: 3px;
		backdrop-filter: blur(6px);
	}

	.menuBtn span {
		position: relative;
		display: block;
		height: var(--hamburgerHeight);
		margin-inline: auto;
		background: var(--hamburgerColor);
		font-size: 9px;
		letter-spacing: 1px;
		line-height: 22px;
	}
	.menuBtn span::before,
	.menuBtn span::after {
		content: "";
		position: absolute;
		display: block;
		inset: 0;
		height: var(--hamburgerHeight);
		margin: auto;
		background: var(--hamburgerColor);
		top: calc(var(--hamburgerHeight) * -5);
	}

	body:has([popover]:popover-open) {
		overflow: hidden;
	}

	nav {
		position: fixed;
		top: 0;
		left: 0;
		background: #fcfcfc;
		border: none;
		height: 100dvh;
		width: 100vw;
		display: none;
	}

	nav:popover-open {
		display: block;
		pointer-events: all;
	}

	.navBox {
		height: 100%;
		width: 100%;
		overflow: auto;
	}

	.navHide {
		display: block;
		position: absolute;
		top: 1rem;
		right: 1.5rem;
		font-size: 2em;
		font-weight: 990;
		background: none;
		outline: none;
		border: none;
		cursor: pointer;
		color: #777;
		z-index: 99;
	}
	.menu {
		column-width: 320px;
		margin: 1.2rem;
	}

	.menu label {
		pointer-events: none;
	}
}

@media (min-width: 991px) {
	.menu::before {
		content: "MENU";
		display: block;
		margin-block: 1em;
		font-size: 1.1em;
		color: #c33;
		font-weight: 990;
		padding-top: 1em;
	}

	p ~ nav .navBox .menu::before {
		border-top: 2px solid #ccc8;
	}

	.menu label {
		cursor: pointer;
		display: block;
	}

	.menu > li ul {
		max-height: 0;
		overflow: hidden;
		transition: max-height 300ms ease-in;
	}

	.menu > li input:checked ~ ul {
		max-height: 99em;
	}
}

.menu input {
	display: none;
}

nav ul,
nav li {
	break-inside: avoid;
	list-style: none;
	margin: 0;
	padding: 0;
}

.menu > li {
	margin-bottom: 1em;
	font:
		990 1.2em/1.5 "微軟正黑體",
		system-ui;
	color: #900;
}

.menu > li ul {
	font:
		400 0.9em/1.5 "微軟正黑體",
		system-ui;
	margin-left: 1em;
	margin-bottom: 1em;
}

.menu ul li {
	margin-block: 0.3em;
	padding-bottom: 0.3em;
	border-bottom: 1px solid #ccc5;
}

.menu a,
.menu a:visited {
	transition: scale ease-in 100ms;
	transform-origin: 0 50%;
	color: #333;
	vertical-align: center;
	margin-right: 0.5em;
}

.menu a:hover {
	background: none;
	color: #06f;
}

a.dsqCount,
a.dsqCount:visited {
	font-size: 0.7em;
	font-weight: 600;
	line-height: 1.4;
	color: #900;
	/* display: inline-block; */
	pointer-events: none;
}

/* 隨機文章 */
.randomBtn {
	background: #0c6eca;
	padding: 0.3em 1em;
	display: flex;
	place-items: center;
	border-radius: 0.5em;
	width: fit-content;
	color: #fff;
	font-weight: 900;
	margin-inline: auto;
	margin-top: 1em;
	box-shadow: 0 0 5px 0 #3335;
}

.randomBtn,
.randomBtn:visited {
	color: #fff;
}

.randomBtn:hover {
	background: #fafafa;
	color: #0c6eca;
}

/* POPOVER ANIMATION */
@media (max-width: 990px) {
	[popover] {
		transition:
			opacity 0.4s,
			transform 0.4s,
			display 0.4s allow-discrete,
			overlay 0.4s allow-discrete;
		opacity: 0;
		transform: translateY(20px) scale(0.9);
	}
	[popover]:popover-open {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	@starting-style {
		[popover]:popover-open {
			opacity: 0;
			transform: translateY(20px) scale(0.9);
		}
	}
	[popover]::backdrop {
		backdrop-filter: blur(3px);
		background-color: rgba(0, 0, 0, 0);
		transition:
			display 0.4s allow-discrete,
			overlay 0.4s allow-discrete,
			background-color 0.4s;
	}
	[popover]:popover-open::backdrop {
		background-color: rgba(0, 0, 0, 0.5);
	}
	@starting-style {
		[popover]:popover-open::backdrop {
			background-color: rgba(0, 0, 0, 0);
		}
	}
}

/* TEXT & BLOCK */
h1,
h2,
h3,
p,
ol,
ul,
dl,
blockquote,
em {
	text-align: left;
}

#content p:not(.date) {
	margin-bottom: 1em;
	text-align: justify;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 900;
	margin-bottom: 0.8em;
	flex: 1 1 100%;
}

h1 {
	font:
		900 clamp(1.3em, 7.6vw, 2.2em) / 1.2 "Noto Serif TC",
		system-ui;
	color: #900;
	margin-bottom: 0;
}

h2 {
	font-size: 1.1em;
	color: #c33;
}

h3 {
	font-size: 1.1em;
	color: #36f;
}

dl,
ol,
ul {
	margin: 0 0 1em 2em;
}

dt:before {
	content: "☼";
}

dd {
	margin: 0.5em 3em 0.5em 1em;
	font-size: 0.8em;
}

strike,
del {
	text-decoration: line-through;
	color: #ccc;
}

.date {
	text-align: right;
	font-size: 0.8em;
	margin-block: 0.5em;
	font-family: "Noto serif TC", system-ui;
}

.pageSelector {
	display: flex;
	flex-wrap: wrap;
	justify-content: end;
	font:
		1em/1.2 "Noto serif TC",
		system-ui;
	color: #9995;
	border: solid #ccc5;
	border-width: 1px 0 0;
	padding-block: 0.3em;
}

.date + .pageSelector {
	font-size: 0.8em;
	border-width: 0 0 1px;
}

.pageSelector a {
	padding: 0.2em 0.4em;
	display: inline-block;
}

blockquote {
	display: block;
	margin: 1em;
	padding: 1em;
	font-size: 0.8em;
	border: 1px #ddd solid;
	background: #efefef;
}

.tableBox {
	width: min(84vw, 920px);
	overflow: auto;
	margin-inline: auto;
}

/* LINK */
a {
	color: #06f;
	text-decoration: none;
}

a:visited {
	color: #039;
}

a:hover {
	background: #efefef;
}

/* PHOTOBOX */
.photo {
	margin-inline: auto;
	margin-bottom: 1em;
	width: min-content;
	text-align: center;
}

.photo iframe,
.photo video,
.photo img {
	display: block;
	border: none;
	max-width: min(84vw, 720px);
	max-height: 560px;
	margin-inline: auto;
	box-sizing: border-box;
}

.photo img {
	border: 5px solid;
	border-color: #efefef #bbb #aaa #dedede;
}

.photo p {
	font-size: 0.8em;
	margin-block: 0.5em;
	margin-inline: auto;
}

/* 玉山／司馬庫斯 */
#content .lyrics {
	padding: 1em 1em 2em;
	margin-block: 1em;
	max-width: 430px;
	margin-inline: auto;
	background: #efefef;
	text-align: center;
	box-sizing: border-box;
}

#content .lyrics h3 {
	text-align: center;
}

#content .lyrics p {
	text-align: center;
	margin: 0.5em;
	font-size: 0.8em;
	font-weight: 600;
}

#content .lyrics p:nth-of-type(1) {
	font-size: 0.7em;
	margin-bottom: 1rem;
	text-align: right;
	font-weight: 400;
}

/* FOR E7 */
.e7Column {
	float: right;
	width: 250px;
	margin: 0 0 1em 1.5em;
	font-size: 0.8em;
}

@media (max-width: 990px) {
	#content .e7Column {
		flex: 0 0 250px;
		margin-inline: auto;
	}
}

.e7Box {
	position: relative;
	margin: 1em 3em;
	font-size: 0.85em;
	background: #dedede;
	padding: 6px 15px 6px 250px;
	border: double #fff 5px;
}

.e7Box img {
	position: absolute;
	top: 6px;
	left: 15px;
	display: block;
	border: 1px #666 solid;
	margin-right: 1em;
}
.e7Box ul {
	font-size: 0.8em;
	margin-bottom: 1em;
	padding-bottom: 1em;
	border-bottom: 1px solid #fff;
}

@media (max-width: 990px) {
	.e7Box {
		padding: 1rem;
	}

	.e7Box img {
		position: unset;
		float: unset;
		margin: 1em auto;
	}
	.e7Box ul {
		margin-inline: auto;
		width: fit-content;
	}
}

/*CLEAR*/
.clearFix:after {
	content: "";
	display: block;
	clear: both;
}

/* INDEX */
.intro {
	margin-top: 1em;
	text-align: center;
}

.intro .photo {
	float: right;
	margin: 0 0 1em 1em;
}

@media (max-width: 990px) {
	.intro .photo {
		float: unset;
		overflow: hidden;
		aspect-ratio: 5/4;
		max-width: 640px;
		width: 90vw;
		height: auto;
		margin: 0 auto 1em;
		position: relative;
	}

	.intro .photo img {
		position: absolute;
		object-fit: cover;
		object-position: 50% 0;
		width: 100%;
		height: 100%;
		inset: 0;
		margin: auto;
	}

	.intro .photo p {
		position: absolute;
		width: fit-content;
		inset: 0;
		margin: auto;
		top: auto;
		background: #dedede;
		display: block;
		padding: 0.3em 0.5em;
	}
}

/* RECOMMEND */
.listBox {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.listBox a {
	color: #333;
	display: block;
	padding: 0.5em;
}

.listBox .photo {
	overflow: hidden;
	aspect-ratio: 3/2;
	position: relative;
	width: 100%;
	margin-bottom: 0.5em;
}

.listBox .photo img {
	position: absolute;
	object-fit: cover;
	width: 100%;
	height: 100%;
}

.listBox a:nth-of-type(5) img,
.listBox a:nth-of-type(7) img {
	object-position: 50% 0;
}

.listBox h3 {
	margin-bottom: 0.5em;
	line-height: 1.3;
}

.listBox p {
	display: -webkit-box;
	line-clamp: 3;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	max-height: 4.5em;
	font-size: 0.8em;
}

/* DISQUS */
.dsq-widget {
	font-size: 0.8em;
	margin-inline: auto;
}

.dsq-widget-item {
	display: flex;
	flex-wrap: wrap;
	align-content: center;
	align-items: center;
}

.dsq-widget-item + .dsq-widget-item {
	border-top: 1px solid #3335;
	padding-top: 1em;
}

.dsq-widget-avatar {
	margin-inline: 10px !important;
}

.dsq-widget a {
	color: #333;
	display: block;
	flex: 0 0 flex;
}

.dsq-widget-comment {
	margin: 1rem;
	display: block;
	flex: 1 1 100%;
}

p.dsq-widget-meta {
	flex: 1 1 100%;
	font-size: 0 !important;
	margin-inline: 1rem !important;
}

.dsq-widget-meta a {
	font-size: 0.8rem;
}

.dsq-widget-meta a:first-child {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	width: clamp(300px, 80vw, 720px);
	display: inline-block;
}

#disqus_thread iframe:last-of-type:not(:only-child),
#disqus_thread iframe:first-of-type:not(:only-child) {
	display: none;
}

/* 搜尋 */
.searchBox {
	background: #efefef;
	padding: 1rem 0.5rem;
	border-radius: 0.5rem;
	margin-bottom: 1rem;
}

#___gcse_0 {
	margin-inline: auto;
	width: fit-content;
}

.gsc-control-cse,
.gsc-tabHeader.gsc-tabhActive,
.gsc-tabHeader.gsc-tabhInactive,
.gsc-webResult.gsc-result {
	background: none !important;
	border: none !important;
}

.gsc-wrapper,
.gsc-search-box {
	max-width: unset !important;
}

.gs-title {
	text-align: left;
}