/*!
Theme Name: gopetr
Theme URI: https://svahabyte.com/gopetr
Author: Svahabyte
Author URI: https://svahabyte.com
Description: A clean, minimalist magazine block theme. Mostly white, monochrome, all sans-serif. Full Site Editing.
Version: 2.2.2
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: gopetr
Tags: full-site-editing, block-styles, blog, news, editor-style, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks

gopetr is a block theme. Most styling lives in theme.json. This file holds the theme header and small supplemental styles.
*/

/* Smooth hover transitions, kept minimal. */
a,
.wp-block-button__link,
.wp-block-post-title a {
	transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

/* Featured post + grid card image: gentle zoom on hover. */
.is-style-card .wp-block-post-featured-image img,
.gopetr-featured .wp-block-post-featured-image img {
	transition: transform 0.4s ease;
}
.is-style-card:hover .wp-block-post-featured-image img,
.gopetr-featured:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

/* Keep featured images crisp with clipped overflow for the zoom. */
.is-style-card .wp-block-post-featured-image,
.gopetr-featured .wp-block-post-featured-image {
	overflow: hidden;
}

/* Stop wide/full content blocks breaking out of the post column into the sidebar. */
.wp-block-column .wp-block-post-content .alignwide,
.wp-block-column .wp-block-post-content .alignfull {
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

/* --------------------------------------------------------------
   Hero mosaic (bento featured area)
   -------------------------------------------------------------- */
/* Outer: two query loops side by side (big | the three smaller). */
.gopetr-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wp--preset--spacing--30);
	height: 600px;
}
.gopetr-hero > .wp-block-query {
	height: 100%;
	min-width: 0;
	margin: 0;
}

/* Reset the post-template lists. */
.gopetr-hero__main,
.gopetr-hero__rest {
	margin: 0;
	padding: 0;
	height: 100%;
	list-style: none;
}
.gopetr-hero__main {
	display: block;
}
.gopetr-hero__main > li {
	margin: 0;
	height: 100%;
	overflow: hidden;
}

/* The three smaller cards: one wide on top, two below. */
.gopetr-hero__rest {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	grid-template-areas:
		"b b"
		"c d";
	gap: var(--wp--preset--spacing--30);
}
.gopetr-hero__rest > li {
	margin: 0;
	min-width: 0;
	overflow: hidden;
}
.gopetr-hero__rest > li:nth-child(1) { grid-area: b; }
.gopetr-hero__rest > li:nth-child(2) { grid-area: c; }
.gopetr-hero__rest > li:nth-child(3) { grid-area: d; }

/* Cover fills its cell. */
.gopetr-hero .wp-block-cover {
	height: 100%;
	min-height: 100%;
	border-radius: 2px;
}
.gopetr-hero .wp-block-cover__image-background {
	transition: transform 0.5s ease;
}
.gopetr-hero .wp-block-cover:hover .wp-block-cover__image-background {
	transform: scale(1.04);
}

/* Make the whole card clickable: stretch the title's link over the cover.
   (inner-container goes static so the pseudo anchors to the cover itself.) */
