/*
Theme Name: Phone Sex UK
Theme URI: https://phone-sex-uk.com/
Author: Phone Sex UK
Description: Standalone classic theme — no parent theme, no dependency on Twenty Twenty or any default WordPress theme. Fast, simple templates; no full-site editing required.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: phone-sex-uk
Tags: blog, one-column, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* -------------------------------------------------------------------------
   Base — system fonts, no webfont requests
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
	font-size: 1.0625rem;
	line-height: 1.6;
	color: #1a1a1a;
	background: #fff;
}

a {
	color: #0d47a1;
	text-decoration-skip-ink: auto;
}

a:hover,
a:focus {
	text-decoration: underline;
}

a:focus-visible {
	outline: 2px solid #0d47a1;
	outline-offset: 2px;
}

img {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */
.site-wrap {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.site-header {
	background: #f8f8f8;
	border-bottom: 1px solid #e8e8e8;
}

.site-header__inner {
	max-width: 80rem;
	margin: 0 auto;
	padding: 1.75rem clamp(1.25rem, 4vw, 2.5rem);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
}

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

.site-header .site-logo,
.site-header .custom-logo-link {
	color: inherit;
}

.site-header .site-logo:focus-visible,
.site-header .custom-logo-link:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 4px;
}

.site-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

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

.site-title a:hover,
.site-title a:focus {
	text-decoration: none;
}

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

.custom-logo-link img,
.site-logo img {
	display: block;
	width: 200px;
	max-width: 100%;
	height: auto;
}

.main-nav .main-nav__list,
.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem clamp(1.25rem, 3vw, 2rem);
}

.main-nav {
	margin-left: auto;
	font-size: 1rem;
	line-height: 1.4;
}

.main-nav a {
	color: #1a1a1a;
	text-decoration: none;
	font-weight: 400;
}

.main-nav a:hover,
.main-nav a:focus {
	color: #1a1a1a;
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

.main-nav .current-menu-item > a {
	font-weight: 600;
}

/* Hamburger: hidden on desktop */
.menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	flex-shrink: 0;
	margin-left: auto;
	-webkit-tap-highlight-color: transparent;
}

.menu-toggle:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 3px;
}

.menu-toggle__icon {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 1.375rem;
}

