/*
Theme Name: Tools Theme
Description: A lightweight, fast, dark-navy theme for a large collection of online tools. Works with the Tools Framework plugin. Change colors, fonts, header, footer and homepage under Appearance > Customize.
Author: You
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tools-theme
*/

/* ==========================================================================
   1. Design tokens (the Customizer overrides these automatically)
   ========================================================================== */
:root {
	--c-bg: #0B1220;
	--c-surface: #0F1830;
	--c-card: #131F3A;
	--c-tool: #17274A;
	--c-input: #0D1730;
	--c-border: #22304D;
	--c-input-border: #5169A0;
	--c-text: #E6EDF7;
	--c-muted: #A3B3D1;
	--c-accent: #4C8DFF;
	--c-accent-hover: #7AA9FF;
	--c-btn-text: #08101F;

	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-heading: var(--font-body);
	--fs-base: 100%;
	--container: 1180px;
	--space-scale: 1;
	--radius-btn: 6px;
	--radius-card: 8px;
	--logo-h: 32px;

	/* extra colours (decoration only, not in the Customizer) */
	--c-accent-2: #9B7BFF;
	--c-accent-3: #22D3EE;
	--grad: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
	--grad-line: linear-gradient(90deg, var(--c-accent-3), var(--c-accent), var(--c-accent-2), #F472B6);
	--ease: cubic-bezier(0.22, 1, 0.36, 1);

	--sp-1: calc(0.25rem * var(--space-scale));
	--sp-2: calc(0.5rem * var(--space-scale));
	--sp-3: calc(0.75rem * var(--space-scale));
	--sp-4: calc(1rem * var(--space-scale));
	--sp-5: calc(1.5rem * var(--space-scale));
	--sp-6: calc(2.5rem * var(--space-scale));
	--sp-7: calc(4rem * var(--space-scale));

	color-scheme: dark;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font-body);
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.site-main { flex: 1 0 auto; }

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--c-accent); text-underline-offset: 0.15em; }
a:hover { color: var(--c-accent-hover); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	line-height: 1.2;
	margin: 0 0 var(--sp-3);
	color: var(--c-text);
}
h1 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 var(--sp-4); }

:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
}

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
	width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0; z-index: 100000;
	left: 0.5rem; top: 0.5rem; padding: 0.75rem 1rem; background: var(--c-accent); color: var(--c-btn-text);
	border-radius: var(--radius-btn); font-weight: 700; text-decoration: none;
}

/* ==========================================================================
   3. Buttons and forms
   ========================================================================== */
.button,
.tf-tool button {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 0.6em 1.1em;
	background: var(--grad); color: var(--c-btn-text);
	border: 0; border-radius: var(--radius-btn);
	font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
	box-shadow: 0 2px 10px rgba(76, 141, 255, 0.25);
	transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s;
}
.button:hover,
.tf-tool button:hover { filter: brightness(1.12); color: var(--c-btn-text); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(76, 141, 255, 0.4); }
.button:active,
.tf-tool button:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(76, 141, 255, 0.3); }

.button--ghost { background: transparent; color: var(--c-text); border: 1px solid var(--c-input-border); box-shadow: none; }
.button--ghost:hover { background: var(--c-card); color: var(--c-text); filter: none; border-color: var(--c-accent); box-shadow: none; }

.search-field,
.tf-tool input[type="text"], .tf-tool input[type="number"], .tf-tool input[type="search"],
.tf-tool input[type="email"], .tf-tool input[type="date"], .tf-tool input[type="time"],
.tf-tool select, .tf-tool textarea {
	min-height: 44px; padding: 0.6rem 0.85rem;
	background: var(--c-input); color: var(--c-text);
	border: 1px solid var(--c-input-border); border-radius: var(--radius-btn);
	font: inherit;
}
.search-field, .tf-tool input, .tf-tool select, .tf-tool textarea { transition: border-color 0.2s, box-shadow 0.2s; }
.search-field:focus, .tf-tool input:focus, .tf-tool select:focus, .tf-tool textarea:focus {
	outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.25);
}
.search-field::placeholder, .tf-tool input::placeholder, .tf-tool textarea::placeholder { color: var(--c-muted); opacity: 1; }

