/*
Theme Name: Paul McAlenan
Version: 0.1.8
Description: Theme for Paul McAlenan Website
Author: Paul McAlenan
Author URI: https://paulmcalenan.co.uk
*/

@import url('./assets/css/reset.css');
/* @import url('./assets/css/typography-min.css'); */

@font-face {
	font-family: 'Lexend';
	font-weight: 400;
	src: url('./assets/fonts/Lexend-Regular.woff2') format('woff2');
}

@font-face {
	font-family: 'Lexend';
	font-weight: 300;
	src: url('./assets/fonts/Lexend-Light.woff2') format('woff2');
}

@font-face {
	font-family: 'Lexend';
	font-weight: 500;
	src: url('./assets/fonts/Lexend-Medium.woff2') format('woff2');
}


/* Global variables
--------------------------------------------- */
:root {
	--black: #000;
	--charcoal: #36454F;
	--dimgrey: #696969;
	--grey: #808080;
	--darkgrey: #A9A9A9;
	--silver: #C0C0C0;
	--lightgrey: #D3D3D3;
	/* --blue: #4076ff; */
	--blue: #409CFE;
	--white: #FFF;
	--text: #212121;
	--text-color: #36454f;
	--background-hover: gainsboro;
	--background-color: #ffffff;
}

html {
	font-family: 'Lexend', sans-serif;
}

body {
	display: grid;
	grid-template-columns:
		[full-width-start] 1fr 
		[content-start] min(40rem, 90%) [content-end]
		1fr [full-width-end]; 
	grid-auto-rows: auto auto 1fr auto;
	row-gap: 2rem;
	margin: 0;
	color: var(--text);
	background-color: var(--background-color);
	font-size: 1.25rem;
	font-weight: 300;
	line-height: 1.5;
}

body > *:not(nav) {
	grid-column: 2;
}

body > nav {
	grid-column: content;
	/* margin: auto; */
	margin-top: -1rem;
}

h1, h2, h3, h4, h5, h6 {
	clear: both;
	font-weight: normal;
	/* margin: 0 0 1rem 0; */
}

/* Format headers */
body:is(.home) h1 {
	/* font-size: 3rem; */
	font-size: 9vw;
}

h1 {
	font-size: 1.75rem;
}

header h1 {
	letter-spacing: 0.1em;
}

/* Smaller font size for the privacy page h1 */
.privacy-policy section h1 {
	font-size: 1.75rem;
}

h2 {
	font-size: 1.5rem;
}

/* Prevent long urls/links from overflowing container */
p {
	overflow-wrap: break-word;
}

big {
	font-size: 125%;
}

small {
  font-size: 85%;
}

strong {
	font-weight: 500;
}

/* Set a tags to --blue except in the menu */
a:not(header h1 a, menu > a, address a, a:has(button))  {
	color: var(--blue);
}

main + footer :is(p, a) {
	font-size: 1rem;
}

main {
	display: grid;
    grid-auto-rows: min-content;
    row-gap: 1rem;
	margin-bottom: 1rem;
}

body > header {
	padding-top: 2rem;
}

main header + nav li {
	display: inline-block;
	font-size: 1.125rem;

}

body:not(.contact) address {
    padding: 1rem 1.5rem;
    border: 2px solid var(--darkgrey);
    border-radius: 2px;
}

address p {
    margin-bottom: .5rem;
}

address :is(.email, .phone) {
    font-size: 1.5rem;
    /* font-weight: normal; */
}

figure > div.box-shadow {
	border: 1px solid var(--silver);
    box-shadow: 0px 1px 5px #888888;
}
  
:is(.home) main > p:first-child {
	font-size: 1.5rem;
}
  
main + footer {
	display: grid;
	row-gap: .5rem;
    margin: 0 -20px -2rem;
    padding: 1rem 20px;
    background-color: #ececec;
    /* font-weight: normal; */
}

:is(header, main + footer) span {
    display: none;
}

 
img {
	max-width: 100%;
	height: auto;
	border-radius: 3px;
}
  
figure > div {
	position: relative;
	display: block;
	width: 100%;
	height: 0;
	margin: 0;
	/* margin-bottom: 1.5rem; */
	background-size: contain;
	background-repeat: no-repeat;
	border: none;
  }

