/* AB Collection: andyblundell.co.uk look */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,400;0,500;0,700;0,800;1,400&display=swap');

:root {
	--ab-bg: #080808;
	--ab-ink: #f2efe8;
	--ab-muted: #8f8a80;
	--ab-line: #222;
	--ab-c1: #e0693f;
	--ab-c2: #5b82c9;
	--ab-c3: #e2b13c;
	--ab-c4: #5fae86;
}

/* ---------- Base ---------- */

/* Divi's own body text colour (used for text modules, and in the builder) follows the site's ink colour */
body {
	--gcid-body-color: var(--ab-ink);
}

body,
#page-container,
#main-content,
.et_pb_section {
	background-color: var(--ab-bg);
}

body,
.et_pb_text,
.entry-content {
	color: var(--ab-ink);
	font-family: 'Inter Tight', system-ui, sans-serif;
	font-size: 18px;
	line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 {
	color: var(--ab-ink);
	font-family: 'Inter Tight', system-ui, sans-serif;
}

/* Big headings only inside Divi layouts, not sidebars or widgets */
.et_pb_section h1,
.et_pb_section h2,
.et_pb_section h3 {
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: -0.05em;
	line-height: 0.88;
	padding-bottom: 0.2em;
}

.et_pb_section h1 { font-size: clamp(64px, 14vw, 240px); }
.et_pb_section h2 { font-size: clamp(44px, 8vw, 128px); }
.et_pb_section h3 { font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.03em; }

a { color: var(--ab-c1); }

/* ---------- Frosted header ---------- */

#main-header {
	background-color: transparent !important;
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	box-shadow: none;
}

#main-header #logo,
#top-menu a {
	font-family: 'Inter Tight', system-ui, sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ab-ink) !important;
}

#top-menu a { opacity: 0.55; }
#top-menu a:hover,
#top-menu li.current-menu-item > a { opacity: 1; }

/* ---------- Entry pages ---------- */

.ab-entry-img,
.ab-group-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.ab-entry-group,
.ab-group-parent {
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ab-c1);
}

.ab-latin {
	font-style: italic;
	color: var(--ab-c3);
	font-size: clamp(22px, 2vw, 30px);
}

/* ---------- [ab_list]: entry cards ---------- */

.ab-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: clamp(20px, 2.5vw, 32px);
}

.ab-card {
	display: block;
	color: var(--ab-ink);
}

.ab-card-img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 4px;
	transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
}

.ab-card:hover .ab-card-img { transform: scale(1.03); }

.ab-card-title {
	display: block;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.2;
	margin-top: 14px;
}

.ab-card-sub {
	display: block;
	font-style: italic;
	font-size: 16px;
	color: var(--ab-muted);
}

/* ---------- [ab_children]: coloured group tiles ---------- */

.ab-groups {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: clamp(20px, 2.5vw, 32px);
}

.ab-group {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	aspect-ratio: 4 / 3;
	padding: 24px;
	border-radius: 6px;
	overflow: hidden;
	color: var(--ab-bg);
	transition: transform 0.15s ease-out;
}

.ab-group:hover { transform: translateY(-4px); }
.ab-group:nth-child(4n+1) { background: var(--ab-c1); }
.ab-group:nth-child(4n+2) { background: var(--ab-c2); }
.ab-group:nth-child(4n+3) { background: var(--ab-c3); }
.ab-group:nth-child(4n+4) { background: var(--ab-c4); }

.ab-group-title {
	font-weight: 800;
	font-size: clamp(26px, 2.2vw, 36px);
	line-height: 0.9;
	letter-spacing: -0.04em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

/* ---------- Pattern sections (add the classes in Divi section settings) ----------
	ab-pattern ab-swirls  or  ab-pattern ab-triang
*/

.et_pb_section.ab-pattern {
	border-top: 1px solid #fff;
	border-bottom: 1px solid #fff;
}

.et_pb_section.ab-swirls {
	background-color: #1d2433;
	background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)), url('swirls-and-sparkles-tile.svg');
	background-size: 100% 140px, 240px 240px;
	background-repeat: no-repeat, repeat;
	background-position: top left, top left !important;
}

.et_pb_section.ab-triang {
	background-color: #292323;
	background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)), url('triang-1-tile.svg');
	background-size: 100% 140px, 180px 311.77px;
	background-repeat: no-repeat, repeat;
	background-position: top left, top left !important;
}

