/*
Theme Name: Daniel Grimes
Author: Daniel Grimes
Description: Custom theme for danielgrimes.ie
Version: 0.6
Requires PHP: 7.4
Text Domain: danielgrimes
*/

/* =========================================================
   FONTS (self-hosted, in /assets/fonts/)
   ========================================================= */
@font-face {
	font-family: "Archivo";
	src: url("assets/fonts/Archivo.ttf") format("truetype");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
}

/* =========================================================
   TOKENS — change the look from here
   ========================================================= */
:root {
	/* Gunmetal base */
	--ink: #15181c;
	--gunmetal: #23282e;
	--steel: #353c44;
	--rivet: #5b6570;
	--mist: #c9ced4;
	--paper: #eceef1;
	--white: #ffffff;

	/* One soft accent, used sparingly */
	--mint: #a9e5cc;
	--mint-deep: #3f8f6e;

	--font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

	--wrap: 1160px;
	--gutter: clamp(16px, 4vw, 40px);
}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
img, iframe, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--mint-deep); outline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.1; font-weight: 800; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--white); padding: 10px 16px; }

/* Pixel corners — the one bit of game flavour kept on the main page.
   Set --px (step size) and --px2 (double it) on anything that uses it. */
.btn, .site-nav a, .brand__mark, .hero__avatar img,
.bench, .tile, .hello,
.tags li, .tags li::before {
	border-radius: 0;
	clip-path: polygon(
		0 var(--px2), var(--px) var(--px2), var(--px) var(--px), var(--px2) var(--px), var(--px2) 0,
		calc(100% - var(--px2)) 0, calc(100% - var(--px2)) var(--px), calc(100% - var(--px)) var(--px), calc(100% - var(--px)) var(--px2), 100% var(--px2),
		100% calc(100% - var(--px2)), calc(100% - var(--px)) calc(100% - var(--px2)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px2)) calc(100% - var(--px)), calc(100% - var(--px2)) 100%,
		var(--px2) 100%, var(--px2) calc(100% - var(--px)), var(--px) calc(100% - var(--px)), var(--px) calc(100% - var(--px2)), 0 calc(100% - var(--px2))
	);
}
.btn:focus-visible, .site-nav a:focus-visible { outline-offset: -7px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 12px 20px;
	--px: 3px; --px2: 6px;
	font-weight: 700; font-size: .98rem;
	text-decoration: none;
	background: var(--ink);
	color: var(--white);
	transition: background .15s ease;
}
.btn:hover { background: var(--steel); }

/* =========================================================
   HEADER
   ========================================================= */
.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand {
	font-weight: 800;
	font-size: 1.15rem;
	text-decoration: none;
	display: inline-flex; align-items: center; gap: 10px;
}
.brand__mark {
	width: 32px; height: 32px;
	display: grid; place-items: center;
	background: var(--gunmetal); color: var(--mint);
	font-size: .8rem; font-weight: 800; letter-spacing: .02em;
	--px: 3px; --px2: 6px;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
	display: block; padding: 8px 14px;
	--px: 3px; --px2: 6px;
	text-decoration: none; font-weight: 600; font-size: .95rem;
}
.site-nav a:hover { background: var(--mist); }
.site-nav .current-menu-item > a { background: var(--ink); color: var(--white); }

/* =========================================================
   HOMEPAGE
   ========================================================= */
.section { padding: clamp(48px, 7vw, 90px) 0 0; }
.section--tight { padding-top: clamp(40px, 6vw, 72px); }
.section__title {
	font-size: clamp(1.7rem, 3vw, 2.3rem);
	font-stretch: 85%; letter-spacing: -.01em;
	margin-bottom: 24px;
}

/* Hero */
.hero { padding: clamp(28px, 6vw, 72px) 0 0; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: center; }
.hero__avatar { margin-bottom: 22px; }
.hero__avatar img {
	width: 104px; height: 104px; object-fit: cover;
	image-rendering: pixelated;           /* keeps a sprite crisp */
	background: var(--gunmetal);
	--px: 4px; --px2: 8px;
}
.hero h1 {
	font-size: 1.15rem; font-weight: 700; letter-spacing: 0;
	display: inline-block; margin-bottom: 18px;
	padding-bottom: 4px; border-bottom: 3px solid var(--mint);
}
.hero__lede {
	font-size: clamp(2rem, 4.4vw, 3.4rem);
	font-weight: 800; font-stretch: 85%; letter-spacing: -.02em; line-height: 1.05;
	max-width: 18ch; margin-bottom: 20px;
}
.hero__sub { font-size: 1.12rem; color: var(--steel); max-width: 44ch; }

