/*
Theme Name: Anakko
Theme URI: https://anakko.ltd
Author: Anakko Ltd
Author URI: https://anakko.ltd
Description: Company website theme for Anakko Ltd. A light, minimal Black & Gold block theme with ready-made Home, Contact, Privacy and Terms pages. Edit everything in Appearance > Editor.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: anakko
*/

/* Small touches theme.json can't express. */

/* ------------------------------------------------------------------
 * 1. Base: rhythm, reading comfort, selection
 * ------------------------------------------------------------------ */

html {
	/* Anchor links (#about, #how-we-work) land below the sticky header. */
	scroll-padding-top: calc(var(--wp--custom--header-height, 4.75rem) + 1rem);
	-webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Balanced headings, no orphaned last words in body copy. */
h1, h2, h3, h4,
.wp-block-heading,
.wp-block-post-title {
	text-wrap: balance;
}
p, li { text-wrap: pretty; }

/* Keep long lead paragraphs to a comfortable measure. */
.has-large-font-size:not(h1):not(h2):not(h3) { max-width: 38em; }

::selection {
	background: var(--wp--preset--color--gold-tint);
	color: var(--wp--preset--color--ink);
}

/* Links: refined underline that thickens on hover. */
a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition:
		color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease),
		text-decoration-color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease);
}
a:hover { text-decoration-thickness: 2px; }

/* ------------------------------------------------------------------
 * 2. Focus: one consistent, visible ring for every control
 * ------------------------------------------------------------------ */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.wp-block-navigation .wp-block-navigation-item__content:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--gold-text);
	outline-offset: 3px;
	border-radius: 2px;
}
.wp-block-button__link:focus-visible { border-radius: var(--wp--custom--radius--md); }

/* WordPress's automatic skip link: on-brand when it appears. */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--surface);
	font-weight: 600;
	border-radius: var(--wp--custom--radius--sm);
	padding: 0.75rem 1.25rem;
	text-decoration: none;
	z-index: 100001;
}

/* ------------------------------------------------------------------
 * 3. Block styles
 * ------------------------------------------------------------------ */

.is-style-eyebrow {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text);
}
/* Short gold rule before the eyebrow: a quiet brand signature. */
.is-style-eyebrow::before {
	content: "";
	display: inline-block;
	width: 1.5rem;
	height: 2px;
	margin-right: 0.75rem;
	vertical-align: middle;
	background: var(--wp--preset--color--gold);
	border-radius: 2px;
}
.has-text-align-center.is-style-eyebrow::before { display: none; }

.is-style-anakko-card {
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	box-shadow: 0 1px 2px rgba(11, 11, 11, 0.04);
}

/* Buttons: smooth state changes, comfortable touch target. */
.wp-block-button__link {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	transition:
		background-color var(--wp--custom--motion--base) var(--wp--custom--motion--ease),
		border-color var(--wp--custom--motion--base) var(--wp--custom--motion--ease),
		color var(--wp--custom--motion--base) var(--wp--custom--motion--ease),
		transform var(--wp--custom--motion--fast) var(--wp--custom--motion--ease);
}
.wp-block-button__link:active { transform: translateY(1px); }

.wp-block-button.is-style-gold .wp-block-button__link {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}
.wp-block-button.is-style-gold .wp-block-button__link:hover {
	background: var(--wp--custom--color--gold-hover);
	color: var(--wp--preset--color--ink);
}

/* Outline: border meets 3:1 against both page surfaces. */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line-strong);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--surface);
}

.anakko-number {
	font-family: var(--wp--preset--font-family--sora);
	font-weight: 600;
	color: var(--wp--preset--color--gold-text);
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------
 * 4. Header: sticky, translucent, with an active-page indicator
 * ------------------------------------------------------------------ */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 600px) {
	/* The admin bar scrolls away on small screens. */
	.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; }
}

