/* RHD Gallery front end. Tiles get --w/--h (pixel size) inline from templates/gallery.php. */

.rhdg {
	--rhdg-gap: 6px;
	--rhdg-row-height: 180px;
	--rhdg-muted: #6b6b6b;
	--rhdg-border: #e3e3e3;
	--rhdg-accent: #24890d; /* twentyfourteen green */
	max-width: none;
	padding: 0 16px 48px;
}

/*
 * Full width on gallery/folder pages (body.rhdg-page): twentyfourteen caps the site at 1260px and
 * keeps a black left column; photos get the whole window instead. Site header and banner stay.
 */
.rhdg-page .site,
.rhdg-page .site-header,
.rhdg-page .site-footer {
	max-width: none;
}

.rhdg-page .site::before,
.rhdg-page #secondary {
	display: none;
}

.rhdg-page .site-content.rhdg {
	margin-left: 0;
	margin-right: 0;
	padding: 0 32px 48px;
}

.rhdg-page #site-header img {
	height: 240px;
	object-fit: cover;
	width: 100%;
}

.rhdg-header {
	margin: 24px 0 16px;
}

/* The search box: top right of every Photos page (above the breadcrumb on phones). Not rhdg-search:
   that is the search page's body class (RHDG_Router::body_class), so the page itself floated right. */
.rhdg-search-form {
	display: flex;
	float: right;
	gap: 6px;
	margin: 0 0 8px 16px;
}

.rhdg-search-form input[type="search"] {
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 14px;
	padding: 6px 10px;
	width: 220px;
}

.rhdg .rhdg-search-form button {
	border-radius: 4px;
	font-size: 13px;
	padding: 6px 12px;
	text-transform: none;
}

.rhdg-results-heading {
	clear: both;
	font-size: 20px;
	margin: 28px 0 12px;
}

.rhdg-more {
	color: #646970;
	font-style: italic;
}

@media (max-width: 600px) {
	.rhdg-search-form {
		float: none;
		margin: 0 0 12px;
	}

	.rhdg-search-form input[type="search"] {
		flex: 1;
		width: auto;
	}
}

