/*
 * Darknation2: the portal's look (Blade views in portal/resources/views). Built on Bootstrap 5.3.8.
 * Reuses the old layout graphics from templates/darknation1/images
 * (top.jpg, bottom.jpg, maska.png) instead of new artwork.
 */
:root,
[data-bs-theme="dark"] {
    /* Greys sampled from the old layout: top.jpg/bottom.jpg sit on #2e2e2e. */
    --dn-bg: #141414;
    --dn-surface: #1c1c1c;
    --dn-surface-2: #242424;
    --dn-old-grey: #2e2e2e;
    --dn-line: #333;
    --dn-text: #e6e6e6;
    --dn-muted: #9a9a9a;
    --dn-accent: #ff9c00;          /* original Darknation orange */
    --dn-accent-soft: #ff9c0019;

    --dn-font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
    --dn-font-body: "Inter", system-ui, sans-serif;
    --dn-font-read: "Source Serif 4", Georgia, serif;

    --bs-body-bg: var(--dn-bg);
    --bs-body-color: var(--dn-text);
    --bs-body-font-family: var(--dn-font-body);
    --bs-body-font-size: .9375rem;
    --bs-secondary-color: var(--dn-muted);
    --bs-border-color: var(--dn-line);
    --bs-link-color: var(--dn-accent);
    --bs-link-color-rgb: 255, 156, 0;
    --bs-link-hover-color: #ffbd57;
    --bs-link-hover-color-rgb: 255, 189, 87;
    --bs-border-radius: .25rem;
    --bs-emphasis-color: #fff;
}

body { background: var(--dn-bg); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--dn-accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
img { max-width: 100%; height: auto; }

/* ---------- Shared building blocks ---------- */
.dn-display { font-family: var(--dn-font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }
.dn-eyebrow { font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--dn-accent); }
.dn-meta { font-size: .8125rem; color: var(--dn-muted); }
.dn-meta a { color: var(--dn-text); }
.dn-meta a:hover { color: var(--dn-accent); }
.dn-dot::before { content: "\00B7"; margin: 0 .45em; color: #555; }

.dn-section-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--dn-line); padding-bottom: .75rem; margin-bottom: 1.5rem; }
.dn-section-title h2 { font-family: var(--dn-font-display); font-weight: 800; font-size: 2rem; text-transform: uppercase; margin: 0; line-height: 1; }
.dn-section-title h2 span { color: var(--dn-accent); }
.dn-section-title a { font-size: .8125rem; color: var(--dn-muted); white-space: nowrap; }
.dn-section-title a:hover { color: var(--dn-accent); }