.ab-pattern .ab-group,
.ab-pattern .ab-card,
.ab-pattern .et_pb_module.ab-float {
	will-change: transform;
	transform: translateZ(0);
	box-shadow: 70px 120px 60px rgba(0, 0, 0, 0.5);
}

.ab-pattern .ab-card {
	background: var(--ab-bg);
	padding: 12px 12px 16px;
	border-radius: 6px;
}

.ab-pattern h2 {
	display: inline-block;
	background: var(--ab-ink);
	color: var(--ab-bg);
	padding: 0.08em 0.18em 0.02em;
}

/* ---------- Theme Builder header ---------- */

.et-l--header .et_pb_section {
	background-color: transparent !important;
	padding: 14px 0 !important;
	z-index: 99;
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.et-l--header .et_pb_row { padding: 0 !important; }

.ab-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	flex-wrap: wrap;
}

.ab-mark {
	font-weight: 800;
	font-size: 20px;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: var(--ab-ink) !important;
}

.ab-header .ab-nav { margin-left: auto; }

.ab-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.ab-menu li { list-style: none; padding: 0 !important; }

.ab-menu a {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ab-ink) !important;
	opacity: 0.55;
	transition: opacity 0.2s;
}

.ab-menu a:hover,
.ab-menu .current-menu-item > a { opacity: 1; }

/* ---------- Search ---------- */

.ab-search input {
	background: transparent;
	border: 1px solid #333;
	border-radius: 4px;
	color: var(--ab-ink);
	font-family: 'Inter Tight', system-ui, sans-serif;
	font-size: 15px;
	padding: 6px 10px;
	width: 160px;
}

.ab-search input:focus {
	outline: none;
	border-color: var(--ab-c1);
}

.ab-search-page {
	width: 90%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 80px 0 120px;
}

.ab-search-page h1 {
	font-weight: 800;
	font-size: clamp(64px, 12vw, 200px);
	line-height: 0.86;
	letter-spacing: -0.05em;
	text-transform: uppercase;
}

.ab-search-big input {
	width: 100%;
	max-width: 520px;
	font-size: 20px;
	padding: 12px 14px;
	margin: 32px 0 16px;
}

.ab-search-count {
	color: var(--ab-muted);
	margin-bottom: 32px;
}

@media (max-width: 760px) {
	.ab-header .ab-nav { margin-left: 0; width: 100%; }
	.ab-search { width: 100%; }
	.ab-search input { width: 100%; }
}

/* ---------- Entry and group pages: smaller titles, tighter spacing, no empty sections ---------- */

.single-ab_entry .et_pb_section h1,
.page-template-group .et_pb_section h1 {
	font-size: clamp(44px, 7vw, 112px);
}

.page-template-group #main-content .et_pb_section {
	padding-top: 16px;
	padding-bottom: 16px;
}

.page-template-group #main-content .et_pb_section:first-child {
	padding-top: 64px;
}

.ab-crumb:empty,
.ab-latin:empty,
.ab-group-text:empty {
	display: none;
}

.et_pb_section:has(.ab-groups:empty),
.et_pb_section:has(.ab-list:empty) {
	display: none;
}

/* ---------- Images, galleries and videos inside entry text ---------- */

.ab-entry-text .ab-content-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
	margin: 24px 0;
}

.ab-entry-text .ab-video iframe {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 4px;
	margin: 24px 0;
}

.ab-entry-text .gallery {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
	margin: 24px 0 !important;
}

.ab-entry-text .gallery .gallery-item {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
}

.ab-entry-text .gallery img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border: 0 !important;
	border-radius: 4px;
}

.ab-entry-text .gallery br { display: none; }


/* ---------- Andy Blundell entries ---------- */

/* A section or row whose shortcodes all came back empty takes up no space */
.et_pb_section:has(.ab-slot):not(:has(.ab-slot:not(:empty))),
.et_pb_row:has(.ab-slot):not(:has(.ab-slot:not(:empty))) {
	display: none;
}

/* Crumb sits tight on the title everywhere (Divi only removes paragraph padding from the last paragraph) */
#main-content .ab-crumb {
	padding-bottom: 0 !important;
}

/* Empty paragraphs WordPress adds around shortcodes */
.ab-slot p:empty {
	display: none;
}

