/*
Theme Name: Miliana Notes
Template: twentytwentyfive
Description: Twenty Twenty-Five 的子佈景，旅行手帳風格：椿花、紙膠帶、貼紙印章，文章頁保持乾淨好讀。
Version: 1.0.0
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: miliana-notes
*/

:root {
	--paper: #FCFCFB; --line: #E7E7E3; --ink: #253122; --sub: #5B6458; --hd: #FFFFFF;
	--hero: #FEF1DB; --tape: #fdbf68; --c1: #FCDEE0; --c2: #FEE5C3; --c3: #EAE2D5;
	--sec: #F7F5F1; --box: #FEEFD9; --boxbar: #fdbf68; --price: #FDEDEE;
	--stamp: #906A6C; --leaf: #986f2d; --ft: #253122;
	--hf: "Chiron GoRound TC", "Noto Sans TC", sans-serif;

	/* 椿花（自繪）：五瓣、黃蕊、橄欖葉 */
	--mn-camellia: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M38 40c9-1 18 4 22 13-10 3-19-2-22-13z' fill='%23253122'/%3E%3Cpath d='M38 40c7 3 13 7 19 12' stroke='%23526148' stroke-width='1' fill='none'/%3E%3Cg transform='translate(29 29)'%3E%3Cg fill='%23a62c37' stroke='%237E1F2A' stroke-width='1.2'%3E%3Cellipse cx='0' cy='-13' rx='11.5' ry='13'/%3E%3Cellipse cx='0' cy='-13' rx='11.5' ry='13' transform='rotate(72)'/%3E%3Cellipse cx='0' cy='-13' rx='11.5' ry='13' transform='rotate(144)'/%3E%3Cellipse cx='0' cy='-13' rx='11.5' ry='13' transform='rotate(216)'/%3E%3Cellipse cx='0' cy='-13' rx='11.5' ry='13' transform='rotate(288)'/%3E%3C/g%3E%3Cg fill='%23C8404F'%3E%3Cellipse cx='0' cy='-10' rx='7' ry='8' transform='rotate(36)'/%3E%3Cellipse cx='0' cy='-10' rx='7' ry='8' transform='rotate(108)'/%3E%3Cellipse cx='0' cy='-10' rx='7' ry='8' transform='rotate(180)'/%3E%3Cellipse cx='0' cy='-10' rx='7' ry='8' transform='rotate(252)'/%3E%3Cellipse cx='0' cy='-10' rx='7' ry='8' transform='rotate(324)'/%3E%3C/g%3E%3Ccircle r='7' fill='%23fdbf68'/%3E%3Cg fill='%23986f2d'%3E%3Ccircle cx='0' cy='-4' r='1.3'/%3E%3Ccircle cx='3.8' cy='-1.2' r='1.3'/%3E%3Ccircle cx='2.4' cy='3.2' r='1.3'/%3E%3Ccircle cx='-2.4' cy='3.2' r='1.3'/%3E%3Ccircle cx='-3.8' cy='-1.2' r='1.3'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

	/* 椿花枝：一朵開花＋一個花苞＋三片葉，斜放 */
	--mn-branch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 240'%3E%3Cpath d='M18 232C60 190 96 150 150 60' stroke='%23986f2d' stroke-width='4' fill='none' stroke-linecap='round'/%3E%3Cpath d='M112 124c6-4 14-12 18-26' stroke='%23986f2d' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3Cg fill='%23253122'%3E%3Cpath d='M66 184c-26-4-44 6-52 22 24 6 44-4 52-22z'/%3E%3Cpath d='M92 148c4-26 24-40 44-40-2 24-20 38-44 40z'/%3E%3Cpath d='M84 162c-24-14-46-10-58 2 20 14 42 12 58-2z'/%3E%3C/g%3E%3Cg stroke='%23526148' stroke-width='1.2' fill='none'%3E%3Cpath d='M64 186c-16 2-30 8-46 18'/%3E%3Cpath d='M94 146c10-12 24-24 40-36'/%3E%3Cpath d='M82 162c-16-4-34-4-52 2'/%3E%3C/g%3E%3Cg transform='translate(130 96) rotate(-20)'%3E%3Cpath d='M0 0c-8-10-6-24 4-30 10 6 10 20-4 30z' fill='%237E1F2A'/%3E%3Cpath d='M0 2c-6-4-12-4-14 2 4 4 10 4 14-2zM0 2c6-4 12-4 14 2-4 4-10 4-14-2z' fill='%23253122'/%3E%3C/g%3E%3Cg transform='translate(150 56)'%3E%3Cg fill='%23a62c37' stroke='%237E1F2A' stroke-width='1.6'%3E%3Cellipse cx='0' cy='-22' rx='19' ry='22'/%3E%3Cellipse cx='0' cy='-22' rx='19' ry='22' transform='rotate(72)'/%3E%3Cellipse cx='0' cy='-22' rx='19' ry='22' transform='rotate(144)'/%3E%3Cellipse cx='0' cy='-22' rx='19' ry='22' transform='rotate(216)'/%3E%3Cellipse cx='0' cy='-22' rx='19' ry='22' transform='rotate(288)'/%3E%3C/g%3E%3Cg fill='%23C8404F'%3E%3Cellipse cx='0' cy='-16' rx='11' ry='13' transform='rotate(36)'/%3E%3Cellipse cx='0' cy='-16' rx='11' ry='13' transform='rotate(108)'/%3E%3Cellipse cx='0' cy='-16' rx='11' ry='13' transform='rotate(180)'/%3E%3Cellipse cx='0' cy='-16' rx='11' ry='13' transform='rotate(252)'/%3E%3Cellipse cx='0' cy='-16' rx='11' ry='13' transform='rotate(324)'/%3E%3C/g%3E%3Ccircle r='11' fill='%23fdbf68'/%3E%3Cg fill='%23986f2d'%3E%3Ccircle cx='0' cy='-6' r='2'/%3E%3Ccircle cx='5.7' cy='-1.9' r='2'/%3E%3Ccircle cx='3.5' cy='4.9' r='2'/%3E%3Ccircle cx='-3.5' cy='4.9' r='2'/%3E%3Ccircle cx='-5.7' cy='-1.9' r='2'/%3E%3Ccircle r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

	/* 紙膠帶：日本青海波 */
	--mn-tape-seigaiha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='20' height='10'%3E%3Cdefs%3E%3Cg id='s'%3E%3Ccircle r='10' fill='%23fdbf68'/%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Ccircle r='9.4'/%3E%3Ccircle r='6.4'/%3E%3Ccircle r='3.4'/%3E%3C/g%3E%3C/g%3E%3C/defs%3E%3Cuse xlink:href='%23s' x='0' y='-5'/%3E%3Cuse xlink:href='%23s' x='20' y='-5'/%3E%3Cuse xlink:href='%23s' x='10' y='0'/%3E%3Cuse xlink:href='%23s' x='0' y='5'/%3E%3Cuse xlink:href='%23s' x='20' y='5'/%3E%3Cuse xlink:href='%23s' x='10' y='10'/%3E%3Cuse xlink:href='%23s' x='0' y='15'/%3E%3Cuse xlink:href='%23s' x='20' y='15'/%3E%3C/svg%3E");

	/* 紙膠帶：韓國조각보拼布 */
	--mn-tape-jogakbo:
		linear-gradient(180deg, transparent 0 46%, rgba(255,255,255,.85) 46% 52%, transparent 52%),
		linear-gradient(90deg, #f8b6ba 0 22%, #fff 22% 24%, #EAE2D5 24% 47%, #fff 47% 49%, #fdbf68 49% 66%, #fff 66% 68%, #C9D3C2 68% 86%, #fff 86% 88%, #FEE5C3 88%);
}

/* ---------- 基本 ---------- */
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }
:where(a, button):focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; border-radius: 3px; }
.wp-site-blocks > * { margin-block-start: 0; }
.wp-site-blocks { padding-top: 0; padding-bottom: 0; }

