/* sf header redesign 2026-11-25 (PREVIEW, includes/sf-header-2026.php). White newspaper masthead like epochtimes.com/taiwan:
   date line, centred nameplate with the paper's name between rules, one row of sections under a thick-thin rule.
   Photos square; buttons 6px, boxes 12-14px; no pills, no gold. */
.sfhd, .sfhd-drawer {
	--hd-navy: #10357e; --hd-ink: #16181d; --hd-text: #3a3f47; --hd-meta: #5c636e; --hd-rule: #dcdfe5;
	--hd-serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
}
.sfhd { position: relative; z-index: 100001; background: #fff; color: var(--hd-ink); font-size: 15px; line-height: 1.5; text-align: left; }
.sfhd *, .sfhd-drawer * { box-sizing: border-box; }
.sfhd ul, .sfhd-drawer ul { list-style: none; margin: 0; padding: 0; }
.sfhd p, .sfhd-drawer p { margin: 0; }
.sfhd a { color: inherit; text-decoration: none; }
.sfhd a:hover { color: var(--hd-navy); text-decoration: underline; text-underline-offset: 3px; }
.sfhd :focus-visible, .sfhd-drawer :focus-visible { outline: 2px solid var(--hd-navy); outline-offset: 2px; }
.sfhd-in { max-inline-size: 1180px; margin-inline: auto; padding-inline: 16px; }
.sfhd-vh { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sfhd-icon { display: inline-grid; place-items: center; inline-size: 44px; block-size: 44px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--hd-ink); cursor: pointer; }
.sfhd-icon:hover { background: #f1f3f7; }

/* date line + services */
.sfhd-util { border-block-end: 1px solid var(--hd-rule); font-size: 13.5px; color: var(--hd-text); }
.sfhd-util .sfhd-in { display: flex; align-items: center; gap: 8px 20px; min-block-size: 36px; }
.sfhd-date { display: flex; gap: 12px; color: var(--hd-ink); white-space: nowrap; }
.sfhd-lunar { color: var(--hd-meta); }
.sfhd-links { margin-inline-start: auto; }
.sfhd-links ul { display: flex; flex-wrap: wrap; }
.sfhd-links li + li { border-inline-start: 1px solid var(--hd-rule); }
.sfhd-links a { display: block; padding: 2px 12px; }
.sfhd-lang a { display: block; padding: 2px 4px; }
.sfhd a.sfhd-acct, .sfhd a.sfw-acct-link { display: inline-flex !important; align-items: center; gap: 5px; block-size: 28px !important; padding: 0 12px !important; margin: 0 !important;
	border: 1px solid var(--hd-navy) !important; border-radius: 6px !important; background: #fff !important; color: var(--hd-navy) !important; font-size: 13.5px !important; font-weight: 700; line-height: 1 !important; text-decoration: none !important; }
.sfhd a.sfw-acct-link:hover { background: #eef2fa !important; }
.sfhd a.sfw-acct-link.sfw-in { background: var(--hd-navy) !important; color: #fff !important; }

/* nameplate row */
.sfhd-mast .sfhd-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding-block: 20px 14px; }
.sfhd-burger, .sfhd-sbtn { display: none; }
/* 2026-11-25 新唐人直播: newspaper "LIVE" kicker (small red bold caps before the name, as news sites mark live
   coverage); plain text, no box/icon/animation (user: the badge version looked too AI) */
.sfhd-live { justify-self: start; display: inline-flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 700; color: var(--hd-ink) !important; text-decoration: none !important; }
.sfhd-live-k { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; color: #b3261e; }
.sfhd-live-go { color: var(--hd-meta); font-weight: 400; }
.sfhd-live:hover { text-decoration: underline !important; text-decoration-thickness: 1px !important; text-underline-offset: 4px; }
.sfhd-name { grid-column: 2; display: grid; justify-items: center; gap: 8px; }
.sfhd-logo { display: block; line-height: 0; }
.sfhd-logo img { display: block; inline-size: 236px; block-size: auto; }
.sfhd-motto { display: flex; align-items: center; gap: 12px; font-family: var(--hd-serif); font-size: 14px; letter-spacing: .32em; color: var(--hd-ink); white-space: nowrap; }
.sfhd-motto::before, .sfhd-motto::after { content: ""; inline-size: 64px; block-size: 4px; border-block: 1px solid currentColor; }
.sfhd-motto::after { margin-inline-start: -.32em; }
.sfhd-search { grid-column: 3; justify-self: end; display: flex; inline-size: min(100%, 260px); border: 1px solid #c4c9d2; border-radius: 6px; overflow: hidden; background: #fff; }
.sfhd-search:focus-within { border-color: var(--hd-navy); box-shadow: 0 0 0 1px var(--hd-navy); }
.sfhd-search input { flex: 1; min-inline-size: 0; block-size: 38px; padding: 0 12px; border: 0; outline: 0; font: inherit; font-size: 15px; color: var(--hd-ink); background: none; }
.sfhd-search button { flex: none; inline-size: 42px; border: 0; background: none; color: var(--hd-navy); cursor: pointer; display: grid; place-items: center; }

/* section row: thin rule above, thick-thin rule below (same rule as the homepage section titles) */
.sfhd-nav { border-block-start: 1px solid var(--hd-rule); }
.sfhd-nav .sfhd-in { position: relative; }
.sfhd-nav .sfhd-in::after { content: ""; position: absolute; inset-inline: 16px; inset-block-end: 0; block-size: 6px; border-block-start: 2px solid var(--hd-ink); border-block-end: 1px solid var(--hd-ink); }
.sfhd-row { display: flex; justify-content: center; align-items: stretch; padding-block-end: 6px; }
.sfhd-row > li { display: flex; align-items: center; }
.sfhd-row > li > a { display: block; padding: 13px 9px; font-size: 16px; white-space: nowrap; }
.sfhd-g { margin-inline-start: 14px; padding-inline-start: 14px; background: linear-gradient(var(--hd-rule), var(--hd-rule)) left center / 1px 18px no-repeat; }
.sfhd-g:first-child { margin-inline-start: 0; padding-inline-start: 0; background: none; }
.sfhd-row > li > a.sfhd-p { font-weight: 700; color: var(--hd-navy); padding-inline-end: 2px; }
.sfhd-row [aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; color: var(--hd-navy); }
/* section panels (2026-11-25 v2, user didn't like the small floating box): one white panel the width of the page under
   the section row - section name + 「進入… ›」 on the left, every sub-section in even columns. No arrows on mouse screens
   (hover opens it); the toggle button stays for keyboards (visible on focus) and touch screens. */
.sfhd-nav { position: relative; }
.sfhd-g { position: static; }
.sfhd-dd { inline-size: 22px; block-size: 30px; margin-inline-end: 2px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--hd-navy); cursor: pointer; }
.sfhd-dd::before { content: ""; display: block; margin: 0 auto; inline-size: 7px; block-size: 7px; border-inline-end: 1.5px solid currentColor; border-block-end: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.sfhd-g.is-open .sfhd-dd::before { transform: translateY(1px) rotate(-135deg); }
@media (hover: hover) {
	.sfhd-dd:not(:focus-visible) { position: absolute; inline-size: 1px; block-size: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); }
	.sfhd-row > li > a.sfhd-p { padding-inline-end: 9px; }
}
.sfhd-g.is-open > a.sfhd-p { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.sfhd-sub { position: absolute; inset-inline: 16px; inset-block-start: 100%; z-index: 5; background: #fff; border: 1px solid var(--hd-rule); border-block-start: 0; border-radius: 0 0 12px 12px;
	box-shadow: 0 18px 24px -18px rgba(16, 30, 70, .22); opacity: 0; visibility: hidden; transition: opacity .15s ease, visibility 0s linear .15s; }
.sfhd-g.is-open .sfhd-sub { opacity: 1; visibility: visible; transition: opacity .15s ease, visibility 0s; }
.sfhd-sub-in { padding: 24px 28px 26px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.sfhd-sub-h { display: grid; gap: 8px; padding-inline-end: 24px; border-inline-end: 1px solid var(--hd-rule); }
.sfhd-sub-h a:first-child { font-family: var(--hd-serif); font-size: 26px; line-height: 1.3; font-weight: 700; color: var(--hd-ink); }
.sfhd-sub-h a.sfhd-sub-go { font-size: 14.5px; color: var(--hd-navy); }
.sfhd-sub ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 24px; }
.sfhd-sub li a { display: block; padding: 9px 0; border-block-end: 1px solid #eef0f3; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfhd-sub li a:hover { text-decoration: none; color: var(--hd-navy); border-block-end-color: var(--hd-navy); }
@media (prefers-reduced-motion: reduce) { .sfhd-sub { transition: none; } }
@media (max-width: 1199px) { .sfhd-q2 { display: none !important; } .sfhd-g { margin-inline-start: 8px; padding-inline-start: 8px; } }

/* phone tabs (hidden on wide screens) */
.sfhd-tabs { display: none; }

/* homepage folio under the new header: the date moved up into the date line, so the folio keeps weather + 新唐人 now
   playing; it loses its heavy double rule (the section row already has one) and the header's own live link hides */
.sfh-folio .sfh-date { display: none !important; }
.sfh-folio { border-block-end: 1px solid var(--s26-rule, #dcdfe5) !important; }
.sfh-folio .sfh-wx::before { content: none !important; }
body:has(.sfh-folio) .sfhd-live { visibility: hidden; }

@media (max-width: 900px) {
	.sfhd-links, .sfhd-lunar, .sfhd-live, .sfhd-search, .sfhd-motto, .sfhd-nav { display: none; }
	.sfhd-util .sfhd-in { min-block-size: 34px; gap: 12px; }
	.sfhd-lang { margin-inline-start: auto; }
	.sfhd a.sfw-acct-link, .sfhd a.sfhd-acct { block-size: 26px !important; padding: 0 10px !important; }
	.sfhd-mast .sfhd-in { grid-template-columns: 44px 1fr 44px; gap: 8px; padding-block: 10px; }
	.sfhd-burger, .sfhd-sbtn { display: inline-grid; }
	.sfhd-burger { grid-column: 1; grid-row: 1; margin-inline-start: -8px; }
	.sfhd-sbtn { grid-column: 3; grid-row: 1; margin-inline-end: -8px; justify-self: end; }
	.sfhd-name { grid-column: 2; grid-row: 1; }
	.sfhd-logo img { inline-size: 150px; }
	.sfhd-tabs { display: block; position: relative; border-block-start: 1px solid var(--hd-rule); }
	.sfhd-tabs::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 5px; border-block-start: 2px solid var(--hd-ink); border-block-end: 1px solid var(--hd-ink); }
	.sfhd-tabs ul { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 0 8px 5px; }
	.sfhd-tabs ul::-webkit-scrollbar { display: none; }
	.sfhd-tabs a { display: block; padding: 11px 9px; font-size: 16px; white-space: nowrap; }
	.sfhd-tabs [aria-current="page"] { color: var(--hd-navy); font-weight: 700; }
}

/* phone menu: modal dialog + scroll-snap swipe (modern-web-guidance navigation-drawer) */
.sfhd-drawer { --dw: min(21em, 86dvw, 100dvw - 24px); --d: 0;
	inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; background: transparent; border: 0; overflow: visible; color: var(--hd-ink); font-size: 16px; line-height: 1.5; }
.sfhd-drawer:modal { overscroll-behavior: contain; }
.sfhd-drawer::backdrop { background: #0a1430; opacity: calc(var(--d) * .5); overflow: hidden; overscroll-behavior: contain; }
.sfhd-dscroll { position: relative; display: grid; grid-template-columns: var(--dw) 100%; block-size: 100%; overflow-x: scroll; overscroll-behavior: none; scrollbar-width: none; scroll-snap-type: x mandatory; }
.sfhd-dscroll::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) { .sfhd-dscroll { scroll-behavior: smooth; } }
.sfhd-dscroll::after { content: ""; scroll-snap-align: end; scroll-initial-target: nearest; }
.sfhd-sheet { block-size: 100svh; overflow-y: auto; overscroll-behavior: contain; scroll-snap-align: start; scrollbar-width: thin; background: #fff; padding: 0 20px 32px; }
.sfhd-dtop { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: 0 -20px; padding: 10px 12px 10px 20px; background: #fff; border-block-end: 1px solid var(--hd-rule); }
.sfhd-dtop img { inline-size: 120px; block-size: auto; }
.sfhd-dsearch { display: flex; gap: 8px; margin-block: 16px 8px; }
.sfhd-dsearch input { flex: 1; min-inline-size: 0; block-size: 44px; padding: 0 12px; border: 1px solid #c4c9d2; border-radius: 6px; font: inherit; }
.sfhd-dsearch button { flex: none; padding: 0 16px; border: 0; border-radius: 6px; background: var(--hd-navy); color: #fff; font: inherit; font-weight: 700; }
.sfhd-dg { padding-block: 14px 6px; border-block-end: 1px solid var(--hd-rule); }
.sfhd-dg h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.4; }
.sfhd-dg h2 a { color: var(--hd-navy); text-decoration: none; }
.sfhd-dg ul { display: grid; grid-template-columns: 1fr 1fr; }
.sfhd-dg li a, .sfhd-dutil a { display: block; padding: 9px 0; color: var(--hd-ink); text-decoration: none; }
.sfhd-dutil { display: grid; grid-template-columns: 1fr 1fr; padding-block-start: 12px; font-size: 15px; }
.sfhd-dutil a { color: var(--hd-text); }
@supports (animation-timeline: scroll()) {
	.sfhd-drawer { timeline-scope: --sfhd-fade; animation: sfhd-fade linear both; animation-timeline: --sfhd-fade; }
	.sfhd-dscroll { scroll-timeline: --sfhd-fade x; }
	@property --d { syntax: '<number>'; inherits: true; initial-value: 0; }
	@keyframes sfhd-fade { 0% { --d: 1 } 100% { --d: 0 } }
}
@media (forced-colors: active) { .sfhd-nav .sfhd-in::after, .sfhd-tabs::after { border-color: CanvasText; } }
@media print { .sfhd-util, .sfhd-nav, .sfhd-tabs, .sfhd-search, .sfhd-icon { display: none !important; } }

/* 2026-11-25 slim pinned bar (.sfhd-mini): 48px, one row, slides in on scroll up */
.sfhd-mini { --hd-navy: #10357e; --hd-ink: #16181d; --hd-rule: #dcdfe5;
	position: fixed; inset: 0 0 auto; z-index: 100002; background: #fff; border-block-end: 1px solid var(--hd-rule); box-shadow: 0 2px 10px rgba(16, 30, 70, .08);
	transform: translateY(-110%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
.sfhd-mini.is-on { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
.sfhd-mini .sfhd-in { display: flex; align-items: center; gap: 20px; block-size: 48px; }
.sfhd-mini .sfhd-icon { inline-size: 40px; block-size: 40px; }
.sfhd-mburger { display: none !important; margin-inline-start: -8px; }
.sfhd-mlogo { flex: none; display: block; line-height: 0; }
.sfhd-mlogo img { block-size: 30px; inline-size: auto; }
.sfhd-mnav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.sfhd-mnav a { display: block; padding: 12px 10px; font-size: 16px; font-weight: 700; color: var(--hd-navy); text-decoration: none; }
.sfhd-mnav a:hover, .sfhd-mnav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.sfhd-msearch { margin-inline-start: auto; margin-inline-end: -8px; }
.sfhd-mini :focus-visible { outline: 2px solid var(--hd-navy); outline-offset: 2px; }
@media (max-width: 900px) {
	.sfhd-mburger { display: inline-grid !important; }
	.sfhd-mnav { display: none; }
	.sfhd-mlogo { margin-inline: auto; }
	.sfhd-mlogo img { block-size: 28px; }
	.sfhd-msearch { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) { .sfhd-mini, .sfhd-mini.is-on { transition: none; } }
@media print { .sfhd-mini { display: none !important; } }
/* pinned things move below the bar while it is showing (article sidebar 本週熱門) */
html.sfhd-mini-on .sfa-sticky { top: 72px !important; transition: top .22s ease; }
html { scroll-padding-top: 60px; }   /* in-page jumps (分享, #comments) land below the pinned bar */

/* 2026-11-25 iPhone: Safari drew a focus frame on the auto-focused ✕ (and the sheet) when the menu was opened by a tap.
   Opened by tap/click: no frame; opened from the keyboard: the frame stays (keyboard users need it). */
.sfhd-drawer, .sfhd-drawer:focus, .sfhd-drawer:focus-visible, .sfhd-sheet:focus { outline: none; }
.sfhd-drawer.sfhd-by-pointer .sfhd-dclose:focus { outline: none; box-shadow: none; }
.sfhd-icon { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sfhd-tabs a, .sfhd-mnav a, .sfhd-dg a { touch-action: manipulation; }

/* 2026-11-25 iPhone: the panel was 100svh (screen height with Safari's toolbars shown), so a gap opened at the bottom
   once the toolbars shrank. The dialog now fills the dynamic viewport and the panel fills the dialog. */
.sfhd-drawer:modal { block-size: 100dvh; max-block-size: none; }
.sfhd-dscroll { block-size: 100%; }
.sfhd-sheet { block-size: 100%; min-block-size: 100svh; padding-block-end: max(32px, env(safe-area-inset-bottom)); }
.sfhd-sheet:focus, .sfhd-sheet:focus-visible { outline: none; }

/* 2026-11-25 iPhone: in browsers without scroll-driven animations the backdrop stayed fully clear, so the strip of page
   right of the menu showed at full strength (the navy rule under the section tabs looked like a stray blue border).
   Dim it whenever the menu is open, and give the panel a soft edge so the strip reads as "behind". */
@supports not (animation-timeline: scroll()) {
	.sfhd-drawer[open]::backdrop { opacity: .5; }
}
.sfhd-sheet { box-shadow: 1px 0 0 rgba(10, 20, 48, .08), 6px 0 24px rgba(10, 20, 48, .18); }
