/* qrz.if.ua photo gallery - redesign 2026-11-01; since qrzfw step 8 the pages are qrzfw's (templates/gallery/*).
   Everything of the gallery is prefixed "pg-" (some rules of the module's admin tools remain for the classes they share).
   Colours, type and radii are the site tokens from base.css (var(--link), var(--line), var(--r)…). */

.pg { --pg-line: var(--line); --pg-muted: var(--muted); --pg-link: var(--link); --pg-bg: var(--strip); --pg-radius: var(--r); }
.pg, .pg * { box-sizing: border-box; }
.pg img { display: block; }

/* ---- page header, breadcrumb, headings ---- */
.pg-adminbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0 0 8px; }
.pg-adminbar:empty { display: none; }
.pg-head { margin: 4px 0 18px; }
.pg-title { font-size: 1.7em; font-weight: bold; line-height: 1.2; margin: 0; color: #2b3539; }
.pg-sub { color: var(--pg-muted); margin-top: 5px; }
.pg-sub .pg-des { color: #444; }
.pg-h { font-size: 1.15em; font-weight: bold; margin: 22px 0 10px; padding-bottom: 5px; border-bottom: 1px solid var(--pg-line); color: #2b3539; }
.pg-h:first-child { margin-top: 4px; }

/* ---- album cards ---- */
.pg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px 14px; margin: 0 0 8px; }
.pg-card { display: block; color: #333; text-decoration: none !important; }
.pg-card-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--pg-radius); background: var(--pg-bg); border: 1px solid var(--pg-line); }
.pg-card-img img { width: 100%; height: 100% !important; object-fit: cover; transition: transform .25s ease; }
.pg-card:hover .pg-card-img img { transform: scale(1.04); }
.pg-card:hover .pg-card-name { color: var(--pg-link); }
.pg-card-empty .pg-card-img { background: var(--pg-bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%23b4c3ca' stroke-width='1.5'><rect x='3' y='5' width='18' height='14' rx='2'/><circle cx='12' cy='12' r='3.5'/></svg>") center / 40px no-repeat; }
.pg-card-name { display: block; margin-top: 7px; font-weight: bold; line-height: 1.25; }
.pg-card-meta { display: block; margin-top: 2px; font-size: 0.86em; color: var(--pg-muted); }

/* ---- full album tree (every gallery page): two columns, sub-albums indented with a dash, counts muted ---- */
.pg-list { margin: 0 0 6px; }
.pg-list ul { list-style: none; margin: 0; padding: 0; }
.pg-list > ul { columns: 2; column-gap: 28px; }
.pg-list > ul > li { break-inside: avoid; margin: 0 0 5px; line-height: 1.45; }
.pg-list ul ul { margin: 0 0 0 4px; }
.pg-list ul ul li { padding-left: 1.4em; text-indent: -1.4em; }
.pg-list ul ul li::before { content: "\2014\00a0"; color: #b4c3ca; }
.pg-list ul ul ul { margin-left: 18px; }
.pg-list .pg-al-n { font-size: 0.86em; color: var(--pg-muted); }
.pg-list .pg-al-cur { font-weight: bold; color: #2b3539; text-decoration: none; }
/* folded tree on album/photo/other pages (compile.php) */
.pg-list-more { margin: 14px 0 8px; }
.pg-list-more > summary { cursor: pointer; list-style: none; margin: 0; color: var(--pg-link); font-size: 1em; font-weight: normal; }
.pg-list-more > summary::-webkit-details-marker { display: none; }
.pg-list-more > summary::before { content: "\25B8"; display: inline-block; width: 1em; color: var(--pg-muted); transition: transform .15s; }
.pg-list-more[open] > summary::before { transform: rotate(90deg); }
.pg-list-more[open] > summary { margin-bottom: 10px; color: #2b3539; font-weight: bold; }

/* ---- photo tiles ---- */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pg-tile { margin: 0; position: relative; min-width: 0; }
.pg-tile-link { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--pg-radius); background: var(--pg-bg); border: 1px solid var(--pg-line); }
.pg-tile-link img { width: 100%; height: 100% !important; object-fit: cover; transition: transform .25s ease; }
.pg-tile:hover .pg-tile-link img { transform: scale(1.04); }
.pg-tile-cap { display: block; padding: 6px 2px 0; font-size: 0.86em; line-height: 1.3; }
.pg-tile-title { display: block; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-tile-title:empty { display: none; }
.pg-tile-meta { display: block; color: var(--pg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-tile-des { display: none; }
.pg-tile-adm { position: absolute; top: 4px; left: 4px; right: 4px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .15s; }
.pg-tile-adm:empty { display: none; }
.pg-tile:hover .pg-tile-adm, .pg-tile:focus-within .pg-tile-adm, .pg-tile.selecteditis .pg-tile-adm { opacity: 1; }
.pg-tile-adm .pg-ic { width: 22px; height: 22px; border-radius: var(--r-sm); }
.pg-tile-adm .pg-ic::before { width: 14px; height: 14px; }
.pg-tile.selecteditis .pg-tile-link { outline: 3px solid var(--link); outline-offset: -3px; }
.pg-tile.selecteditis .pg-tile-link img { opacity: .75; }
.pg-tile.selecteditis .pg-ic-sel { color: #fff; background-color: var(--link); border-color: var(--link-hover); }
.pg-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pg-ops:empty { display: none; }
.pg-ops-do { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pg-ops script { display: none; }

/* ---- pagination (the module prints <a>2</a> links and <a><b>1</b></a> for the current page) ---- */
.pg-pages { text-align: center; margin: 18px 0 6px; line-height: 2.4; }
.pg-pages:empty { display: none; }
.pg-pages a { display: inline-block; min-width: 2.1em; padding: 0 7px; margin: 0 2px; border: 1px solid var(--pg-line); border-radius: var(--pg-radius); text-decoration: none !important; background: #fff; }
.pg-pages a:hover { background: var(--pg-bg); }
.pg-pages a b { color: #fff; }
.pg-pages a:has(b) { background: var(--pg-link); border-color: var(--pg-link); }
.pg-pages .pg-gap { padding: 0 4px; color: var(--pg-muted); }
.pg-none { text-align: center; color: var(--pg-muted); margin: 18px 0; }

/* ---- footer tools and statistics ---- */
.pg-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--pg-line); font-size: 0.9em; color: var(--pg-muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.pg-tools a { margin-right: 14px; }
.pg-tools a.pg-rss::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; background: #f60 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><circle cx='2' cy='6' r='1' fill='white'/><path d='M1 3a4 4 0 0 1 4 4M1 1a6 6 0 0 1 6 6' stroke='white' fill='none'/></svg>") center / 8px no-repeat; }
.pg-stats b { color: #444; }

/* ---- photo page ---- */
.pg-view-adm { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-bottom: 8px; }
.pg-view-adm:empty { display: none; }
.pg-figure { position: relative; margin: 0; background: #1d2326; border-radius: var(--pg-radius); overflow: hidden; text-align: center; }
.pg-figure img { max-width: 100%; max-height: 80vh; height: auto; margin: 0 auto; }
.pg-zoom { display: block; cursor: zoom-in; }
.pg-photoborder { display: inline-block; position: relative; }
.pg-figure .back_photo, .pg-figure .forward_photo { position: absolute; top: 0; bottom: 0; width: 22%; max-width: 160px; display: flex; align-items: center; z-index: 2; text-decoration: none !important; opacity: .6; transition: opacity .2s; }
.pg-figure .back_photo { left: 0; justify-content: flex-start; }
.pg-figure .forward_photo { right: 0; justify-content: flex-end; }
.pg-figure:hover .back_photo, .pg-figure:hover .forward_photo, .pg-figure .back_photo:focus, .pg-figure .forward_photo:focus { opacity: 1; }
.pg-nav { display: block; width: 44px; height: 44px; line-height: 40px; margin: 0 10px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 34px; font-family: Georgia, serif; text-align: center; }
.pg-figure a:hover .pg-nav { background: rgba(0,0,0,.7); }
.pg-counter { position: absolute; right: 10px; top: 8px; z-index: 2; font-size: 0.8em; color: #fff; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 10px; }
.pg-counter:empty { display: none; }
.pg-view-info { margin-top: 12px; }
.pg-view-title { font-size: 1.35em; font-weight: bold; margin: 0 0 4px; color: #2b3539; }
.pg-view-des { margin: 0 0 6px; }
.pg-view-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.9em; color: var(--pg-muted); }
.pg-view-meta a { color: var(--pg-link); }
.pg-rating b { color: #444; }
.pg-rating a { display: inline-block; min-width: 22px; padding: 0 4px; text-align: center; font-weight: bold; line-height: 20px; color: var(--text); background: var(--strip); border: 1px solid var(--border); border-radius: var(--r-sm); text-decoration: none !important; }
.pg-rating a:hover { color: var(--link-hover); background: var(--hover); }
.pg-view-tags { margin-top: 6px; font-size: 0.9em; }
.pg-view-actions { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 0.9em; color: var(--pg-muted); }
.pg-file { color: var(--pg-muted); }
.pg-marks { margin-top: 6px; font-size: 0.9em; }

/* filmstrip of the whole album */
.pg-strip { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0 4px; padding: 4px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.pg-strip-item { flex: 0 0 auto; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; opacity: .75; scroll-snap-align: center; }
.pg-strip-item:hover { opacity: 1; }
.pg-strip-item img { width: 100%; height: 100% !important; object-fit: cover; }
.pg-strip-cur { border-color: var(--pg-link); opacity: 1; }

/* ---- buttons: the site's own .fbutton (base.css: quiet strip, border, bold, 6px radius), its primary colours
   for the one main action (.pg-main), a compact size for bars (.pg-sm), and square icon buttons for photo tools ---- */
.pg .fbutton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 0; vertical-align: middle; text-decoration: none !important; white-space: nowrap; }
.pg .fbutton.pg-main { color: #fff; background-color: var(--link); border-color: var(--link-hover); }
.pg .fbutton.pg-main:hover { background-color: var(--link-hover); }
.pg .fbutton.pg-sm { padding: 5px 12px; font-size: 13px; }
.pg .pg-select { height: 29px; padding: 0 8px; font: 13px var(--font); color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: var(--r); }
.pg-ops-do select { height: 29px; padding: 0 8px; font: 13px var(--font); color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: var(--r); max-width: 260px; }
.pg-ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; vertical-align: middle; color: var(--text-2); background: var(--strip); border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; }
.pg-ic::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--pg-i) center / contain no-repeat; mask: var(--pg-i) center / contain no-repeat; }
a:hover > .pg-ic, a:focus-visible > .pg-ic { color: var(--link-hover); background-color: var(--hover); }
a:hover > .pg-ic-del { color: var(--danger-dark); background-color: var(--danger-bg); border-color: var(--danger-line); }
.pg-ic-del { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 11v6M14 11v6'/></svg>"); }
.pg-ic-edit { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20h4L19 9l-4-4L4 16z'/><path d='M13 7l4 4'/></svg>"); }
.pg-ic-sel { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>"); }
.pg-ic-left { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 4v6h6'/><path d='M3.5 10A8.5 8.5 0 1 1 6 17.5'/></svg>"); }
.pg-ic-right { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 4v6h-6'/><path d='M20.5 10A8.5 8.5 0 1 0 18 17.5'/></svg>"); }
.pg-ic-half { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 21V10a4 4 0 0 1 8 0v5'/><path d='M12.5 12l3.5 3.5 3.5-3.5'/></svg>"); }
.pg-ic-hide { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12z'/><circle cx='12' cy='12' r='3'/><path d='M4 4l16 16'/></svg>"); }
.pg-ic-show { --pg-i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3.6-6.5 10-6.5S22 12 22 12s-3.6 6.5-10 6.5S2 12 2 12z'/><circle cx='12' cy='12' r='3'/></svg>"); }
.pg-tile-adm a, .pg-view-adm a { display: inline-flex; text-decoration: none !important; }

/* ---- phones ---- */
@media (max-width: 620px) {
	.pg-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 10px; }
	.pg-list > ul { columns: 1; }
	.pg-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.pg-tile-cap { font-size: 0.8em; }
	.pg-title { font-size: 1.4em; }
	.pg-figure img { max-height: 70vh; }
	.pg-figure .back_photo, .pg-figure .forward_photo { opacity: 1; width: 25%; }
	.pg-nav { width: 36px; height: 36px; line-height: 32px; font-size: 28px; margin: 0 6px; }
	.pg-foot { flex-direction: column; }
	.pg-tile-adm { top: 3px; left: 3px; right: 3px; gap: 1px; }
	.pg-tile-adm .pg-ic { width: 20px; height: 20px; }
	.pg-tile-adm .pg-ic::before { width: 13px; height: 13px; }
}