/* A picture at the very start of the text doesn't add its own gap under the title */
.ab-entry-text > p:first-child .ab-content-img {
	margin-top: 0;
}

/* Featured image: always fills its column, whole picture, never cropped */
.ab-entry-image a {
	display: block;
	cursor: zoom-in;
}

.ab-entry-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

/* Text under a landscape image (or with no image): paragraphs and headings at a readable line length,
   pictures, galleries and videos at full width */
.ab-entry-text.ab-wide > :not(:has(img, iframe, .gallery)):not(.gallery) {
	max-width: 720px;
}

/* Gallery section */
.ab-entry-gallery .gallery {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
	margin: 0 !important;
}

.ab-entry-gallery .gallery .gallery-item {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
}

.ab-entry-gallery .gallery img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border: 0 !important;
	border-radius: 4px;
	cursor: zoom-in;
}

.ab-entry-gallery .gallery br {
	display: none;
}

/* Lightbox */
.ab-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(8, 8, 8, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	cursor: zoom-out;
}

.ab-lightbox img {
	max-width: 92vw;
	max-height: 88vh;
	border-radius: 4px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.ab-lightbox button {
	position: absolute;
	background: none;
	border: 0;
	color: #f2efe8;
	font-family: 'Inter Tight', system-ui, sans-serif;
	font-size: 64px;
	line-height: 1;
	padding: 16px 24px;
	opacity: 0.6;
	cursor: pointer;
}

.ab-lightbox button:hover { opacity: 1; }
.ab-lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.ab-lb-next { right: 0; top: 50%; transform: translateY(-50%); }
.ab-lb-close { right: 0; top: 0; font-size: 48px !important; }
.ab-lb-single .ab-lb-prev,
.ab-lb-single .ab-lb-next { display: none; }

/* When the title section is hidden (portrait layout), the next section gets the top spacing */
.page-template-entry #main-content .et_pb_section:first-child:has(.ab-slot):not(:has(.ab-slot:not(:empty))) + .et_pb_section {
	padding-top: 64px;
}

/* No sidebar anywhere on this site (404, search and any non-builder page) */
#sidebar { display: none; }
#main-content .container::before { display: none; }
#left-area { width: 100%; padding-right: 0; float: none; }

/* ---------- Homepage ---------- */

/* Section heading with an optional "All ..." link on the right */
.ab-sec-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 32px;
}

.ab-sec-head h2 { padding-bottom: 0; }

.ab-sec-head a {
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.ab-intro p {
	font-size: clamp(20px, 1.6vw, 26px);
	max-width: 720px;
}

/* Entries with no picture (e.g. Lab) show as coloured tiles */
.ab-card:not(:has(img)) {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	aspect-ratio: 4 / 3;
	padding: 24px;
	border-radius: 6px;
	color: var(--ab-bg);
	transition: transform 0.15s ease-out;
}

.ab-card:not(:has(img)):hover { transform: translateY(-4px); }
.ab-card:not(:has(img)):nth-child(4n+1) { background: var(--ab-c1); }
.ab-card:not(:has(img)):nth-child(4n+2) { background: var(--ab-c2); }
.ab-card:not(:has(img)):nth-child(4n+3) { background: var(--ab-c3); }
.ab-card:not(:has(img)):nth-child(4n+4) { background: var(--ab-c4); }

.ab-card:not(:has(img)) .ab-card-title {
	font-weight: 800;
	font-size: clamp(26px, 2.2vw, 36px);
	line-height: 0.9;
	letter-spacing: -0.04em;
	text-transform: uppercase;
	margin-top: 0;
}

.ab-card:not(:has(img)) .ab-card-sub {
	color: var(--ab-bg);
	font-style: normal;
	opacity: 0.75;
	margin-top: 8px;
}

.ab-pattern .ab-card:not(:has(img)) { padding: 24px; }

/* Link button inside entry text */
.ab-button {
	display: inline-block;
	background: var(--ab-c1);
	color: var(--ab-bg) !important;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 12px 20px;
	border-radius: 4px;
	margin-top: 16px;
}

/* ---------- Headings inside entry text: smaller than page titles ---------- */

.single-ab_entry .et_pb_section h2 {
	font-size: clamp(30px, 3vw, 48px);
	line-height: 0.95;
}

.single-ab_entry .et_pb_section h3 {
	font-size: clamp(22px, 1.8vw, 30px);
}

.ab-prose h2 { margin-top: 48px; }
.ab-prose h3 { margin-top: 32px; }

/* Same room above headings in a full-width column's text (text width itself is set in Divi: Design, Sizing, Max Width) */
.single-ab_entry .et_pb_column_4_4 .et_pb_text h2 { margin-top: 48px; }
.single-ab_entry .et_pb_column_4_4 .et_pb_text h3 { margin-top: 32px; }

/* Text in a single column: readable line length */
.ab-prose {
	max-width: 720px;
}

.ab-disclaimer {
	color: var(--ab-muted);
	font-size: 15px;
	max-width: 720px;
}

.ab-formula {
	display: inline-block;
	font-size: 1.4em;
	color: var(--ab-c3);
}

/* ---------- Calculator and other forms inside entry text ---------- */

.ab-calc {
	max-width: 720px;
	margin: 24px 0 32px;
	padding: 24px;
	border: 1px solid #2a2a2a;
	border-radius: 6px;
}

.ab-calc-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 16px;
}