/* Breadcrumb as on SmugMug: home icon > Hikes > 2026, grey, above the title. */
.rhdg-crumbs {
	align-items: center;
	color: var(--rhdg-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 15px;
	gap: 4px;
	margin-bottom: 10px;
}

.rhdg-crumbs a {
	color: var(--rhdg-muted);
	text-decoration: none;
}

.rhdg-crumbs a:hover,
.rhdg-crumbs a:focus {
	color: var(--rhdg-accent);
}

.rhdg-crumbs svg {
	display: block;
	height: 16px;
	width: 16px;
}

.rhdg-crumb-home svg {
	fill: currentColor;
	height: 18px;
	width: 18px;
}

.rhdg-crumb-sep {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.rhdg-title {
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
	text-transform: none;
}

.rhdg-date {
	color: var(--rhdg-muted);
	margin: 4px 0 0;
}

.rhdg-description {
	margin-top: 12px;
	max-width: 70ch;
}

.rhdg-badge {
	border-radius: 3px;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	margin-left: 8px;
	padding: 2px 6px;
	text-transform: uppercase;
	vertical-align: middle;
}

.rhdg-badge-unlisted {
	background: #8a6d00;
}

.rhdg-badge-private {
	background: #a12622;
}

.rhdg-empty {
	color: var(--rhdg-muted);
}

/* ---------------------------------------------------------------- Cards */

.rhdg-cards {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.rhdg-card a {
	color: inherit;
	display: block;
	text-decoration: none;
}

.rhdg-card-image {
	aspect-ratio: 3 / 2;
	background: #ececec;
	border-radius: 4px;
	display: block;
	overflow: hidden;
}

.rhdg-card-image img {
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
	width: 100%;
}

.rhdg-card a:hover .rhdg-card-image img,
.rhdg-card a:focus-visible .rhdg-card-image img {
	transform: scale(1.04);
}

.rhdg-card-title {
	display: block;
	font-weight: 600;
	margin-top: 8px;
}

.rhdg-card-meta {
	color: var(--rhdg-muted);
	display: block;
	font-size: 13px;
}

/* ---------------------------------------------------- Justified grid */

.rhdg-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rhdg-gap);
}

/* Each tile grows in proportion to its aspect ratio, so every row fills the width. */
.rhdg-tile {
	background: #ececec;
	display: block;
	flex-basis: calc(var(--w) / var(--h) * var(--rhdg-row-height));
	flex-grow: calc(var(--w) / var(--h));
	overflow: hidden;
	position: relative;
}

/* Caption banner across the top of a thumbnail on hover (as on SmugMug); hidden otherwise. */
.rhdg-tile-caption {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	display: -webkit-box;
	font-size: 13px;
	left: 0;
	line-height: 1.35;
	opacity: 0;
	overflow: hidden;
	padding: 6px 10px;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 0;
	transition: opacity 0.15s ease;
}

.rhdg-tile:hover .rhdg-tile-caption,
.rhdg-tile:focus-visible .rhdg-tile-caption {
	opacity: 1;
}

@media (hover: none) {
	.rhdg-tile-caption {
		display: none;
	}
}

/* Keeps a short last row from stretching. */
.rhdg-grid::after {
	content: "";
	flex-grow: 999999;
}

.rhdg-tile img {
	aspect-ratio: var(--w) / var(--h);
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.rhdg-tile-video::after {
	background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 60% no-repeat;
	border-radius: 50%;
	content: "";
	height: 44px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
}

@media (max-width: 600px) {
	.rhdg-page .site-content.rhdg {
		padding: 0 16px 32px;
	}

	.rhdg {
		--rhdg-row-height: 90px; /* two landscape photos per row on a phone */
		--rhdg-gap: 3px;
	}

	.rhdg-title {
		font-size: 30px;
	}
}

/* ------------------------------------------------------------ Photos in posts */

/* Many posts wrap their text in <div class="rw-pad20">, the theme's 20px indent; the photo's own
   rw-pad20 margins would indent it a second time. Line it up with photos in unwrapped posts. */
.rw-pad20 img.rhdg-photo.rw-pad20 {
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
}

/* ------------------------------------------------------------ Lightbox */

.pswp__rhdg-caption {
	bottom: 0;
	color: #f2f2f2;
	left: 0;
	padding: 12px 16px 16px;
	position: absolute;
	right: 0;
	text-align: center;
}

.pswp__rhdg-caption p {
	margin: 0 auto;
	max-width: 80ch;
}

/* Rob's caption editing (.pswp in front: the theme styles every button and text box). */
.pswp .rhdg-caption-edit,
.pswp .rhdg-caption-save,
.pswp .rhdg-caption-cancel {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
	color: #e8e8e8;
	cursor: pointer;
	font-size: 12px;
	font-weight: normal;
	letter-spacing: normal;
	margin: 6px 3px 0;
	padding: 3px 10px;
	text-transform: none;
}

.pswp .rhdg-caption-save {
	background: var(--rhdg-accent, #24890d);
	border-color: transparent;
	color: #fff;
}

.pswp .rhdg-caption-edit:hover,
.pswp .rhdg-caption-cancel:hover {
	background: rgba(255, 255, 255, 0.12);
}

.pswp .rhdg-caption-box {
	background: #2b2b2b;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
	box-sizing: border-box;
	color: #fff;
	display: block;
	font-size: 15px;
	margin: 0 auto;
	max-width: 80ch;
	padding: 6px 8px;
	width: 100%;
}

.pswp .rhdg-delete-yes {
	background: #b32d2e;
}

.rhdg-delete-question {
	color: #ffd2d2;
}

.rhdg-caption-note:empty {
	display: none;
}

/* In a container (the map page): over it rather than the window; the caption sits right under
   the photo (lightbox.js sets its top). */
.pswp.rhdg-pswp-contained {
	position: absolute;
}

.rhdg-pswp-contained .pswp__rhdg-caption {
	bottom: auto;
	padding-top: 8px;
}

.rhdg-pswp-info {
	color: #b5b5b5;
	display: none;
	font-size: 13px;
	margin-top: 4px !important;
}

.rhdg-show-info .rhdg-pswp-info {
	display: block;
}

/* Rob's Cover menu: top right under the toolbar, while the Cover button is on. */
.pswp__rhdg-cover-menu {
	background: rgba(27, 27, 27, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
	display: none;
	max-width: calc(100% - 32px); /* phones: the labels wrap instead of running off the screen */
	padding: 6px;
	position: absolute;
	right: 16px;
	top: 64px;
	z-index: 11;
}

.rhdg-show-cover .pswp__rhdg-cover-menu {
	display: block;
}

/* .pswp in front: the theme styles every button (capitals, green fill when disabled). */
.pswp .rhdg-cover-choice {
	background: transparent;
	border: 0;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	display: block;
	font-size: 14px;
	font-weight: normal;
	letter-spacing: normal;
	line-height: 1.4;
	padding: 8px 12px;
	text-align: left;
	text-transform: none;
	width: 100%;
}

.pswp .rhdg-cover-choice:hover {
	background: rgba(255, 255, 255, 0.12);
}

.pswp .rhdg-cover-choice.is-chosen {
	color: #a9d18e;
}

.pswp .rhdg-cover-choice.is-automatic {
	color: #b5b5b5;
}

.rhdg-cover-note {
	color: #b5b5b5;
	font-size: 13px;
	margin: 4px 12px 2px !important;
}

/* Per-photo location map: bottom right, beside the photo, while the map button is on. */
.pswp__rhdg-location {
	background: #1b1b1b;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
	bottom: 96px;
	display: none;
	height: 340px;
	overflow: hidden;
	position: absolute;
	right: 16px;
	width: 440px; /* lightbox.js moves the photo left by this plus the margins */
	z-index: 10;
}

.rhdg-show-map .pswp__rhdg-location:not([hidden]) {
	display: block;
}

.rhdg-location-map {
	height: 100%;
	width: 100%;
}

.rhdg-location-link {
	background: rgba(0, 0, 0, 0.65);
	border-radius: 3px;
	color: #fff !important;
	font-size: 12px;
	right: 6px;
	top: 6px;
	padding: 2px 6px;
	position: absolute;
	text-decoration: none;
	z-index: 1000;
}

.pswp__button--rhdg-map[hidden],
.pswp__button--rhdg-download[hidden],
.pswp__button--rhdg-comments-button[hidden] {
	display: none;
}

.rhdg-show-map .pswp__button--rhdg-map,
.rhdg-show-comments .pswp__button--rhdg-comments-button {
	color: var(--rhdg-accent, #24890d);
}

/* Comments: the right-hand side like the map (one at a time), while the comments button is on. */
.pswp__rhdg-comments {
	background: rgba(27, 27, 27, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
	bottom: 96px;
	box-sizing: border-box;
	color: #e8e8e8;
	display: none;
	font-size: 14px;
	line-height: 1.45;
	overflow-y: auto;
	padding: 12px 14px;
	position: absolute;
	right: 16px;
	top: 64px;
	width: 380px; /* lightbox.js moves the photo left by this plus the margins */
	z-index: 10;
}

.rhdg-show-comments .pswp__rhdg-comments {
	display: block;
}

.pswp__button--rhdg-comments-button {
	position: relative;
}

/* "1 / 7" stays on one line when the toolbar is full (phones). */
.pswp__counter {
	white-space: nowrap;
}

.rhdg-comment-count {
	background: var(--rhdg-accent, #24890d);
	border-radius: 8px;
	color: #fff;
	font-size: 11px;
	line-height: 16px;
	min-width: 16px;
	padding: 0 4px;
	position: absolute;
	right: 4px;
	top: 6px;
}

.rhdg-comment-count:empty {
	display: none;
}

.pswp .rhdg-comments-heading {
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: normal;
	margin: 0 0 8px;
	text-transform: none;
}

.rhdg-comment {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding: 8px 0;
}

.rhdg-comment.is-reply {
	border-top: 0;
	margin-left: 18px;
	padding-top: 0;
}

.rhdg-comment.is-owner .rhdg-comment-meta strong {
	color: #a9d18e;
}

.pswp .rhdg-comment p,
.pswp .rhdg-comment-form p {
	margin: 0 0 4px;
}

.rhdg-comment-meta,
.rhdg-comment-empty,
.rhdg-comment-hint {
	color: #b5b5b5;
	font-size: 13px;
}

.rhdg-comment-text {
	overflow-wrap: anywhere;
	white-space: pre-line;
}

.rhdg-comment-form {
	border-top: 1px solid rgba(255, 255, 255, 0.25);
	margin-top: 8px;
	padding-top: 10px;
}

.rhdg-comment-form[hidden],
.rhdg-comment-who[hidden],
.rhdg-comment-approval[hidden] {
	display: none;
}

.rhdg-comment-form label {
	display: block;
	font-size: 13px;
	margin-bottom: 8px;
}

/* .pswp in front: the theme styles every input and button. */
.pswp .rhdg-comment-form input,
.pswp .rhdg-comment-form textarea {
	background: #2b2b2b;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	box-sizing: border-box;
	color: #fff;
	display: block;
	font-size: 14px;
	margin-top: 3px;
	padding: 6px 8px;
	width: 100%;
}

.pswp .rhdg-comment-form textarea {
	resize: vertical;
}

/* The bot trap: out of sight, and out of reach of the Tab key and screen readers. */
.rhdg-comment-trap {
	height: 1px;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.rhdg-comment-turnstile {
	margin-bottom: 8px;
	min-height: 0;
}

.pswp .rhdg-comment-send {
	background: var(--rhdg-accent, #24890d);
	border: 0;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: normal;
	padding: 8px 18px;
	text-transform: none;
}

.pswp .rhdg-comment-send:disabled {
	cursor: wait;
	opacity: 0.6;
}

.rhdg-comment-status:empty {
	display: none;
}

@media (max-width: 600px) {
	.pswp__rhdg-location {
		bottom: 90px;
		height: 180px;
		left: 8px;
		right: 8px;
		width: auto;
	}

	.pswp__rhdg-comments {
		bottom: 90px;
		left: 8px;
		right: 8px;
		top: auto;
		max-height: 60%;
		width: auto;
	}
}

.rhdg-pswp-video {
	align-items: center;
	display: flex;
	height: 100%;
	justify-content: center;
	width: 100%;
}

.rhdg-pswp-video video {
	max-height: 100%;
	max-width: 100%;
}
