/*
Theme Name: NathanSpenceDesign
Description: Portfolio
Version: 2.7 - Stacked Name & Code Cleanup
Author: Nathan Spence
Author URL: http://nathanspence.com
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1.0 CSS Custom Properties (Variables)
2.0 Resets & Global Styles
3.0 Base Typography & Links
4.0 Page Layout
5.0 Header (Mobile First)
6.0 Footer
7.0 Content Area Styles
8.0 Components
9.0 Media Queries
--------------------------------------------------------------*/

/*--------------------------------------------------------------
1.0 CSS Custom Properties (Variables)
--------------------------------------------------------------*/
:root {
	/* Theme Colors */
	--color-purple: #663399;
	--color-purple-light: #7449a4; 
	--color-dark: #351A4F;
	--color-orange: #ff9966;
	--color-white: #FFFFFF;

	/* Typography */
	--font-sans: 'Open Sans', sans-serif;

	/* Transitions */
	--transition-speed: 0.3s;
	--transition-ease: ease-in-out;
}

/*--------------------------------------------------------------
2.0 Resets & Global Styles
--------------------------------------------------------------*/
* {
	margin: 0;
	padding: 0;
	border: 0;
	text-decoration: none;
	box-sizing: border-box;
}

ul, ol, li {
	list-style-type: none;
}

h1, h2, h3, h4, h5, h6 {
	font-size: 100%;
}

body {
	font-family: var(--font-sans);
	color: var(--color-white);
	line-height: 1.4;
	font-size: 100%;
	background-color: var(--color-purple);
	position: relative;
}


html, body {
	height: 100%;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Universal External Link Icon */
a[href^="http"]:not([href*="nightmaresugar.com"])::after {
	content: '';
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-left: 0.2em;
	vertical-align: middle;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'></path><polyline points='15 3 21 3 21 9'></polyline><line x1='10' y1='14' x2='21' y2='3'></line></svg>");
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'></path><polyline points='15 3 21 3 21 9'></polyline><line x1='10' y1='14' x2='21' y2='3'></line></svg>");
	mask-repeat: no-repeat;
	mask-size: 100% 100%;
}

/*--------------------------------------------------------------
3.0 Base Typography & Links
--------------------------------------------------------------*/
h1, h2, h3 {
	font-weight: 700;
}

h1 {
	font-size: 3em;
	margin-bottom: 0.5em;
}

h2 {
	font-size: 1.5em;
	margin-bottom: 1em;
}

h3, p {
	font-size: 1.125em;
	margin-bottom: 1.333em;
}

h4 {
	font-size: 0.875em;
	margin-bottom: 1.714em;
	font-style: italic;
	font-weight: 400;
}

/* Links */
a {
	color: var(--color-white);
	transition: color var(--transition-speed) var(--transition-ease);
	text-decoration: none;
}

p a,
.summary a {
	text-decoration: underline;
	text-decoration-color: var(--color-white);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--color-orange);
}

/* Lists */
article ul {
	margin-bottom: 1.5em;
}

article ul li {
	list-style-type: disc;
	margin-left: 1em;
}

/*--------------------------------------------------------------
4.0 Page Layout
--------------------------------------------------------------*/
.page-wrap {
	position: relative;
	min-height: 100%;
	margin: 0 auto;
	background-color: var(--color-purple-light);
}

.page-content {
	margin: 0.75rem auto 2.5vw;
	padding: 1.5rem;
	position: relative;
	max-width: 95%;
}

.single-column-page .post-content h1,
.single-column-page .post-content p,
.single-column-page .post-content ul,
.single-column-page .post-content h2,
.single-column-page .post-content h3,
.single-column-page .post-content h4 {
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}

/*--------------------------------------------------------------
5.0 Header (Mobile First)
--------------------------------------------------------------*/
.page-header-wrap {
	padding-left: 5%;
	padding-right: 5%;
	background-color: var(--color-purple);
}

.page-header {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1em;
	align-items: center;
	width: 100%;
	position: relative;
	padding: 0.75rem 0 1rem;
}

.page-header .logotype {
	display: none;
}

.page-header .logo {
	grid-column: 1;
	justify-self: center;
	margin: 0.625em 0 0;
	padding-top: 0.5em;
}