.gopetr-hero__card .wp-block-cover__inner-container {
	position: static;
}
.gopetr-hero__card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Category badge pill — kept above the stretched link so it stays clickable. */
.gopetr-hero__badge {
	position: relative;
	z-index: 2;
	display: inline-block;
	background-color: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
	padding: 0.25em 0.6em;
	font-size: 0.7rem !important;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.gopetr-hero__badge,
.gopetr-hero__badge a {
	color: #fff !important;
	text-decoration: none;
}

/* Overlaid titles in white. */
.gopetr-hero .wp-block-post-title,
.gopetr-hero .wp-block-post-title a {
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	line-height: 1.2;
}
.gopetr-hero .wp-block-post-title a:hover {
	text-decoration: underline;
}
.gopetr-hero__main .wp-block-post-title {
	font-size: clamp(1.6rem, 3vw, 2.25rem);
}
.gopetr-hero__rest .wp-block-post-title {
	font-size: clamp(1rem, 1.6vw, 1.25rem);
}

/* Meta (author + date) appears only on the big card. */
.gopetr-hero__meta,
.gopetr-hero__meta * {
	color: rgba(255, 255, 255, 0.85) !important;
}

/* Mobile: big card on top, three smaller cards as a horizontal swipe row. */
@media (max-width: 781px) {
	.gopetr-hero {
		display: block;
		height: auto;
	}
	.gopetr-hero > .wp-block-query {
		height: auto;
	}
	.gopetr-hero__main > li {
		height: 380px;
	}
	.gopetr-hero__rest {
		display: flex;
		grid-template: none;
		flex-wrap: nowrap;
		gap: 0;
		margin-top: var(--wp--preset--spacing--30);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-x;
		cursor: grab;
		scrollbar-width: none; /* Firefox */
	}
	.gopetr-hero__rest::-webkit-scrollbar {
		display: none; /* WebKit */
	}
	.gopetr-hero__rest.is-dragging {
		cursor: grabbing;
		scroll-snap-type: none;
	}
	.gopetr-hero__rest > li {
		grid-area: auto !important;
		flex: 0 0 86%;
		height: 220px;
		scroll-snap-align: start;
	}
	.gopetr-hero__rest .wp-block-cover {
		border-radius: 0;
	}
}

/* --------------------------------------------------------------
   Ad placeholder slots
   -------------------------------------------------------------- */
.gopetr-ad {
	background-color: var(--wp--preset--color--subtle);
	border: 1px dashed var(--wp--preset--color--tertiary);
	width: 100%;
}
.gopetr-ad--leaderboard {
	min-height: 90px;
}
.gopetr-ad--rectangle {
	min-height: 250px;
}
.gopetr-ad__label {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--secondary);
}

/* --------------------------------------------------------------
   Login card (shown to logged-out visitors in place of comment form)
   -------------------------------------------------------------- */
.gopetr-login-card {
	margin: 0 auto;
	padding: var(--wp--preset--spacing--50);
	border: 1px solid var(--wp--preset--color--tertiary);
	border-radius: 2px;
	text-align: center;
}
/* When the login card replaces the form, drop the redundant
   "Leave a Reply" heading so the card's own title leads. */
.comment-respond:has(.gopetr-login-card) .comment-reply-title {
	display: none;
}
.gopetr-login-card__title {
	margin: 0 0 0.35rem;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	line-height: 1.2;
}
.gopetr-login-card__text {
	margin: 0 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
}
.gopetr-login-card__actions {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}
.gopetr-login-card__primary {
	display: inline-block;
	padding: 0.7rem 1.5rem;
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	border-radius: 0;
}
.gopetr-login-card__primary:hover {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--base);
}
.gopetr-login-card__google {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.65rem 1.5rem;
	border: 1px solid var(--wp--preset--color--tertiary);
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
}
.gopetr-login-card__google:hover {
	background-color: var(--wp--preset--color--subtle);
	color: var(--wp--preset--color--contrast);
}
.gopetr-login-card__google svg {
	width: 18px;
	height: 18px;
	flex: none;
}
.gopetr-login-card__login {
	margin: var(--wp--preset--spacing--30) 0 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}

/* --------------------------------------------------------------
   Auth modal (login / register popup)
   -------------------------------------------------------------- */
body.gopetr-modal-open {
	overflow: hidden;
}
.gopetr-modal[hidden] {
	display: none;
}
/* A hidden panel must never render — guards against any display override. */
.gopetr-auth__panel[hidden] {
	display: none !important;
}
.gopetr-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--wp--preset--spacing--40);
}
.gopetr-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.55);
}
.gopetr-modal__dialog *,
.gopetr-modal__dialog *::before,
.gopetr-modal__dialog *::after {
	box-sizing: border-box;
}
.gopetr-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 400px;
	max-height: 90vh;
	overflow-y: auto;
	background: var(--wp--preset--color--base);
	border-radius: 3px;
	padding: var(--wp--preset--spacing--50);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.gopetr-modal__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}
.gopetr-modal__close svg {
	width: 22px;
	height: 22px;
}
.gopetr-modal__close:hover {
	color: var(--wp--preset--color--secondary);
}

