/* TWS Author Pages. Change --tws-accent to the site's brand colour. */
.tws-author,
.tws-authors,
.tws-author-box {
	--tws-accent: #1f4e79;
	--tws-muted: #5b6470;
	--tws-line: #e3e6ea;
	--tws-radius: 10px;
	--tws-content: 820px; /* width of the author column */
}

/* ---------- Single author page ---------- */
.tws-author {
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(24px, 5vw, 56px) 20px;
}

/* One centred column for photo + name, bio and articles */
.tws-author__hero,
.tws-author__bio,
.tws-author__posts {
	max-width: var(--tws-content);
	margin-left: auto;
	margin-right: auto;
}

.tws-author__hero {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: clamp(20px, 4vw, 36px);
	align-items: center;
	padding-bottom: clamp(20px, 3vw, 32px);
}

.tws-author__photo img {
	display: block;
	width: clamp(120px, 18vw, 180px);
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 50%;
}

.tws-author__name {
	margin: 0 0 0.25em;
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1.1;
}

.tws-author__role {
	margin: 0 0 0.75em;
	color: var(--tws-accent);
	font-weight: 600;
}

.tws-author__short {
	margin: 0;
	max-width: 60ch;
	font-size: 1.125rem;
	line-height: 1.6;
}

.tws-author__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.tws-author__links a {
	color: var(--tws-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tws-author__bio {
	padding: 0 0 clamp(24px, 4vw, 40px);
}

.tws-author__posts > h2 {
	margin: 0 0 0.75em;
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
	line-height: 1.25;
}

.tws-author__bio-body {
	font-size: 1.0625rem;
	line-height: 1.75;
}

.tws-author__bio-body p {
	margin: 0 0 1em;
}

.tws-author__policy {
	margin: 1.5em 0 0;
	font-size: 0.95rem;
	color: var(--tws-muted);
}

.tws-author__policy a {
	color: var(--tws-accent);
}

.tws-author__posts {
	padding-top: clamp(24px, 4vw, 40px);
	border-top: 1px solid var(--tws-line);
}

/* ---------- Article list ---------- */
.tws-post-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tws-post {
	display: grid;
	grid-template-columns: minmax(0, 240px) 1fr;
	gap: clamp(16px, 3vw, 28px);
	margin: 0;
	padding: clamp(16px, 2.5vw, 24px) 0;
	border-bottom: 1px solid var(--tws-line);
}

.tws-post:last-child {
	border-bottom: 0;
}

.tws-post__thumb {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: var(--tws-radius);
	background: var(--tws-line);
}

.tws-post__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tws-post__title {
	margin: 0 0 0.35em;
	font-size: clamp(1.1rem, 2vw, 1.35rem);
	line-height: 1.3;
}

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

.tws-post__title a:hover {
	color: var(--tws-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tws-post__meta {
	margin: 0 0 0.5em;
	font-size: 0.875rem;
	color: var(--tws-muted);
}

.tws-post__excerpt {
	margin: 0;
	line-height: 1.6;
}

.tws-author .tws-pagination {
	margin-top: 2rem;
}

/* ---------- Authors page grid ---------- */
.tws-authors {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tws-author-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0;
	padding: 24px;
	border: 1px solid var(--tws-line);
	border-radius: var(--tws-radius);
}

.tws-author-card__photo img {
	display: block;
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 50%;
}

.tws-author-card__name {
	margin: 0.5rem 0 0;
	font-size: 1.25rem;
	line-height: 1.25;
}

.tws-author-card__name a {
	color: inherit;
	text-decoration: none;
}

.tws-author-card__name a:hover {
	color: var(--tws-accent);
}

.tws-author-card__role {
	margin: 0;
	color: var(--tws-accent);
	font-weight: 600;
	font-size: 0.95rem;
}

.tws-author-card__bio {
	margin: 0;
	line-height: 1.55;
}

.tws-author-card__more {
	margin-top: auto;
	padding-top: 0.5rem;
	color: var(--tws-accent);
	font-weight: 600;
	text-underline-offset: 3px;
}

/* ---------- Author box under posts ---------- */
.tws-author-box {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: clamp(16px, 3vw, 24px);
	align-items: start;
	margin: 2.5rem 0 0;
	padding: clamp(18px, 3vw, 28px);
	border: 1px solid var(--tws-line);
	border-top: 3px solid var(--tws-accent);
	border-radius: var(--tws-radius);
}

.tws-author-box__photo img {
	display: block;
	width: 88px;
	height: 88px;
	object-fit: cover;
	border-radius: 50%;
}

.tws-author-box__body p {
	margin: 0;
}

.tws-author-box__label {
	font-size: 0.875rem;
	color: var(--tws-muted);
}

.tws-author-box__name {
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
}

.tws-author-box__name a {
	color: inherit;
	text-decoration: none;
}

.tws-author-box__name a:hover {
	color: var(--tws-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tws-author-box__role {
	margin-top: 0.15rem !important;
	color: var(--tws-accent);
	font-weight: 600;
	font-size: 0.95rem;
}

.tws-author-box__bio {
	margin-top: 0.6rem !important;
	line-height: 1.6;
}

.tws-author-box__more {
	display: inline-block;
	margin-top: 0.75rem;
	color: var(--tws-accent);
	font-weight: 600;
	text-underline-offset: 3px;
}

/* ---------- Focus + mobile ---------- */
.tws-author a:focus-visible,
.tws-authors a:focus-visible,
.tws-author-box a:focus-visible {
	outline: 2px solid var(--tws-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

@media (max-width: 640px) {
	.tws-author__hero,
	.tws-post {
		grid-template-columns: 1fr;
	}

	.tws-author-box {
		grid-template-columns: 1fr;
	}
}