.anakko-header {
	position: relative;
	isolation: isolate;
	border-bottom: 1px solid var(--wp--preset--color--line);
	background-color: var(--wp--preset--color--surface);
}
/* Blur lives on a pseudo-element: backdrop-filter on the header itself
   would trap the mobile menu overlay inside the header box. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.anakko-header { background-color: transparent; }
	.anakko-header::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: -1;
		background: color-mix(in srgb, var(--wp--preset--color--surface) 86%, transparent);
		-webkit-backdrop-filter: saturate(180%) blur(14px);
		backdrop-filter: saturate(180%) blur(14px);
	}
}

.anakko-header .wp-block-image { margin: 0; }
.anakko-header .wp-block-image a { display: block; }

/* Desktop nav: generous hit area, underline grows in on hover. */
.anakko-header .wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.625rem;
}
@media (min-width: 600px) {
	.anakko-header .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0.35rem;
		height: 2px;
		border-radius: 2px;
		background: var(--wp--preset--color--gold);
		transform: scaleX(0);
		transform-origin: left;
		transition: transform var(--wp--custom--motion--base) var(--wp--custom--motion--ease);
	}
	.anakko-header .wp-block-navigation .wp-block-navigation-item__content:hover { text-decoration: none; }
	.anakko-header .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover::after,
	.anakko-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after,
	.anakko-header .wp-block-navigation [aria-current="page"]::after {
		transform: scaleX(1);
	}
}

/* Mobile menu toggle: 44px touch target. */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--custom--radius--sm);
}
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg {
	width: 28px;
	height: 28px;
}

/* Mobile overlay menu: large, well-spaced links. */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 4rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
	gap: 0;
	width: 100%;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item {
	font-family: var(--wp--preset--font-family--sora);
	font-size: 1.5rem;
	font-weight: 600;
	width: 100%;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding-block: 1rem;
}

/* ------------------------------------------------------------------
 * 5. Sections & content
 * ------------------------------------------------------------------ */

/* Hero art: show only when it sits beside the text (columns stack below 782px). */
.anakko-hero-art img {
	width: 100%;
	height: auto;
}
@media (max-width: 781px) {
	.anakko-hero-art { display: none; }
}

/* Company facts table */
.anakko-facts { margin: 0; }
.anakko-facts table { border-collapse: collapse; width: 100%; }
.anakko-facts td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.8rem 0;
	font-size: 0.9375rem;
	vertical-align: top;
}
.anakko-facts tr:last-child td { border-bottom: 0; }
.anakko-facts td:first-child { font-weight: 600; padding-right: 1.5rem; white-space: nowrap; }
.anakko-facts td:last-child {
	color: var(--wp--preset--color--ink-muted);
	text-align: right;
	overflow-wrap: anywhere;
	font-variant-numeric: tabular-nums;
}
.anakko-facts td a { color: var(--wp--preset--color--ink); }

/* Phones: stack label above value so long values never overflow. */
@media (max-width: 480px) {
	.anakko-facts tr { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
	.anakko-facts tr:last-child { border-bottom: 0; }
	.anakko-facts td { display: block; border: 0; padding: 0; }
	.anakko-facts td:first-child {
		font-size: 0.8125rem;
		font-weight: 600;
		letter-spacing: 0.04em;
		color: var(--wp--preset--color--ink-muted);
		padding: 0 0 0.125rem;
	}
	.anakko-facts td:last-child { text-align: left; color: var(--wp--preset--color--ink); }
}

/* Legal pages: scannable section headings. */
.anakko-legal h2 {
	font-size: var(--wp--preset--font-size--large);
	margin-top: 2.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--line);
}
.anakko-legal li + li { margin-top: 0.5rem; }

/* Post lists */
.wp-block-post-template .wp-block-post-title a { text-decoration: none; }
.wp-block-post-template .wp-block-post-title a:hover { text-decoration: underline; }
.wp-block-query-pagination { margin-top: var(--wp--preset--spacing--50); }

/* ------------------------------------------------------------------
 * 6. Footer
 * ------------------------------------------------------------------ */

.anakko-footer a { text-decoration: none; }
.anakko-footer a:hover { text-decoration: underline; }
/* Bigger tap area for small footer links without changing the look. */
.anakko-footer .has-small-font-size > a {
	display: inline-block;
	padding-block: 0.625rem;
	margin-block: -0.625rem;
}

/* ------------------------------------------------------------------
 * 7. Reduced motion
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}
}