.menu-toggle__icon span {
	display: block;
	height: 2px;
	background: #1a1a1a;
	border-radius: 1px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(2) {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1024px) {
	.site-header__inner {
		justify-content: flex-start;
		row-gap: 0.75rem;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.main-nav {
		display: none;
		order: 3;
		flex: 1 0 100%;
		width: 100%;
		margin-left: 0;
		padding-top: 0.75rem;
		border-top: 1px solid #eee;
	}

	.site-header__inner.is-nav-open .main-nav {
		display: block;
	}

	.main-nav .main-nav__list,
	.main-nav ul {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 0.35rem 0;
		padding-bottom: 0.25rem;
	}

	.main-nav a {
		display: block;
		padding: 0.5rem 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.menu-toggle__icon span {
		transition: none;
	}
}

.site-main {
	flex: 1;
	max-width: 80rem;
	width: 100%;
	margin: 0 auto;
	padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
}

.site-footer {
	margin-top: auto;
	padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2.5rem);
	background: #f8f8f8;
	border-top: 1px solid #e8e8e8;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: #444;
}

.site-footer__inner {
	max-width: 80rem;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.site-footer__inner:has(.site-footer__nav) {
	gap: 0.75rem;
}

.site-footer__nav {
	width: 100%;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e0e0e0;
}

.site-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.35rem 1.5rem;
}

.site-footer__menu a {
	color: #1a1a1a;
	text-decoration: none;
	font-weight: 500;
}

.site-footer__menu a:hover,
.site-footer__menu a:focus {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.site-footer__network {
	margin: 0;
	max-width: 40rem;
	color: #333;
}

.site-footer__network-link {
	color: #1a1a1a;
	font-weight: 600;
	text-decoration: none;
}

.site-footer__network-link:hover,
.site-footer__network-link:focus {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.site-footer__copy {
	margin: 0;
	font-size: 0.8125rem;
	color: #666;
}

.site-footer__copy a {
	color: inherit;
	font-weight: 500;
	text-decoration: none;
}

.site-footer__copy a:hover,
.site-footer__copy a:focus {
	text-decoration: underline;
}

.site-footer__sep {
	color: #999;
}

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

.page-header h1,
.entry-title {
	margin: 0 0 0.22em;
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	line-height: 1.2;
	letter-spacing: -0.02em;
}

body.single .entry-intro {
	margin: 0 0 clamp(1rem, 2vw, 1.35rem);
	font-size: 1.125rem;
	line-height: 1.65;
	font-weight: 400;
	color: #333;
	max-width: 42rem;
}

body.single .entry-intro > p:first-child {
	margin-top: 0;
}

body.single .entry-intro > p:last-child {
	margin-bottom: 0;
}

.entry-meta {
	font-size: 0.875rem;
	color: #666;
	margin-bottom: 1rem;
}

/* Single post featured image — match home post-card image frame */
body.single .entry-featured {
	margin: 0 0 clamp(1.5rem, 3vw, 2rem);
	line-height: 0;
	overflow: hidden;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	background: #f0f0f0;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.single .entry-featured__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	object-position: center;
	vertical-align: middle;
}

/*
 * Single posts + ordinary pages: same readable column.
 * Exclude body.home — the real front page has class "home" (static or blog index), so the homepage
 * .site-main stays full width for grids; Contact etc. have "page" but not "home".
 */
@media (min-width: 768px) {
	body.single .site-main,
	body.page:not(.home) .site-main {
		max-width: 46rem;
	}
}

/* Home: top + bottom intro — same max-width column as single posts (plain text; grid stays full width) */
@media (min-width: 768px) {
	.home-hero,
	.home-acf-top,
	.home-acf-bottom,
	.page-static-home .home-static__top,
	.page-static-home .home-static__bottom {
		max-width: 46rem;
		margin-left: auto;
		margin-right: auto;
	}
}

/* Blog index hero (large H1 + intro) — vertical margins only so desktop centering (above) is not reset */
.home-hero {
	margin-top: 0;
	margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
	padding: clamp(0.5rem, 2vw, 1.5rem) 0 0;
}

.home-hero__title {
	margin: 0 0 0.4em;
	font-size: clamp(2.25rem, 5.5vw, 4.25rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.035em;
	color: #1a1a1a;
}

.home-hero__intro {
	margin: 0;
	max-width: 42rem;
	font-size: 1.125rem;
	line-height: 1.65;
	font-weight: 400;
	color: #333;
}

/* Post grid (archive-style cards) */
.post-list--grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 2.5vw, 2rem);
	align-items: start;
}

@media (max-width: 900px) {
	.post-list--grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.post-list--grid {
		grid-template-columns: 1fr;
	}
}

/* Fallback: non-grid post lists */
.post-list:not(.post-list--grid) {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.post-list:not(.post-list--grid) {
	gap: 1.5rem;
}

.post-list--grid .post-card {
	align-self: start;
}

/* One card in a multi-column grid was sitting in column 1 only — center the row */
@media (min-width: 561px) {
	.post-list--grid:has(> .post-card:only-child) {
		grid-template-columns: minmax(0, 1fr);
		max-width: 28rem;
		width: 100%;
		margin-inline: auto;
	}
}

.post-card {
	margin: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
	border-color: #d8d8d8;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
}

/* Link wraps image + title only — no flex-grow or equal-height stretch (that left a huge gap before the excerpt). */
.post-card__link {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	color: #1a1a1a;
	text-decoration: none;
}

.post-card__link:hover,
.post-card__link:focus {
	text-decoration: none;
	color: #1a1a1a;
}

.post-card__link:hover .post-card__title,
.post-card__link:focus-visible .post-card__title {
	text-decoration: underline;
	text-decoration-color: #1a1a1a;
	text-underline-offset: 0.18em;
}

.post-card__link:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
	border-radius: 2px;
}

.post-card__media {
	display: block;
	margin: 0;
	overflow: hidden;
	line-height: 0;
	background: #f0f0f0;
}

.post-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.post-card:hover .post-card__img {
	transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
	.post-card {
		transition: none;
	}

	.post-card:hover .post-card__img {
		transform: none;
	}
}

.post-card__title {
	margin: 0;
	padding: 0.85rem 1.25rem 0.15rem;
	font-size: clamp(1.35rem, 2.2vw, 1.75rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: #1a1a1a;
}

.post-card__media + .post-card__title {
	padding-top: 0;
}

.post-card:not(.has-post-thumbnail) .post-card__title {
	padding-top: 1.1rem;
}

.post-card__excerpt {
	margin: 0;
	padding: 0.2rem 1.25rem 1.2rem;
	font-size: 0.96875rem;
	line-height: 1.55;
	font-weight: 400;
	color: #444;
	text-decoration: none;
}

.post-card__excerpt p {
	margin: 0 0 0.65em;
	text-decoration: none;
}

.post-card__excerpt p:last-child {
	margin-bottom: 0;
}

.read-more {
	display: inline-block;
	margin-top: 0.75rem;
	font-weight: 600;
}

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

.entry-content .phone-sex-uk-post-grid {
	margin-top: clamp(1.75rem, 3vw, 2.75rem);
	margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
}

/* Static front: hero + grid + optional bottom from editor */
.page-static-home--hero-grid .home-hero {
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

.page-static-home .home-static__top > *:first-child,
.page-static-home .home-static__bottom > *:first-child {
	margin-top: 0;
}

.page-static-home .home-static__bottom {
	margin-top: clamp(2.25rem, 4vw, 3.5rem);
}

.page-static-home--split .phone-sex-uk-post-grid {
	margin-top: clamp(1.75rem, 3vw, 2.75rem);
}

/* ACF top + More-split top: same typography as .home-hero (big H1 + lead paragraph) */
.home-acf-top,
.page-static-home .home-static__top {
	padding: clamp(0.5rem, 2vw, 1.5rem) 0 0;
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

.page-static-home--split .home-static__top {
	margin-bottom: 0;
}

.home-acf-top > *:first-child,
.page-static-home .home-static__top > *:first-child {
	margin-top: 0;
}

.home-acf-top h1,
.page-static-home .home-static__top h1 {
	margin: 0 0 0.4em;
	font-size: clamp(2.25rem, 5.5vw, 4.25rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.035em;
	color: #1a1a1a;
}

.home-acf-top h1 + p,
.page-static-home .home-static__top h1 + p {
	margin-top: 0;
	margin-bottom: 0;
	max-width: 42rem;
	font-size: 1.125rem;
	line-height: 1.65;
	font-weight: 400;
	color: #333;
}

/* Block editor “muted” / secondary colour on the lead paragraph */
.home-acf-top h1 + p.has-text-color,
.page-static-home .home-static__top h1 + p.has-text-color {
	color: #333;
}

/* ACF home zones */
.home-acf-bottom {
	margin-top: clamp(2.25rem, 4vw, 3.5rem);
}

.home-acf-bottom > *:first-child {
	margin-top: 0;
}

/* Block headings use .wp-block-heading — match specificity so core margins don’t win */
.entry-content :is(h1, h2, h3, h4, h5, h6),
.entry-content .wp-block-heading {
	margin-top: 0;
	margin-bottom: 0.3em;
	margin-block-start: 0.5em;
	margin-block-end: 0;
	line-height: 1.25;
}

.entry-content :is(h1, h2, h3, h4, h5, h6):first-child,
.entry-content .wp-block-heading:first-child {
	margin-top: 0;
	margin-block-start: 0;
}

/*
 * Gap under headings: core “layout flow” adds margin-block-start on * + * (block gap), and
 * .wp-block-paragraph has its own margin-top — together it looks like a huge h3→p gap.
 */
.entry-content :is(h1, h2, h3, h4, h5, h6) + p,
.entry-content :is(h1, h2, h3, h4, h5, h6) + .wp-block-paragraph,
.entry-content .wp-block-heading + p,
.entry-content .wp-block-heading + .wp-block-paragraph {
	margin-block-start: 0.4em;
	margin-top: 2px;
}

.entry-content.is-layout-flow > :is(h1, h2, h3, h4, h5, h6) + *,
.entry-content.is-layout-flow > .wp-block-heading + * {
	margin-block-start: 0.4em;
}

.pagination {
	margin-top: 2.5rem;
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	align-items: center;
}

.pagination a {
	font-weight: 600;
}

.no-results {
	padding: 2rem;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999999;
	padding: 0.75rem 1rem;
	background: #000;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.skip-link:focus {
	left: 0.5rem;
	top: 0.5rem;
}
