/*
Theme Name: Asahi Music Theme
Theme URI: https://github.com/cheangiotou238-star/asahi-music-theme
Author: Asahi Music
Author URI: https://github.com/cheangiotou238-star
Description: 輕量、高 SEO 友善的 WordPress 專屬音樂推廣佈景主題。內建單曲作品 (song) CPT、自訂欄位、左圖右文雙欄排版、Plyr 播放器與 Color Thief 動態背景配色。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: asahi-music-theme
Tags: music, custom-post-type, responsive, seo, dark, featured-images
*/

/* ===== Base ===== */
:root {
	--asahi-bg: #0f1115;
	--asahi-surface: rgba(255, 255, 255, 0.06);
	--asahi-surface-hover: rgba(255, 255, 255, 0.1);
	--asahi-border: rgba(255, 255, 255, 0.14);
	--asahi-text: #f5f6f8;
	--asahi-muted: rgba(245, 246, 248, 0.68);
	--asahi-accent: #9db8ff;
	--asahi-radius: 18px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: "Noto Sans JP", "Noto Sans TC", "PingFang TC", "Hiragino Sans", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.75;
	color: var(--asahi-text);
	background-color: var(--asahi-bg);
	background-attachment: fixed;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	transition: background 0.6s ease, background-color 0.6s ease;
}

a {
	color: var(--asahi-accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
}

.container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 40px 32px 96px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ===== Header ===== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	background: rgba(15, 17, 21, 0.72);
	border-bottom: 1px solid var(--asahi-border);
}

.site-header__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 12px 32px 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.site-brand {
	display: inline-flex;
	align-items: center;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--asahi-text);
	letter-spacing: 0.02em;
}

.site-brand:hover {
	text-decoration: none;
}

.site-brand__name {
	line-height: 1.2;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 34px;
}

.nav-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1.15;
	color: var(--asahi-muted);
	transition: color 0.2s ease;
}

.nav-link:hover {
	color: var(--asahi-text);
	text-decoration: none;
}

.nav-link__main {
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.nav-link__sub {
	font-family: "Cormorant Garamond", "Noto Serif JP", serif;
	font-size: 0.72rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	opacity: 0.65;
}

/* ===== Footer ===== */
.site-footer {
	border-top: 1px solid var(--asahi-border);
	margin-top: 48px;
}

.site-footer__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 32px;
	color: var(--asahi-muted);
	font-size: 0.9rem;
}

.site-footer__inner p {
	margin: 0;
}

/* ===== Common ===== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 999px;
	background: var(--asahi-accent);
	color: #0f1115;
	font-weight: 700;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
	text-decoration: none;
	opacity: 0.9;
	transform: translateY(-1px);
}

.section-title {
	font-size: 1.6rem;
	margin: 0 0 24px;
	letter-spacing: 0.02em;
}

/* ===== Song grid / cards ===== */
.song-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 24px;
}

.song-card {
	display: block;
	color: var(--asahi-text);
	border-radius: var(--asahi-radius);
	overflow: hidden;
	background: var(--asahi-surface);
	border: 1px solid var(--asahi-border);
	transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.song-card:hover {
	text-decoration: none;
	transform: translateY(-4px);
	background: var(--asahi-surface-hover);
	border-color: rgba(255, 255, 255, 0.24);
}

.song-card__cover {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #000;
}

.song-card__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.song-card:hover .song-card__cover img {
	transform: scale(1.05);
}

.song-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 3rem;
	color: rgba(255, 255, 255, 0.4);
}

.song-card__title {
	margin: 14px 16px 0;
	font-size: 1.05rem;
	font-weight: 700;
}

.song-card__creator {
	margin: 4px 16px 16px;
	font-size: 0.85rem;
	color: var(--asahi-muted);
}

/* ===== Featured song (front page) ===== */
.featured-song {
	display: grid;
	grid-template-columns: minmax(260px, 420px) 1fr;
	gap: 40px;
	align-items: center;
	padding: 24px;
	margin-bottom: 64px;
	border-radius: 24px;
	background: var(--asahi-surface);
	border: 1px solid var(--asahi-border);
}

.featured-song__media {
	aspect-ratio: 1 / 1;
	border-radius: 18px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}

.featured-song__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.featured-song__badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--asahi-accent);
	color: #0f1115;
	font-size: 0.8rem;
	font-weight: 700;
	margin-bottom: 12px;
}

.featured-song__title {
	margin: 0 0 6px;
	font-size: 2rem;
	line-height: 1.3;
}

.featured-song__creator {
	margin: 0 0 20px;
	color: var(--asahi-muted);
}

/* ===== Single song: two-column layout ===== */
.song-layout {
	display: flex;
	align-items: flex-start;
	gap: 56px;
	max-width: 1280px;
	margin: 0 auto;
	padding: 48px 32px 96px;
}

.song-sidebar {
	flex: 0 0 40%;
	width: 40%;
	position: sticky;
	top: 24px;
	align-self: flex-start;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding-right: 4px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.song-sidebar::-webkit-scrollbar {
	width: 6px;
}

.song-sidebar::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.25);
	border-radius: 999px;
}