/* ---------- 頁首 ---------- */
.mn-header { border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.mn-header__in { min-height: 68px; padding-left: 20px; padding-right: 20px; gap: 16px; }
.mn-logo { margin: 0; font-family: var(--hf); font-weight: 700; font-size: 21px; line-height: 1.2; }
.mn-logo a { display: inline-grid; grid-template-columns: 34px auto; column-gap: 10px; align-items: center; color: var(--ink); }
.mn-logo a::before { content: ""; grid-row: 1 / span 2; width: 34px; height: 34px; background: var(--mn-camellia) center / contain no-repeat; }
.mn-logo small { display: block; font-family: "Noto Sans TC", sans-serif; font-weight: 400; font-size: 12px; color: var(--sub); letter-spacing: .04em; }

.mn-nav, .mn-nav .wp-block-navigation__container { font-size: 15px; gap: 22px; }
.mn-nav .wp-block-navigation-item__content { padding: 4px 1px; }
.mn-nav .wp-block-navigation-item__content:hover { box-shadow: inset 0 -8px 0 var(--tape); }
.mn-nav .wp-block-navigation__responsive-container-open { width: 44px; height: 44px; justify-content: center; align-items: center; border-radius: 8px; }
.mn-nav .wp-block-navigation__responsive-container-open svg,
.mn-nav .wp-block-navigation__responsive-container-close svg { width: 28px; height: 28px; }
.mn-nav .wp-block-navigation__responsive-container.is-menu-open { background: var(--paper); padding: 24px; }
.mn-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 56px; gap: 6px; }
.mn-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-family: var(--hf); font-weight: 700; font-size: 22px; }
@media (min-width: 600px) and (max-width: 900px) { .mn-nav, .mn-nav .wp-block-navigation__container { gap: 14px; font-size: 14px; } .mn-logo small { display: none; } }