.page-header .logo .logomark img {
	width: 100px;
	height: auto;
	transition: transform var(--transition-speed) var(--transition-ease),
	            filter var(--transition-speed) var(--transition-ease);
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.page-header .logo .logomark img:hover {
	transform: rotate(10deg);
	filter: brightness(1.2) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.page-header nav {
	grid-column: 1;
	justify-self: center;
	width: 100%;
	max-width: 600px;
}

.page-header nav ul {
	display: flex;
	justify-content: space-around;
	padding: 0;
	width: 100%;
	list-style: none;
}

.page-header nav a {
	color: var(--color-orange);
	font-weight: 400;
	font-size: 1.125em;
	display: inline-block;
	transition: color var(--transition-speed) var(--transition-ease),
	            transform 0.2s var(--transition-ease);
}

.page-header nav a:hover {
	color: var(--color-white);
	transform: translateY(-2px);
}

/*--------------------------------------------------------------
6.0 Footer
--------------------------------------------------------------*/
.page-footer-wrap {
	padding: 1.5rem 0;
	background-color: var(--color-purple);
}

.page-footer {
	margin-left: auto;
	margin-right: auto;
	padding-left: 5%;
	padding-right: 5%;
	color: var(--color-white);
}

.page-footer ul {
	margin-bottom: 1.5em;
	line-height: 2.5;
}

.page-footer a {
	color: var(--color-white);
	text-decoration: underline;
	text-decoration-color: var(--color-white);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.page-footer a:hover {
	color: var(--color-orange);
	border-bottom-color: var(--color-orange);
}

.footer-legal {
	margin-top: 5%;
}

.footer-legal img {
	margin: 0 auto;
}

/*--------------------------------------------------------------
7.0 Content Area Styles
--------------------------------------------------------------*/
.post-header {
	text-align: left;
}

.post-header .sub-title {
	font-size: 1.5em;
	margin-bottom: 1em;
	font-weight: 700;
}

.post-meta {
	margin-bottom: 1.5em;
}

.post-content img {
	margin: 0 auto;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.column-right img {
	margin-top: 1.5em;
}

/*--------------------------------------------------------------
8.0 Components
--------------------------------------------------------------*/

/* --- Thumbnails --- */
.thumb-wrap {
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	background-color: var(--color-orange);
}

.thumb-wrap > h2 {
	margin-left: 0.375em;
	grid-column: 1 / -1;
}

.thumb {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.work .thumb {
	background-color: var(--color-orange);
}

.thumb img {
	width: 100%;
	transition: opacity var(--transition-speed) var(--transition-ease);
}

.work .thumb .post-excerpt {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: var(--color-purple);
	opacity: 0;
	transform: scale(0.9);
	z-index: 1999;
	transition: opacity var(--transition-speed) var(--transition-ease),
	            transform var(--transition-speed) var(--transition-ease);
	padding-left: 1em;
	padding-right: 1em;
}

.work .thumb:hover .post-excerpt {
	opacity: 1;
	transform: scale(1);
}

.work .thumb:hover img {
	opacity: 0.1;
}

.post-excerpt h2 {
	margin-bottom: 0;
}

.work .post-excerpt h2 {
	font-size: 1.5em;
}


/*--------------------------------------------------------------
9.0 Media Queries
--------------------------------------------------------------*/

/* 375px up */
@media (min-width: 23em) {
	.thumb-wrap {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 530px up */
@media (min-width: 33em) {
	body {
		font-size: 120%;
	}

	.page-header .logo .logomark img {
		width: 120px;
	}
}

/* 960px up */
@media (min-width: 60em) {
	/* -- Header -- */
	.page-header {
		grid-template-columns: 1fr auto 1fr;
		padding: 1rem 0;
		gap: 1em;
	}

.page-header .logotype {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.3em;
    font-size: 1.1em;
    line-height: 1.1;
    color: var(--color-orange);
    grid-column: 1;
    justify-self: start;
    white-space: nowrap;
}

	.page-header .logotype .brand-name {
		font-weight: 700;
		display: flex;
		flex-direction: row;
	}

	.page-header .logotype .brand-name span {
		display: block;
	}

	.page-header .logotype .brand-tagline {
		font-weight: 400;
		display: block;
	}

	.page-header .logo {
		grid-column: 2;
		margin: 0;
		padding: 0;
	}

	.page-header .logo .logomark img {
		width: 150px;
	}

	.page-header nav {
		grid-column: 3;
		justify-self: end;
		text-align: right;
		width: auto;
		max-width: none;
	}

	.page-header nav ul {
		display: block;
		width: auto;
	}

	.page-header nav ul li {
		margin-left: 1.5em;
		display: inline;
	}

	/* -- Layout -- */
	.ready-to-column {
		display: flex;
		gap: 2rem;
	}

	/* Footer Columns */
	.page-footer .ready-to-column .column-1 {
		flex: 60%;
		padding-right: 10%;
	}

	.page-footer .ready-to-column .column-2,
	.page-footer .ready-to-column .column-3 {
		flex: 20%;
	}

	/* -- Content Area -- */
	.post-content.ready-to-column .column-left,
	.post-content.ready-to-column .column-right {
		flex: 50%;
	}

	.project-info {
		padding-right: 10%;
	}

	/* -- Components -- */
	.thumb-wrap {
		grid-template-columns: repeat(3, 1fr);
	}

	.previous-project-nav,
	.next-project-nav {
		flex: 1;
	}

	.previous-project-nav {
		text-align: left;
	}

	.next-project-nav {
		text-align: right;
	}
}

/* 1800px up */
@media (min-width: 113em) {
	body {
		font-size: 150%;
	}

	.single-column-page .post-content h1,
	.single-column-page .post-content p,
	.single-column-page .post-content ul,
	.single-column-page .post-content h2,
	.single-column-page .post-content h3,
	.single-column-page .post-content h4 {
		width: 60%;
		max-width: 2000px;
	}

	.thumb-wrap {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* --- Seamless Masonry Grid (No Titles) --- */

.illustration-gallery-feed {
    max-width: 1200px; /* Slightly wider looks better for a pure grid */
    margin: 0 auto;
    padding: 2rem 1rem;
}

.image-masonry {
    column-count: 2;
    column-gap: 20px; /* Horizontal gap */
    width: 100%;
}

.image-masonry img {
    display: inline-block;
    width: 100%;
    height: auto;
    margin-bottom: 20px !important; /* Vertical gap */
    break-inside: avoid;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Subtle shadow for definition */
    border-radius: 2px;
    transition: transform 0.3s ease;
}

/* Optional: Slight zoom effect when hovering over an illustration */
.image-masonry img:hover {
    transform: scale(1.02);
    z-index: 10;
}

/* Mobile: Single column for phones */
@media (max-width: 44em) {
    .image-masonry {
        column-count: 1;
    }
}