/* ==========================================================================
   Torlei - main stylesheet
   https://torleidigital.co.uk

   Contents
   1.  Variables (edit per client)
   2.  Reset & base
   3.  Typography
   4.  Layout
   5.  Header & navigation
   6.  Hero & sections
   7.  Entries, cards & post grid
   8.  Sidebar & widgets
   9.  Forms & buttons
   10. Pagination & post navigation
   11. Comments
   12. Footer
   13. WordPress core classes
   14. Accessibility helpers
   15. Responsive
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&display=swap');

/* 1. VARIABLES ---------------------------------------------------------- */
:root {
	--torlei-primary: #ffffff; /* logo text */
	--torlei-accent: #f52715;
	--torlei-text: #fff;
	--torlei-muted: #ad99ca;
	--torlei-bg: #000;
	--torlei-surface: #f5f7fa;
	--torlei-border: #e4e7eb;
	--torlei-radius: 6px;
	--torlei-container: 1140px;
	--torlei-gutter: 1.25rem;
	--torlei-header-height: 72px;
	--torlei-font-body: "Didact Gothic", Arial, sans-serif;
	--torlei-font-heading: var(--torlei-font-body);
}

/* 2. RESET & BASE -------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--torlei-bg);
	color: var(--torlei-text);
	font-family: var(--torlei-font-body);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img,
video,
iframe,
svg {
	max-width: 100%;
	height: auto;
}

figure {
	margin: 0 0 1.5rem;
}

a {
	color: var(--torlei-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover,
a:focus {
	color: var(--torlei-accent);
}

:focus-visible {
	outline: 3px solid var(--torlei-accent);
	outline-offset: 2px;
}

hr {
	border: 0;
	border-top: 1px solid var(--torlei-border);
	margin: 2rem 0;
}

blockquote {
	margin: 1.5rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 4px solid var(--torlei-accent);
	color: var(--torlei-muted);
	font-style: italic;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.5rem;
}

th,
td {
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--torlei-border);
	text-align: left;
}

pre,
code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

pre {
	overflow-x: auto;
	padding: 1rem;
	background: var(--torlei-surface);
	border-radius: var(--torlei-radius);
}

/* 3. TYPOGRAPHY ---------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.6em;
	color: var(--torlei-text);
	font-family: var(--torlei-font-heading);
	line-height: 1.2;
}

h1 { font-size: clamp(1.5rem, 2vw + 1rem, 2rem); }
h2 { font-size: clamp(1.2rem, 2vw + 1rem, 1.2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.15rem; }

p,
ul,
ol,
dl {
	margin: 0 0 1.25rem;
}

/* 4. LAYOUT -------------------------------------------------------------- */
.container {
	width: 100%;
	max-width: var(--torlei-container);
	margin-inline: auto;
	padding-inline: var(--torlei-gutter);
}

.site-content {
	min-height: 50vh;
	/*padding-block: 2.5rem;*/
}

.content-wrap {
	display: flex;
	gap: 3rem;
	align-items: flex-start;
}

.content-wrap > .site-main,
.content-wrap > .site-main .two-col {
	flex: 1 1 0;
	min-width: 0;
	padding-top: 5rem;
}

.content-wrap > .widget-area {
	flex: 0 0 300px;
}

.content-wrap--single > .site-main {
	/*max-width: 780px;*/
	margin-inline: auto;
}

.site-main--fullwidth .entry__content > * {
	max-width: var(--torlei-container);
	margin-inline: auto;
}

.page-header {
	margin-bottom: 2rem;
}

.page-title {
	margin: 0;
}

.archive-description {
	margin-top: 0.5rem;
	color: var(--torlei-muted);
}

.author-header img {
	border-radius: 50%;
	margin-bottom: 0.75rem;
}

/* 5. HEADER & NAVIGATION ------------------------------------------------- */
.site-logo {
	display: inline-block;
	line-height: 0;
}

