/**
 * Halcyon — supplementary styles.
 *
 * Only effects the block editor cannot express in theme.json live here:
 * block-style variations, card hover states, and small editorial niceties.
 * Everything else (colour, type, spacing) is theme.json and stays editable.
 */

/* ---- Readability ---------------------------------------------------- */
body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.entry-content,
.wp-block-post-content {
	text-wrap: pretty;
}

/* ---- Card group / columns variation --------------------------------- */
.wp-block-group.is-style-card,
.wp-block-columns.is-style-card {
	background-color: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--secondary);
	border-radius: 16px;
	padding: clamp(1.5rem, 3vw, 2.25rem);
	box-shadow: var(--wp--preset--shadow--soft);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

a:hover > .wp-block-group.is-style-card,
.wp-block-group.is-style-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--card);
	border-color: var(--wp--preset--color--primary);
}

/* ---- Soft frame image variation ------------------------------------- */
.wp-block-image.is-style-frame img,
.wp-block-post-featured-image.is-style-frame img,
.wp-block-post-featured-image.is-style-frame {
	border-radius: 16px;
	box-shadow: var(--wp--preset--shadow--card);
}

/* ---- Project / post cards ------------------------------------------- */
.halcyon-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--secondary);
	border-radius: 16px;
	overflow: clip;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.halcyon-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--card);
	border-color: var(--wp--preset--color--primary);
}

.halcyon-card .wp-block-post-featured-image {
	border-radius: 0;
	margin: 0;
}

.halcyon-card .wp-block-post-featured-image img {
	border-radius: 0;
}

/* ---- Checklist list variation --------------------------------------- */
.wp-block-list.is-style-checks {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-checks li {
	position: relative;
	padding-left: 1.75rem;
	margin-bottom: 0.6rem;
}

.wp-block-list.is-style-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 0.7rem;
	height: 0.4rem;
	border-left: 2px solid var(--wp--preset--color--primary);
	border-bottom: 2px solid var(--wp--preset--color--primary);
	transform: rotate(-45deg);
}

/* ---- Dotted separator variation ------------------------------------- */
.wp-block-separator.is-style-dotted {
	border: none;
	border-top: 2px dotted var(--wp--preset--color--secondary);
	background: none;
	max-width: 6rem;
	opacity: 1;
}

/* ---- Navigation underline on hover ---------------------------------- */
.wp-block-navigation .wp-block-navigation-item__content {
	transition: color 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--primary);
}

/* ---- Navigation: top-level items as whole-cell links ----------------- *
 * Each first-level item is a fully clickable pill: padding lives on the
 * <a> itself, so the entire cell is the link. On hover/keyboard focus the
 * cell fills with the Primary preset (medium blue in light mode, pastel
 * blue in dark mode) with light-surface text — matching the buttons.
 * The chevron stays a separate touch target inside the same pill.
 * Scoped to :not(.is-menu-open) so the mobile overlay keeps core styling. */