figure > img {
	display: block;
	margin-inline: auto;
}

figcaption {
	/* position: absolute; */
	bottom: calc(-1.125rem * 1.5 - .25rem);
	right: 0;
	font-size: 1.125rem;
    text-align: right;
}

main > section {
    padding: 1rem;
    border: 2px solid var(--darkgrey);
    border-radius: 2px;
    display: grid;
    row-gap: .5rem;
    margin-bottom: 1rem;
}

main ul li {
	list-style-type: disc;
	list-style-position: outside;
	margin-left: 1.25rem;	
}
  
/* Screen reader link */
.screen-reader-text {
	border: 0;
	clip: rect(1px,1px,1px,1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal!important;
}

.screen-reader-text:focus {
	background-color: #ddd;
	clip: auto!important;
	clip-path: none;
	color: #444;
	display: block;
	font-size: 1em;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/*--------------------------------------------------------------
# NAVIGATION
--------------------------------------------------------------*/
nav *, a[href="#"] {
	/* margin-bottom: 1rem; */
	/* text-transform: uppercase; */
	transition: background 0.6s;
}

button, a[href="#"], input[type="submit"] {
	width: fit-content;
	overflow: hidden;
	padding: .5rem;
	border: 2px solid var(--darkgrey);
	border-radius: 2px;
	color: var(--dimgrey);
	cursor: pointer;
}

menu a {
	display: block;
	padding: 0.5rem;
}

/* Toggle nav button */
nav > menu {
/* nav button + menu { */
	display: none;
}

.menu-open nav button + menu {
	display: block;
	margin-top: 1rem;
	border: 2px solid var(--darkgrey);
    border-radius: 5px;
    /* background-color: whitesmoke; */
    /* box-shadow: -3px 3px 8px #888888; */
}

/* Background color of button when nav menu is visible */
.menu-open nav button {
	background-color: var(--background-hover);
}

nav menu > a[aria-current="page"] {
	background-color: var(--background-hover);
}

nav menu > a.sub-item {
	padding-left: 1.5rem;
}

main nav {
	display: none;
}

@media ( min-width: 768px ) {

	nav {
		place-items: center;
	}

	nav > menu {
		/* display: inline-flex; */
		display: grid;
		grid-template-columns: auto auto auto auto auto auto;
		column-gap: .5rem;
		row-gap: .5rem;
	}

	nav a + menu {
		grid-column: 1/-1;
	}

	
body > nav {
	grid-column: full-width;
}

}

/* added to the javascript to remove focus-within */
:is(nav button, menu > a, input[type="submit"], a[href="#"]):is(:hover, :focus-within) {
	background-color: var(--background-hover);
}

a[href="#"] {
	width: fit-content;
	margin-left: auto;
	border-radius: 5px;
}

a[href="#"] svg {
    display: revert;
    vertical-align: text-top;
}

.condition {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-column: 1 / 2;
    column-gap: 0.1rem;
}

.condition span:first-child {
	margin-top: -2px;
}

.condition span:last-child {
	grid-column: 2;
	font-size: 1rem;
}

/*--------------------------------------------------------------
# CONTACT FORM
--------------------------------------------------------------*/
.wpcf7 form {
	display: grid;
	grid-auto-rows: auto;
}

.wpcf7 form label {
	margin-bottom: 0.5rem;
}

.wpcf7 form input:not([type="submit"]) {
	width: 100%;
}

.wpcf7 form textarea {
	width: 100%;
	resize: vertical;
	border: 2px solid var(--darkgrey);
	border-radius: 2px;
	padding: 1%;
	background: linear-gradient(135deg, WhiteSmoke, WhiteSmoke 98%, #fff 95%); /* https://developer.mozilla.org/en-US/docs/Web/CSS/resize */
}

/* next 4 declarations for verification not implemented */
.wpcf7 form input:not([type="checkbox"], [type="submit"]) {
	border: 2px solid var(--darkgrey);
	border-radius: 2px;
	padding: 1%;
	background-color: whitesmoke;
}

.wpcf7 form input[type="submit"] {
	width: fit-content;
	margin-top: 0.5rem;
	cursor: pointer;
	border-radius: 10px;
}

.wpcf7 form div.submit {
	display: grid;
	grid-template-columns: auto;
}

.wpcf7 form div.submit .agree {
	grid-row: 1;
	grid-column: 2/-1;
	align-self: center;
}

label:has(input.acceptance)::before {
	content: "";
	display: inline-block;
	width: 32px;
	height: 32px;
	border: 2px solid var(--darkgrey);
}

/* Contact Form Errors
--------------------------------------------------------------*/
.wpcf7-not-valid-tip {
	display: none !important;
}

.invalid label span {
	color: red;
}

.wpcf7 form :is(:is(input, textarea):has(+ .wpcf7-not-valid-tip), .wpcf7-response-output) {
	border-width: 2px;
	border-color: rgba(255, 0, 0, 0.5);
	/* box-shadow: 0 0 5px red; */
}

.wpcf7 form :is(input, textarea):has(+ .wpcf7-not-valid-tip)::placeholder {
color: red;
}

.wpcf7 form:is(.sent, .invalid, .failed) .wpcf7-response-output {
	border-width: 3px;
	border-radius: 2px;
}

.wpcf7 form:is(.invalid, .failed) .wpcf7-response-output {
	margin: 2rem 0 1rem 0;
	border-color: rgba(255, 0, 0, 0.5) !important;
}

.wpcf7 form .wpcf7-response-output {
	order: -1;
	margin: 0 0 0.5rem 0;
}

/* Contact Form I Agree checkbox
-------------------------------------------------------------- */
.wpcf7 form input[type="checkbox"] {
	display: inline-block;
	width: 30px;
	height: 30px;
	position: absolute; 
	left: 10px;
	top: 3px;
}

.wpcf7 form input[type="checkbox"]:checked {
	/* display: inline-block; */
	transform: rotate(45deg);
	height: 22px;
	width: 10px;
	border-bottom: 4px solid grey;
	border-right: 4px solid grey;
	border-top: 0;
	border-left: 0
  }

.wpcf7 form input[type="checkbox"] + span {
	display: inline-flex;
	margin-left: 0.5rem;
}

/*--------------------------------------------------------------
# COOKIES
-------------------------------------------------------------- */
#cookie-dialog {
	z-index: 9999;
	position: fixed;
	max-width: 600px;
	bottom: 0;
	right: 0;
	padding: 1rem 1rem 1rem 1.5rem;
	background: var(--lightgrey);
	border-radius: 0;
	box-shadow:rgba(23,43,99,.4) 0 7px 28px
}

@media ( min-width: 768px ) {

	#cookie-dialog {
		height: fit-content;
		top: inherit;
		top: 3%;
		right: 2%;
		border: 1px solid rgba(0, 0, 0, .15);
		border-radius: 5px;
		background: #fff;
	}

	#cookie-dialog p {
		font-size: 1rem;
	}
	
}

