/*
Theme Name: Biomorus
Theme URI: https://www.biomorus.com/it
Description: Tema figlio di Twenty Twenty-Five per il blog fotografico Biomorus: sfondo nero, tipografia sans serif essenziale, slider a tutto schermo.
Author: Biomorus
Template: twentytwentyfive
Version: 1.1.0
Text Domain: biomorus
*/

html { background: #000; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: #fff; color: #000; }
:root { --bm-pad: clamp(1.25rem, 4vw, 3.5rem); --bm-muted: #8a8a8a; --bm-line: #262626; }

/* ---------- Header ---------- */
.bm-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(0, 0, 0, 0.92);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--bm-line);
	transition: background-color .4s ease, border-color .4s ease;
}
.admin-bar .bm-header { top: var(--wp-admin--admin-bar--height, 32px); }
.bm-header-inner { padding: 1.1rem var(--bm-pad) !important; }
.bm-logo img { width: clamp(170px, 18vw, 240px); height: auto; display: block; }
.bm-header .wp-block-navigation a { color: #d9d9d9; transition: color .2s; }
.bm-header .wp-block-navigation a:hover,
.bm-header .wp-block-navigation .current-menu-item > a { color: #fff; text-decoration: none; }
.bm-header .wp-block-navigation__submenu-container {
	background: #0b0b0b !important; border: 1px solid var(--bm-line) !important;
	padding: .5rem 0; min-width: 220px !important;
}
.bm-header .wp-block-navigation__submenu-container a { padding: .45rem 1.1rem !important; }
.wp-block-navigation__responsive-container.is-menu-open { background: #000 !important; color: #fff !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 18px; }

/* Transparent header over the slider on the home page */
.bm-has-slider .wp-site-blocks > header.wp-block-template-part { position: absolute; inset: 0 0 auto 0; z-index: 50; }
.admin-bar.bm-has-slider .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 32px); }
.bm-has-slider .bm-header { position: fixed; left: 0; right: 0; background: linear-gradient(to bottom, rgba(0,0,0,.65), rgba(0,0,0,0)); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.bm-has-slider.bm-scrolled .bm-header { background: rgba(0, 0, 0, 0.92); border-bottom-color: var(--bm-line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ---------- Slider ---------- */
.bm-slider { position: relative; height: 100vh; height: 100svh; min-height: 420px; overflow: hidden; background: #000; }
.bm-slides { position: absolute; inset: 0; }
.bm-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1.4s ease, visibility 0s linear 1.4s; color: #fff; text-decoration: none !important; }
.bm-slide.is-active { opacity: 1; visibility: visible; transition: opacity 1.4s ease, visibility 0s; z-index: 1; }
.bm-slide-img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.06); transition: transform 8s ease-out; }
.bm-slide.is-active .bm-slide-img { transform: scale(1); }
.bm-slide::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0)); pointer-events: none; }
.bm-slide-caption { position: absolute; left: var(--bm-pad); bottom: clamp(4.5rem, 10vh, 7rem); z-index: 2; max-width: min(720px, 80vw); display: flex; flex-direction: column; gap: .35rem; }
.bm-slide-cat { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #cfcfcf; }
.bm-slide-title { font-size: clamp(1.6rem, 3.6vw, 3rem); font-weight: 300; line-height: 1.1; letter-spacing: -.01em; }
.bm-slide.is-active .bm-slide-caption { animation: bm-rise 1.2s ease both .3s; }
@keyframes bm-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.bm-nav { position: absolute; bottom: clamp(4.5rem, 10vh, 7rem); z-index: 3; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.2); color: #fff; font-size: 18px; cursor: pointer; transition: background .2s, border-color .2s; font-family: inherit; }
.bm-nav:hover, .bm-nav:focus-visible { background: #fff; color: #000; border-color: #fff; }
.bm-prev { right: calc(var(--bm-pad) + 56px); }
.bm-next { right: var(--bm-pad); }
.bm-dots { position: absolute; left: var(--bm-pad); bottom: 2rem; z-index: 3; display: flex; gap: 8px; }
.bm-dot { width: 22px; height: 2px; padding: 0; border: 0; background: rgba(255,255,255,.35); cursor: pointer; transition: background .3s, width .3s; }
.bm-dot.is-active { background: #fff; width: 40px; }
.bm-scroll { position: absolute; left: 50%; bottom: 1.6rem; z-index: 3; width: 1px; height: 42px; background: rgba(255,255,255,.25); overflow: hidden; }
.bm-scroll span { position: absolute; left: 0; top: -42px; width: 1px; height: 42px; background: #fff; animation: bm-drip 2.2s ease-in-out infinite; }
@keyframes bm-drip { to { top: 42px; } }
@media (max-width: 700px) {
	.bm-nav { display: none; }
	.bm-scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.bm-slide, .bm-slide-img { transition: none; }
	.bm-slide.is-active .bm-slide-caption, .bm-scroll span { animation: none; }
}

/* ---------- Section titles ---------- */
.bm-kicker { font-size: 12px !important; letter-spacing: .24em; text-transform: uppercase; color: var(--bm-muted); margin: 0; }
.bm-section-title { font-size: clamp(1.6rem, 3vw, 2.4rem) !important; font-weight: 300 !important; margin-top: .4rem !important; }
.bm-intro { max-width: 640px; color: #bdbdbd; }

/* ---------- Category grid ---------- */
.bm-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.bm-cat { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #111; color: #fff; text-decoration: none !important; }
.bm-cat-img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(.25) brightness(.72); transform: scale(1.01); transition: transform .9s ease, filter .6s ease; }
.bm-cat:hover .bm-cat-img, .bm-cat:focus-visible .bm-cat-img { transform: scale(1.06); filter: none; }
.bm-cat-label { position: absolute; left: 1.2rem; right: 1.2rem; bottom: 1.1rem; display: flex; flex-direction: column; gap: .2rem; }
.bm-cat-name { font-size: clamp(1.1rem, 1.6vw, 1.45rem); font-weight: 300; }
.bm-cat-count { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #cfcfcf; }
@media (max-width: 1000px) { .bm-cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .bm-cats { grid-template-columns: 1fr; } .bm-cat { aspect-ratio: 3 / 2; } }

/* ---------- Post grid (query loops) ---------- */
.bm-grid .wp-block-post-template { gap: 2.4rem 4px !important; }
.bm-card { position: relative; }
.bm-card .wp-block-post-featured-image { margin: 0 0 .9rem !important; overflow: hidden; background: #111; }
.bm-card .wp-block-post-featured-image img { transition: transform .9s ease, opacity .4s; }
.bm-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.bm-card .wp-block-post-title { font-size: 1.15rem !important; font-weight: 300 !important; line-height: 1.3; margin: .25rem 0 0 !important; padding: 0 .2rem; }
.bm-card .wp-block-post-title a { text-decoration: none; }
.bm-card .wp-block-post-date, .bm-card .wp-block-post-terms { padding: 0 .2rem; margin: 0 !important; }
.bm-card .wp-block-post-terms a { color: var(--bm-muted); }
.bm-grid .wp-block-query-pagination { margin-top: 3.5rem !important; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.bm-grid .wp-block-query-pagination a { color: #d0d0d0; }
.bm-grid .wp-block-query-pagination .page-numbers.current { color: #fff; border-bottom: 1px solid #fff; }

/* ---------- Archive header ---------- */
.bm-archive-head { border-bottom: 1px solid var(--bm-line); }
.bm-archive-head .wp-block-query-title { font-weight: 300; }
.bm-archive-head .wp-block-term-description { color: #a8a8a8; }

/* ---------- Single post ---------- */
.bm-single-head .wp-block-post-title { font-weight: 300; }
.bm-meta { gap: .6rem 1.4rem !important; }
.wp-block-post-content { color: #d6d6d6; }
.wp-block-post-content a { text-decoration: underline; text-decoration-color: #555; text-underline-offset: 3px; }
.wp-block-post-content a:hover { text-decoration-color: #fff; }
.wp-block-post-content a:has(> img) { text-decoration: none; }
.wp-block-post-content h2, .wp-block-post-content h3 { margin-top: 2.6em; font-weight: 300; }
.wp-block-post-content img { height: auto; max-width: 100%; }
/* Photos run wider than the text column */
.wp-block-post-content > figure,
.wp-block-post-content > .wp-block-image,
.wp-block-post-content > .wp-block-gallery,
.wp-block-post-content > p:has(> a > img:only-child),
.wp-block-post-content > p:has(> img:only-child),
.wp-block-post-content > div:has(> figure) {
	max-width: min(1240px, calc(100vw - 2 * var(--bm-pad))) !important;
	margin-top: 2.6rem !important; margin-bottom: 2.6rem !important;
}
.wp-block-post-content figure img, .wp-block-post-content p > a > img, .wp-block-post-content p > img { display: block; margin-inline: auto; width: auto; max-height: 88vh; object-fit: contain; }
.wp-block-post-content figure { margin-inline: auto; }
.wp-block-post-content figure.wp-caption, .wp-block-post-content .wp-caption { width: auto !important; }
.wp-block-post-content figcaption, .wp-block-post-content .wp-caption-text {
	max-width: 760px; margin: .9rem auto 0 !important; text-align: center;
	font-size: 13px !important; line-height: 1.6; color: var(--bm-muted) !important;
}
.wp-block-post-content figcaption a { color: #b0b0b0; }
.wp-block-post-content .wp-block-gallery.bm-gallery,
.wp-block-post-content .wp-block-gallery { gap: 4px !important; }
.wp-block-post-content .wp-block-gallery figure img { max-height: none; width: 100%; height: 100%; object-fit: cover; }
.wp-block-post-content iframe { max-width: 100%; }
.wp-block-post-content .aligncenter { margin-inline: auto; }
.wp-block-post-content blockquote { border-left: 1px solid #555; padding-left: 1.4rem; color: #bdbdbd; }
.wp-block-post-content table { border-color: var(--bm-line); }
.wp-block-post-content ul, .wp-block-post-content ol { padding-left: 1.3rem; }

.bm-tags { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.bm-tags a { display: inline-block; border: 1px solid #333; padding: .35rem .7rem; margin: 0 .35rem .45rem 0; color: #bdbdbd; text-decoration: none; transition: border-color .2s, color .2s; }
.bm-tags a:hover { border-color: #fff; color: #fff; text-decoration: none; }
.bm-tags .wp-block-post-terms__separator { display: none; }
.bm-postnav { border-top: 1px solid var(--bm-line); padding-top: 2rem; font-size: 14px; }
.bm-postnav a { text-decoration: none; }
.bm-postnav .post-navigation-link-next { text-align: right; }

/* ---------- Footer ---------- */
.bm-footer { border-top: 1px solid var(--bm-line); color: var(--bm-muted); font-size: 13px; }
.bm-footer a { color: #bdbdbd; }
.bm-footer .bm-logo img { width: 180px; opacity: .85; }
.bm-footer .wp-block-search__input { background: transparent; color: #fff; border: 1px solid #333; border-radius: 0; font-size: 14px; }
.bm-footer .wp-block-search__button { border-radius: 0; }

/* ---------- Lightbox ---------- */
.bm-lb-lock { overflow: hidden; }
.bm-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.97); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 3rem 4.5rem 2rem; }
.bm-lightbox.is-open { display: flex; }
.bm-lightbox img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; }
.bm-lb-caption { color: #9a9a9a; font-size: 13px; text-align: center; max-width: 820px; margin: 1rem 0 0; min-height: 1.2em; }
.bm-lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; padding: .6rem 1rem; opacity: .75; font-family: inherit; }
.bm-lightbox button:hover, .bm-lightbox button:focus-visible { opacity: 1; }
.bm-lb-close { top: .8rem; right: 1rem; font-size: 34px !important; }
.bm-lb-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.bm-lb-next { right: .5rem; top: 50%; transform: translateY(-50%); }
.bm-lightbox.is-single .bm-lb-prev, .bm-lightbox.is-single .bm-lb-next { display: none; }
@media (max-width: 700px) { .bm-lightbox { padding: 3rem .5rem 1.5rem; } .bm-lb-prev, .bm-lb-next { top: auto; bottom: .5rem; transform: none; } }

/* ---------- Misc ---------- */
.wp-block-search__input { background: #0d0d0d; color: #fff; border: 1px solid #333; }
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