/* ---------- 首頁 hero ---------- */
.mn-hero { padding: 64px 20px 56px; overflow: hidden; }
.mn-hero__cols { gap: 48px; margin: 0; }
.mn-hero__title { font-size: clamp(34px, 5vw, 54px); line-height: 1.3; letter-spacing: .02em; margin: 0; }
.mn-hero__lead { margin-top: 18px; font-size: 17px; color: var(--ink); opacity: .82; max-width: 30em; }
.mn-hero__cols > .wp-block-column:last-child { position: relative; }
/* 椿花枝：花朵壓在便條紙右下角（避開文字），枝葉往下伸出 */
.mn-hero__cols > .wp-block-column:last-child::after {
	content: ""; position: absolute; z-index: 2; right: -44px; bottom: -132px;
	width: 170px; height: 204px; background: var(--mn-branch) center / contain no-repeat;
	pointer-events: none;
}
.mn-note {
	position: relative; z-index: 1; background: #fff; border: 1px solid var(--line); border-radius: 6px;
	padding: 28px 26px 20px; transform: rotate(-1.2deg); box-shadow: 0 18px 40px -24px rgba(37,49,34,.4);
}
.mn-note::before {
	content: ""; position: absolute; top: -13px; left: 50%; width: 104px; height: 26px; margin-left: -52px;
	background: var(--mn-tape-seigaiha); opacity: .88; transform: rotate(2.5deg);
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.mn-note__title { font-size: 19px; margin: 0 0 8px; }
.mn-note__list { list-style: none; padding: 0; margin: 0; }
.mn-note__list li { padding: 8px 0 8px 26px; border-bottom: 1px dashed var(--line); font-size: 15px; line-height: 1.6; position: relative; }
.mn-note__list li:last-child { border-bottom: 0; }
.mn-note__list li::before { position: absolute; left: 2px; top: 8px; color: var(--leaf); font-weight: 700; }
.mn-note__list li.is-done::before { content: "✓"; }
.mn-note__list li.is-open::before { content: "…"; }

/* ---------- 分類標籤（貼紙） ---------- */
.mn-cats { padding: 30px 20px 36px; margin: 0; }
.mn-cats__row { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 0; }
.mn-cats__row a {
	display: inline-block; border-radius: 999px; padding: 6px 18px; font-size: 15px; font-weight: 500; color: var(--ink);
	background: var(--c3); box-shadow: 0 0 0 2px #fff, 0 2px 6px -2px rgba(37,49,34,.25);
	transition: transform .15s ease;
}
.mn-cats__row a:nth-child(3n+1) { background: var(--c1); }
.mn-cats__row a:nth-child(3n+2) { background: var(--c2); }
.mn-cats__row a:nth-child(2) { transform: rotate(-3deg); }
.mn-cats__row a:nth-child(5) { transform: rotate(2.5deg); }
.mn-cats__row a:hover { transform: translateY(-2px) rotate(0); }

/* ---------- 最近寫好的 ---------- */
.mn-recent { padding: 44px 20px 64px; margin: 0; }
.mn-section-title { font-size: 26px; margin: 0 0 22px; }
.mn-recent__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.mn-recent__grid > * { margin: 0; }
.mn-feat .wp-block-post-template, .mn-list .wp-block-post-template { margin: 0; padding: 0; list-style: none; }
.mn-feat .wp-block-post { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.mn-feat .wp-block-post::after {
	content: ""; position: absolute; top: -10px; right: 22px; width: 86px; height: 22px;
	background: var(--mn-tape-jogakbo); opacity: .85; transform: rotate(4deg); box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.mn-feat__img { margin: 0; border-radius: 8px 8px 0 0; overflow: hidden; }
.mn-feat__img img { border-radius: 8px 8px 0 0; }
.mn-feat .wp-block-post:not(:has(.mn-feat__img))::before {
	content: ""; display: block; aspect-ratio: 3 / 1; border-radius: 8px 8px 0 0;
	background: linear-gradient(135deg, var(--hero), var(--c2));
}
.mn-feat__body { padding: 22px 24px 26px; }
.mn-feat__body > * + * { margin-top: 10px; }
.mn-feat__title { font-size: clamp(21px, 2.4vw, 25px); line-height: 1.45; margin: 0; }
.mn-feat__title a:hover, .mn-list__title a:hover { box-shadow: inset 0 -8px 0 var(--c2); }
.mn-feat__excerpt { color: var(--sub); font-size: 15px; margin: 0; }
.mn-feat__excerpt p { margin: 0; }
.mn-feat__excerpt .wp-block-post-excerpt__more-text { display: none; }

.mn-list .wp-block-post { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mn-list .wp-block-post:first-child { padding-top: 0; }
.mn-list .wp-block-post:not(:has(.mn-list__img)) { grid-template-columns: 1fr; }
.mn-list__img { margin: 0; }
.mn-list__img img { border-radius: 6px; }
.mn-list__body > * { margin: 0; }
.mn-list__title { font-family: "Noto Sans TC", sans-serif; font-size: 16px; line-height: 1.55; margin-top: 4px !important; }
.mn-empty { color: var(--sub); }

.mn-terms { font-size: 13px; font-weight: 500; color: #7E5A1F; margin: 0; }
.mn-terms a { color: #7E5A1F; }
.mn-terms a:hover { text-decoration: underline; }

/* ---------- 文章頁 ---------- */
.mn-article { padding: 52px 20px 72px; background: #fff; }
.mn-article__title { font-size: clamp(28px, 4vw, 38px); line-height: 1.4; margin-top: 10px !important; }
.mn-article__meta { font-size: 14px; color: var(--sub); gap: 6px 16px; margin-top: 12px !important; }
.mn-article__meta .mn-updated::before { content: "最後更新 "; }
.mn-article__meta .wp-block-post-author-name::before { content: "作者 "; }
.mn-article__img { position: relative; border-radius: 8px; overflow: visible; margin-top: 28px !important; }
.mn-article__img img { border-radius: 8px; }
.mn-article__img::before {
	content: ""; position: absolute; z-index: 1; top: -10px; left: 18px; width: 92px; height: 22px;
	background: var(--mn-tape-seigaiha); opacity: .85; transform: rotate(-4deg);
}
.mn-content { margin-top: 32px !important; font-size: 17px; line-height: 1.9; }
.mn-content > * { margin-block-start: 0; margin-block-end: 0; }
.mn-content > * + * { margin-block-start: 1.1em; }
.mn-content h2 { font-size: clamp(21px, 2.6vw, 24px); margin-block-start: 2.2em; padding-left: 30px; position: relative; }
.mn-content h2::before {
	content: ""; position: absolute; left: 0; top: .2em; width: 22px; height: 22px;
	background: var(--mn-camellia) center / contain no-repeat;
}
.mn-content h3 { font-size: 19px; margin-block-start: 1.8em; }
.mn-content a:not(.mn-btn) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--tape); text-decoration-thickness: 2px; text-underline-offset: 3px; word-break: break-all; }
.mn-content ul, .mn-content ol { padding-left: 1.3em; }
.mn-content li + li { margin-top: .4em; }
.mn-content li::marker { color: var(--leaf); }
.mn-content strong { font-weight: 700; }
.mn-content .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mn-content .wp-block-table table { border-collapse: collapse; font-size: 15px; line-height: 1.6; min-width: 680px; width: 100%; }
.mn-content .wp-block-table th, .mn-content .wp-block-table td { border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.mn-content .wp-block-table thead { border: 0; }
.mn-content .wp-block-table th { background: var(--sec); font-weight: 700; white-space: nowrap; }
.mn-content .wp-block-table td:first-child { font-weight: 700; white-space: nowrap; }
@media (max-width: 781px) {
	.mn-content .wp-block-table { margin-right: -20px; padding-right: 20px; }
}

.mn-article__nav { margin-top: 56px !important; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; gap: 12px 24px; }

/* ---------- 稿子用的 class ---------- */
/* 印章貼紙：做功課 */
.mn-stamps { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0; }
.mn-stamp {
	display: inline-block; font-family: var(--hf); font-weight: 700; font-size: 13px; line-height: 1.5;
	color: var(--stamp); background: #fff; border: 2px solid var(--stamp); border-radius: 999px; padding: 3px 12px;
	box-shadow: 0 0 0 3px #fff, 0 3px 8px -3px rgba(37,49,34,.35); transform: rotate(-2.5deg);
}
/* 印章貼紙：我去過 */
.mn-stamp--been { color: var(--leaf); border-color: var(--leaf); transform: rotate(2deg); }

/* 我會怎麼訂 */
.mn-box { background: var(--box); border-left: 4px solid var(--boxbar); border-radius: 0 8px 8px 0; padding: 18px 22px; }
.mn-box__title { font-family: var(--hf); font-weight: 700; font-size: 18px; margin: 0 0 8px; }
.mn-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mn-box li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 8px 0; border-top: 1px dashed rgba(152,111,45,.3); margin: 0 !important; }
.mn-box li:first-child { border-top: 0; padding-top: 2px; }
.mn-box p:last-child { margin-bottom: 0; }

/* 聯盟按鈕 */
.mn-btn {
	display: inline-block; background: var(--stamp); color: #fff !important; border-radius: 6px; padding: 9px 18px;
	font-size: 15px; font-weight: 500; line-height: 1.4; text-decoration: none !important; white-space: nowrap;
	transition: background .15s ease;
}
.mn-btn:hover { background: #7a5a5c; }

/* 聯盟小工具佔位 */
.mn-widget { border: 2px dashed #D4D1C8; border-radius: 8px; padding: 22px; text-align: center; color: var(--sub); font-size: 14px; background: var(--paper); }

/* 價格怎麼看 */
.mn-price { background: var(--price); border-radius: 8px; padding: 18px 22px; font-size: 15px; }
.mn-price dt, .mn-price h3, .mn-price .mn-price__title { font-weight: 700; margin-top: 10px; }
.mn-price > :first-child { margin-top: 0; }
.mn-price dd { margin: 0; color: var(--sub); }

/* 聯盟揭露一行 */
.mn-disclosure { font-size: 14px; color: var(--sub); background: var(--sec); border-radius: 6px; padding: 8px 14px; line-height: 1.6; }

/* 延伸閱讀 */
.mn-related { font-size: 15px; color: var(--sub); }

/* ---------- 列表頁（分類、搜尋、首頁以外） ---------- */
.mn-archive { padding: 48px 20px 72px; }
.mn-archive__title { font-size: clamp(26px, 3.4vw, 34px); margin: 0 0 8px; }
.mn-archive__desc { color: var(--sub); }
.mn-archive .wp-block-post-template { list-style: none; padding: 0; margin: 28px 0 0; }
.mn-archive .wp-block-post { padding: 22px 0; border-bottom: 1px solid var(--line); }
.mn-archive .wp-block-post > * { margin: 0; }
.mn-archive .wp-block-post-title { font-size: 21px; margin-top: 6px; }
.mn-archive .wp-block-post-excerpt { color: var(--sub); font-size: 15px; margin-top: 6px; }
.mn-archive .wp-block-post-excerpt p { margin: 0; }
.mn-archive .wp-block-query-pagination { margin-top: 32px; gap: 16px; }
.mn-archive .wp-block-search__input { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.mn-archive .wp-block-search__button { border-radius: 6px; }

/* ---------- 頁尾 ---------- */
.mn-footer { color: rgba(255,255,255,.78); padding: 40px 20px 44px; font-size: 14px; margin: 0; }
.mn-footer > * { margin: 0; }
.mn-footer__name { font-family: var(--hf); font-weight: 700; font-size: 18px; color: #fff; display: flex; align-items: center; gap: 10px; }
.mn-footer__name::before { content: ""; width: 26px; height: 26px; background: var(--mn-camellia) center / contain no-repeat; flex: none; }
.mn-footer__note { margin-top: 8px !important; }

/* ---------- 手機 ---------- */
@media (max-width: 781px) {
	.mn-hero { padding: 40px 20px 44px; }
	.mn-hero__cols { gap: 36px; }
	.mn-note { transform: none; margin-right: 34px; }
	.mn-hero__cols > .wp-block-column:last-child::after { width: 96px; height: 115px; right: -26px; bottom: -78px; }
	.mn-recent__grid { grid-template-columns: 1fr; gap: 28px; }
	.mn-feat .wp-block-post::after { width: 64px; height: 18px; }
	.mn-cats { padding: 26px 20px 30px; }
	.mn-article { padding: 36px 20px 56px; }
	.mn-list .wp-block-post { grid-template-columns: 76px 1fr; gap: 14px; }
	.mn-list .wp-block-post:not(:has(.mn-list__img)) { grid-template-columns: 1fr; }
	.mn-list__img, .mn-list__img img { width: 76px !important; height: 76px !important; }
	.mn-box li { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