.gopetr-auth__title {
	margin: 0 0 0.25rem;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1.2;
}
.gopetr-auth__sub {
	margin: 0 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
}
.gopetr-auth__field {
	display: block;
	margin-bottom: var(--wp--preset--spacing--30);
}
.gopetr-auth__field span {
	display: block;
	margin-bottom: 0.35rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}
.gopetr-auth__field input {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--wp--preset--color--tertiary);
	border-radius: 2px;
	font-size: var(--wp--preset--font-size--medium);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.gopetr-auth__field input:focus {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--contrast);
}
/* Honeypot — hidden from humans, present for bots. */
.gopetr-auth__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}
.gopetr-auth__submit {
	width: 100%;
	margin-top: var(--wp--preset--spacing--20);
	padding: 0.75rem 1rem;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	cursor: pointer;
}
.gopetr-auth__submit:hover {
	background: var(--wp--preset--color--secondary);
}
.gopetr-auth__submit.is-loading {
	opacity: 0.6;
	cursor: progress;
}
.gopetr-auth__google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	margin-top: var(--wp--preset--spacing--30);
	padding: 0.65rem 1rem;
	border: 1px solid var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
}
.gopetr-auth__google:hover {
	background: var(--wp--preset--color--subtle);
	color: var(--wp--preset--color--contrast);
}
.gopetr-auth__google svg {
	width: 18px;
	height: 18px;
	flex: none;
}
.gopetr-auth__switch {
	margin: var(--wp--preset--spacing--40) 0 0;
	text-align: center;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}
.gopetr-auth__switch button {
	border: 0;
	background: none;
	padding: 0;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}
.gopetr-auth__msg {
	margin-bottom: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--small);
}
.gopetr-auth__msg:empty {
	margin: 0;
}
.gopetr-auth__msg.is-error {
	color: #c0392b;
}
.gopetr-auth__msg.is-ok {
	color: #1e7d34;
}

/* Header "Log in" menu item: hide for logged-in users. */
body.logged-in .gopetr-auth-login {
	display: none;
}

/* --------------------------------------------------------------
   Edit profile (front-end)
   -------------------------------------------------------------- */
.gopetr-profile {
	max-width: 560px;
	margin: 0 auto;
	padding: var(--wp--preset--spacing--50);
	border: 1px solid var(--wp--preset--color--tertiary);
	border-radius: 3px;
}
.gopetr-profile *,
.gopetr-profile *::before,
.gopetr-profile *::after {
	box-sizing: border-box;
}
.gopetr-profile__notice {
	margin-bottom: var(--wp--preset--spacing--40);
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--tertiary);
	border-radius: 2px;
	font-size: var(--wp--preset--font-size--small);
}
.gopetr-profile__notice.is-ok {
	border-color: #1e7d34;
	color: #1e7d34;
}
.gopetr-profile__notice.is-error {
	border-color: #c0392b;
	color: #c0392b;
}
.gopetr-profile__avatar {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--40);
}
.gopetr-profile__avatar img {
	border-radius: 50%;
	width: 72px;
	height: 72px;
	object-fit: cover;
}
.gopetr-profile__avatar-field {
	flex: 1;
}
.gopetr-profile__row {
	display: flex;
	gap: var(--wp--preset--spacing--30);
}
.gopetr-profile__row > .gopetr-profile__field {
	flex: 1;
}
.gopetr-profile__field {
	display: block;
	margin-bottom: var(--wp--preset--spacing--30);
}
.gopetr-profile__field > span {
	display: block;
	margin-bottom: 0.35rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}
