/* attach: index.php,forumdisplay.php */
/* pb-home.css: home (hero, categories, forum rows, side boxes) and the forum thread list. Tokens come from pb-base.css. */

/* ---------- Hero slideshow (home only) ---------- */
/* aspect-ratio reserves the height before the photo arrives, so nothing shifts */
.hero { position: relative; aspect-ratio: 960 / 315; max-height: 440px; width: 100%; overflow: hidden; background: #c8d9b8; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 700ms ease; }
.slide.on { opacity: 1; }
.slide img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 45%; }
/* The title is real text over the photo: readable by search engines, never baked into the image */
.hero-title { position: absolute; top: 50%; right: 7%; transform: translateY(-50%); margin: 0; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35), 0 2px 18px rgba(0,0,0,.25); text-align: right; pointer-events: none; }
.hero-title b { display: block; font: 700 clamp(30px, 6vw, 64px)/1.15 var(--head-font); }
.hero-title span { display: block; font: 500 clamp(13px, 2vw, 22px)/1.6 var(--body-font); }
.dots { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.dot { width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.15); transition: width 200ms var(--ease-out), background-color 200ms ease; }
.dot[aria-current="true"]::before { width: 20px; border-radius: 4px; background: #fff; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.75); color: #1f2a24; font-size: 26px; display: grid; place-items: center; cursor: pointer; transition: scale 160ms var(--ease-out), background-color 150ms ease; z-index: 2; }
.hero-nav.prev { right: 12px; }
.hero-nav.next { left: 12px; }
.hero-nav:active { scale: 0.95; }
/* Controls appear only once pb_home.js runs: without it they would do nothing */
.hero:not(.ready) .hero-nav, .hero:not(.ready) .dots { display: none; }
@media (hover: hover) and (pointer: fine) {
	.hero-nav { opacity: 0; transition: opacity 200ms ease, scale 160ms var(--ease-out); }
	.hero:hover .hero-nav, .hero-nav:focus-visible { opacity: 1; }
}
.home-h1 { margin: 0 0 12px; font-size: 24px; }

/* ---------- Home: categories ---------- */
.cat-head { position: relative; aspect-ratio: 1600 / 397; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bar-solid); }
/* the WebP <picture> wrapper must not take part in layout, so the img still sizes against .cat-head / .slide */
.cat-head picture, .hero picture { display: contents; }
.cat-head img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: left center; }
.cat .cat-head h2 { position: absolute; top: 50%; right: 4%; transform: translateY(-50%); margin: 0; padding: 0; border: 0; font-size: clamp(18px, 3.2vw, 30px); text-shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 14px rgba(0,0,0,.3); }
.cat .cat-head h2 a, .cat .cat-head h2 a:link, .cat .cat-head h2 a:visited { color: #fff; }
.cat h2 { margin: 0; padding: 12px 18px; font-size: 18px; border-bottom: 1px solid var(--line); }
.cat h2 a, .cat h2 a:link, .cat h2 a:visited { color: var(--ink); }

/* Forum rows: style 4 "large" on desktop */
.forum { display: grid; grid-template-columns: 88px 1fr 240px; gap: 18px; padding: 18px; border-bottom: 1px solid var(--line); align-items: start; }
.forum:last-child { border-bottom: 0; }
.forum > * { min-width: 0; }
.ficon { display: block; width: 88px; height: 88px; border-radius: 50%; background: url(/images/pb/icons/sparrow.webp) center / contain no-repeat; }
.ficon.forum_on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); cursor: pointer; }
.letter { width: 72px; height: 72px; border-radius: 50%; background: var(--chip); font-size: 0; line-height: 72px; text-align: center; color: var(--link); overflow: hidden; }
.letter::first-letter { font: 700 26px/72px var(--head-font); }
.fic:has(.forum_on) .letter { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.fname, a.fname:link, a.fname:visited { font-weight: 700; font-size: 19px; color: var(--link); }
.new-tag { display: none; margin-inline-start: 6px; font-size: 11px; font-weight: 700; color: var(--accent); }
.forum:has(.ficon.forum_on) .new-tag { display: inline-block; }
.rss, a.rss:link, a.rss:visited { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-inline-start: 2px; color: var(--muted); font-size: 12px; vertical-align: middle; border-radius: 6px; }
.fdesc { color: var(--muted); font-size: 13px; }
.fdesc:empty { display: none; }
.fmeta { color: var(--muted); font-size: 12px; }
.fmeta .fa { color: var(--link); }
.subs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin-top: 8px; }
.subs .chip, .subs a.chip:link, .subs a.chip:visited { background: none; padding: 4px 0; border-radius: 0; font-size: 14px; color: var(--link); min-height: 32px; }
.subs .chip .fa { opacity: 1; }
.sub-st { display: none; } /* the mockup shows plain chips; read state stays in the markup */
.last { font-size: 13px; color: var(--muted); line-height: 1.8; border: 0; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.last .title { display: block; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last .fa { color: var(--link); }
.last .never { display: block; text-align: center; }

/* ---------- Side: shoutbox, latest posts, stats (markup comes from pb_ plugins) ---------- */
.side .card-h::before { font-family: FontAwesome; font-weight: 400; color: var(--link); }
.pb-shoutbox .card-h::before { content: "\f27a"; }
.pb-latest .card-h::before { content: "\f017"; }
.pb-stats .card-h::before { content: "\f080"; }
.shout { list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.shout li { padding: 8px 16px; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.shout .who { display: flex; gap: 6px; align-items: baseline; }
.shout .who b, .shout .who a { color: var(--link); font-weight: 700; font-size: 13px; }
.shout time { font-size: 11px; color: var(--muted); }
.shout li.mine { background: var(--link-soft); }
.shout-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; }
.shout-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-height: 44px; }
.shout-note { font-size: 11px; color: var(--muted); padding: 0 16px 10px; }
.shout .shout-note { padding: 8px 0; font-size: 13px; }
.latest { list-style: none; margin: 0; padding: 4px 0; }
.latest li { padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.7; }
.latest li:last-child { border: 0; }
.latest a.t { display: block; color: var(--ink); font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.stat { background: var(--surface); padding: 12px 16px; }
.stat b { display: block; font-size: 20px; line-height: 1.3; color: var(--ink); }
.stat span { font-size: 12px; color: var(--muted); }

/* Board stats (who's online, birthdays) under the forums */
.bs-row { padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bs-row h4 { margin: 0 0 2px; font-size: 14px; }
.bs-row h4 a { font: 400 12px var(--body-font); margin-inline-start: 6px; }
.bs-row p { margin: 0; }
.bs-note { color: var(--muted); }
.bs-list { line-height: 2; }
.card-f { padding: 8px 16px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.card-f a { display: inline-block; padding: 6px 0; }

/* ---------- Forum page: thread list ---------- */
.fd .page-head .btn { order: 2; }
.fd-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--chip); border-radius: 10px; padding: 3px; gap: 2px; }
.tab, a.tab:link, a.tab:visited { font-size: 13px; color: var(--muted); padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 8px; }
/* MyBB prints selected="selected" on the active sort; it marks the current tab */
.tab[selected] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
@media (hover: hover) and (pointer: fine) { a.tab:hover { text-decoration: none; color: var(--ink); } }
.tlist-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 8px 18px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.tlist-h .selall { margin-inline-start: auto; min-height: 32px; }
.sec-label { padding: 8px 18px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.trow { display: grid; grid-template-columns: 1fr 110px 190px; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.trow:last-child { border-bottom: 0; }
.trow > * { min-width: 0; }
.trow .tmod { grid-column: 4; }
.trow.trow_selected { background: var(--link-soft); }
.ttitle, a.ttitle:link, a.ttitle:visited { font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.6; }
.subject_new .ttitle::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: middle; }
.forumdisplay_sticky .ttitle::after { content: "\f08d"; font-family: FontAwesome; font-weight: 400; color: var(--link); margin-inline-start: 6px; font-size: 13px; }
.pin { color: var(--link); margin-inline-end: 4px; }
.gounread { color: var(--accent); margin-inline-end: 4px; }
.tmeta { font-size: 12px; color: var(--muted); }
.tmeta img { vertical-align: middle; max-height: 16px; width: auto; }
.tmeta .fa { color: var(--link); }
.tpages a { padding: 0 3px; }
.tcount { font-size: 12px; color: var(--muted); line-height: 1.7; }
.tcount span { display: block; }
.tcount b { color: var(--ink); font-weight: 500; }
.trow .last { background: none; padding: 0; border-radius: 0; font-size: 12px; }
.empty { padding: 24px 18px; text-align: center; color: var(--muted); }
.hiddenrow { display: none; }
.selectall { padding: 8px 18px; font-size: 13px; background: var(--link-soft); border-bottom: 1px solid var(--line); }
.pager-top:empty, .pager-bottom:empty { display: none; }
.pager-bottom { margin-bottom: 14px; }
.fd-foot { display: grid; gap: 12px; }
.more-sort { margin: 0; }
.more-sort summary { padding: 12px 16px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 14px; }
.sort-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.fd-tools { font-size: 13px; }
.fd-tools form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }

/* ---------- Phone: forum rows switch to style 2 "compact" ---------- */
@media (max-width: 760px) {
	/* on a phone the arrows move to the bottom corners so they stay clear of the title */
	.hero-nav { top: auto; bottom: 6px; transform: none; width: 44px; height: 44px; font-size: 22px; }
	/* the title moves to the top so the arrows and dots in the bottom row never cover it */
	.hero-title { top: 10px; transform: none; }
	.forum { grid-template-columns: 40px 1fr; padding: 10px 14px; gap: 12px; align-items: center; }
	.ficon { width: 40px; height: 40px; }
	.letter { width: 36px; height: 36px; line-height: 36px; }
	.letter::first-letter { font-size: 15px; line-height: 36px; }
	.fname, a.fname:link, a.fname:visited { font-size: 15px; }
	.fdesc, .fmeta, .rss { display: none; }
	.subs { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
	.subs .chip, .subs a.chip:link, .subs a.chip:visited { display: inline; padding: 0; min-height: 0; font-size: 13px; line-height: 2; }
	.subs .chip .fa { display: none; }
	.subs .chip:not(:last-child)::after { content: "، "; color: var(--muted); }
	.forum .last { grid-column: 1 / -1; background: none; border-radius: 0; padding: 8px 0 0; border-top: 1px dashed var(--line); }
	.forum .last br, .forum .last > .fa-clock-o { display: none; }
	.trow { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
	.trow .tmod { grid-column: auto; grid-row: 1; justify-self: end; }
	.tcount { display: flex; gap: 12px; }
	.tcount span { display: inline; }
	.sec-label, .tlist-h { padding-inline: 14px; }
	.toolbar { flex-direction: column; align-items: stretch; }
	.seg { justify-content: space-between; }
	.tools .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.slide, .dot::before, .hero-nav { transition: none; }
	.hero-nav:active { scale: 1; }
}

/* ---------- Forum icons: real forum ids (from the live index), matched by name ---------- */
/* fp- (parent id) lets a subforum borrow its parent's bird; fi- (own id) wins because it comes later */
.fp-1, .fi-1, .fi-357 { background-image: url(/images/pb/icons/canary.webp); }
.fp-2, .fi-2 { background-image: url(/images/pb/icons/goldfinch.webp); }
.fp-350, .fi-350 { background-image: url(/images/pb/icons/thrush.webp); }
.fp-75, .fi-75 { background-image: url(/images/pb/icons/greenfinch.webp); }
.fp-152, .fi-152 { background-image: url(/images/pb/icons/bulbul.webp); }
.fp-362, .fi-362, .fi-356 { background-image: url(/images/pb/icons/budgie.webp); }
.fp-346, .fi-346 { background-image: url(/images/pb/icons/african-grey.webp); }
.fp-334, .fi-334 { background-image: url(/images/pb/icons/myna.webp); }
.fp-154, .fi-154 { background-image: url(/images/pb/icons/pigeon.webp); }
.fp-156, .fi-156, .fi-370 { background-image: url(/images/pb/icons/dove.webp); }
.fp-151, .fi-151 { background-image: url(/images/pb/icons/zebra-finch.webp); }
.fp-230, .fi-230 { background-image: url(/images/pb/icons/rooster.webp); }
.fp-238, .fi-238 { background-image: url(/images/pb/icons/chukar.webp); }
.fp-138, .fi-138 { background-image: url(/images/pb/icons/falcon.webp); }
.fp-395, .fi-395, .fi-367 { background-image: url(/images/pb/icons/nightingale.webp); }
.fp-391, .fi-391, .fi-369, .fp-403 { background-image: url(/images/pb/icons/kingfisher.webp); }
.fi-361 { background-image: url(/images/pb/icons/owl.webp); }
.fi-226 { background-image: url(/images/pb/icons/sparrow.webp); }
.fi-228 { background-image: url(/images/pb/icons/robin.webp); }
.fi-368 { background-image: url(/images/pb/icons/lovebirds.webp); }
.fp-366, .fi-366, .fi-399, .fi-358 { background-image: url(/images/pb/icons/finch-millet.webp); }