.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item {
	border-radius: 8px;
	transition: background-color 0.15s ease;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0.5rem 0.85rem;
	border-radius: 8px;
	text-decoration: none;
	transition: color 0.15s ease;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item.has-child > .wp-block-navigation-item__content {
	padding-right: 0.25rem;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-icon {
	align-self: stretch;
	margin-left: 0;
	padding: 0 0.6rem 0 0.25rem;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item:where(:hover, :focus-within) {
	background-color: var(--wp--preset--color--primary);
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item:where(:hover, :focus-within) > .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item:where(:hover, :focus-within) > .wp-block-navigation__submenu-icon {
	color: var(--wp--preset--color--base-2);
	text-decoration: none;
}

/* ============================================================ *
 * Navigation dropdowns — 1- and 2-level submenus.
 *
 * The core Navigation block already renders nested menu items (or
 * nested pages, via the Page List fallback) as submenus, opening on
 * hover/focus on desktop and via the chevron button on touch. These
 * rules give the popovers Halcyon's chrome. Everything uses colour
 * presets, so dropdowns follow light/dark mode automatically.
 * Scoped to :not(.is-menu-open) so the mobile overlay keeps core's
 * accordion layout.
 * ============================================================ */

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
	background-color: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--secondary);
	border-radius: 12px;
	box-shadow: var(--wp--preset--shadow--card);
	padding: 0.4rem;
	min-width: 220px;
	margin-top: 0.55rem;
	max-width: min(320px, calc(100vw - 2rem));
	transform: translateY(6px);
	transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
	transition-delay: 0.35s;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .has-child:where(:hover, :focus-within) > .wp-block-navigation__submenu-container {
	transform: translateY(0);
	/* The 0.35s delay above applies only when closing — opening is instant. */
	transition-delay: 0s;
}

/* Hover bridges: keep the interstitial gap between an item and its panel
   inside the hover area, so crossing it never collapses the menu. The
   pseudo-element is part of the (hidden) panel, so it only intercepts the
   pointer while the menu is open. */
.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -0.65rem;
	height: 0.65rem;
}

/* Nested flyouts: bridge the horizontal gap instead. */
.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container::before {
	top: 0;
	bottom: 0;
	left: -0.55rem;
	right: auto;
	width: 0.55rem;
	height: auto;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .has-child.halcyon-opens-left > .wp-block-navigation__submenu-container::before {
	left: auto;
	right: -0.55rem;
}

/* Second level: flies out to the side of the first dropdown. */
.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
	margin-top: -0.4rem;
	margin-left: 0.45rem;
	transform: translateX(6px);
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .has-child:where(:hover, :focus-within) > .wp-block-navigation__submenu-container {
	transform: translateX(0);
}

/* Edge-aware direction: assets/js/navigation.js adds .halcyon-opens-left
   to a .has-child item whose submenu would overflow the right edge of the
   viewport. Top-level dropdowns right-align; nested flyouts flip sides. */
.wp-block-navigation__responsive-container:not(.is-menu-open) .has-child.halcyon-opens-left > .wp-block-navigation__submenu-container {
	left: auto;
	right: -1px;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .has-child.halcyon-opens-left > .wp-block-navigation__submenu-container {
	left: auto;
	right: 100%;
	margin-left: 0;
	margin-right: 0.45rem;
	transform: translateX(-6px);
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .has-child.halcyon-opens-left:where(:hover, :focus-within) > .wp-block-navigation__submenu-container {
	transform: translateX(0);
}

/* Items inside a dropdown: full-width rows with a soft hover state. */
.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 0.5rem 0.8rem;
	border-radius: 8px;
	color: var(--wp--preset--color--contrast);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content:where(:hover, :focus-visible) {
	background-color: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--primary);
}

/* Chevron: muted, rotates while its submenu is open. Tap target for touch. */
.wp-block-navigation__submenu-icon {
	color: var(--wp--preset--color--contrast-2);
}

.wp-block-navigation__submenu-icon svg {
	transition: transform 0.12s ease;
}

.wp-block-navigation .has-child:where(:hover, :focus-within) > .wp-block-navigation__submenu-icon svg,
.wp-block-navigation .wp-block-navigation-submenu__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/* Mobile overlay: theme-coloured panel, indented accordion submenus. */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	border-left: 1px solid var(--wp--preset--color--secondary);
	padding-left: 0.9rem;
	margin-top: 0.4rem;
}

/* ---- Eyebrow / kicker label ----------------------------------------- */
.halcyon-eyebrow {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

/* ---- Sticky header niceties ----------------------------------------- */
.halcyon-sticky-header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: saturate(140%) blur(8px);
}

/* ---- Contact form --------------------------------------------------- */
.halcyon-form {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.halcyon-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.1rem;
}

@media (max-width: 600px) {
	.halcyon-form__row {
		grid-template-columns: 1fr;
	}
}

.halcyon-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin: 0;
}

.halcyon-form label {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 0.82rem;
	letter-spacing: 0.01em;
	color: var(--wp--preset--color--contrast);
}

.halcyon-form input[type="text"],
.halcyon-form input[type="email"],
.halcyon-form textarea {
	width: 100%;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	color: var(--wp--preset--color--contrast);
	background-color: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--secondary);
	border-radius: 10px;
	padding: 0.7rem 0.9rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.halcyon-form textarea {
	resize: vertical;
	min-height: 8rem;
	line-height: 1.6;
}

.halcyon-form input::placeholder,
.halcyon-form textarea::placeholder {
	color: var(--wp--preset--color--contrast-2);
	opacity: 0.7;
}

.halcyon-form input:focus,
.halcyon-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 22%, transparent);
}

.halcyon-form__submit {
	align-self: flex-start;
	margin-top: 0.3rem;
	cursor: pointer;
}

/* Honeypot — visually and physically removed from the layout, kept for bots. */
.halcyon-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---- Form notices --------------------------------------------------- */
.halcyon-notice {
	font-size: 0.95rem;
	line-height: 1.5;
	padding: 0.9rem 1.1rem;
	border-radius: 10px;
	margin-bottom: 1.4rem;
	border: 1px solid transparent;
}

.halcyon-notice--success {
	background-color: var(--wp--preset--color--tertiary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--contrast);
}

.halcyon-notice--error {
	background-color: color-mix(in srgb, #c0392b 10%, var(--wp--preset--color--base-2));
	border-color: color-mix(in srgb, #c0392b 45%, transparent);
	color: var(--wp--preset--color--contrast);
}

/* ---- Plugin form fields (CF7 / WPForms / Gravity Forms) ------------- *
 * So third-party form plugins inherit Halcyon's field styling automatically. */
.wp-block-post-content :where(input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="search"], input[type="number"], input[type="password"], textarea, select),
.wpcf7-form :where(input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), textarea, select),
.wpforms-form :where(input:not([type="submit"]), textarea, select),
.gform_wrapper :where(input:not([type="submit"]), textarea, select) {
	width: 100%;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	color: var(--wp--preset--color--contrast);
	background-color: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--secondary);
	border-radius: 10px;
	padding: 0.7rem 0.9rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-block-post-content :where(input, textarea, select):focus,
.wpcf7-form :where(input, textarea, select):focus,
.wpforms-form :where(input, textarea, select):focus,
.gform_wrapper :where(input, textarea, select):focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 22%, transparent);
}

