/*
Theme Name: Algonexis
Theme URI: https://www.ea-coder.com
Author: Algonexis Technologies
Description: Lightweight block theme shared by the Algonexis Technologies websites (FxMagnetic, Local Trade Copier, Signal Magician, Equity Sentry EA). Pages are built from core blocks only; each site sets its own logo, menu and colours in the Site Editor.
Version: 1.0.9
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
License: Proprietary
Text Domain: algonexis
*/

/* ---------- Block styles registered in functions.php ---------- */

/* Group: "Section" = full-width band with generous vertical padding */
.wp-block-group.is-style-section {
	padding-top: clamp(48px, 7vw, 96px);
	padding-bottom: clamp(48px, 7vw, 96px);
}

/* Group: "Card" */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border-radius: 14px;
	padding: 28px;
	box-shadow: 0 2px 16px rgba(16, 24, 40, .07);
}
.wp-block-group.is-style-card > :first-child { margin-top: 0; }

/* Group: "Highlight" = soft tinted box */
.wp-block-group.is-style-highlight {
	background: var(--wp--preset--color--tint);
	border-radius: 18px;
	padding: clamp(28px, 5vw, 56px);
}

/* List: "Checklist" */
.wp-block-list.is-style-checklist { list-style: none; padding-left: 0; }
.wp-block-list.is-style-checklist li { position: relative; padding-left: 1.8em; margin: .45em 0; }
.wp-block-list.is-style-checklist li::before {
	content: "\2713";
	position: absolute; left: 0; top: 0;
	color: var(--wp--preset--color--accent);
	font-weight: 700;
}

/* Paragraph: "Kicker" = small label above a heading */
.is-style-kicker {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	margin-bottom: .4em !important;
}
.has-primary-background-color .is-style-kicker { color: var(--wp--preset--color--cta); }

/* Image: "Avatar" (round, 64px) and "Icon" (72px) */
.wp-block-image.is-style-avatar img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.wp-block-image.is-style-icon img { width: 72px; height: auto; }
.wp-block-image.is-style-avatar, .wp-block-image.is-style-icon { margin-bottom: .5em; }

/* ---------- Building blocks ---------- */

/* FAQ (Details block) */
.wp-block-details {
	background: var(--wp--preset--color--base);
	border-radius: 12px;
	padding: 16px 20px;
	box-shadow: 0 1px 8px rgba(16, 24, 40, .06);
}
.wp-block-details summary { font-weight: 600; cursor: pointer; }
.wp-block-details[open] summary { margin-bottom: .6em; }
.wp-block-details + .wp-block-details { margin-top: 12px; }

/* Media & Text: keep images at their natural proportions */
.wp-block-media-text { gap: clamp(20px, 4vw, 48px); }
.wp-block-media-text .wp-block-media-text__content { padding: 0; }
.wp-block-media-text > .wp-block-media-text__media img { height: auto; border-radius: 10px; }

/* Galleries: never crop */
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 8px; }

/* Header */
.alg-header { border-bottom: 1px solid rgba(16, 24, 40, .08); }
.alg-header .wp-block-navigation { font-weight: 500; }

/* Footer */
.alg-footer a { color: inherit; }
.alg-footer .wp-block-list { list-style: none; padding-left: 0; }

/* Dark bands: links and text */
.has-primary-background-color a:not(.wp-element-button) { color: inherit; }
.has-primary-background-color .wp-block-list.is-style-checklist li::before { color: var(--wp--preset--color--accent); }