/* "On the bench" panel */
.bench {
	background: var(--gunmetal); color: var(--paper);
	padding: 26px 28px 22px;
	--px: 6px; --px2: 12px;
}
.bench__title {
	display: flex; align-items: center; gap: 10px;
	font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
	color: var(--mist); margin-bottom: 16px;
}
.bench .dot { width: 9px; height: 9px; background: var(--mint); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.bench ul { list-style: none; margin: 0; padding: 0; }
.bench li {
	display: grid; grid-template-columns: 2.2rem 1fr;
	padding: 12px 0; border-top: 1px solid var(--steel);
	font-size: 1rem; line-height: 1.5;
}
.bench li span { font-family: ui-monospace, Consolas, monospace; color: var(--mint); font-size: .85rem; padding-top: 2px; }

/* What's on here — uneven blocks */
.bento {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	grid-template-rows: auto auto;
	gap: 16px;
}
.tile {
	position: relative; isolation: isolate; overflow: hidden;
	background: var(--gunmetal); color: var(--paper);
	padding: clamp(22px, 3vw, 32px);
	--px: 6px; --px2: 12px;
}
.tile::after { content: ""; position: absolute; z-index: -1; background: var(--mint); }
.tile h3 { font-size: 1.45rem; font-stretch: 90%; margin-bottom: 10px; }
.tile p { margin-bottom: .6em; color: var(--mist); max-width: 34ch; }
.tile p:last-child { margin-bottom: 0; }
.tile--feature { grid-row: span 2; display: flex; flex-direction: column; min-height: 320px; }
.tile--feature h3 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.tile__note { margin-top: auto !important; padding-top: 24px; font-weight: 600; color: var(--paper) !important; }

/* Colour-block cuts — one accent slicing through a different corner of each tile */
.tile--cut-tr::after { top: 0; right: 0; width: 34%; height: 46%; clip-path: polygon(30% 0, 100% 0, 100% 100%); }
.tile--cut-br::after { right: 0; bottom: 0; width: 64px; height: 64px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.tile--cut-br p { padding-right: 40px; }
.tile--cut-strip::after { left: 12px; bottom: 0; width: 38%; height: 8px; }
.tile--cut-tr h3, .tile--cut-tr p { position: relative; }

/* A bit about me — two text columns + the Ask box */
.about {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr);
	gap: 0 28px; border-top: 2px solid var(--ink); padding-top: 22px; align-items: start;
}
.about__item { padding-right: 4px; }
.about__item + .about__item { padding-left: 28px; border-left: 1px solid var(--mist); }
.about__item h3, .ask__title { font-size: 1.15rem; font-weight: 800; margin-bottom: 12px; }
.about__item p { color: var(--steel); }
.muted { color: var(--rivet) !important; font-size: .95rem; margin-top: 12px; }

/* Ask me something — RPG dialogue box with question buttons */
.dialogue {
	background: var(--ink); color: var(--paper);
	border: 3px solid var(--mist);
	box-shadow: 0 0 0 3px var(--ink);
	border-radius: 8px;
	padding: 16px 18px;
	min-height: 132px;
	margin: 3px 3px 16px;
}
.dialogue__name { display: block; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; font-weight: 700; color: var(--mint); margin-bottom: 6px; letter-spacing: .05em; }
.dialogue__text { margin: 0; font-size: 1.02rem; }
.dialogue__text::after { content: ""; display: inline-block; width: .55em; height: 1em; margin-left: 3px; background: var(--mint); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ask__options { display: flex; flex-direction: column; gap: 6px; }
.ask__btn {
	font: inherit; font-size: .95rem; font-weight: 600; text-align: left; color: var(--ink);
	background: none; border: 0; padding: 6px 0 6px 22px; cursor: pointer; position: relative;
}
.ask__btn::before { content: "\25B8"; position: absolute; left: 4px; color: var(--rivet); transition: transform .15s ease; }
.ask__btn[aria-pressed="true"] { color: var(--mint-deep); }
.ask__btn[aria-pressed="true"]::before { color: var(--mint-deep); transform: translateX(3px); }
@media (hover: hover) {
	.ask__btn:hover { color: var(--mint-deep); }
	.ask__btn:hover::before { color: var(--mint-deep); transform: translateX(3px); }
}

/* Tools — small outlined tags with pixel corners */
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
	--px: 2px; --px2: 4px;
	position: relative; isolation: isolate;
	background: var(--rivet);              /* shows as the 1px border */
	padding: 4px 11px; font-size: .9rem; font-weight: 600;
}
.tags li::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--paper); }