.site-logo img {
	display: block;
	width: auto;
	height: auto;
	max-height: 56px; /* adjust to suit the header */
}
.site-header {
	position: absolute;
	width: 100%;
	z-index: 100;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.9) 0%,
		rgba(0, 0, 0, 0.35) 55%,
		rgba(0, 0, 0, 0) 100%
	);
	border-bottom: 0;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--torlei-header-height);
}

.site-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.2;
}

.site-title a {
	color: var(--torlei-text);
	text-decoration: none;
	border-bottom: 3px solid transparent;
	transition: all 0.4s ease;
}

.site-description {
	margin: 0;
	color: var(--torlei-muted);
	font-size: 0.85rem;
}

.custom-logo-link {
	display: inline-block;
	line-height: 0;
}

.custom-logo {
	width: auto;
	max-height: 56px;
}

.main-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-navigation a {
	display: block;
	padding: 0.5rem 0;
	color: var(--torlei-text);
	font-weight: 600;
	text-decoration: none;
	text-transform: uppercase;
	border-bottom: 3px solid transparent;
	transition: all 0.4s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.site-title a:hover {
	color: var(--torlei-accent);
	border-bottom: 3px solid var(--torlei-accent);
}

/* Dropdown (one level) */
.main-navigation li {
	position: relative;
}

.main-navigation ul ul {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 99;
	display: none;
	flex-direction: column;
	gap: 0;
	min-width: 200px;
	padding: 0.5rem 1rem;
	background: var(--torlei-bg);
	border: 1px solid var(--torlei-border);
	border-radius: var(--torlei-radius);
}

.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul {
	display: flex;
}

.menu-toggle {
	display: none;
	padding: 0.5rem 1rem;
	background: transparent;
	border: 1px solid var(--torlei-border);
	border-radius: var(--torlei-radius);
	color: var(--torlei-text);
	font: inherit;
	cursor: pointer;
}

/* ==========================================================================
   Photo columns – front page
   ========================================================================== */

:root {
	--pc-header-height: 80px; /* set this to your header's actual height */
	--pc-gap: 1rem;
}

/* Visually hidden <h1> (keeps the page heading for SEO and screen readers) */
.photo-columns__title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
	border: 0;
}

/* The wall: fills the screen below the header */
.photo-columns {
	display: grid;
	grid-template-columns: repeat(var(--pc-cols, 3), minmax(0, 1fr));
	gap: var(--pc-gap);
	height: calc(100vh - var(--pc-header-height));
	height: calc(100svh - var(--pc-header-height));
	overflow: hidden;
	minmax(0, 1fr);
}

/* Allow for the WordPress admin bar when logged in */
body.admin-bar .photo-columns {
	height: calc(100vh - var(--pc-header-height) - 32px);
	height: calc(100svh - var(--pc-header-height) - 32px);
}

@media (max-width: 782px) {
	body.admin-bar .photo-columns {
		height: calc(100vh - var(--pc-header-height) - 46px);
		height: calc(100svh - var(--pc-header-height) - 46px);
	}
}

/* One column */
.photo-column {
	height: 100%;
	overflow: hidden;
	min-height: 0;
}

/* The moving strip. Only transform is animated (smooth, GPU-accelerated). */
.photo-column__track {
	display: flex;
	flex-direction: column;
	animation: pc-scroll var(--pc-duration, 60s) linear infinite;
	will-change: transform;
}

/* Down = the same animation played backwards */
.photo-column--down .photo-column__track {
	animation-direction: reverse;
}

/* Margin (not grid/flex gap) keeps the two image sets exactly equal in height,
   which is what makes the -50% loop seamless. */
.photo-column__item {
	margin: 0 0 var(--pc-gap);
}

.photo-column__img {
	display: block;
	width: 100%;
	height: auto;
	transition: opacity 0.25s ease;
}

.photo-column__link {
	display: block;
}

.photo-column__link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: -3px;
}

