/**
 * set the box-sizing property to border-box
 * all elements will include padding and border in the width and height
 * the star selector is a universal selector - selects all elements
 * the before and after pseudo-elements are included
 * now the width property value will be subtracted to include padding and border
 * default model is content-box - padding and border are added to the width and height
 * works best for most designs 
 * - however if width is small and padding is large overflow can occur
 */
 *,
 *:before,
 *:after {
	box-sizing: border-box;
 }
 
 /**
  * set the min-height to 100dvh
  * dvh is the dynamic viewport height
  * it will adjust based on the changing viewport height
  * if the browser adds controls or the viewport height changes
  * the min-height will adjust to the new height
  */
 html {
	font-family: "Josefin Sans", Arial, sans-serif;
	min-height: 100dvh;
 }
 
 /**
  * multiple backgrounds
  * background is the shorthand property
  * url() is the background-image property
  * repeat-x is the background-repeat property
  * fixed is the background-attachment property
  * top image and the gradient will be fixed to the viewport
  * page content will scroll and the background will remain fixed
  */
 
 /* prettier-ignore */
 body {
	margin: 0;
	min-height: 100dvh;
	background: 
	     radial-gradient(circle, #ffffff, #eff0fb, #dbe2f8, #c3d5f5, #a6caf1, #91c0ec, #79b6e7, #5dace2, #4ba0dd, #3895d8, #2389d3, #007dcd),
		url(images/compressed-image-01.webp) no-repeat left center,
		url(images/compressed-image-02.webp) no-repeat right center;
 }
 
 /**
  * create a grid container
  * no columns or rows are defined
  * the grid will automatically create columns and rows
  * based on the content
  * max-width is 800px
  * div is a block-level element
  * it will try to take up the full width of the container
  * never larger than 800px
  */
 
 .wrapper {
	display: grid;
	max-width: 800px;
	border: 2px solid white;
	border-radius: 10px;
	background: #393b3d;
	margin-top: 10px;
	margin-bottom: 10px;
 }
 
 /**
  * display flex - create a flex container
  * flex direction is row (left to right)
  * all elements will shrink to the minimum size of the content
  * and flow from left to right
  * multiple background images (gradients behave like images)
  * background is the shorthand property
  * url() is the background-image property
  * no-repeat is the background-repeat property
  * top 0px right 0px is the background-position property (x, y)
  * the additional value after the keyword is the offset
  * place the image in the top right corner
  * then move it 0px down and 0px left
  * positive values move in towards the center of the element
  * negative values move out away from the element
  * / 50px 50px is the background-size property (width, height)
  * keyword cover is the background-size property
  * cover will scale the image to cover the entire container
  * contain will scale the image to fit inside the container
  * cover is used most often
  * background color must always be last
  * a stacking order is created
  * first background image/gradient is on top
  * last background image/gradient is on the bottom
  */
 /* prettier-ignore */
 header {
	display: flex;
	border-radius: 10px;
	border: 2px solid gray;
	margin: 20px;
	background:
	    url(images/compressed-image-03.webp) no-repeat left top / 20%,
	    url(images/compressed-image-05.webp) no-repeat right top / 20%,
	    url(images/compressed-image-04.webp) no-repeat center center / cover;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
 }
 
 /**
  * h1 is a flex item of the flex container
  * flex-grow is 1 - don't shrink wrap around the content
  * flex-shrink is 1 - allow the item to shrink to fit the container
  * flex-basis is auto - the initial size of the item
  * the flex direction is row (left to right) layout the h1 in the row direction
  * margin is 0 remove the default margin - creating an edge-to-edge design
  * line-height is 4 * font-size - this will set the actual height of the line box
  * the text will be vertically centered in the in the line box
  * background is a gradient
  * border-radius is 10px all 4 corners - will be overridden in the media query
  */
 /* prettier-ignore */
 header h1 {
	flex: 1 1 auto;
	margin: 0;
	color: #fff;
	line-height: 4;
	text-align: center;
	font-variant-caps: small-caps;
	letter-spacing: 4px;
	text-shadow: 0 -2px 2px rgba(0, 0, 0, 0.6);
	background: 
	    transparent 
	    linear-gradient(
		   to bottom, 
		   hsla(218, 62%, 80%, 0.7) 1px, 
		   hsla(218, 62%, 50%, 0.7) 2px, 
		   hsla(218, 62%, 8%, 1)
	    );
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	padding-left: 0px;
	padding-right: 0px;
 }
 
 /**
  * sup is a superscript element
  * used for footnotes, endnotes, power, and exponents
  * font-size is 0.6 * inherited font-size
  * find the value of the inherited font-size from the parent element
  * multiply by 0.6
  * use the Developer Tools Computed tab/panel to find the actual font-size of the parent element
  */
 header h1 sup {
	font-size: 0.6em;
	font-variant-caps: small-caps;
 }

 /* START - .nav-main */
 .nav-main {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 9999;
	line-height: 0;
	background: none;
 }
 
 .nav-main-menu-toggle {
	background: rgba(255, 255, 255, 0.312);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	border-bottom: 2.5px solid #000;
	border-right: 2.5px solid #000;
	border-top: none;
	border-left: none;
	margin-bottom: -2.5px;
	cursor: pointer;
	padding: 0;
	line-height: 0;
 }
 
 /* SET SVG TRANSFORMS - based on individual elements not SVG box */
 .nav-main-menu-toggle svg * {
	transform-box: fill-box;
 }
 
 /* HAMBURGER MENU ICON */
 .nav-main-menu-toggle rect:nth-child(1) {
	transition: all 2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
	transform-origin: center;
 }
 
 .nav-main-menu-toggle rect:nth-child(2) {
	transition: all 2.25s linear;
	transform-origin: center;
 }
 
 .nav-main-menu-toggle rect:nth-child(3) {
	transition: all 2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
	transform-origin: center;
 }
 
 /* JAVASCRIPT WILL ADD - aria-expanded="true" - to .nav-main-menu-toggle */
 .nav-main-menu-toggle[aria-expanded="true"] rect:nth-child(1) {
	rotate: 1.125turn;
	translate: 0 10px;
 }
 
 .nav-main-menu-toggle[aria-expanded="true"] rect:nth-child(2) {
	scale: 0;
 }
 
 .nav-main-menu-toggle[aria-expanded="true"] rect:nth-child(3) {
	rotate: -1.125turn;
	translate: 0 -10px;
 }
 
 /* END - .nav-main-menu-toggle */
 
 #nav-main-menu {
	transform: translateX(-100%);
	transition: all 1s ease-in-out;
	position: absolute;
	width: fit-content;
	background: rgba(255, 255, 255, 0.312);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	visibility: hidden;
	flex-wrap: nowrap;
	flex-direction: column;
	font-variant-caps: small-caps;
	border-bottom: 2.5px solid #000;
	border-right: 2.5px solid #000;
	border-top: 2.5px solid #000;
 }
 
 #nav-main-menu:not([hidden]) {
	visibility: visible;
	transform: translateX(0);
	transition: all 1.8s ease-in-out;
 }
 
 #nav-main-menu li a {
	color: inherit;
	display: flex;
	line-height: 3;
	padding: 0 2em;
	transition: all .25s ease-in-out;
	text-decoration: none;
 }
 
 #nav-main-menu li a:hover,
 #nav-main-menu li a:focus {
	background: whitesmoke;
 }
 
 /* END - .nav-main */

 /**
  * background gradient
  * small gradient on top
  * first color is 0% from the top
  * second color is 5% from the top
  * third color is 20% from the top (same color as the background)
  */
 /* prettier-ignore */
 section {
	margin: 20px;
	border: 2px solid white;
	border-radius: 10px;
	padding: 10px;
	box-shadow: 0 4px 4px rgba(0, 0, 0, 0.8);
	background:  
	    linear-gradient(
		   to bottom, 
		   hsla(0, 0%, 0%, 0.8) 0%, 
		   hsla(0, 0%, 100%, 0.6) 5%, 
		   hsla(0, 0%, 100%, 0.8) 20%
	    )
	    #fff;
 }
 
 /**
  * margin 24px on top and bottom
  * zero on right and left
  * 6px on bottom (override the 24px)
  */
 h2 {
	margin: 24px 0 6px;
	font-variant-caps: small-caps;
 }

 .main-subheading {
    text-align: center;
    margin-top: 10px;
 }

 .posts-subheading {
    padding-top: 1.5em;
    padding-bottom: 1.5em;
    background-image: radial-gradient(circle 2em, rgba(255, 255, 255, 1.0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.0));
 }
 
 /**
  * use larger line-height for improved readability
  * set maximumn width to 60ch (60 characters) for improved readability
  */
 p {
	margin: 0 0 16px;
	line-height: 1.6;
	max-width: 60ch;
 }

 .cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
 }

 .cards-item {
    flex: 0 0 calc(100% - 20px);
    display: flex;
    margin: 10px;
    min-width: 0;
    background-color: powderblue;
 }

 .cards-item-link {
    text-decoration: none;
    color: #000033;
 }

 .cards-item-figure {
    position: relative;
    margin: 0;
    line-height: 0;
    overflow: hidden;
 }

 .cards-item-figure-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transform-origin: 80% 12%;
    transform: rotate(0) scale(1);
    transition: all 2s;
    filter: grayscale(100);
    background-color: powderblue;
 }

 .cards-item-figure-caption {
    padding: 0 10px;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0px;
    background: hsla(228, 3%, 34%, 0.5);
    color: hsla(0, 0%, 100%, 1);
    backdrop-filter: blur(5px);
    line-height: 2;
    font-style: italic;
 }

 .cards-item-link:hover .cards-item-figure-image {
    transform: rotate(6deg) scale(2);
    filter: grayscale(0);
 }

 .cards-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: powderblue;
 }

 .cards-item-details-title {
    margin-bottom: 0;
    border-bottom: 1px solid;
    font-variant-caps: small-caps;
 }

 .cards-item-details-meta {
    display: flex;
    flex-wrap: wrap;
 }

 .cards-item-details-meta * {
    flex: 0 0 50%;
    font-size: .8em;
    line-height: 2;
 }

 .cards-item-details-meta > span:nth-child(even) {
    text-align: right;
 }

 .cards-item-details-excerpt {
    flex-grow: 1;
 }

 .cards-item-details-button {
    align-self: flex-end;
    margin: 10px;
    padding: 0 1em;
    border-radius: 1em;
    border: 1px solid;
    line-height: 2;
 }
 
 /**
  * Responsive Images
  * set width to 100%
  * images will scale to fit the container
  * percentage is based on the width of the containing block (parent element)
  */
 section img {
	width: 50%;
	border: 5px #000;
	border-radius: 5px;
 }

 .cta {
	display: flex;
	flex-wrap: nowrap;
	flex-direction: column;
	padding-left: 5px;
	padding-right: 5px;
	padding-bottom: 20px;
	margin: 20px;
	clear: both;
	border: 2.5px solid #FFF;
	border-radius: 10px;
	justify-content: center;
	background-color: #393b3d;
 }

 .cta-heading {
	color: #FFF;
	text-align: center;
	margin-bottom: 10px;
	font-variant-caps: small-caps;
 }

 .cta-button {
	height: 2em;
	width: 7em;
	align-self: center;
	line-height: 2;
	padding: 0 1em;
	margin: 10px;
	border: 0.125em solid;
	border-radius: 1em;
	text-align: center;
	font-size: 3em;
	text-decoration: none;
	font-weight: 700;
	letter-spacing: 0.015625em;
	transition: all 0.25s ease-in-out;
 }

 .cta-button:hover {
	box-shadow: 0 0 5px 5px;
 }

 .cta-button:active {
	box-shadow: inset 0 0 5px 5px;
 }

 .cta-button-primary {
	background-color: powderblue;
	color: navy;
 }

 .cta-button-secondary {
	background-color: navy;
	color: powderblue;
 }

 .cta-button-tertiary {
	background-color: palegoldenrod;
	color: darkred;
 }

 .cta-button-quaternary {
	background-color: darkred;
	color: palegoldenrod;
 }

 .cta-button-large {
	font-size: 5em;
 }

 .cta-button-small {
	font-size: 1em;
 }
 
 /**
  * Setup flex container
  * elements flow in row direction (left to right)
  * gap between elements is 20px
  * margin is 0 on top 
  * 20px on right and left
  * 20px on bottom
  */
 footer {
	display: flex;
	gap: 20px;
	margin: 0 20px 20px;
 }
 
 /**
  * All anchor pseudo states
  * remove default text decoration
  * color is white
  * height is 2 * font-size (2 * 16 = 32)
  */
 footer a {
	color: white;
	text-decoration: none;
	line-height: 2;
 }
 
 /**
  * first child of footer
  * margin-right is auto
  * as a flex item margin auto will consume all available space (unused pixels
  * the other flex items will be pushed to the right)
  */
 footer a:first-child {
	margin-right: auto;
 }
 
 /**
  * square brackets are attribute selectors
  * href^="javascript" means href attribute starts with javascript
  * the $ means ends with
  * the * means contains
  * the ~ means contains word
  * the | means starts with
  * the ^ means starts with
  * the = means is equal to
  * the != means is not equal to
  * position is relative (setting up for the active state - moving the element down 2px)
  * style like a button
  */
 footer a[href^="javascript"] {
	position: relative;
	color: #000;
	background-color: #fff;
	border-radius: 3px;
	padding: 0 10px;
	box-shadow: 0 2px 2px #000;
 }
 
 footer a[href^="javascript"]:active {
	top: 2px;
	box-shadow: none;
 }
 
 @media (min-width: 250px) {
	.wrapper {
	    margin: 10px auto;
	    width: 75%;
	}
	
	header {
	   	height: 250px;
	    	background:
	    	   	url(images/compressed-image-03.webp) no-repeat left top / 10%,
	    	   	url(images/compressed-image-05.webp) no-repeat right top / 10%,
		   	url(images/compressed-image-04.webp) no-repeat center center / cover;
	}

	header h1 {
	    font-size: 2.75em;
	    font-variant-caps: small-caps;
	    line-height: 2;
	    align-self: flex-end;
	    border-top-left-radius: 0px;
	    border-top-right-radius: 0px;
	    height: 25%;
	    padding-left: 0px;
	    padding-right: 0px;
	}

	img {
	    width: 10%;
	    float: right;
	    margin: 0 0 2px 4px;
	    border: 5px #000;
	    border-radius: 5px;
	}
 }
 
 /*
 Start Media Query
	if screen is 48rem or larger (can use px or em)
	rem is based on font size of root element
	    (16px * 48 = 768)
	use the following rules
 */
 
 @media (min-width: 48rem) {
	/**
	 * override the margin of the container 
	 * margin is now 20px on top and bottom
	 * auto on left and right
	 * auto will center the container
	 */
	.wrapper {
	    margin: 20px auto;
	}
	/**
	 * height is 400px - a design decision
	 * multiple background images
	 * background is the shorthand property
	 * url() is the background-image property
	 * no-repeat is the background-repeat property
	 * 80px -10px is the background-position property (x, y)
	 * / 200px 200px is the background-size property (width, height)
	 */
	/* prettier-ignore */
	header {
	    height: 400px;
	    background:
	    	   url(images/compressed-image-03.webp) no-repeat left top / 20%,
	    	   url(images/compressed-image-05.webp) no-repeat right top / 20%,
		   url(images/compressed-image-04.webp) no-repeat center center / cover;
	}
 
	/**
	 * font-size is 2.75 * inherited font-size (16px)
	 * height is 2 * font-size (2.75 * 16 = 44)
	 * flex item flowing in row direction (left to right the main axis)
	 * align-self is flex-end (bottom of flex container the cross axis)
	 * remove border-radius from top of header
	 */
	header h1 {
	    font-size: 2.25em;
	    font-variant-caps: small-caps;
	    line-height: 2;
	    align-self: flex-end;
	    border-top-left-radius: 0px;
	    border-top-right-radius: 0px;
	    padding-left: 0px;
	    padding-right: 0px;
	    padding-top: 10px;
	}

	.nav-main {
		position: static;
		top: auto;
		left: auto;
		z-index: auto;
		background: none;
		border: none;
	}
  
	.nav-main-menu-toggle {
		display: none;
	}
  
	#nav-main-menu {
		position: relative;
		visibility: visible;
		transform: translateX(0);
		transition: none;
		background: #c3d5f5;
		display: flex;
		flex-direction: row;
		font-variant-caps: small-caps;
		justify-content: space-evenly;
		justify-self: center;
		border: 5px solid #393b3d;
		border-radius: 10px;
	}

	#nav-main-menu li a {
		color: #000;
		border: 5px hidden;
		border-radius: 5px;
	}

    .cards-item {
        flex: 0 0 calc(25% - 20px);
        flex: 0 0 calc(33.333% - 20px);
        flex: 0 0 calc(50% - 20px);
    }
 
	section {
		height: fit-content;
	}

	/**
	 * override the width of the image (auto is the intrinsic width)
	 * float the image to the right
	 * set margin opposite the float direction
	 */
	section img {
	    width: 25%;
	    float: right;
	    margin: -25px 0 2px 4px;
	    border: 5px #000;
	    border-radius: 5px;
	}
 }