#cookie-dialog p {
	margin: 0;
	font-size: 1.175rem;
	color: #000;
	padding-right: 6.0rem;
}

#cookie-dialog button {
	position:absolute;
	right: 1.5rem;
	top: 20px;
	display: inline-block;
    width: fit-content;
	padding: 1% 2%;
	cursor: pointer;
	border: 2px solid var(--darkgrey);
	border-radius: 50px;
    border-radius: 10px;
	transition: 0.6s;
}

#cookie-dialog button:hover { background-color: var(--silver); }

main > *:not(a[href="#"]) {
	min-width: 100%;
}

/*--------------------------------------------------------------
# SITE IMAGES
-------------------------------------------------------------- */
._01 > div {
	background-image: url('./assets/images/golden_triangle_norwich_loft_conversion_01.webp');
	padding-top: 71.7188%;
}

._02 > div {
	background-image: url('./assets/images/timber_frame_extension_lakenham_norwich.webp');
	padding-top: 75%;
}

._03 > div {
	background-image: url('./assets/images/not_permitted_development.webp');
	padding-top: 66.4062%;
}

._04 > div {
	background-image: url('./assets/images/proposed_extension_rear_elevation.webp');
	padding-top: 66.4063%;
}

._05 > div {
	background-image: url('./assets/images/construction_detail_01.webp');
	padding-top: 74.8438%;
}