.tf-tool label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.tf-tool input[type="text"], .tf-tool input[type="number"], .tf-tool input[type="search"],
.tf-tool input[type="email"], .tf-tool select, .tf-tool textarea { width: 100%; max-width: 30rem; }

.search-form { display: flex; gap: var(--sp-2); width: 100%; }
.search-form .search-field { flex: 1 1 auto; min-width: 0; }

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header { position: relative; background: linear-gradient(180deg, var(--c-surface), var(--c-bg)); border-bottom: 1px solid var(--c-border); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad-line); opacity: 0.9; }
.has-sticky-header .site-header { position: sticky; top: 0; z-index: 50; }
.admin-bar.has-sticky-header .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar.has-sticky-header .site-header { top: 46px; } }

.site-header__inner { display: flex; align-items: center; gap: var(--sp-4); min-height: 4rem; flex-wrap: wrap; padding-block: var(--sp-2); }

.site-title {
	font-size: 1.3rem; font-weight: 800; color: var(--c-text); text-decoration: none; letter-spacing: -0.01em;
	background: linear-gradient(90deg, var(--c-text), var(--c-accent-hover) 60%, var(--c-accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
	transition: filter 0.2s;
}
.site-title:hover { filter: brightness(1.2); }
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: var(--logo-h); width: auto; }

.menu-toggle { display: none; margin-left: auto; }

.site-header__panel { display: flex; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.site-header__panel .search-form { max-width: 20rem; margin-left: auto; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.menu a { display: block; padding: 0.5rem 0.75rem; color: var(--c-text); text-decoration: none; border-radius: var(--radius-btn); transition: background-color 0.2s, color 0.2s; }
.menu a:hover { background: rgba(76, 141, 255, 0.14); color: var(--c-accent-hover); }
.menu .current-menu-item > a, .menu a[aria-current="page"] { color: var(--c-accent-hover); background: rgba(76, 141, 255, 0.12); }

@media (max-width: 800px) {
	.js .menu-toggle { display: inline-flex; }
	.site-header__panel { flex-direction: column; align-items: stretch; flex-basis: 100%; }
	.js .site-header__panel { display: none; }
	.js .site-header__panel.is-open { display: flex; }
	.site-header__panel .search-form { max-width: none; margin-left: 0; }
	.menu { flex-direction: column; }
}

/* ==========================================================================
   5. Sections, hero, grids, cards
   ========================================================================== */
.hero {
	position: relative; overflow: hidden;
	background:
		radial-gradient(60rem 22rem at 15% -20%, rgba(76, 141, 255, 0.28), transparent 60%),
		radial-gradient(45rem 20rem at 90% 0%, rgba(155, 123, 255, 0.24), transparent 60%),
		radial-gradient(35rem 16rem at 60% 120%, rgba(34, 211, 238, 0.14), transparent 60%),
		var(--c-surface);
	border-bottom: 1px solid var(--c-border);
	padding-block: var(--sp-6);
}
.hero__inner { max-width: 46rem; margin-inline: auto; text-align: center; animation: ts-rise 0.6s var(--ease) both; }
.hero--left .hero__inner { margin-inline: 0; text-align: left; }
.hero h1 {
	background: linear-gradient(90deg, var(--c-text) 10%, var(--c-accent-hover) 55%, var(--c-accent-2));
	-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__text { color: var(--c-muted); font-size: 1.1rem; margin-bottom: var(--sp-5); }
.hero .search-form { max-width: 36rem; margin-inline: auto; }
.hero--left .search-form { margin-inline: 0; }
.hero .search-field { min-height: 50px; font-size: 1.02rem; }
.hero .button { min-height: 50px; }

.section { padding-block: var(--sp-5); }
.section--alt { background: var(--c-surface); border-block: 1px solid var(--c-border); }
.section__head { margin-bottom: var(--sp-4); }
.section__head h2 { display: flex; align-items: center; gap: 0.6rem; margin-bottom: var(--sp-1); }
.section__head h2::before { content: ""; flex: none; width: 5px; height: 1.1em; border-radius: 3px; background: var(--grad); }
.section__head p { color: var(--c-muted); margin: 0; font-size: 0.95rem; }
.section__more { margin-top: var(--sp-4); }
.section__title-link { color: inherit; text-decoration: none; }
.section__title-link:hover { color: var(--c-accent-hover); }

.page-head { padding-block: var(--sp-4) var(--sp-4); }
.page-head__intro { color: var(--c-muted); font-size: 1.05rem; max-width: 60rem; }
.page-head__intro > :last-child { margin-bottom: 0; }

.grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.stack { display: grid; gap: var(--sp-2); }

/* Compact card: small coloured icon on the left, text on the right. */
.card {
	--h: 215;
	position: relative; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: var(--sp-3); align-items: center;
	padding: 0.7rem 2rem 0.7rem 0.75rem; background: var(--c-card);
	border: 1px solid var(--c-border); border-radius: var(--radius-card);
	box-shadow: inset 3px 0 0 hsl(var(--h) 85% 62% / 0.85);
	transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s var(--ease), background-color 0.2s;
	animation: ts-rise 0.5s var(--ease) both;
}
.card::after {
	content: ""; position: absolute; right: 0.85rem; top: 50%; width: 0.5rem; height: 0.5rem;
	border-top: 2px solid var(--c-muted); border-right: 2px solid var(--c-muted);
	transform: translateY(-50%) rotate(45deg); opacity: 0.6;
	transition: transform 0.25s var(--ease), border-color 0.2s, opacity 0.2s;
}
.card:hover {
	transform: translateY(-3px); border-color: hsl(var(--h) 80% 65% / 0.8);
	background: linear-gradient(135deg, hsl(var(--h) 70% 55% / 0.12), var(--c-card) 70%);
	box-shadow: inset 3px 0 0 hsl(var(--h) 85% 62%), 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px hsl(var(--h) 80% 65% / 0.15);
}
.card:hover::after { transform: translateY(-50%) translateX(3px) rotate(45deg); border-color: hsl(var(--h) 90% 75%); opacity: 1; }
.card:focus-within { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.no-card-borders .card { border-color: transparent; }
.no-card-borders .card:hover { border-color: var(--c-border); }

.grid > .card:nth-child(2) { animation-delay: 0.04s; }
.grid > .card:nth-child(3) { animation-delay: 0.08s; }
.grid > .card:nth-child(4) { animation-delay: 0.12s; }
.grid > .card:nth-child(5) { animation-delay: 0.16s; }
.grid > .card:nth-child(6) { animation-delay: 0.2s; }
.grid > .card:nth-child(n+7) { animation-delay: 0.24s; }

.card__link { color: var(--c-text); text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card__link:focus-visible { outline: none; }
.card:hover .card__link { color: hsl(var(--h) 90% 80%); }

.card__icon {
	grid-row: 1 / span 3; align-self: center;
	display: flex; align-items: center; justify-content: center;
	width: 2.5rem; height: 2.5rem; border-radius: 10px; overflow: hidden;
	font-weight: 800; font-size: 1.1rem; line-height: 1;
	color: hsl(var(--h) 95% 82%);
	background: linear-gradient(145deg, hsl(var(--h) 80% 60% / 0.32), hsl(var(--h) 80% 45% / 0.16));
	border: 1px solid hsl(var(--h) 80% 65% / 0.35);
	transition: transform 0.3s var(--ease);
}
.card__icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.card:hover .card__icon { transform: scale(1.08) rotate(-4deg); }

.card__title { grid-column: 2; margin: 0; font-size: 0.98rem; font-weight: 600; line-height: 1.3; }
.card__desc {
	grid-column: 2; margin: 0.1rem 0 0; color: var(--c-muted); font-size: 0.85rem; line-height: 1.4;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta { grid-column: 2; margin-top: 0.25rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: hsl(var(--h) 85% 76%); }
.hide-card-desc .card__desc { display: none; }

@keyframes ts-rise {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
	.hero { padding-block: var(--sp-5); }
	.card { padding-block: 0.6rem; }
}

/* ==========================================================================
   6. Breadcrumbs, tool page, content
   ========================================================================== */
.breadcrumbs { padding-block: var(--sp-4) 0; font-size: 0.875rem; color: var(--c-muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-accent); }

.tool-header { padding-block: var(--sp-4) var(--sp-4); }
.tool-header__intro { color: var(--c-muted); font-size: 1.1rem; max-width: 60rem; margin-bottom: var(--sp-3); }
.tool-header__cat { font-size: 0.9rem; color: var(--c-muted); }

.tf-tool-area {
	background: linear-gradient(180deg, rgba(76, 141, 255, 0.07), transparent 40%), var(--c-tool);
	border: 1px solid var(--c-border); border-top: 3px solid var(--c-accent); border-radius: var(--radius-card);
	padding: clamp(1rem, 3vw, 2rem); margin-bottom: var(--sp-5);
}
.tf-tool-notice p:last-child { margin-bottom: 0; }

.tool-columns { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); padding-bottom: var(--sp-6); }
@media (min-width: 62rem) { .tool-columns { grid-template-columns: minmax(0, 1fr) 20rem; } }

.sidebar-block h2 { font-size: 1.1rem; }

.prose { max-width: 75ch; }
.prose > * { max-width: 75ch; }
.prose h2 { margin-top: var(--sp-6); }
.prose h3 { margin-top: var(--sp-5); }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 var(--sp-4); }
.prose li { margin-bottom: var(--sp-1); }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-4); }
.prose th, .prose td { border: 1px solid var(--c-border); padding: 0.5rem 0.75rem; text-align: left; }
.prose th { background: var(--c-card); }
.prose blockquote { margin: 0 0 var(--sp-4); padding: var(--sp-2) var(--sp-4); border-left: 3px solid var(--c-accent); background: var(--c-card); }
.prose pre, .prose code { background: var(--c-input); border-radius: 4px; }
.prose pre { padding: var(--sp-3); overflow-x: auto; }
.prose code { padding: 0.1em 0.35em; }
.prose img { border-radius: var(--radius-card); }
.elementor-page .prose, .elementor-page .prose > * { max-width: none; }

.tf-faq { margin-top: var(--sp-6); }
.tf-faq details { background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-card); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2); transition: border-color 0.2s; }
.tf-faq details:hover, .tf-faq details[open] { border-color: var(--c-accent); }
.tf-faq summary { cursor: pointer; font-weight: 600; }
.tf-faq details[open] summary { margin-bottom: var(--sp-2); }
.tf-faq details > div > :last-child { margin-bottom: 0; }

.ad-slot { margin-block: var(--sp-4); text-align: center; }

/* ==========================================================================
   7. Pagination, empty states
   ========================================================================== */
.pagination { margin-top: var(--sp-5); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.page-numbers {
	display: inline-block; min-width: 44px; padding: 0.55rem 0.85rem; text-align: center;
	background: var(--c-card); color: var(--c-text); border: 1px solid var(--c-border);
	border-radius: var(--radius-btn); text-decoration: none;
}
a.page-numbers:hover { border-color: var(--c-accent); color: var(--c-text); transform: translateY(-1px); }
.page-numbers { transition: transform 0.2s var(--ease), border-color 0.2s; }
.page-numbers.current { background: var(--grad); color: var(--c-btn-text); border-color: var(--c-accent); font-weight: 700; }
.page-numbers.dots { background: transparent; border-color: transparent; }

.empty { padding: var(--sp-6); text-align: center; border: 1px dashed var(--c-input-border); border-radius: var(--radius-card); color: var(--c-muted); }
.empty p:last-child { margin-bottom: 0; }

.narrow { max-width: 40rem; }
.entry-meta { color: var(--c-muted); font-size: 0.9rem; }

/* ==========================================================================
   8. Footer
   ========================================================================== */
.site-footer { position: relative; background: linear-gradient(180deg, var(--c-surface), #0A1022); border-top: 1px solid var(--c-border); margin-top: var(--sp-6); padding-top: var(--sp-6); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--grad-line); }
.footer-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); padding-bottom: var(--sp-6); }
.footer-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-accent-3); margin-bottom: var(--sp-3); }
.footer-site { font-weight: 700; margin-bottom: var(--sp-2); }
.footer-col p { color: var(--c-muted); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: var(--sp-2); }
.footer-col a { color: var(--c-text); text-decoration: none; transition: color 0.2s, padding-left 0.2s var(--ease); }
.footer-col a:hover { color: var(--c-accent-hover); padding-left: 4px; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); border-top: 1px solid var(--c-border); padding-block: var(--sp-4); font-size: 0.9rem; color: var(--c-muted); }
.footer-bottom p { margin: 0; }
.footer-bottom .menu a { color: var(--c-muted); padding: 0.25rem 0.5rem; }
.footer-bottom .menu a:hover { color: var(--c-accent-hover); background: transparent; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