/* Pause while hovering or keyboard-focusing, so images are easy to click 
@media (hover: hover) {
	.photo-columns:hover .photo-column__track {
		animation-play-state: paused;
	}

	.photo-column__link:hover .photo-column__img {
		opacity: 0.85;
	}
}

.photo-columns:focus-within .photo-column__track {
	animation-play-state: paused;
}*/

@keyframes pc-scroll {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(0, -50%, 0); }
}

/* Phones: keep three narrow columns, tighter gaps */
@media (max-width: 768px) {
	:root {
		--pc-gap: 0.5rem;
	}
}


/* ==========================================================================
   Two Columns page template
   ========================================================================== */

.two-col__container {
	width: 100%;
	max-width: var(--torlei-container, 1140px);
	margin-inline: auto;
	padding-inline: var(--torlei-gutter, 1.25rem);
    padding-top: 5rem;
}

.two-col__header {
	margin-bottom: 2rem;
}

.two-col__title {
	margin: 0;
}

.two-col__intro {
	margin-bottom: 2.5rem;
}

/* Two equal columns on larger screens */
.two-col__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr)); /* minmax(0, …) stops long words or wide images stretching a column */
	gap: 2rem 3rem; /* row gap (when stacked) / column gap */
	align-items: start;
}

/* Only one column filled: use the full width instead of leaving a gap */
.two-col__grid--single {
	grid-template-columns: minmax(0, 1fr);
}

/* Contains floated images (alignleft / alignright) so they can't spill into the next column */
.two-col__col {
	display: flow-root;
	min-width: 0;
}

/* Tidy editor content inside the columns */
.two-col__col > :first-child {
	margin-top: 0;
}

.two-col__col > :last-child {
	margin-bottom: 0;
}

.two-col__col img,
.two-col__col iframe,
.two-col__col video {
	max-width: 100%;
	height: auto;
}

.two-col__col .alignleft,
.two-col__col .alignright {
	max-width: 50%;
}

.two-col__notice {
	padding: 1rem;
	background: #f5f7fa;
	border: 1px dashed #c0c7d0;
	border-radius: 6px;
	text-align: center;
}

/* Tablets and phones: one full-width column, left stacked above right.
   Change 768px here if you want the switch to happen at a different width. */
@media (max-width: 768px) {
	.two-col__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 2rem;
	}

	/* Floated images become full-width blocks so text doesn't wrap into a skinny strip */
	.two-col__col .alignleft,
	.two-col__col .alignright {
		float: none;
		display: block;
		max-width: 100%;
		margin: 0 auto 1rem;
	}
}


/* 6. HERO & SECTIONS ----------------------------------------------------- */
.front-page {
	margin-top: -2.5rem; /* sit flush under the header */
}

.hero {
	padding-block: clamp(4rem, 12vw, 8rem);
	background: var(--torlei-bg);
	color: #fff;
	text-align: center;
}

.hero__title {
	color: #fff;
}

.hero__text {
	max-width: 40rem;
	margin-inline: auto;
	margin-bottom: 2rem;
	font-size: 1.2rem;
	opacity: 0.9;
}

.section {
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section--latest {
	background: var(--torlei-surface);
}

.section__title {
	margin-bottom: 1.5rem;
	text-align: center;
}

/* 7. ENTRIES, CARDS & POST GRID ------------------------------------------ */
.entry {
	margin-bottom: 3rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--torlei-border);
}

.entry__title {
padding: 1rem 0;
}

.entry__title a {
	color: inherit;
	text-decoration: none;
}

.entry__title a:hover {
	color: var(--torlei-accent);
}

.entry__meta,
.card__date {
	color: var(--torlei-muted);
	font-size: 0.875rem;
}

.entry__thumb {
	margin-block: 1rem;
}

.entry__thumb img {
	display: block;
	width: 100%;
	border-radius: var(--torlei-radius);
}

.entry__footer {
	margin-top: 1.5rem;
	color: var(--torlei-muted);
	font-size: 0.9rem;
}

.page-links {
	margin-bottom: 1.25rem;
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}

