/*
Theme Name: T Keen Photography
Theme URI: https://tkeen.photography
Author: Taylor Keen
Description: Block theme for T Keen Photography. Child of Twenty Twenty-Five. Colors, fonts and spacing come from the T Keen design system: teal, charcoal and white; Figtree and DM Mono; square corners; viewfinder frame details.
Template: twentytwentyfive
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
Version: 0.8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tkeen
*/

/* Viewfinder corners: add the class "tk-frame" to an Image, Cover or Group block (Advanced > Additional CSS class). */
.tk-frame { position: relative; }
.tk-frame::after {
	content: "";
	position: absolute;
	inset: 24px;
	pointer-events: none;
	z-index: 2;
	--c: var(--tk-frame-color, #F1F3F4);
	background:
		linear-gradient(var(--c), var(--c)) top left / 36px 2px,
		linear-gradient(var(--c), var(--c)) top left / 2px 36px,
		linear-gradient(var(--c), var(--c)) top right / 36px 2px,
		linear-gradient(var(--c), var(--c)) top right / 2px 36px,
		linear-gradient(var(--c), var(--c)) bottom left / 36px 2px,
		linear-gradient(var(--c), var(--c)) bottom left / 2px 36px,
		linear-gradient(var(--c), var(--c)) bottom right / 36px 2px,
		linear-gradient(var(--c), var(--c)) bottom right / 2px 36px;
	background-repeat: no-repeat;
}
.tk-frame--dark { --tk-frame-color: var(--wp--preset--color--teal); }

/* Camera readout line: add class "tk-readout" to a Paragraph inside a Cover block. */
.tk-readout {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--readout);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Small mono labels above headings: class "tk-label". */
.tk-label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

/* Navigation: uppercase, tracked, no underline. */
.wp-block-navigation .wp-block-navigation-item__content {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	text-decoration: none;
}

/* Photos are square-cornered and unframed by default. */
.wp-block-image img,
.wp-block-gallery img,
.wp-block-cover { border-radius: 0; }

/* WooCommerce: square buttons and controls in brand colors. */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.wc-block-components-button:not(.is-link) {
	border-radius: 0 !important;
	background-color: var(--wp--preset--color--teal);
	color: #FFFFFF;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 500;
	letter-spacing: 0.04em;
	min-height: 44px;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.wc-block-components-button:not(.is-link):hover { background-color: var(--wp--preset--color--charcoal); color: #FFFFFF; }
.woocommerce .price,
.wc-block-components-product-price { font-family: var(--wp--preset--font-family--sans); color: var(--wp--preset--color--ink); }

/* Keyboard focus: a visible teal ring everywhere. */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* ---------- Viewfinder hero ---------- */
.tk-hero { position: relative; overflow: hidden; }
.wp-block-gallery.tk-viewfinder {
	position: relative;
	display: block !important;
	height: min(88vh, 900px);
	min-height: 520px;
	margin: 0 !important;
	background: #121415;
	gap: 0 !important;
}
.wp-block-gallery.tk-viewfinder > figure.wp-block-image {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100%;
	margin: 0 !important;
	opacity: 0;
	transition: opacity 0.6s ease;
}
.wp-block-gallery.tk-viewfinder:not(.is-enhanced) > figure.wp-block-image:first-of-type,
.wp-block-gallery.tk-viewfinder.is-enhanced > figure.wp-block-image.is-active { opacity: 1; }
.wp-block-gallery.tk-viewfinder > figure img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
}
.wp-block-gallery.tk-viewfinder figcaption { display: none; }
.wp-block-gallery.tk-viewfinder::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(18,20,21,0.62) 0%, rgba(18,20,21,0.15) 45%, rgba(18,20,21,0) 70%),
		linear-gradient(0deg, rgba(18,20,21,0.6) 0%, rgba(18,20,21,0) 22%);
}
.tk-vf-frame { position: absolute; left: 6%; right: 6%; top: 10%; bottom: 15%; pointer-events: none; z-index: 2; }
.tk-vf-corner { position: absolute; width: 44px; height: 44px; border: 0 solid rgba(241,243,244,0.85); }
.tk-vf-tl { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.tk-vf-tr { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.tk-vf-bl { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.tk-vf-br { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }
.tk-vf-af { position: absolute; left: 50%; top: 50%; transition: left 0.5s ease, top 0.5s ease; width: 64px; height: 44px; border: 2px solid #4A9BB5; transform: translate(-50%, -50%); }
.tk-vf-bar {
	position: absolute; left: var(--wp--preset--spacing--60); right: var(--wp--preset--spacing--60); bottom: 28px; z-index: 3;
	display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; align-items: center;
	padding-top: 16px; border-top: 1px solid rgba(241,243,244,0.3);
	font-family: var(--wp--preset--font-family--mono); font-size: 13px; letter-spacing: 0.1em; color: #F1F3F4;
}
.tk-vf-bar p { margin: 0; }
.tk-vf-place { margin-left: auto !important; }
.tk-vf-count { opacity: 0.7; }
.tk-vf-shutter {
	position: absolute; right: var(--wp--preset--spacing--60); top: 50%; transform: translateY(-50%); z-index: 3;
	width: 72px; height: 72px; border-radius: 50%; border: 2px solid #F1F3F4; background: rgba(18,20,21,0.35);
	display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.tk-vf-shutter-inner { display: block; width: 52px; height: 52px; border-radius: 50%; background: #F1F3F4; transition: transform 0.15s; }
.tk-vf-shutter:active .tk-vf-shutter-inner { transform: scale(0.9); }
.tk-vf-flash { position: absolute; inset: 0; background: #FFFFFF; opacity: 0; pointer-events: none; z-index: 4; }
.tk-vf-flash.is-on { animation: tk-flash 0.45s ease-out; }
@keyframes tk-flash { from { opacity: 0.85; } to { opacity: 0; } }
.tk-hero .tk-hero-copy {
	position: absolute; z-index: 3; left: var(--wp--preset--spacing--60); top: 50%; transform: translateY(-50%);
	max-width: 600px; color: #F1F3F4; margin: 0 !important;
}
.tk-hero .tk-hero-copy h1 { color: #F1F3F4; margin: 0 0 28px; }
.tk-hero .tk-hero-copy .tk-label { color: #4A9BB5; margin: 0 0 12px; }
@media (max-width: 781px) {
	.wp-block-gallery.tk-viewfinder { height: 78vh; min-height: 460px; }
	.tk-hero .tk-hero-copy { top: auto; bottom: 110px; transform: none; right: var(--wp--preset--spacing--40); }
	.tk-hero .tk-hero-copy h1 { font-size: 40px; }
	.tk-vf-shutter { top: 96px; transform: none; width: 56px; height: 56px; }
	.tk-vf-shutter-inner { width: 40px; height: 40px; }
	.tk-vf-af { display: none; }
}

/* Language link in the header nav */
.wp-block-navigation .tk-lang .wp-block-navigation-item__content { color: var(--wp--preset--color--accent); }
/* Front page: no gap between header and hero, sections butt together */
.home main > .wp-block-post-content > * { margin-block-start: 0; }

/* Portfolio tiles on the homepage */
.tk-portfolio figcaption.wp-element-caption {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 48px 16px 14px;
}
.tk-portfolio img { transition: transform 0.4s ease; }
.tk-portfolio a:hover img, .tk-portfolio a:focus-visible img { transform: scale(1.03); }
.tk-portfolio figure { overflow: hidden; }
@media (max-width: 781px) {
	.wp-block-gallery.tk-portfolio.columns-5 > figure { width: calc(50% - var(--wp--style--gallery-gap-default, 8px) / 2) !important; }
}

/* Header tools: cart + language, far right */
header .wp-block-navigation { margin-left: auto; }
.tk-header-tools { margin-left: var(--wp--preset--spacing--50); }
.tk-lang-switch { position: relative; font-family: var(--wp--preset--font-family--mono); font-size: 12px; letter-spacing: 0.1em; }
.tk-lang-switch summary {
	list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
	min-height: 44px; padding: 0 4px; color: var(--wp--preset--color--ink);
}
.tk-lang-switch summary::-webkit-details-marker { display: none; }
.tk-lang-switch summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.tk-lang-switch img { display: block; width: 16px; height: auto; }
.tk-lang-switch ul {
	position: absolute; right: 0; top: 100%; z-index: 20; margin: 0; padding: 6px 0; list-style: none; min-width: 150px;
	background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--line); box-shadow: 0 10px 24px rgba(18,20,21,0.12);
}
.tk-lang-switch li a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; text-decoration: none; color: var(--wp--preset--color--ink); }
.tk-lang-switch li a:hover { background: var(--wp--preset--color--grey); }
.tk-lang-name { font-family: var(--wp--preset--font-family--sans); letter-spacing: 0; color: var(--wp--preset--color--ink-muted); margin-left: auto; }

.tk-vf-af.is-locking { animation: tk-af-lock 0.5s ease-out; }
@keyframes tk-af-lock { 0% { transform: translate(-50%, -50%) scale(1.35); opacity: 0.4; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tk-vf-af, .tk-vf-af.is-locking { transition: none; animation: none; } }

/* No gap between the last section and the footer */
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part:last-child,
.wp-site-blocks > *:last-child { margin-block-start: 0; }

/* Shutter hint and progress line */
.tk-vf-hint {
	position: absolute; z-index: 3; right: var(--wp--preset--spacing--60); top: calc(50% + 46px); width: 72px; text-align: center;
	font-family: var(--wp--preset--font-family--mono); font-size: 10px; letter-spacing: 0.16em; color: rgba(241,243,244,0.85);
}
.tk-vf-bar { position: absolute; }
.tk-vf-progress { position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: #4A9BB5; }
.tk-vf-progress.is-running { animation: tk-progress 7s linear forwards; }
.tk-vf-progress.is-paused { animation-play-state: paused; }
@keyframes tk-progress { from { width: 0; } to { width: 100%; } }
@media (max-width: 781px) { .tk-vf-hint { top: 156px; width: 56px; } }


/* ---------- Contact sheet galleries (portfolio pages) ----------
   Add class "tk-contact-sheet" to a Gallery block. Add class "tk-select" to an
   individual image (Advanced > Additional CSS class) to circle it as a print. */
.wp-block-gallery.tk-contact-sheet {
	counter-reset: tk-frame;
	background: #111211;
	padding: 34px 22px !important;
	gap: 14px !important;
	position: relative;
	--wp--style--unstable-gallery-gap: 14px;
	background-image:
		repeating-linear-gradient(90deg, #FFFFFF 0 14px, transparent 14px 34px),
		repeating-linear-gradient(90deg, #FFFFFF 0 14px, transparent 14px 34px);
	background-size: 100% 9px, 100% 9px;
	background-position: 22px 12px, 22px calc(100% - 12px);
	background-repeat: no-repeat;
	background-color: #111211;
}
.wp-block-gallery.tk-contact-sheet > figure.wp-block-image {
	counter-increment: tk-frame;
	position: relative;
	margin: 0 !important;
}
.wp-block-gallery.tk-contact-sheet > figure.wp-block-image img {
	aspect-ratio: 3 / 2;
	object-fit: contain;
	background: #000000;
	width: 100%;
	height: auto !important;
	filter: saturate(0.9);
	transition: filter 0.3s ease;
}
.wp-block-gallery.tk-contact-sheet > figure.wp-block-image:hover img { filter: none; }
.wp-block-gallery.tk-contact-sheet > figure.wp-block-image::before {
	content: counter(tk-frame) "A";
	position: absolute;
	left: 4px;
	bottom: -20px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 10px;
	letter-spacing: 0.2em;
	color: #E8A33D;
	z-index: 2;
}
.wp-block-gallery.tk-contact-sheet figcaption { display: none; }
/* Selects: circled in red wax pencil */
.wp-block-gallery.tk-contact-sheet > figure.tk-select img { filter: none; }
.wp-block-gallery.tk-contact-sheet > figure.tk-select::after {
	content: "";
	position: absolute;
	inset: -12px;
	pointer-events: none;
	z-index: 3;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 70' preserveAspectRatio='none'%3E%3Cpath d='M8 34 C 6 12, 40 3, 62 5 C 86 7, 97 22, 94 40 C 91 60, 60 68, 36 66 C 14 64, 3 52, 6 34 C 8 22, 20 12, 30 9' fill='none' stroke='%23D62B2B' stroke-width='2.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.wp-block-gallery.tk-contact-sheet > figure.tk-select a::after {
	content: "PRINT →";
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 4;
	padding: 4px 8px;
	background: #D62B2B;
	color: #FFFFFF;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.14em;
}
@media (max-width: 781px) {
	.wp-block-gallery.tk-contact-sheet { padding: 30px 12px !important; }
}

/* Category pills under portfolio page titles */
.tk-pills .wp-block-button__link { padding: 10px 18px; font-size: 13px; }

/* ---------- Contact page (Forminator) ---------- */
.tk-contact-form .forminator-ui,
.tk-contact-form .forminator-ui * { font-family: var(--wp--preset--font-family--sans) !important; }
.tk-contact-form .forminator-ui .forminator-label,
.tk-contact-form .forminator-ui .forminator-description {
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	color: var(--wp--preset--color--ink-muted) !important;
	margin-bottom: 8px !important;
}
.tk-contact-form .forminator-ui input[type="text"],
.tk-contact-form .forminator-ui input[type="email"],
.tk-contact-form .forminator-ui input[type="tel"],
.tk-contact-form .forminator-ui select,
.tk-contact-form .forminator-ui textarea {
	width: 100% !important;
	box-sizing: border-box !important;
	min-height: 48px !important;
	padding-top: 12px !important;
	padding-bottom: 12px !important;
	padding-right: 14px !important;
	border: 1px solid #8A9298 !important;
	border-radius: 4px !important;
	background: #FFFFFF !important;
	box-shadow: none !important;
	font-size: 16px !important;
	line-height: 1.4 !important;
	color: var(--wp--preset--color--ink) !important;
}
.tk-contact-form .forminator-ui input[type="text"],
.tk-contact-form .forminator-ui input[type="email"],
.tk-contact-form .forminator-ui select,
.tk-contact-form .forminator-ui textarea { padding-left: 14px !important; }
.tk-contact-form .forminator-ui textarea { min-height: 160px !important; resize: vertical; }
.tk-contact-form .forminator-ui input::placeholder,
.tk-contact-form .forminator-ui textarea::placeholder {
	font-family: var(--wp--preset--font-family--sans) !important;
	font-size: 16px !important;
	color: #6B7378 !important;
	opacity: 1 !important;
}
.tk-contact-form .forminator-ui input:focus,
.tk-contact-form .forminator-ui textarea:focus,
.tk-contact-form .forminator-ui select:focus {
	outline: 2px solid var(--wp--preset--color--teal) !important;
	outline-offset: 1px !important;
	border-color: var(--wp--preset--color--teal) !important;
}
/* Phone field: keep the flag and "+1" on one line */
.tk-contact-form .iti { width: 100%; display: block; }
.tk-contact-form .iti__selected-country,
.tk-contact-form .iti__selected-country-primary { display: flex !important; align-items: center; gap: 4px; white-space: nowrap; }
.tk-contact-form .iti__selected-dial-code { white-space: nowrap; font-size: 16px !important; color: var(--wp--preset--color--ink) !important; }
/* Send button in brand teal */
.tk-contact-form .forminator-ui .forminator-button,
.tk-contact-form .forminator-ui .forminator-button-submit,
.tk-contact-form .forminator-ui button[type="submit"] {
	min-height: 48px !important;
	padding: 0 32px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--wp--preset--color--teal) !important;
	color: #FFFFFF !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	letter-spacing: 0.04em !important;
	text-transform: none !important;
	box-shadow: none !important;
	cursor: pointer;
}
.tk-contact-form .forminator-ui .forminator-button:hover,
.tk-contact-form .forminator-ui .forminator-button-submit:hover { background: var(--wp--preset--color--charcoal) !important; }
.tk-contact-form .forminator-ui .forminator-checkbox-label,
.tk-contact-form .forminator-ui .forminator-checkbox__label { font-size: 14px !important; line-height: 1.5 !important; text-transform: none !important; letter-spacing: 0 !important; }

/* Instagram embed on the About page */
.tk-instagram .instagram-media { margin: 0 !important; max-width: 100% !important; min-width: 0 !important; }

/* ---------- Mobile header: one row — logo · cart · menu; language lives in the menu ---------- */
.tk-lang-mobile { display: none; }
@media (max-width: 599px) {
	header.wp-block-group { flex-wrap: nowrap !important; gap: 12px !important; padding-left: 20px !important; padding-right: 20px !important; }
	header .tk-wordmark img { width: 132px !important; height: auto !important; }
	header .wp-block-navigation { order: 3; margin-left: 0; }
	header .tk-header-tools { order: 2; margin-left: auto; gap: 0 !important; }
	header .tk-header-tools .tk-lang-switch { display: none; }
	.wp-block-navigation__responsive-container.is-menu-open .tk-lang-mobile {
		display: flex; gap: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--wp--preset--color--line);
		font-family: var(--wp--preset--font-family--mono); font-size: 14px; letter-spacing: 0.1em;
	}
	.tk-lang-mobile a { display: flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--wp--preset--color--ink-muted); }
	.tk-lang-mobile a.is-current { color: var(--wp--preset--color--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--wp--preset--color--teal); }
	.tk-lang-mobile img { width: 18px; height: auto; }
}

/* ---------- Mobile hero: copy up top, shutter bottom-centre above the readout ---------- */
@media (max-width: 781px) {
	.wp-block-gallery.tk-viewfinder { height: 82vh; min-height: 560px; }
	.tk-hero .tk-hero-copy { top: 96px; bottom: auto; right: var(--wp--preset--spacing--40); }
	.tk-hero .tk-hero-copy h1 { font-size: 38px; margin-bottom: 20px; }
	.tk-hero .tk-hero-copy .wp-block-buttons { gap: 10px; }
	.tk-vf-shutter { top: auto; right: auto; left: 50%; bottom: 112px; transform: translateX(-50%); width: 60px; height: 60px; }
	.tk-vf-shutter-inner { width: 44px; height: 44px; }
	.tk-vf-hint { top: auto; right: auto; left: 50%; bottom: 90px; width: auto; transform: translateX(-50%); white-space: nowrap; }
	.tk-vf-bar { left: 20px; right: 20px; bottom: 20px; font-size: 11px; gap: 4px 16px; }
	.tk-vf-place { margin-left: 0 !important; }
}

/* ---------- Portfolio dropdown (desktop): hangs from the label's left edge, lighter ---------- */
@media (min-width: 600px) {
	header .wp-block-navigation .wp-block-navigation__submenu-container {
		left: -16px !important; right: auto !important; top: calc(100% + 12px) !important;
		min-width: 200px !important; padding: 8px 0 !important;
		border: 0 !important; border-top: 2px solid var(--wp--preset--color--teal) !important;
		box-shadow: 0 12px 28px rgba(18,20,21,0.12);
	}
	header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding: 10px 16px !important; font-size: 13px; letter-spacing: 0.12em;
	}
	header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--teal); background: var(--wp--preset--color--grey); }
	/* invisible bridge so the menu doesn't close crossing the gap */
	header .wp-block-navigation .wp-block-navigation__submenu-container::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
}
