/*
Theme Name: Rainoff Eksell
Template: eksell
Description: Small child theme of Eksell for rainoff.com: photo-story fields, "Story behind the image" panel, Stories wording and the no-crop rule.
Author: Adam Rainoff
Version: 1.3.1
Text Domain: rainoff
*/

/* ---------- No-crop rule: images keep their natural aspect ratio everywhere ---------- */
img, .wp-post-image, .preview-media img, .featured-media img, .single-nav-item-media img {
	height: auto !important;
	max-width: 100%;
	object-fit: contain !important;
	aspect-ratio: auto !important;
}
.preview-media, .preview-media-link, .featured-media .media-wrapper, .single-nav-item-media { height: auto !important; aspect-ratio: auto !important; }

/* ---------- Footer: copyright only, no theme credit ---------- */
.footer-credits .theme-credits { display: none; }

/* ---------- Black site, white text (colours come from Eksell's Customizer; these are the extras) ---------- */
html, body { background: #000; color: #fff; }
a:hover, a:focus { color: #d0d0d0; }
button:hover, button:focus, .faux-button:hover, #load-more:hover, #load-more:focus, input[type="submit"]:hover, .wp-block-button__link:hover {
	background: #d0d0d0 !important; color: #000 !important; text-decoration: underline;
}
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
::placeholder { color: #a8a8a8; opacity: 1; }
.search-field, input[type="search"], input[type="text"], textarea { background: #000; color: #fff; border-color: #7a7a7a; }

/* ---------- Stories wording additions ---------- */
.rainoff-read-story { display: inline-block; margin-top: .6rem; font-size: 1.5rem; font-weight: 600; color: #fff; text-decoration: underline; text-underline-offset: .2em; }
.rainoff-read-story:hover, .rainoff-read-story:focus { color: #d0d0d0; text-decoration: none; }
.rainoff-more-stories { margin: 6rem auto 2.4rem; font-size: 2.4rem; color: #fff; }
.single-nav-label { display: block; margin: 0 0 .4rem; font-size: 1.4rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #bdbdbd; }
.rainoff-count { margin-top: .8rem; font-size: 1.5rem; color: #bdbdbd; }

/* ---------- "Story behind the image" panel ---------- */
.rainoff-story-details { margin: 4rem 0 0; padding: 2.4rem; background: #000; border: 1px solid #3a3a3a; border-top: 3px solid #fff; color: #fff; font-size: 1.6rem; }
.rainoff-story-details .rainoff-panel-label { margin: 0 0 1.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 1.3rem; color: #bdbdbd; }
.rainoff-story-details dl { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.6rem; margin: 0; }
.rainoff-story-details dt { font-weight: 600; margin: 0; }
.rainoff-story-details dd { margin: 0; }
.rainoff-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
.entry-content .rainoff-btn { display: inline-block; padding: .9rem 1.8rem; background: #fff; color: #000; border: 1px solid #fff; text-decoration: none; font-weight: 600; }
.entry-content .rainoff-btn-outline { background: transparent; color: #fff; }
.entry-content .rainoff-btn:hover, .entry-content .rainoff-btn:focus { background: #d0d0d0; border-color: #d0d0d0; color: #000; text-decoration: underline; }

/* The logo already carries the name; the tagline is kept for SEO but hidden (as on the previous theme). */
.site-description { display: none; }

/* ---------- Header: same as the original static site (values converted from 16px rem to px) ---------- */
.rainoff-site-header { background: #030405; color: #fff; position: relative; z-index: 10; margin-bottom: 4.8rem; font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.rainoff-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.rainoff-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.rainoff-logo-h { margin: 0; font-size: inherit; line-height: 0; }
.rainoff-logo { display: block; flex: 0 1 auto; line-height: 0; }
.rainoff-logo img { display: block; width: min(304px, 56vw) !important; height: auto !important; max-height: none; }
.rainoff-nav-toggle {
	display: none; align-items: center; gap: 8px; background: transparent !important; color: #fff !important;
	border: 1px solid rgba(255,255,255,.45); border-radius: 4px; padding: 7.2px 12px;
	font: 500 12.8px/1 "Figtree", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; text-decoration: none !important;
}
.rainoff-nav-toggle .bars, .rainoff-nav-toggle .bars::before, .rainoff-nav-toggle .bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: ""; }
.rainoff-nav-toggle .bars::before { position: absolute; top: -6px; } .rainoff-nav-toggle .bars::after { position: absolute; top: 6px; }
.rainoff-site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 25.6px; }
.rainoff-site-nav li { margin: 0; }
.rainoff-site-nav a {
	color: #fff; text-decoration: none; font-weight: 500; font-size: 12.8px; line-height: 1.7; letter-spacing: .14em; text-transform: uppercase;
	padding: 5.6px 0; border-bottom: 2px solid transparent; display: inline-block;
}
.rainoff-site-nav a:hover, .rainoff-site-nav a:focus { color: #9bbd3c; }
.rainoff-site-nav .current-menu-item > a, .rainoff-site-nav .current-menu-parent > a, .rainoff-site-nav .current-post-ancestor > a { border-bottom-color: #9bbd3c; }
.rainoff-site-header :focus-visible { outline: 3px solid #9bbd3c; outline-offset: 3px; }
@media (min-width: 880px) { .rainoff-wrap { padding: 0 40px; } }
@media (max-width: 879.98px) {
	.rainoff-js .rainoff-nav-toggle { display: inline-flex; }
	.rainoff-js .rainoff-site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #030405; border-top: 1px solid #222; padding: 8px 20px 20px; }
	.rainoff-js .rainoff-site-nav.open { display: block; }
	.rainoff-js .rainoff-site-nav ul { flex-direction: column; gap: 0; }
	.rainoff-js .rainoff-site-nav a { display: block; padding: 12.8px 0; font-size: 14.4px; border-bottom: 1px solid #1d1f1f; }
	.rainoff-js .rainoff-site-nav .current-menu-item > a, .rainoff-js .rainoff-site-nav .current-menu-parent > a, .rainoff-js .rainoff-site-nav .current-post-ancestor > a { color: #9bbd3c; border-bottom-color: #1d1f1f; }
	.rainoff-header-inner { padding-top: 11.2px; padding-bottom: 11.2px; }
	html:not(.rainoff-js) .rainoff-header-inner { flex-wrap: wrap; }
	.rainoff-js .rainoff-header-inner { flex-wrap: nowrap; }
}
.rainoff-nav-toggle:hover, .rainoff-nav-toggle:focus { background: transparent !important; color: #fff !important; text-decoration: none !important; }

/* ---------- Home (front-page.php): original static home layout, on black. 16px-rem values converted to px. ---------- */
.home .rainoff-site-header { margin-bottom: 0; }
.rainoff-home { font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 300; font-size: 17px; line-height: 1.7; color: #e9eae5; background: #000; }
.rainoff-home h1, .rainoff-home h2 { font-family: Optima, "Optima Nova", "URW Classico", Candara, "Tenor Sans", "Segoe UI", sans-serif; font-weight: 600; color: #fff; letter-spacing: -0.01em; line-height: 1.2; font-synthesis: none; }
.rainoff-home p { margin: 0 0 16px; }
.rainoff-home a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.rainoff-home a:hover, .rainoff-home a:focus { color: #9bbd3c; }
.rainoff-home :focus-visible { outline: 3px solid #9bbd3c; outline-offset: 3px; }
.rh-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.rh-section { padding: clamp(48px, 6vw, 88px) 0; }
.rh-section + .rh-section { border-top: 1px solid #1d1f1f; }
.rh-band { background: #000; }
.rh-dark { background: #000; color: #e9eae5; }
.rh-center { text-align: center; }
.rh-center .rh-btn-row { justify-content: center; }
.rh-eyebrow { margin: 0 0 9.6px !important; font-size: 12.8px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: #c9cbc4; }
.rh-meta { color: #c9cbc4; }
.rh-section-head { text-align: center; max-width: 704px; margin: 0 auto 40px; }
.rh-section-head h2 { margin: 0 0 12.8px; font-size: clamp(28.8px, 20.8px + 2vw, 41.6px); }
.rh-section-head p { margin: 0; }

/* Buttons (original green, white text) */
.rh-btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.rainoff-home .rh-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 46.4px; box-sizing: border-box;
	padding: 12.8px 25.6px; background: #567532; color: #fff; border: 1px solid #567532; border-radius: 4px;
	font: 500 13.12px/1.2 "Figtree", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}
.rainoff-home .rh-btn:hover, .rainoff-home .rh-btn:focus { background: #405825; border-color: #405825; color: #fff; text-decoration: underline; }
.rainoff-home .rh-btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.rainoff-home .rh-btn-outline:hover, .rainoff-home .rh-btn-outline:focus { background: #fff; border-color: #fff; color: #030405; }

/* Photos: always whole, never cropped */
.rh-photo { margin: 0; }
.rh-photo img { display: block; width: auto !important; height: auto !important; max-width: min(100%, 960px); max-height: min(80vh, 960px); margin: 0 auto; object-fit: contain; }

/* Hero */
.rh-hero { background: #030405; color: #fff; padding: 24px 0 40px; }
.rh-hero .rh-photo img { max-height: min(76vh, 960px); }
.rh-hero-caption { text-align: center; margin-top: 16px; }
.rh-hero-caption p { margin: 0; }
.rh-hero-species { font-family: Optima, "Optima Nova", "URW Classico", Candara, "Tenor Sans", "Segoe UI", sans-serif; font-weight: 600; font-size: clamp(24px, 17.6px + 1.6vw, 36.8px); line-height: 1.2; color: #fff; }
.rh-hero-place { margin: 5.6px 0 0 !important; font-size: 12.8px; letter-spacing: .16em; text-transform: uppercase; color: #c9cbc4; }
.rh-hero-caption p:last-child { margin-top: 16px; }
.rh-hero-caption a { color: #9bbd3c; }
.rh-hero-caption a:hover { color: #fff; }

/* Mission */
.rh-mission { text-align: center; }
.rh-mission h1 { margin: 0 auto; max-width: 38ch; font-size: clamp(23.2px, 16.8px + 1.7vw, 37.6px); line-height: 1.35; text-wrap: balance; }

/* Split */
.rh-split { display: grid; gap: 32px; align-items: center; }
.rh-split h2 { margin: 0 0 16px; font-size: clamp(27.2px, 19.2px + 1.8vw, 40px); }
.rh-h2-prints { font-size: clamp(28.8px, 20.8px + 2vw, 41.6px); margin: 0 0 12.8px; }

/* Masonry of whole tiles (CSS columns) */
.rh-masonry { columns: 1; column-gap: 24px; list-style: none; margin: 0; padding: 0; }
.rh-tile { break-inside: avoid; margin: 0 0 28px; display: block; }
.rainoff-home .rh-tile a { display: block; text-decoration: none; color: inherit; }
.rh-tile img { display: block; width: 100%; height: auto !important; }
.rh-tile-text { display: block; padding-top: 10.4px; }
.rh-tile-title { display: block; font-family: Optima, "Optima Nova", "URW Classico", Candara, "Tenor Sans", "Segoe UI", sans-serif; font-weight: 600; font-size: 18.4px; color: #fff; line-height: 1.3; }
.rh-tile-meta { display: block; font-size: 13.6px; color: #c9cbc4; }
.rainoff-home .rh-tile a:hover .rh-tile-title { color: #9bbd3c; text-decoration: underline; }

/* Meet the photographer */
.rh-portrait { margin: 0 auto; max-width: 288px; }
.rh-portrait img { display: block; width: 100%; height: auto !important; object-fit: contain; }

/* Conservation */
.rh-stat { font-family: Optima, "Optima Nova", "URW Classico", Candara, "Tenor Sans", "Segoe UI", sans-serif; font-weight: 600; font-size: clamp(20px, 16px + 1vw, 27.2px); line-height: 1.4; color: #fff; max-width: 736px; margin: 0 auto !important; text-wrap: balance; }

@media (min-width: 640px) { .rh-masonry { columns: 2; } }
@media (min-width: 880px) {
	.rh-wrap { padding: 0 40px; }
	.rh-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; }
	.rh-split.rh-reverse { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
	.rh-split.rh-reverse > :first-child { order: 2; }
	.rh-masonry { columns: 3; column-gap: 32px; }
}

/* Portfolio page (page-portfolio.php, Eksell grid) */
.rainoff-portfolio-more { text-align: center; margin-top: 4rem; }
#site-content.rainoff-home { display: block; overflow: visible; align-items: initial; }
.rainoff-home > section { width: 100%; }