.card {
	overflow: hidden;
	background: var(--torlei-bg);
	border: 1px solid var(--torlei-border);
	border-radius: var(--torlei-radius);
}

.card__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.card__body {
	padding: 1.25rem;
}

.card__title {
	margin: 0.25rem 0 0.5rem;
	font-size: 1.2rem;
}

.card__title a {
	color: inherit;
	text-decoration: none;
}

.error-404 {
	max-width: 640px;
	margin-inline: auto;
	text-align: center;
}

.error-404__code {
	margin: 0;
	color: var(--torlei-accent);
	font-size: clamp(4rem, 15vw, 8rem);
	font-weight: 800;
	line-height: 1;
}

/* 8. SIDEBAR & WIDGETS --------------------------------------------------- */
.widget {
	margin-bottom: 2rem;
}

.widget-title {
	font-size: 1.1rem;
}

.widget ul {
	padding-left: 1.1rem;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2rem;
	padding-bottom: 2rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* 9. FORMS & BUTTONS ----------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select {
	width: 100%;
	padding: 0.65rem 0.8rem;
	background: var(--torlei-bg);
	border: 1px solid var(--torlei-border);
	border-radius: var(--torlei-radius);
	color: inherit;
	font: inherit;
}

textarea {
	min-height: 8rem;
}

label {
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 600;
}

.button,
button[type="submit"],
input[type="submit"],
.wp-block-button__link {
	display: inline-block;
	padding: 0.7rem 1.4rem;
	background: var(--torlei-accent);
	border: 0;
	border-radius: var(--torlei-radius);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease;
}

.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
	background: var(--torlei-accent);
	color: #fff;
}

.search-form {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.search-form label {
	flex: 1;
	margin: 0;
}

/* 10. PAGINATION & POST NAVIGATION --------------------------------------- */
.pagination .nav-links,
.post-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem;
}

.pagination .page-numbers {
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--torlei-border);
	border-radius: var(--torlei-radius);
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--torlei-primary);
	border-color: var(--torlei-primary);
	color: #fff;
}

.post-navigation {
	margin-block: 2rem;
}

.post-navigation .nav-subtitle {
	display: block;
	color: var(--torlei-muted);
	font-size: 0.8rem;
	text-transform: uppercase;
}

/* 11. COMMENTS ----------------------------------------------------------- */
.comments-area {
	margin-top: 3rem;
}

.comment-list,
.comment-list .children {
	padding-left: 0;
	list-style: none;
}

.comment-list .children {
	margin-left: 1.5rem;
}

.comment-body {
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: var(--torlei-surface);
	border-radius: var(--torlei-radius);
}

.comment-meta {
	font-size: 0.875rem;
	color: var(--torlei-muted);
}

.comment-meta .avatar {
	float: left;
	margin-right: 0.75rem;
	border-radius: 50%;
}

/* 12. FOOTER ------------------------------------------------------------- */
.site-footer {
	padding-block: 1.5rem 2rem;
	background: var(--torlei-bg);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.8rem;
}

.site-footer a,
.site-footer .widget-title {
	color: #fff;
}

.site-footer a:hover {
	color: var(--torlei-accent);
}

.footer-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.site-info {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
}

.site-info p {
	margin: 0;
}

/* Sticky footer */
.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh; /* accounts for mobile browser toolbars */
}

.site-content {
	flex: 1 0 auto; /* grows to take up any spare height */
}

.site-footer {
	flex-shrink: 0;
}

body.admin-bar .site {
	min-height: calc(100vh - 32px);
	min-height: calc(100dvh - 32px);
}

