/* Public information pages use the active board theme's colours, fonts and background. */
html.portal-root { --portal-mast-height:49px; min-width:0 !important; scroll-padding-top:calc(var(--portal-mast-height) + 8px) }
html.portal-root body.nichan-portal {
	--portal-line:var(--nichan-gallery-border,#555);
	--portal-surface:var(--nichan-gallery-background,#191919);
	--portal-accent:var(--nichan-gallery-selected,#9abfeb);
	box-sizing:border-box; margin:0 !important; padding:0 !important; min-width:0; width:100%; max-width:none; overflow-x:clip;
}
.portal-root:has(#stylesheet[href*="/dark_nich.css"]) body.nichan-portal { background-size:clamp(85px,14vw,180px) auto }
.portal-root:has(#stylesheet[href*="/dark_nich.css"]) { --portal-feed-meta:#a1aaa7 }
.portal-root:has(#stylesheet[href*="/dark_nich_noimg.css"]) { --portal-feed-meta:#a6a8ac }
.portal-root:has(#stylesheet[href*="/neon.css"]) { --portal-feed-meta:#bdbab2 }
.portal-root:has(#stylesheet[href*="/yotsuba_a.css"]) { --portal-feed-meta:#6f5c55 }
.portal-root:has(#stylesheet[href*="/yotsuba_b.css"]) { --portal-feed-meta:#515569 }
.portal-root:has(#stylesheet[href*="/futaba.css"]) { --portal-feed-meta:#455667 }
.portal-root:has(#stylesheet[href*="/ukrchan.css"]) { --portal-feed-meta:#293a4e }
.portal-root:has(#stylesheet[href*="/fellowkids.css"]) { --portal-feed-meta:#c2b8bb }
.portal-home,.portal-extras { font-size:max(1em,.95rem) }
.nichan-portal .portal-width { box-sizing:border-box; width:min(1100px,calc(100% - 64px)); margin-inline:auto }
.portal-board-nav #portal-main { padding-top:var(--portal-mast-height) }
.portal-skip,.portal-visually-hidden,.portal-feed input { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.portal-skip:focus { width:auto; height:auto; clip-path:none; z-index:6; background:var(--portal-surface); padding:8px }
.nichan-portal :is(.pages,.portal-home,.portal-extras) :is(a,summary):focus-visible,
.portal-feed input:focus-visible + label { outline:2px solid currentColor; outline-offset:3px }
.portal-cover { background:var(--portal-surface); border-bottom:1px solid var(--portal-line); overflow:hidden }
.portal-heading { position:relative; display:flex; flex-direction:column; justify-content:center; min-height:132px; isolation:isolate }
.portal-heading::after { content:""; position:absolute; inset:0 0 0 auto; width:min(43%,445px); z-index:-1; opacity:.86;
	background:linear-gradient(90deg,var(--portal-surface),transparent 32%,transparent 78%,var(--portal-surface)),var(--portal-heading-image,url("../images/dn.png")) center 27%/cover no-repeat }
.portal-root:has(#stylesheet[href*="dark_nich_noimg"]) .portal-heading::after { display:none }
.nichan-portal .portal-heading h1 { margin:0; padding:0; max-width:62%; font-family:inherit; font-size:clamp(2rem,4vw,3.2rem); color:inherit; text-align:left; line-height:1.05; letter-spacing:-.035em; background:none }
.portal-heading p { margin:.5em 0 0; max-width:58%; font-size:1.02em; line-height:1.3 }
.portal-content { padding-block:28px 40px; min-height:45vh; line-height:1.5; overflow-wrap:anywhere }
.portal-home { display:grid; grid-template-columns:minmax(165px,24%) minmax(0,1fr); gap:clamp(24px,5vw,68px) }
.portal-stream { --feed-title-size:.95em; --feed-text-size:.87em; --feed-meta-size:.81em }
.portal-side,.portal-stream,.portal-content fieldset { min-width:0 }
.portal-side { position:sticky; top:calc(var(--portal-mast-height) + 12px); align-self:start; max-height:calc(100vh - var(--portal-mast-height) - 24px); max-height:calc(100dvh - var(--portal-mast-height) - 24px); overflow-y:auto }
.portal-home ul,.portal-extras { list-style:none; margin:0; padding:0 }
.portal-directory li { padding:6px 0; line-height:1.4 }
.portal-directory h2 { margin:0; color:inherit; text-align:left; font-size:1.25em }
.portal-directory .nichan-board-online { white-space:nowrap; font-size:.82em }
.portal-directory ul { margin-top:9px }
.portal-directory li:last-child { border-top:1px solid var(--portal-line); padding-top:10px; margin-top:5px }
.portal-directory b { display:inline-block; min-width:3.5em; font-family:monospace }
.portal-side .nichan-front-news { margin-top:22px }
.nichan-front-news .nichan-news-list { display:grid; gap:8px }
.nichan-front-news .nichan-news-list > li {
	padding:10px 12px;
	background-color:var(--portal-surface);
	background-color:color-mix(in srgb,var(--portal-surface) 92%,var(--portal-accent));
	border:1px solid var(--portal-line); border-top:3px solid var(--portal-accent); border-radius:4px;
}
.portal-side .nichan-news-list time { display:block; font-size:.82em; margin:0 0 .15em }
.portal-side .nichan-news-list p { margin:.25em 0 0; font-weight:normal }
.portal-stream .nichan-since { margin-bottom:20px; padding:12px 16px; background:var(--portal-surface); border-left:3px solid var(--portal-accent) }
.portal-stream .nichan-since h2 { margin:0; padding-right:32px; color:inherit; text-align:left; font-size:var(--feed-title-size) !important }
.portal-stream .nichan-since p,.portal-stream .nichan-since ul { font-size:var(--feed-text-size); line-height:1.35 }
.portal-stream .nichan-since p.unimportant { font-size:var(--feed-meta-size); line-height:1.3 }
.portal-stream .nichan-since-close { width:32px; height:32px; padding:0; border:0; background:none; color:inherit; cursor:pointer }
.portal-stream .nichan-since li + li { margin-top:.2em }
.portal-popular { margin:0 0 18px; padding:10px 12px; background:var(--portal-surface); border:1px solid var(--portal-line); border-radius:4px }
.portal-popular h2 { margin:0; text-align:left; color:inherit; font-size:var(--feed-title-size) }
.portal-popular-row small { color:var(--portal-feed-meta,GrayText); font-size:var(--feed-meta-size) }
.portal-popular ul { margin:5px 0 0 }
.portal-popular li { border-top:1px solid var(--portal-line) }
.portal-popular .portal-popular-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:baseline; gap:8px; padding:4px 2px; color:inherit; font-size:var(--feed-text-size); font-weight:normal; text-decoration:none; line-height:1.35 }
.portal-popular-row:hover,.portal-popular-row:focus-visible { background-color:rgba(128,128,128,.18); background-color:color-mix(in srgb,var(--portal-accent) 16%,transparent) }
.portal-popular-board,.portal-popular-count { color:var(--portal-feed-meta,GrayText); font-family:ui-monospace,Consolas,monospace }
.portal-content .nichan-stats h2,.portal-content .nichan-faq h2 { text-align:left }
.portal-content .portal-feed { position:relative; width:auto; max-width:none; background:transparent; box-shadow:none; border:0; padding:0; margin:0 }
.portal-feed label { display:inline-block; padding:0 1px 8px; margin:0 20px 0 0; cursor:pointer; font-size:var(--feed-title-size); font-weight:bold }
.portal-feed input:checked + label { box-shadow:inset 0 -2px currentColor }
.portal-list { --portal-thumb-size:48px; display:none; border-top:1px solid var(--portal-line) }
#feed-posts:checked ~ #front-posts,#feed-threads:checked ~ #front-threads { display:block }
.portal-list li { border-bottom:1px solid var(--portal-line) }
.portal-list .portal-feed-row { display:flex; align-items:flex-start; gap:12px; padding:6px 8px; font-weight:400; color:inherit !important; text-decoration:none }
.portal-feed-row > span:first-child { flex:1 1 auto; min-width:0 }
.portal-feed-row:hover,.portal-feed-row:focus-visible { background-color:rgba(128,128,128,.18); background-color:color-mix(in srgb,var(--portal-accent) 16%,transparent) }
.portal-thumbs { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px }
.portal-thumbs:has(img:nth-child(2)) { min-width:calc(2 * var(--portal-thumb-size) + 4px) }
.portal-thumbs img { display:block; flex:none; width:var(--portal-thumb-size); height:var(--portal-thumb-size); object-fit:contain; background:var(--portal-surface); border-radius:3px }
/* Let the excerpt determine the space shared with attachments. Long thread titles wrap inside it. */
.portal-list small { display:block; contain:inline-size; font-family:ui-monospace,Consolas,monospace; font-size:var(--feed-meta-size); line-height:1.3; margin-bottom:2px; color:var(--portal-feed-meta,GrayText) }
.portal-excerpt { display:block; width:fit-content; max-width:100%; font-size:var(--feed-text-size); line-height:1.35 }
/* Neon gives every link a shadow and a hover glow. Feed links contain whole paragraphs. */
.portal-root:has(#stylesheet[href*="/neon.css"]) .portal-feed-row,
.portal-root:has(#stylesheet[href*="/neon.css"]) .portal-excerpt .quote { text-shadow:none }
.portal-root:has(#stylesheet[href*="/neon.css"]) .portal-excerpt { font-family:system-ui,sans-serif }
.portal-excerpt .spoiler:not(:hover):not(.portal-revealed),.portal-excerpt .spoiler:not(:hover):not(.portal-revealed) * { color:transparent !important; text-shadow:none !important }
.portal-excerpt .spoiler.portal-revealed,.portal-excerpt .spoiler.portal-revealed * { background:var(--portal-surface) !important; color:inherit !important; text-shadow:none !important }
.portal-extras { margin-inline:auto; max-width:780px }
.portal-extras li { padding:15px 0; border-bottom:1px solid var(--portal-line) }
.portal-extras strong,.portal-extras span { display:block }
.portal-extras strong { font-size:1.25em }
.portal-extras span { margin-top:3px }
.nichan-stats details { margin-top:1.25em }
.portal-content .nichan-news-page { max-width:72ch; margin:0; padding:0; font-size:max(1em,.95rem) }
.portal-content .nichan-news-others { border-color:var(--portal-line) }
.portal-heading h1 { overflow-wrap:anywhere }
.portal-root:has(#stylesheet[href*="fellowkids"]) .portal-content { background:rgba(30,30,30,.94); padding-inline:clamp(12px,2vw,24px) }
@media (max-width:650px) {
	.nichan-portal .portal-width { width:calc(100% - 28px) }
	.portal-heading { min-height:98px }
	.portal-heading p { font-size:.96em }
	.portal-heading::after { width:36%; right:-14px }
	.portal-content { padding-block:14px 26px }
	.portal-home { display:block }
	.portal-side { position:static; max-height:none; overflow:visible; margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid var(--portal-line) }
	.portal-side .nichan-front-news { margin-top:12px }
	.portal-list { --portal-thumb-size:32px }
	.portal-list .portal-feed-row { gap:8px; padding-inline:4px }
}