.gopetr-profile__field input,
.gopetr-profile__field select,
.gopetr-profile__field textarea {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--wp--preset--color--tertiary);
	border-radius: 2px;
	font-size: var(--wp--preset--font-size--medium);
	font-family: inherit;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.gopetr-profile__field input[type="file"] {
	padding: 0.5rem;
	font-size: var(--wp--preset--font-size--small);
}
/* Custom select — no native browser styling. */
.gopetr-profile__field select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 2.5rem;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	background-size: 16px;
}
.gopetr-profile__field select::-ms-expand {
	display: none;
}
.gopetr-profile__field input:focus,
.gopetr-profile__field select:focus,
.gopetr-profile__field textarea:focus {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--contrast);
}
.gopetr-profile__fieldset {
	margin: var(--wp--preset--spacing--40) 0;
	padding: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--tertiary);
	border-radius: 2px;
}
.gopetr-profile__fieldset legend {
	padding: 0 0.5rem;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
}
.gopetr-profile__hint {
	margin: 0 0 var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
}
.gopetr-profile__actions {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	margin-top: var(--wp--preset--spacing--40);
}
.gopetr-profile__submit {
	padding: 0.75rem 1.75rem;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	cursor: pointer;
}
.gopetr-profile__submit:hover {
	background: var(--wp--preset--color--secondary);
}
.gopetr-profile__logout {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}
.gopetr-profile__logout:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
}
@media (max-width: 600px) {
	.gopetr-profile__row {
		flex-direction: column;
		gap: 0;
	}
}

/* Header account area (logged-in). */
.gopetr-account__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
	color: inherit;
}
.gopetr-account__link:hover .gopetr-account__name {
	text-decoration: underline;
}
.gopetr-account {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-size: var(--wp--preset--font-size--small);
}
.gopetr-account__avatar {
	border-radius: 50%;
	width: 28px;
	height: 28px;
}
.gopetr-account__name {
	font-weight: 500;
}
.gopetr-account__logout {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	padding-left: 0.6rem;
	border-left: 1px solid var(--wp--preset--color--tertiary);
}
.gopetr-account__logout:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
}
@media (max-width: 600px) {
	.gopetr-account__name {
		display: none;
	}
}

/* --------------------------------------------------------------
   Comments
   -------------------------------------------------------------- */
.gopetr-comment {
	margin-bottom: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--wp--preset--color--tertiary);
}
.gopetr-comment .wp-block-avatar img {
	border-radius: 50%;
}
/* Name + date on one line; date pushed right and muted. */
.gopetr-comment__head .wp-block-comment-author-name,
.gopetr-comment__head .wp-block-comment-author-name a {
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}
.gopetr-comment__head .wp-block-comment-date,
.gopetr-comment__head .wp-block-comment-date a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
}
.gopetr-comment .wp-block-comment-content {
	margin: 0;
	line-height: 1.6;
}
.gopetr-comment .wp-block-comment-reply-link a {
	color: var(--wp--preset--color--secondary);
	font-weight: 500;
	text-decoration: none;
}
.gopetr-comment .wp-block-comment-reply-link a:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
}

/* --------------------------------------------------------------
   Single post sidebar
   -------------------------------------------------------------- */
.gopetr-sticky {
	position: sticky;
	top: 2rem;
}

/* Recent posts list: compact, thumb beside title, no bullets. */
.wp-block-latest-posts.wp-block-latest-posts__list {
	padding-left: 0;
	list-style: none;
}
.wp-block-latest-posts__list li {
	margin-bottom: 1.25rem;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
}
.wp-block-latest-posts__list li a {
	text-decoration: none;
	font-weight: 500;
}
.wp-block-latest-posts__list li a:hover {
	text-decoration: underline;
}
.wp-block-latest-posts__featured-image img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	margin-right: 1rem;
}
.wp-block-latest-posts__post-date {
	color: var(--wp--preset--color--secondary);
	font-size: 0.8rem;
}

/* Stack columns on small screens; release the sticky sidebar. */
@media (max-width: 781px) {
	.gopetr-sticky {
		position: static;
	}
}

/* --------------------------------------------------------------
   Mobile navigation overlay
   -------------------------------------------------------------- */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--50);
	background-color: var(--wp--preset--color--base);
}
/* Left-aligned drawer menu with room to breathe. */
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__responsive-container-content {
	align-items: flex-start;
	justify-content: flex-start;
	padding: var(--wp--preset--spacing--80) var(--wp--preset--spacing--50)
		var(--wp--preset--spacing--60) !important;
}
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__container {
	align-items: flex-start;
	gap: var(--wp--preset--spacing--30);
	text-align: left;
}
/* Compact, tappable links. */
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	text-decoration: none;
}
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--secondary);
}
/* Larger close target, nudged down and in from the corner. */
.wp-block-navigation__responsive-container-close {
	top: var(--wp--preset--spacing--40);
	right: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--20);
}