.song-sidebar__inner {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.song-content {
	flex: 0 0 60%;
	width: 60%;
	min-width: 0;
}

/* Cover */
.song-cover {
	margin: 0;
	aspect-ratio: 1 / 1;
	border-radius: 22px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 28px 56px rgba(0, 0, 0, 0.5);
}

.song-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.song-cover__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 4rem;
	color: rgba(255, 255, 255, 0.4);
}

/* Meta */
.song-title {
	margin: 0;
	font-size: 2rem;
	line-height: 1.3;
	letter-spacing: 0.01em;
}

.song-creator {
	margin: 0;
	color: var(--asahi-muted);
	font-size: 1.05rem;
}

.song-credits {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border-radius: 16px;
	background: var(--asahi-surface);
	border: 1px solid var(--asahi-border);
}

.song-credits__item {
	display: flex;
	gap: 12px;
	font-size: 0.92rem;
}

.song-credits__item dt {
	flex: 0 0 auto;
	color: var(--asahi-muted);
	min-width: 44px;
}

.song-credits__item dd {
	margin: 0;
	color: var(--asahi-text);
}

/* Player + streaming */
.song-player {
	margin-top: 4px;
}

.song-streaming {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.stream-btn {
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 700;
	color: #fff;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.stream-btn:hover {
	text-decoration: none;
	transform: translateY(-2px);
	opacity: 0.9;
}

.stream-btn--spotify {
	background: #1db954;
}

.stream-btn--apple {
	background: #fa243c;
}

.stream-btn--youtube {
	background: #ff0000;
}

/* Content sections */
.song-section {
	margin-bottom: 40px;
}

.song-section__title {
	margin: 0 0 16px;
	font-size: 1.5rem;
	letter-spacing: 0.02em;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--asahi-border);
}

.song-section__body {
	color: var(--asahi-text);
	line-height: 1.9;
}

.song-section__body p {
	margin: 0 0 1.2em;
}

.song-lyrics__body {
	white-space: pre-line;
}

/* ===== Plyr overrides ===== */
.plyr {
	--plyr-color-main: var(--asahi-accent);
	border-radius: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
	.song-layout {
		gap: 40px;
	}
}

@media (max-width: 768px) {
	.song-layout {
		flex-direction: column;
		padding: 24px 16px 64px;
		gap: 32px;
	}

	.song-sidebar {
		flex: none;
		width: 100%;
		position: static;
		max-height: none;
		overflow: visible;
	}

	.song-content {
		flex: none;
		width: 100%;
	}

	.featured-song {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.container {
		padding: 24px 16px 64px;
	}

	.site-header__inner {
		padding: 14px 16px;
	}
}

/* ===== Language switcher + two-row header (Nogizaka46-inspired) ===== */
.site-header__top {
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.lang-switcher {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-wrap: wrap;
}

.site-header__brand-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.lang-select {
	position: relative;
}

.lang-select__trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 999px;
	border: 1px solid var(--asahi-border);
	background: var(--asahi-surface);
	color: var(--asahi-text);
	font-family: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.lang-select__trigger:hover {
	background: var(--asahi-surface-hover);
	border-color: rgba(255, 255, 255, 0.28);
}

.lang-select__globe {
	font-size: 1rem;
	line-height: 1;
}

.lang-select__caret {
	font-size: 0.6rem;
	opacity: 0.8;
}

.lang-select__menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 60;
	min-width: 160px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #171a20;
	border: 1px solid var(--asahi-border);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.lang-select__menu li {
	margin: 0;
}

.lang-select__menu a {
	display: block;
	padding: 8px 12px;
	border-radius: 10px;
	color: var(--asahi-text);
	font-size: 0.9rem;
	transition: background 0.2s ease;
}

.lang-select__menu a:hover {
	background: var(--asahi-surface-hover);
	text-decoration: none;
}

.lang-select__menu a[aria-current="true"] {
	background: var(--asahi-surface);
	color: var(--asahi-accent);
	font-weight: 600;
}

.lang-quick {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.82rem;
}

.lang-quick__label {
	color: var(--asahi-muted);
	font-family: "Cormorant Garamond", "Noto Serif JP", serif;
	letter-spacing: 0.08em;
}

.lang-quick__links {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.lang-quick__links a {
	padding: 2px 6px;
	border-radius: 999px;
	color: var(--asahi-muted);
	transition: color 0.2s ease, background 0.2s ease;
}

.lang-quick__links a:hover {
	color: var(--asahi-text);
	text-decoration: none;
}

.lang-quick__links a.is-active {
	color: var(--asahi-accent);
	background: var(--asahi-surface);
}

/* ===== Typography accents ===== */
.site-brand__name,
.song-title,
.section-title,
.featured-song__title,
.song-section__title {
	font-family: "Noto Serif JP", "Noto Sans JP", serif;
}

/* ===== Header responsive ===== */
@media (max-width: 768px) {
	.site-header__inner {
		padding: 12px 16px 14px;
	}

	.site-header__brand-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.site-nav {
		gap: 24px;
	}

	.lang-switcher {
		gap: 12px;
	}

	.lang-quick {
		flex-wrap: wrap;
	}
}