.ab-calc-fields label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 15px;
	color: var(--ab-muted);
}

.ab-calc input[type="number"],
.ab-calc input[type="text"] {
	background: var(--ab-bg);
	border: 1px solid #333;
	border-radius: 4px;
	color: var(--ab-ink);
	font-family: 'Inter Tight', system-ui, sans-serif;
	font-size: 18px;
	padding: 10px 12px;
	width: 100%;
	box-sizing: border-box;
}

.ab-calc input[type="number"]:focus,
.ab-calc input[type="text"]:focus {
	outline: none;
	border-color: var(--ab-c1);
}

.ab-calc-opts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin-bottom: 8px;
}

.ab-calc-opts label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.ab-calc input[type="radio"],
.ab-calc input[type="checkbox"] {
	accent-color: var(--ab-c1);
	width: 18px;
	height: 18px;
	margin: 0;
}

.ab-calc .ab-button {
	border: 0;
	cursor: pointer;
	font-family: 'Inter Tight', system-ui, sans-serif;
	font-size: 15px;
}

.ab-calc-result {
	font-size: 26px;
	font-weight: 800;
	color: var(--ab-c3);
	margin-top: 16px;
	padding-bottom: 0 !important;
}

.ab-calc-result:empty { display: none; }

@media (max-width: 600px) {
	.ab-calc-fields { grid-template-columns: 1fr; }
}

/* Homepage name: capped so BLUNDELL stays on one line on very wide screens */
.et_pb_section .ab-intro h1 {
	font-size: clamp(64px, 14vw, 220px);
}

/* ---------- Hikes (pages built from the Landscape Britain feed by template-hikes.php) ---------- */

.page-template-template-hikes .et_pb_section h1 { font-size: clamp(44px, 7vw, 112px); }
.page-template-template-hikes .et_pb_section h2 { font-size: clamp(30px, 3vw, 48px); }

/* Text on the left, map or photos on the right */
.hike-top,
.hike-step {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: clamp(24px, 4vw, 64px);
	align-items: start;
}

.hike-step { margin-top: clamp(48px, 6vw, 96px); }

.hike-step-text h2,
.hike-parking h2 { margin-top: 0; }

.hike-map img,
.hike-step-images img {
	display: block;
	width: 100%;
	border-radius: 4px;
}

#main-content ul.hike-spec {
	list-style: none;
	padding: 0;
	margin: 20px 0 0;
}

.hike-spec li {
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hike-spec span {
	display: inline-block;
	min-width: 110px;
	color: var(--ab-muted);
}

.hike-parking { margin-top: 28px; }
.page-template-template-hikes .et_pb_section .hike-parking h2 { font-size: clamp(22px, 1.8vw, 30px); }

.hike-step-images figure { margin: 0 0 20px; }

.hike-step-images figcaption {
	color: var(--ab-muted);
	font-size: 15px;
	margin-top: 8px;
}

.hike-locations {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 32px;
}

.hike-locations a {
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 15px;
	color: var(--ab-ink);
}

.page-template-template-hikes .ab-disclaimer { margin-top: 64px; }

@media (max-width: 980px) {
	.hike-top,
	.hike-step { grid-template-columns: 1fr; }
}