/* ---------- Forms (Contact Form 7 and plain forms) ---------- */
.wpcf7 fieldset { min-width: 0; max-width: 100%; box-sizing: border-box; border: 0; margin: 0; border-radius: 14px; }
.wpcf7 form p { margin: 0 0 1em; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 input[type="url"],
.wpcf7 input[type="number"], .wpcf7 select, .wpcf7 textarea {
	display: block; width: 100%; max-width: 100%; box-sizing: border-box;
	margin-top: 6px; padding: 12px 14px;
	font: inherit; color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base);
	border: 1px solid #d0d5dd; border-radius: 10px;
}
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 1px; }
.wpcf7 textarea { min-height: 160px; }
.wpcf7 input[type="submit"] {
	font: inherit; font-weight: 700; font-size: 1.125rem; cursor: pointer;
	background: var(--wp--preset--color--cta); color: var(--wp--preset--color--primary);
	border: 0; border-radius: 10px; padding: 14px 32px;
}
.wpcf7 input[type="submit"]:hover { background: #ffb84d; }
.wpcf7 .wpcf7-spinner { vertical-align: middle; }

/* Legacy Salient [button] shortcode output in old posts (salient-shortcodes still renders it as a.nectar-button) */
a.nectar-button {
	display: inline-block;
	background: var(--wp--preset--color--cta);
	color: var(--wp--preset--color--primary);
	border-radius: 10px;
	padding: 16px 32px;
	font-weight: 700;
	text-decoration: none;
}
a.nectar-button:hover { background: #ffb84d; }

/* Post byline (single.html) */
.post-byline p { margin: 0; }

/* Legacy classic-editor content in old posts: [caption] figures carry a fixed inline width */
.wp-caption { max-width: 100%; }
.wp-block-post-content img { max-width: 100%; height: auto; }
.wp-caption-text { font-size: 0.875rem; color: var(--wp--preset--color--muted); }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
@media (max-width: 600px) { .alignleft, .alignright { float: none; margin: 0 0 1em; } }

/* Opt-in page template: full-width bands touch each other (no block-gap strips between them) */
.page-template-page-optin .wp-site-blocks > *,
.page-template-page-optin main > * { margin-block-start: 0; }

/* ---------- Posts and pages with a printed title: legacy content and readability (1.0.8) ----------
   Scoped with ".wp-block-post-title ~" so landing/blank/opt-in templates (where post-content is the whole <main>) are untouched. */
/* Section headings coded as <h1> inside the content (Word/classic imports): keep them below the post title's size */
.wp-block-post-title ~ .wp-block-post-content h1 { font-size: var(--wp--preset--font-size--x-large); }
/* Easy Table of Contents box: left-aligned with the text instead of centred by the constrained layout */
.wp-block-post-title ~ .wp-block-post-content > #ez-toc-container { margin-left: 0 !important; }
/* Classic screenshots marked aligncenter sit inline inside a <p>/<li>: make them centred blocks */
.wp-block-post-title ~ .wp-block-post-content img.aligncenter { display: block; margin-left: auto; margin-right: auto; }
/* Long URLs in classic content wrap instead of widening the page */
.wp-block-post-title ~ .wp-block-post-content { overflow-wrap: break-word; }
/* Bare classic tables (core Table blocks are wrapped in figure.wp-block-table and keep their own styles) */
.wp-block-post-title ~ .wp-block-post-content > table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-block: 1.5em; }
.wp-block-post-title ~ .wp-block-post-content > table :is(td, th) { border: 1px solid #d0d5dd; padding: 6px 12px; vertical-align: top; text-align: left; }
.wp-block-post-title ~ .wp-block-post-content > table :is(td, th)[width] { width: auto; }
.wp-block-post-title ~ .wp-block-post-content > table :is(td, th) p { margin: 0; }

/* Author card (single.html): readable sizes; no bio = no "About the author" card (the byline still names the author) */
.wp-block-post-author__byline { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.wp-block-post-author__name { font-size: var(--wp--preset--font-size--medium); font-weight: 700; margin: .2em 0 0; }
.wp-block-post-author__bio { font-size: 0.9375rem; margin: .4em 0 0; }
.wp-block-group.is-style-card:has(> .wp-block-post-author .wp-block-post-author__bio:empty) { display: none; }

/* Author archive: avatar + bio under the H1 (inc/posts.php) */
.author-archive-bio { display: flex; gap: 16px; align-items: flex-start; margin: 0 0 32px; }
.author-archive-bio img { border-radius: 50%; flex: none; }
.author-archive-bio p { margin: 0 0 .5em; }

/* Previous / next post links (added by a site plugin where wanted): two columns on desktop, stacked on phones */
.alg-post-nav { gap: 16px; font-weight: 600; }
.alg-post-nav > * { flex: 1 1 280px; }
.alg-post-nav .post-navigation-link-next { text-align: right; }

/* Search icon in a site header: a plain icon, not the orange call-to-action button style (1.0.9) */
.alg-header .wp-block-search__button { padding: 8px; background: transparent; color: var(--wp--preset--color--primary); border: 0; box-shadow: none; }
.alg-header .wp-block-search__button:hover { background: var(--wp--preset--color--light); }
