/* =========================================================
   SPP PHOTO GALLERY — plugin stylesheet
   Deliberately not borrowed from any theme (this plugin must render
   correctly under any active theme, per the "portable/independent"
   requirement).

   .spp-photo-gallery-columns column count is NOT a fixed
   --spp-gallery-columns var + viewport breakpoints (that was v1.1.0's
   approach, and it broke down: it assumed a Divi row max-width of
   ~1080-1200px, but on [spp_photo_browse]'s actual page this shortcode
   sits inside a right-sidebar Theme Builder body template — a
   .et_pb_row_0_tb_body capped at 1280px, containing a 75%-width content
   column — so the real container is ~945-960px, not the site's 1920px
   content_width option (that option only caps a DIFFERENT, non-sidebar
   .et_pb_row default that isn't the one actually wrapping this
   shortcode). Either way, a "4 columns until 1400px" rule left visible
   unused width on ordinary desktop windows. column-width below auto-fits
   to whatever the row's ACTUAL width is, on any page/template, without
   per-page breakpoint tuning or needing to trace the containment chain.
   ========================================================= */

/* ---------------- SUBMISSION FORM ---------------- */

.spp-photo-submit-wrap {
	max-width: 640px;
	margin: 0 auto;
}

.spp-photo-submit-message {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-weight: 600;
}
.spp-photo-submit-message.success {
	background: #eef7f6;
	border-left: 4px solid #00897B;
	color: #004D40;
}
.spp-photo-submit-message.error {
	background: #fdf3f2;
	border-left: 4px solid #c0392b;
	color: #c0392b;
}

.spp-photo-field { margin-bottom: 18px; }
.spp-photo-label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}
.spp-photo-hint {
	font-weight: 400;
	font-size: 0.82rem;
	color: #888;
}
.spp-required { color: #c0392b; }

.spp-photo-select,
.spp-photo-date,
.spp-photo-caption-input {
	width: 100%;
	max-width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.95rem;
	background: #fff;
	box-sizing: border-box;
}

.spp-photo-editor {
	margin: 12px 0 20px;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 12px;
	background: #fafafa;
}
.spp-photo-editor-image-wrap {
	max-height: 420px;
	overflow: hidden;
}
.spp-photo-editor-image-wrap img {
	display: block;
	max-width: 100%;
}
.spp-photo-editor-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
	flex-wrap: wrap;
}
.spp-photo-brightness-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
}

.spp-photo-actions { margin-top: 20px; }
.spp-photo-submit-btn {
	background: #00897B;
	color: #fff;
	border: none;
	border-radius: 5px;
	padding: 10px 28px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}