._06 > div {
	background-image: url('./assets/images/construction_detail_02.webp');
	padding-top: 56.5625%;
}

._07 > div {
	background-image: url('./assets/images/could_be_permitted_development_01.webp');
	padding-top: 66.41%;
}

._08 > div{
	background-image: url('./assets/images/side_extension_thorpe_hamlet.webp');
	padding-top: 100%;
}

._09 > div {
	background-image: url('./assets/images/rear_extension_cringleford.webp');
	padding-top: 73.9599%;
}

._10 > div {
	background-image: url('./assets/images/town_close_loft.webp');
	padding-top: 72.6562%;
}

._11 > div {
	background-image: url('./assets/images/oak_stairs_loft_conversion.webp');
	padding-top: 100%;
}

._12 > div {
	background-image: url('./assets/images/golden_triangle_norwich_loft_conversion_02.webp');
	padding-top: 75%;
}

._13 > div {
	background-image: url('./assets/images/rockland_roof_extension.webp');
	padding-top: 75%;
}

._14 > div {
	background-image: url('./assets/images/extension_earlham_road.webp');
	padding-top: 75%;
}

._15 > div {
	background-image: url('./assets/images/studio_extension.webp');
	padding-top: 100%;
}

._16 > div {
	background-image: url('./assets/images/roof_extension_concept.webp');
	padding-top: 46.8259%;
}

._17 > div {
	background-image: url('./assets/images/golden_triangle_house_remodel.webp');
	padding-top: 75%;
}

._18 > div {
	background-image: url('./assets/images/golden_triangle_kitchen_remodel.webp');
	padding-top: 75%;
}

.paul > div {
	background-image: url('./assets/images/paul_mcalenan.webp');
	padding-top: 53.2813%;
}

@media only screen and (min-width: 768px) {
	br {
        display: none;
    }
	
	h1 {
		font-size: 2rem;
	}

	body:is(.home) h1 {
		font-size: 2.5rem;
	}

	body > header {
		grid-column: content;
		/* grid-column: 2 / -1; */
	}

	menu {
		max-width: 900px;
	}

	main + footer {
		display: grid;
		grid-template-columns: auto auto;
		grid-auto-rows: auto;
		align-content: end;
		column-gap: 2rem;
		justify-content: space-between;
		margin: 0;
		padding: 1rem 0 3rem 0;
		border-top: 1px solid var(--darkgrey);
		background-color: revert;
	}

	main + footer p {
		margin-bottom: 0;
	}
	
	main + footer p:nth-child(1) {
		grid-column: 1 / 2;
		grid-row: 1;
	}
	
	main + footer p:nth-child(2) {
		grid-column: 1 / 3;
		grid-row: 2;
	}

	main + footer .address {
		grid-column: 1 / -1;
		grid-row: 3;
	}
	
	main + footer span {
		display: inline;
	}

	body:not(.contact) address > section {
		display: flex;
		justify-content: space-between;
	}
		
	:is(header, figcaption, main + footer .me) br {
		display: none;
	}

	:is(header, figcaption, main + footer) span {
		display: inline;
	}

	/* Navigation
	-------------------------------------------------------------- */
	/* Remove nav button and set menu to visible */
	nav button {
		display: none;
	}

	/* nav button + menu, menu {
		display: flex;
		flex-flow: row wrap;
		column-gap: .5rem;
		row-gap: .5rem;
		/* border: revert; */
	/* } */

	menu a {
		border: 2px solid var(--darkgrey);
		border-radius: 2px;
		transition: background 0.6s;
	}

	menu > menu {
		display: none;
		order: 1;
		font-size: 1.125rem;
	}

	.planning menu > menu {
		display: flex;
	}
/* 
	nav button + menu li, main menu a.sub-item li  {
		border: 2px solid var(--darkgrey);
		border-radius: 2px;
		transition: background 0.6s;
	} */
	
	/* nav menu > a.sub-item {
		display: none;
	} */
/* 
	main nav {
		display: block;
		margin-top: -1rem;
		font-size: 1.125rem;
	} */

	/* main menu a.sub-item {
		display: inline-block;
	} */

	menu > menu a.sub-item li {
		padding-left: .5rem;
	} 

}

details {
	display: inline;
}