@media (max-width: 782px) {
	body.admin-bar .site {
		min-height: calc(100vh - 46px);
		min-height: calc(100dvh - 46px);
	}
}
/* 13. WORDPRESS CORE CLASSES -------------------------------------------- */
.alignleft {
	float: left;
	margin: 0.3rem 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.3rem 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.alignwide {
	max-width: var(--torlei-container);
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

.wp-caption,
.gallery-caption,
.wp-element-caption {
	max-width: 100%;
	color: var(--torlei-muted);
	font-size: 0.875rem;
}

.wp-caption-text {
	margin-top: 0.4rem;
	text-align: center;
}

.sticky .entry__title::before {
	content: "\2605\00a0";
	color: var(--torlei-accent);
}

.bypostauthor {
	display: block;
}

.gallery {
	display: grid;
	grid-gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }

.gallery-item {
	margin: 0;
}

/* 14. ACCESSIBILITY HELPERS --------------------------------------------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.9rem 1.4rem;
	clip: auto;
	clip-path: none;
	background: #fff;
	color: var(--torlei-text);
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}



/* 15. RESPONSIVE --------------------------------------------------------- */
@media (max-width: 900px) {
	.content-wrap {
		flex-direction: column;
		gap: 2rem;
	}

	.content-wrap > .widget-area {
		flex: 1 1 auto;
		width: 100%;
	}
}

@media (max-width: 768px) {
	.menu-toggle {
		display: inline-block;
	}

	.site-header__inner {
		flex-wrap: wrap;
	}

	.main-navigation {
		display: none;
		width: 100%;
		padding-bottom: 1rem;
	}

	.main-navigation.is-open {
		display: block;
	}

	.main-navigation ul {
		flex-direction: column;
		gap: 0;
	}

	.main-navigation a {
		padding: 0.6rem 0;
		border-bottom: 1px solid var(--torlei-border);
	}

	.main-navigation ul ul {
		position: static;
		display: flex;
		border: 0;
		padding: 0 0 0 1rem;
	}

	.alignleft,
	.alignright {
		float: none;
		display: block;
		margin: 0 auto 1rem;
	}

	.gallery-columns-3,
	.gallery-columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 768px) {

	/* Colours for the mobile menu panel – edit to suit the site */
	:root {
		--torlei-menu-bg: #111111;
		--torlei-menu-text: #ffffff;
		--torlei-menu-line: rgba(255, 255, 255, 0.15);
	}

	/* Logo + button row keeps the same height whether the menu is open or closed */
	.site-header__inner {
		position: relative; /* the menu panel anchors to the bottom of this row */
		flex-wrap: nowrap;
	}

	.menu-toggle {
		flex-shrink: 0;
	}

	/* The panel sits outside the normal flow, so opening it can't push the row */
	.main-navigation,
	.main-navigation.is-open {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 99;
		display: grid;
		width: auto;
		padding: 0;
		background: var(--torlei-menu-bg); /* solid, not transparent */
	}

	/* Closed: zero height, hidden from view and from keyboard focus */
	.main-navigation {
		grid-template-rows: 0fr;
		visibility: hidden;
		transition: grid-template-rows 0.3s ease, visibility 0s linear 0.3s, box-shadow 0.3s ease;
	}

	/* Open: slides down to its natural height */
	.main-navigation.is-open {
		grid-template-rows: 1fr;
		visibility: visible;
		box-shadow: 0 14px 24px rgba(0, 0, 0, 0.3);
		transition-delay: 0s;
	}

	.main-navigation > ul {
		min-height: 0;
		overflow: hidden;
		margin: 0;
		padding: 0;
	}

	/* Specific on purpose, so these beat the front-page header colour rules */
	body .site-header .main-navigation a {
		padding: 0.9rem 1.25rem;
		color: var(--torlei-menu-text);
		border-bottom: 1px solid var(--torlei-menu-line);
	}

	body .site-header .main-navigation a:hover,
	body .site-header .main-navigation .current-menu-item > a,
	body .site-header .main-navigation .current_page_item > a {
		color: var(--torlei-accent, #13a89e);
	}

	/* Sub-menus sit inside the dark panel */
	.main-navigation ul ul {
		background: transparent;
	}
}

@media (prefers-reduced-motion: reduce) {
	.main-navigation,
	.main-navigation.is-open {
		transition: none;
	}
}