/* ============================================================ *
 * Core-block coverage — styles for blocks theme.json can't reach.
 * ============================================================ */

/* ---- Button: outline variation -------------------------------------- */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--primary);
	border: 1.5px solid currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base-2);
	border-color: var(--wp--preset--color--primary);
}

/* ---- Table ---------------------------------------------------------- */
.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}
.wp-block-table th,
.wp-block-table td {
	border: 1px solid var(--wp--preset--color--secondary);
	padding: 0.7rem 0.9rem;
	text-align: left;
}
.wp-block-table thead th {
	background-color: var(--wp--preset--color--tertiary);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
}
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: color-mix(in srgb, var(--wp--preset--color--tertiary) 55%, transparent);
}
.wp-block-table figcaption {
	color: var(--wp--preset--color--contrast-2);
}

/* ---- Details / accordion -------------------------------------------- */
.wp-block-details > summary {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	cursor: pointer;
	padding: 0.85rem 0;
	color: var(--wp--preset--color--contrast);
	list-style-position: inside;
}
.wp-block-details[open] > summary {
	border-bottom: 1px solid var(--wp--preset--color--secondary);
	margin-bottom: 0.7rem;
}

/* ---- File ----------------------------------------------------------- */
.wp-block-file__button {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base-2);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	border-radius: 9px;
}
.wp-block-file__button:hover {
	background-color: var(--wp--preset--color--contrast);
}

/* ---- Lists of links: latest posts/comments, RSS, categories, archives */
.wp-block-latest-posts:not(.is-grid),
.wp-block-categories-list,
.wp-block-archives-list,
.wp-block-latest-comments,
.wp-block-rss {
	list-style: none;
	padding-left: 0;
}
.wp-block-latest-posts > li,
.wp-block-categories-list > li,
.wp-block-archives-list > li,
.wp-block-rss__item {
	padding: 0.4rem 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--secondary) 60%, transparent);
}
.wp-block-latest-posts__post-date,
.wp-block-latest-comments__comment-date,
.wp-block-rss__item-publish-date {
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
	font-family: var(--wp--preset--font-family--heading);
}

/* ---- Tag cloud ------------------------------------------------------ */
.wp-block-tag-cloud a {
	display: inline-block;
	padding: 0.3rem 0.75rem;
	margin: 0 0.3rem 0.45rem 0;
	background-color: var(--wp--preset--color--tertiary);
	border-radius: 999px;
	font-size: 0.85rem !important;
	text-decoration: none;
}
.wp-block-tag-cloud a:hover {
	background-color: var(--wp--preset--color--secondary);
}

/* ---- Calendar ------------------------------------------------------- */
.wp-block-calendar table th {
	background-color: var(--wp--preset--color--tertiary);
}
.wp-block-calendar tbody td,
.wp-block-calendar th {
	border-color: var(--wp--preset--color--secondary);
}

/* ============================================================ *
 * Breadcrumbs.
 * ============================================================ */
.halcyon-breadcrumbs {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-2);
}
.halcyon-breadcrumbs a {
	color: var(--wp--preset--color--contrast-2);
	text-decoration: none;
}
.halcyon-breadcrumbs a:hover {
	color: var(--wp--preset--color--primary);
}
.halcyon-breadcrumbs__sep {
	margin: 0 0.55rem;
	color: var(--wp--preset--color--secondary);
}
.halcyon-breadcrumbs [aria-current="page"] {
	color: var(--wp--preset--color--contrast);
}

/* ============================================================ *
 * New patterns & layouts.
 * ============================================================ */

/* ---- Sidebar widgets ------------------------------------------------ */
.halcyon-sidebar .wp-block-heading {
	margin-bottom: 0.6rem;
}

@media (max-width: 781px) {
	.halcyon-sidebar {
		position: static !important;
	}
}

/* ---- Project metadata strip ----------------------------------------- */
.halcyon-project-meta__item .wp-block-heading {
	margin-bottom: 0;
}

/* ---- Author box ----------------------------------------------------- */
.halcyon-author-box .wp-block-post-author__avatar img {
	border-radius: 50%;
}
.halcyon-author-box .wp-block-post-author__byline {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-2);
}
.halcyon-author-box .wp-block-post-author__name {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
}

/* ---- Logo cloud ----------------------------------------------------- */
.halcyon-logos img {
	filter: grayscale(1);
	opacity: 0.55;
	transition: filter 0.25s ease, opacity 0.25s ease;
}
.halcyon-logos img:hover {
	filter: grayscale(0);
	opacity: 1;
}

/* ---- Pricing: featured tier ----------------------------------------- */
.wp-block-group.halcyon-pricing--featured {
	border-color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--card);
}

/* ---- Table of contents pattern -------------------------------------- */
.halcyon-toc .wp-block-table-of-contents ol,
.halcyon-toc .wp-block-table-of-contents ul {
	margin: 0;
	padding-left: 1.1rem;
}
.halcyon-toc a {
	text-decoration: none;
}
.halcyon-toc a:hover {
	text-decoration: underline;
}