/* Optional page content (e.g. the LinkedIn embed) */
.extra { margin-top: 32px; }
.extra iframe[src*="linkedin.com"] {
	width: 100% !important; max-width: 520px;
	height: 460px !important;
	border: 1px solid var(--mist); background: var(--white);
}
.extra .wp-block-columns, .extra [style*="flex"] { display: block !important; }

/* Say hello */
.hello {
	background: var(--ink); color: var(--paper);
	padding: clamp(28px, 4vw, 44px);
	display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
	--px: 6px; --px2: 12px;
}
.hello h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-stretch: 85%; margin-bottom: 8px; }
.hello p { margin: 0; color: var(--mist); }
.btn--light { background: var(--mint); color: var(--ink); }
.btn--light:hover { background: var(--white); }

/* Writing list (inside the Tests & fixes block once posts exist) */
.posts-list { list-style: none; margin: auto 0 0; padding: 18px 0 0; }
.posts-list li {
	display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
	padding: 11px 0; border-top: 1px solid var(--steel);
}
.posts-list a { font-weight: 700; text-decoration: none; }
.posts-list a:hover { text-decoration: underline; }
.posts-list time { font-size: .88rem; white-space: nowrap; }

/* =========================================================
   PAGES + POSTS
   ========================================================= */
.page-hero { padding: clamp(30px, 6vw, 70px) 0 24px; }
.page-hero h1 {
	font-size: clamp(2.2rem, 5vw, 3.6rem);
	font-stretch: 85%; letter-spacing: -.02em;
	max-width: 22ch;
}
.page-hero time { color: var(--rivet); font-size: .95rem; }
.prose { max-width: 70ch; padding-bottom: 90px; }
.prose h2 { font-size: 1.7rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose a { text-decoration-color: var(--mint-deep); text-decoration-thickness: 2px; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--mint-deep); color: var(--steel); }
.prose pre, .prose code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
.prose pre { background: var(--ink); color: var(--paper); padding: 18px; overflow-x: auto; }
.prose img { margin: 1.5em 0; }
.prose figure { margin: 1.5em 0; }

/* Blog archive cards (index.php) */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.post-card { background: var(--white); display: flex; flex-direction: column; text-decoration: none; }
.post-card__img { aspect-ratio: 4 / 3; background: var(--mist); }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 20px; }
.post-card h3 { font-size: 1.25rem; }
.post-card time { color: var(--rivet); font-size: .85rem; }
.post-nav { display: flex; justify-content: space-between; gap: 20px; padding: 30px 0 80px; border-top: 1px solid var(--mist); }
.post-nav a { font-weight: 700; text-decoration: none; }
.empty { padding: 24px 0; color: var(--rivet); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--mist); padding: 24px 0 32px; font-size: .9rem; color: var(--rivet); }
.site-footer__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer a { color: var(--steel); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
	.hero__grid { grid-template-columns: 1fr; }
	.about { grid-template-columns: 1fr 1fr; gap: 28px; }
	.ask { grid-column: 1 / -1; }
	.posts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.bento { grid-template-columns: 1fr; }
	.tile--feature { grid-row: auto; min-height: 0; }
	.about { grid-template-columns: 1fr; }
	.about__item + .about__item { padding-left: 0; border-left: 0; padding-top: 22px; border-top: 1px solid var(--mist); }
	.posts { grid-template-columns: 1fr; }
	.posts-list li { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* Upcoming posts list inside Tests & fixes */
.upcoming__title { margin: 22px 0 8px !important; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mint) !important; }
.upcoming { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--steel); }
.upcoming li { position: relative; padding: 5px 0 5px 16px; color: var(--mist); font-size: .98rem; }
.upcoming li::before { content: ""; position: absolute; left: 0; top: 1em; width: 6px; height: 6px; background: var(--mint); }