.dn-tag { display: inline-block; font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dn-text); border: 1px solid var(--dn-line); border-radius: 2px; padding: .2rem .5rem; }
a.dn-tag:hover { border-color: var(--dn-accent); color: var(--dn-accent); }
.dn-tag-accent { background: var(--dn-accent); border-color: var(--dn-accent); color: #111; }

.btn-dn { --bs-btn-bg: var(--dn-accent); --bs-btn-border-color: var(--dn-accent); --bs-btn-color: #111; --bs-btn-hover-bg: #ffb138; --bs-btn-hover-border-color: #ffb138; --bs-btn-hover-color: #111; --bs-btn-active-bg: #ffbd57; --bs-btn-active-border-color: #ffbd57; --bs-btn-active-color: #111; font-weight: 600; }
.btn-dn-ghost { --bs-btn-color: var(--dn-text); --bs-btn-border-color: #444; --bs-btn-hover-bg: var(--dn-surface-2); --bs-btn-hover-border-color: #5a5a5a; --bs-btn-hover-color: var(--dn-accent); --bs-btn-active-bg: var(--dn-surface-2); --bs-btn-active-border-color: var(--dn-accent); --bs-btn-active-color: var(--dn-accent); }

.dn-panel { background: var(--dn-surface); border: 1px solid var(--dn-line); border-radius: var(--bs-border-radius); padding: 1.25rem; }
.dn-panel + .dn-panel { margin-top: 1.5rem; }
.dn-panel-title { font-family: var(--dn-font-display); font-weight: 800; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 1rem; }

/* Faint scanline texture, echoing the photocopied look of top.jpg. */
.dn-grain { background-image: repeating-linear-gradient(0deg, transparent 0 3px, #ffffff05 3px 4px); }

/* Fallback cover: the old site's gas mask (maska.png) on a grey tile. */
.dn-fallback-cover { display: grid; place-items: center; background: var(--dn-old-grey); }
.dn-fallback-cover img { width: 45%; height: auto; opacity: .9; }

/* ---------- Top strip ---------- */
.dn-topstrip { font-size: .75rem; color: var(--dn-muted); background: #000; }
.dn-topstrip a { color: var(--dn-muted); }
.dn-topstrip a:hover, .dn-topstrip a.active { color: var(--dn-accent); }

/* ---------- Masthead: the original top.jpg ---------- */
/* The 990px image is centred on its own background grey; the edges fade into it,
   so wide screens get a continuous band instead of a boxed 990px banner. */
.dn-masthead { display: block; background: var(--dn-old-grey); overflow: hidden; }
.dn-masthead img {
    display: block; width: 990px; max-width: none; height: 170px; margin-inline: auto;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* ---------- Main navigation ---------- */
.dn-header { background: color-mix(in srgb, #0b0b0b 92%, transparent); backdrop-filter: blur(10px); border-block: 1px solid #000; box-shadow: 0 1px 0 var(--dn-line); }
.dn-header .navbar { --bs-navbar-padding-y: .35rem; --bs-navbar-color: #cfcfcf; --bs-navbar-hover-color: var(--dn-accent); --bs-navbar-active-color: var(--dn-accent); --bs-navbar-nav-link-padding-x: .85rem; }
.dn-header .nav-link { font-size: .875rem; font-weight: 500; position: relative; }
.dn-header .navbar-nav > .nav-item:first-child .nav-link { padding-left: 0; }
.dn-header .nav-link.active::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: -.4rem; height: 2px; background: var(--dn-accent); }
.dn-header .navbar-nav > .nav-item:first-child .nav-link.active::after { left: 0; }
/* "More" holds the current page (e.g. bios): colour only, its ::after is Bootstrap's caret. */
.dn-header .dropdown-toggle.dn-current { color: var(--dn-accent); }
.dn-header .dropdown-menu { --bs-dropdown-bg: var(--dn-surface-2); --bs-dropdown-border-color: var(--dn-line); --bs-dropdown-link-hover-bg: #2e2e2e; --bs-dropdown-link-hover-color: var(--dn-accent); --bs-dropdown-font-size: .875rem; }
.dn-header .navbar-toggler { align-items: center; gap: .5rem; font-size: .875rem; color: var(--dn-text); }

/* ---------- Homepage: hero (newest news item) ---------- */
.dn-hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--dn-line); }
.dn-hero-bg { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center; filter: blur(38px) saturate(.5) brightness(.42); transform: scale(1.1); }
.dn-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--dn-bg) 10%, #141414cc 55%, #14141466), linear-gradient(0deg, var(--dn-bg), transparent 40%); }
.dn-hero-cover { width: 100%; max-width: 300px; aspect-ratio: 1; object-fit: cover; box-shadow: 0 30px 60px -20px #000, 0 0 0 1px #ffffff14; }
.dn-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.8rem); }
.dn-hero-lead { font-family: var(--dn-font-read); font-size: 1.0625rem; line-height: 1.65; color: #d4d4d4; max-width: 38rem; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

.dn-hero-side a { display: flex; gap: 1rem; align-items: center; padding: .9rem 0; border-top: 1px solid #ffffff14; color: var(--dn-text); }
.dn-hero-side a:hover h3 { color: var(--dn-accent); }
.dn-hero-side .dn-thumb { width: 72px; height: 72px; object-fit: cover; flex-shrink: 0; }
.dn-hero-side h3 { font-size: 1rem; font-weight: 600; margin: .15rem 0 0; transition: color .15s; }

/* ---------- Homepage: news feed ---------- */
.dn-news { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 1.25rem; padding-bottom: 1.75rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--dn-line); }
.dn-news:last-of-type { border-bottom: 0; }
.dn-news-cover .dn-thumb { display: grid; width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(.25); transition: filter .25s; }
.dn-news-cover:hover .dn-thumb { filter: none; }
.dn-news h3 { font-family: var(--dn-font-display); font-weight: 800; font-size: 1.7rem; text-transform: uppercase; line-height: 1; margin: 0 0 .6rem; }
.dn-news h3 a { color: #fff; }
.dn-news h3 a:hover { color: var(--dn-accent); }
.dn-news p { color: #bcbcbc; margin-bottom: .75rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Review covers (7 items from $ostatnie_recki) ---------- */
/* A scrolling row rather than a fixed grid, so the 7-item query limit fits every width. */
.dn-cover-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 1.25rem; overflow-x: auto; scrollbar-width: thin; padding-bottom: .5rem; }
.dn-cover-card { display: block; color: var(--dn-text); }
.dn-cover-card .ratio { background: var(--dn-surface-2); overflow: hidden; }
.dn-cover-card .ratio > img { object-fit: cover; transition: transform .35s; }
.dn-cover-card:hover .ratio > img { transform: scale(1.04); }
.dn-cover-card:hover .dn-cover-title { color: var(--dn-accent); }
.dn-cover-title { font-weight: 600; font-size: .875rem; line-height: 1.35; margin-top: .65rem; transition: color .15s; }

/* ---------- Sidebar widgets ---------- */
.dn-empty { display: flex; gap: 1rem; align-items: center; color: var(--dn-muted); font-size: .875rem; }
.dn-empty img { width: 44px; height: auto; opacity: .85; flex-shrink: 0; }

.dn-plain-list { list-style: none; padding: 0; margin: 0; }
.dn-plain-list li { padding: .5rem 0; border-top: 1px solid var(--dn-line); font-size: .875rem; }
.dn-plain-list li:first-child { border-top: 0; padding-top: 0; }
.dn-plain-list a { color: var(--dn-text); }
.dn-plain-list a:hover { color: var(--dn-accent); }

.dn-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 0; }
.dn-stats div + div { border-left: 1px solid var(--dn-line); }
.dn-stats dd { font-family: var(--dn-font-display); font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0; }
.dn-stats dt { font-size: .6875rem; color: var(--dn-muted); font-weight: 400; line-height: 1.3; }

.dn-join { background: linear-gradient(135deg, #2b1c07, var(--dn-surface) 70%); border-color: #4a3210; }
.dn-join ul { padding-left: 1.1rem; color: #cfcfcf; font-size: .875rem; }
.dn-join li::marker { color: var(--dn-accent); }

.dn-mini-review { display: flex; gap: .85rem; align-items: center; color: var(--dn-text); padding: .55rem 0; border-top: 1px solid var(--dn-line); font-size: .875rem; line-height: 1.35; }
.dn-mini-review:first-of-type { border-top: 0; padding-top: 0; }
.dn-mini-review:hover { color: var(--dn-accent); }
.dn-mini-review .dn-thumb { width: 52px; height: 52px; object-fit: cover; flex-shrink: 0; }

/* Banner slot for the general rotation served by /py/banners/serve. */

/* ---------- Review page ---------- */
.dn-review-hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--dn-line); }
.dn-review-hero .dn-hero-bg { filter: blur(50px) saturate(.6) brightness(.36); }
.dn-review-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--dn-bg) 0%, #14141499 60%, #14141455); }
/* Fills its column: the cover's size is set by the Bootstrap column classes in the templates. */
.dn-review-cover { width: 100%; aspect-ratio: 1; object-fit: cover; box-shadow: 0 40px 70px -25px #000, 0 0 0 1px #ffffff1a; }
/* Titles are stored as one string ("Artist - Album (Year)") and can be long, so the size scales down. */
.dn-review-title { font-size: clamp(2.2rem, 5vw, 4.4rem); margin: .4rem 0 1rem; color: #fff; overflow-wrap: anywhere; }

/* post_text comes out of bbparser as <br>-separated lines, not paragraphs; style it as-is. */
.dn-article { font-family: var(--dn-font-read); font-size: 1.125rem; line-height: 1.75; color: #dadada; max-width: 42rem; overflow-wrap: anywhere; }
.dn-article b, .dn-article strong { font-family: var(--dn-font-body); color: #fff; }
.dn-article a { text-decoration: underline; text-decoration-color: #ff9c0066; text-underline-offset: 3px; }

.dn-comments-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; border-block: 1px solid var(--dn-line); padding: 1.5rem 0; }

/* ---------- Footer with the original bottom.jpg ---------- */
.dn-bottom-art { background: linear-gradient(var(--dn-bg), #000); overflow: hidden; }
.dn-bottom-art img {
    display: block; width: 990px; max-width: none; height: 52px; margin-inline: auto;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.dn-footer { background: #000; font-size: .8125rem; color: var(--dn-muted); }
.dn-footer h4 { font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dn-text); margin-bottom: .9rem; }
.dn-footer ul { list-style: none; padding: 0; margin: 0; }
.dn-footer li { margin-bottom: .4rem; }
.dn-footer a { color: var(--dn-muted); }
.dn-footer a:hover { color: var(--dn-accent); }

/* ---------- Account panel ---------- */
/* $lang.profity_z_rejestracji ships its own <br/> and .ostatnie_dash separators. */
.dn-join-benefits { font-size: .875rem; color: #cfcfcf; margin-bottom: 1rem; }
.dn-join-benefits .ostatnie_dash { border-top: 1px solid #ffffff1a; margin: .4rem 0; }
.dn-avatar { width: 56px; height: 56px; object-fit: cover; border: 1px solid #000; }

/* ---------- Review list (reviews.php without ?item) ---------- */
/* One column: 50 titles per page read as a list, not a dense two-column index. */
.dn-review-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--dn-line); }
.dn-review-list li { display: flex; align-items: baseline; gap: 1.25rem; padding: .8rem 0; border-bottom: 1px solid var(--dn-line); font-size: 1rem; }
.dn-review-list time { flex: 0 0 5.75rem; color: var(--dn-muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.dn-review-list a { color: var(--dn-text); overflow-wrap: anywhere; }
.dn-review-list a:hover { color: var(--dn-accent); }
.dn-pagination { --bs-pagination-bg: var(--dn-surface); --bs-pagination-border-color: var(--dn-line); --bs-pagination-color: var(--dn-text); --bs-pagination-hover-bg: var(--dn-surface-2); --bs-pagination-hover-color: var(--dn-accent); --bs-pagination-hover-border-color: var(--dn-line); --bs-pagination-active-bg: var(--dn-accent); --bs-pagination-active-border-color: var(--dn-accent); --bs-pagination-active-color: #111; --bs-pagination-focus-box-shadow: 0 0 0 .2rem var(--dn-accent-soft); flex-wrap: wrap; gap: .25rem; }
.dn-pagination .page-link { border-radius: 2px !important; min-width: 2.25rem; text-align: center; }
.dn-pagination .page-item.disabled .page-link { background: transparent; border-color: transparent; color: var(--dn-muted); }

/* Category catalogues (download.php, links.php): one category open at a time, picked server-side by ?cat=. */
.dn-catalog { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--dn-line); }
.dn-catalog > li { border-bottom: 1px solid var(--dn-line); padding: 1rem 0; overflow-wrap: anywhere; }
.dn-catalog-name { font-family: var(--dn-font-display); font-weight: 800; font-size: 1.4rem; text-transform: uppercase; color: #fff; }
.dn-catalog-name:hover, .dn-catalog > li.is-open > .dn-catalog-name { color: var(--dn-accent); }
.dn-catalog-desc { color: var(--dn-muted); font-size: .9375rem; margin-top: .35rem; }
.dn-catalog-items { list-style: none; padding: 0; margin: 1rem 0 0; }
.dn-catalog-items > li { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--dn-surface); border: 1px solid var(--dn-line); border-radius: var(--bs-border-radius); }
.dn-catalog-items > li + li { margin-top: .5rem; }
.dn-catalog-items > li > div:first-child { min-width: 0; flex: 1 1 18rem; }
.dn-notice { display: inline-block; font-size: .875rem; border-left: 3px solid var(--dn-accent); background: var(--dn-accent-soft); padding: .5rem .85rem; }

/* Event date block, shared by the homepage widget (widgets/events.tpl) and the calendar. */
.dn-event { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: .9rem; padding: .75rem 0; border-top: 1px solid var(--dn-line); color: var(--dn-text); }
.dn-event:first-of-type { border-top: 0; padding-top: 0; }
.dn-event:hover strong { color: var(--dn-accent); }
.dn-event-date { text-align: center; border: 1px solid var(--dn-line); padding: .3rem 0; line-height: 1; }
.dn-event-date b { display: block; font-family: var(--dn-font-display); font-size: 1.6rem; font-weight: 800; }
.dn-event-date span { font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dn-accent); }

/* Calendar (events.php). */
.dn-event-date small { display: block; font-size: .625rem; color: var(--dn-muted); margin-top: .25rem; }
.dn-event-date-lg { width: 5.5rem; flex-shrink: 0; padding: .6rem 0; }
.dn-event-date-lg b { font-size: 2.6rem; }
.dn-event-detail { display: flex; gap: 1.25rem; align-items: center; }
.dn-event-poster { max-width: 100%; max-height: 32rem; width: auto; height: auto; border: 1px solid var(--dn-line); }
.dn-event-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--dn-line); }
.dn-event-list > li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--dn-line); }
.dn-event-list > li.dn-meta { display: block; }
.dn-event-list > li.is-patronage { background: linear-gradient(90deg, var(--dn-accent-soft), transparent 70%); }
.dn-event-name { font-weight: 600; font-size: 1.0625rem; color: var(--dn-text); overflow-wrap: anywhere; }
.dn-event-name:hover { color: var(--dn-accent); }
.dn-event-thumb img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--dn-line); }
.dn-form .form-control { background: var(--dn-surface); border-color: var(--dn-line); }
.dn-form .form-control:focus { border-color: var(--dn-accent); box-shadow: 0 0 0 .2rem var(--dn-accent-soft); }

/* Announcement ($sticky) above the hero. */
.dn-announcement { border-bottom: 1px solid #4a3210; background: linear-gradient(90deg, #2b1c07, var(--dn-bg)); }
.dn-announcement .dn-article { max-width: none; font-size: 1rem; }

/* Legacy BBCode output (tables, images, <font>) must never widen the page. */
.dn-article img { max-width: 100%; height: auto; }
.dn-article table { width: 100% !important; table-layout: fixed; }
.dn-article td { overflow-wrap: anywhere; }

/* ---------- Gallery (galeria.php) ---------- */
.dn-gal-hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--dn-line); }
.dn-gal-hero .dn-hero-bg { filter: blur(40px) saturate(.8) brightness(.42); }
.dn-gal-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--dn-bg), #14141488 70%); }
.dn-gal-hero-cover { width: 160px; aspect-ratio: 4 / 3; object-fit: cover; box-shadow: 0 30px 50px -20px #000, 0 0 0 1px #ffffff1a; }
.dn-gal-hero-text { min-width: 0; }
.dn-gal-desc { color: #cfcfcf; max-width: 42rem; overflow-wrap: anywhere; }
/* Section headings carry an album count and a "show all" link; let them wrap on phones. */
.dn-gal .dn-section-title { flex-wrap: wrap; row-gap: .35rem; }
/* Album and photo titles come from users and may hold long words. */
.dn-gal .dn-eyebrow, .dn-gal-photo-title, .dn-photo-facts dd { overflow-wrap: anywhere; }
/* The lightbox hint only applies when scripts run (see layout/head.tpl). */
.dn-no-js .dn-gal-hint { display: none; }
/* Search (galeria.php?q=): the form in the hero, matching users as a wrapping list of names. */
.dn-gal-search { max-width: 32rem; }
.dn-gal-users { display: flex; flex-wrap: wrap; gap: .5rem; }
.dn-gal-users li { padding: .5rem .85rem; background: var(--dn-surface); border: 1px solid var(--dn-line); overflow-wrap: anywhere; }
.dn-gal-users a { font-weight: 600; }

/* Album cards: cover with two photos peeking out behind it, like a small pile of prints. */
.dn-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2rem 1.5rem; }
.dn-album-card { display: block; color: var(--dn-text); min-width: 0; }
.dn-album-cover { position: relative; aspect-ratio: 4 / 3; margin: .6rem .6rem 0 0; }
.dn-album-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 1px solid #000; }
.dn-album-front { z-index: 2; box-shadow: 0 14px 28px -12px #000; transition: transform .25s; }
.dn-album-behind { z-index: 1; filter: grayscale(1) brightness(.45); transition: transform .25s; }
.dn-album-behind-1 { transform: translate(.35rem, -.35rem) rotate(2deg); }
.dn-album-behind-2 { transform: translate(.6rem, -.6rem) rotate(4deg); z-index: 0; }
.dn-album-card:hover .dn-album-front { transform: translateY(-3px); }
.dn-album-card:hover .dn-album-behind-1 { transform: translate(.6rem, -.6rem) rotate(4deg); }
.dn-album-card:hover .dn-album-behind-2 { transform: translate(1rem, -1rem) rotate(7deg); }
.dn-album-count { position: absolute; z-index: 3; left: .5rem; bottom: .5rem; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: #0c0c0edd; padding: .2rem .45rem; }
.dn-album-title { font-weight: 600; margin-top: .75rem; line-height: 1.3; overflow-wrap: anywhere; transition: color .15s; }
.dn-album-card:hover .dn-album-title { color: var(--dn-accent); }

/* Photo grid: square crops, a little gap, gentle zoom on hover. */
.dn-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: .4rem; }
.dn-photo-grid-lg { grid-template-columns: repeat(auto-fill, minmax(min(100%, 225px), 1fr)); }
.dn-photo-tile { display: block; aspect-ratio: 1; overflow: hidden; background: var(--dn-surface-2); }
.dn-photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s, filter .3s; filter: saturate(.85); }
.dn-photo-tile:hover img, .dn-photo-tile:focus-visible img { transform: scale(1.06); filter: none; }

/* Lightbox (widgets/gallery_lightbox.tpl, album and photo pages). Without JS the links open the photo page or the file. */
.dn-lightbox { position: fixed; inset: 0; z-index: 1090; display: grid; grid-template-columns: 4rem minmax(0, 1fr) 4rem; align-items: center; background: #050505f2; }
.dn-lightbox[hidden] { display: none; }
.dn-lb-figure { margin: 0; text-align: center; min-width: 0; }
/* Viewport the original is fitted into; when zoomed to 1:1 it scrolls instead. */
.dn-lb-viewport { height: calc(100vh - 6rem); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dn-lb-viewport img { max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 30px 80px -30px #000; }
.dn-lb-viewport.can-zoom img { cursor: zoom-in; }
.dn-lb-viewport.is-zoomed { display: block; overflow: auto; text-align: left; }
.dn-lb-viewport.is-zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.dn-lb-hint { opacity: .8; }
.dn-stage-zoom { display: block; cursor: zoom-in; }
.dn-lb-figure figcaption { margin-top: .75rem; font-size: .875rem; color: var(--dn-muted); }
.dn-lb-title { color: var(--dn-text); }
.dn-lb-nav, .dn-lb-close { background: none; border: 0; color: #fff; font-size: 3rem; line-height: 1; opacity: .7; }
.dn-lb-nav:hover, .dn-lb-close:hover { opacity: 1; color: var(--dn-accent); }
.dn-lb-close { position: absolute; top: .5rem; right: 1rem; font-size: 2.5rem; }

/* Photo page: dark stage, large image, side arrows; filmstrip of neighbours below. */
.dn-photo-stage { position: relative; display: flex; justify-content: center; align-items: center; background: #050505; padding: 1.5rem 0; margin-top: .5rem; border-block: 1px solid var(--dn-line); }
.dn-photo-stage img { max-width: min(100%, 1100px); max-height: 75vh; width: auto; height: auto; }
.dn-stage-nav { position: absolute; top: 0; bottom: 0; width: 18%; display: flex; align-items: center; color: #fff; font-size: 3.5rem; opacity: 0; transition: opacity .2s; }
.dn-stage-prev { left: 0; justify-content: flex-start; padding-left: 1.5rem; background: linear-gradient(90deg, #0008, transparent); }
.dn-stage-next { right: 0; justify-content: flex-end; padding-right: 1.5rem; background: linear-gradient(270deg, #0008, transparent); }
.dn-photo-stage:hover .dn-stage-nav, .dn-stage-nav:focus-visible { opacity: .85; }
.dn-stage-nav:hover { color: var(--dn-accent); opacity: 1; }
@media (hover: none) { .dn-stage-nav { opacity: .6; } }
.dn-strip { display: flex; gap: .4rem; justify-content: center; overflow-x: auto; scrollbar-width: thin; }
.dn-strip-item { flex: 0 0 72px; aspect-ratio: 1; opacity: .55; transition: opacity .2s; border: 2px solid transparent; }
.dn-strip-item img { width: 100%; height: 100%; object-fit: cover; }
.dn-strip-item:hover, .dn-strip-item.is-current { opacity: 1; }
.dn-strip-item.is-current { border-color: var(--dn-accent); }
.dn-photo-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.dn-photo-facts dt { font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dn-muted); font-weight: 600; }
.dn-photo-facts dd { margin: 0; font-size: .875rem; }

/* Two album cards per row until two of 300 px fit; auto-fill alone would leave one card the width of the page. */
@media (max-width: 767.98px) {
    .dn-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .dn-album-grid { gap: 1.5rem 1rem; }
    .dn-photo-grid, .dn-photo-grid-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dn-lightbox { grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem; }
    .dn-gal-hero-cover { width: 110px; }
}
@media (prefers-reduced-motion: reduce) { .dn-album-card *, .dn-photo-tile img { transition: none; } }

/* Without Bootstrap JS the collapsed menu and dropdown stay open (see layout/head.tpl). */
.dn-no-js .navbar-collapse { display: block !important; }
.dn-no-js .dropdown-menu { display: block; position: static; }
.dn-no-js .navbar-toggler { display: none !important; }

/* Titles and excerpts come straight from the forum and may hold long words or bare URLs. */
.dn-hero h1, .dn-hero-lead, .dn-hero-side h3, .dn-news, .dn-cover-title, .dn-plain-list, .dn-mini-review, .dn-event, .dn-announcement, .breadcrumb { overflow-wrap: anywhere; }
.dn-mini-review span, .dn-hero-side a > div, .dn-event > div { min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .dn-header .nav-link.active::after { display: none; }
    /* Only below lg, otherwise it would override Bootstrap hiding the toggler on desktop. */
    .dn-header .navbar-toggler { display: flex; }
    .dn-hero-cover { max-width: 220px; }
}
@media (max-width: 767.98px) {
    /* Crop the masthead around the logo (it sits ~60% across the image). */
    .dn-masthead img { width: 100%; height: 120px; object-fit: cover; object-position: 60% 40%; -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 575.98px) {
    .dn-news { grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; }
    .dn-news h3 { font-size: 1.35rem; }
    .dn-news p { -webkit-line-clamp: 2; }
    .dn-article { font-size: 1.0625rem; }
    .dn-cover-row { grid-auto-columns: 42%; }
    /* Up to 12 pagination items in one line from 360px, with ~25px tap targets. */
    .dn-pagination { gap: 1px; }
    .dn-pagination .page-link { min-width: 1.55rem; padding-inline: .2rem; }
}
@media (max-width: 359.98px) {
    /* Narrowest phones: smaller items so the bar still fits one line at 320px. */
    .dn-pagination .page-link { min-width: 1.375rem; padding-inline: .125rem; font-size: .8125rem; }
}