.spp-photo-submit-btn:disabled {
	background: #aaa;
	cursor: not-allowed;
}
.spp-photo-submit-btn:not(:disabled):hover { background: #004D40; }

/* ---------------- MODERATION QUEUE ---------------- */

.spp-pending-photos-wrap { max-width: 900px; margin: 0 auto; }
.spp-pending-photos-title {
	color: #00897B;
	border-bottom: 2px solid #00897B;
	padding-bottom: 8px;
	margin-bottom: 20px;
}
.spp-pending-photos-none { color: #888; font-style: italic; }
.spp-pending-photos-message {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-weight: 600;
}
.spp-pending-photos-message.success {
	background: #eef7f6;
	border-left: 4px solid #00897B;
	color: #004D40;
}
.spp-pending-photos-message.error {
	background: #fdf3f2;
	border-left: 4px solid #c0392b;
	color: #c0392b;
}

.spp-pending-photo {
	display: flex;
	gap: 16px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 14px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.spp-pending-photo-thumb img {
	display: block;
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
}
.spp-pending-photo-info { flex: 1; min-width: 0; }
.spp-pending-photo-row { margin-bottom: 4px; font-size: 0.92rem; }
.spp-pending-photo-meta { color: #888; font-size: 0.85rem; }
.spp-pending-photo-caption { color: #555; font-style: italic; }

.spp-pending-photo-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}
.spp-pending-photo-approve-btn {
	background: #00897B;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 7px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}
.spp-pending-photo-approve-btn:hover { background: #004D40; }
.spp-pending-photo-reject-btn {
	background: #c0392b;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 7px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}
.spp-pending-photo-reject-btn:hover { background: #a93226; }
.spp-pending-photo-status {
	font-size: 0.85rem;
	font-style: italic;
}

/* Moderation queue's one and only breakpoint — unlike the gallery views
   (column-width intrinsically self-scales, no breakpoint needed; see that
   section's own header comment), .spp-pending-photo is a flex ROW of
   fixed-size pieces (a fixed thumbnail box + sub-1rem text + small
   buttons), and nothing about a fixed-size row gets more comfortable on
   its own as the viewport shrinks — it just gets proportionally more
   cramped. So this page needs an explicit rework at phone width instead:
   stack thumbnail-over-text rather than keep them side-by-side (a
   120-220px-wide thumbnail plus a text column both squeezed into a
   ~350-400px phone screen is exactly what was reported as "too small to
   use," and widening the thumbnail while keeping the row layout would
   only leave the text column narrower still) — a full stack gives both
   the image and the text the full card width to work with, at a size
   that doesn't need pinch-zoom to read or tap accurately.
   spp-masonry-thumb is already generated at 300x300 (image-sizes.php) —
   raising the display size here needs no registered-size change, the
   source resolution already covers it. */
@media (max-width: 600px) {
	.spp-pending-photo {
		flex-direction: column;
	}
	.spp-pending-photo-thumb {
		align-self: center;
	}
	.spp-pending-photo-thumb img {
		width: 200px;
		height: 200px;
	}
	.spp-pending-photo-row {
		font-size: 1.05rem;
	}
	.spp-pending-photo-meta {
		font-size: 0.95rem;
	}
	.spp-pending-photo-actions {
		gap: 12px;
	}
	/* flex:1 on both buttons splits the card's full width evenly between
	   them instead of leaving them shrunk to their label — bigger, more
	   reliable tap targets than just bumping padding/font-size alone
	   would give. min-height backstops the touch-target size directly
	   rather than depending on padding+line-height happening to add up
	   to something tappable. */
	.spp-pending-photo-approve-btn,
	.spp-pending-photo-reject-btn {
		flex: 1;
		min-height: 48px;
		padding: 12px 18px;
		font-size: 1.05rem;
	}
	.spp-pending-photo-status {
		font-size: 0.95rem;
	}
}

/* ---------------- BROWSE ---------------- */

.spp-photo-browse-none {
	color: #888;
	font-style: italic;
}
.spp-photo-browse-form {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
}
.spp-photo-browse-label {
	font-weight: 600;
}
.spp-photo-browse-select {
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.95rem;
	background: #fff;
}
.spp-photo-browse-submit {
	background: #00897B;
	color: #fff;
	border: none;
	border-radius: 5px;
	padding: 8px 20px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}

/* ---------------- GALLERY DISPLAY (masonry via CSS columns) ---------------- */

.spp-photo-gallery-error {
	padding: 0.75rem 1rem;
	background: #fff3f3;
	border-left: 4px solid #dc3232;
	font-size: 0.9rem;
}
.spp-photo-gallery-empty {
	color: #888;
	font-style: italic;
}

/* column-width is the real driver — it fits as many ~220px+ columns as
   the row's actual width allows, so this self-calibrates per page/screen
   instead of guessing viewport breakpoints against an assumed container
   width (see file header). On [spp_photo_browse]'s own page the
   container only runs ~945-960px (Theme Builder body row × sidebar
   column — see file header), which column-width alone already resolves
   to 4 columns; column-count:6 is just a sanity ceiling in case this
   shortcode ever renders in a wider/full-width row on another page, so
   tiles there can't get smaller than roughly container/6. Below any of
   that, column-width keeps shrinking the count as normal, all the way to
   1 on mobile — no small-screen breakpoint needed either. */
.spp-photo-gallery-columns {
	column-width: 220px;
	column-count: 6;
	column-gap: 1rem;
}

.spp-photo-gallery-item {
	break-inside: avoid;
	margin-bottom: 1rem;
}

.spp-photo-gallery-link {
	display: block;
	overflow: hidden;
	border-radius: 8px;
}
/* No max-width cap here on purpose: width:100% means each image already
   renders at exactly its column's width, so column-width above (not a
   cap here) is what makes tiles render smaller/denser as the row gets
   wider. A fixed px cap on the image would fight that — on a column
   wider than the cap it'd leave dead whitespace beside the image instead
   of actually shrinking the tile. The underlying spp-masonry file itself
   is unchanged (still 500px); this is screen rendering only. */
.spp-photo-gallery-image {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.3s ease;
}
.spp-photo-gallery-link:hover .spp-photo-gallery-image {
	transform: scale(1.04);
}

.spp-photo-gallery-item-date {
	padding: 0.35rem 0.25rem 0;
	font-size: 0.75rem;
	color: #999;
	text-align: center;
}

.spp-photo-gallery-caption {
	padding: 0.4rem 0.25rem 0;
	font-size: 0.85rem;
	line-height: 1.35;
	color: #444;
	text-align: center;
}
/* Tighter gap when a tile shows both — the date label already opened the
   vertical rhythm, the caption directly below it doesn't need a second
   full gap. */
.spp-photo-gallery-item-date + .spp-photo-gallery-caption {
	padding-top: 0.1rem;
}

/* Photographer credit — always auto-generated, distinct from the
   submitter's own free-text caption above it, so it's styled smaller/
   muted rather than competing with it as a second full-weight line. */
.spp-photo-gallery-credit {
	padding: 0.15rem 0.25rem 0;
	font-size: 0.72rem;
	color: #999;
	text-align: center;
}

/* No column-count media-query tiers — column-width above already
   auto-fits every width, mobile included, without guessing breakpoints
   against a container size that varies per page/theme. */
