/*
Theme Name: Zotung Language Fresh
Theme URI: https://zotung.us/
Author: Zotung Community
Description: A fresh, self-configuring WordPress theme for the Zotung dictionary, translator, and language-learning community.
Version: 2.0.2
Requires at least: 6.2
Tested up to: 6.8
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: zotung-language
Tags: education, translation-ready, custom-logo, custom-menu, featured-images, accessibility-ready
*/

:root {
	--zt-primary: #175c53;
	--zt-primary-dark: #0c3935;
	--zt-accent: #edb84e;
	--zt-ink: #172522;
	--zt-muted: #5d6d68;
	--zt-bg: #f5f8f4;
	--zt-card: #fff;
	--zt-border: #dce6e0;
	--zt-radius: 1.25rem;
	--zt-shadow: 0 18px 50px rgba(15, 65, 57, .11);
	--zt-content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--zt-bg);
	color: var(--zt-ink);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 17px;
	line-height: 1.65;
}
a { color: var(--zt-primary); text-underline-offset: .2em; }
a:hover { color: var(--zt-primary-dark); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--zt-accent); outline-offset: 3px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
	top: 1rem; left: 1rem; z-index: 9999; width: auto; height: auto; margin: 0;
	padding: .75rem 1rem; clip: auto; background: #fff; color: #000;
}
.zt-container { width: min(calc(100% - 2rem), var(--zt-content)); margin-inline: auto; }
.site-header {
	position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(23, 92, 83, .1);
	background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px);
}
.zt-header-inner { min-height: 76px; display: flex; align-items: center; gap: 1.5rem; }
.custom-logo { display: block; max-height: 48px; width: auto; }
.site-branding { display: flex; align-items: center; gap: .75rem; margin-right: auto; text-decoration: none; color: var(--zt-ink); }
.zt-brand-mark {
	display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px;
	background: var(--zt-primary); color: #fff; font-weight: 800;
}
.zt-brand-copy strong, .zt-brand-copy small { display: block; line-height: 1.2; }
.zt-brand-copy small { margin-top: .2rem; color: var(--zt-muted); font-size: .72rem; }
.primary-menu { display: flex; align-items: center; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.primary-menu li { position: relative; }
.primary-menu a { display: block; padding: .65rem .8rem; border-radius: .65rem; color: var(--zt-ink); text-decoration: none; font-weight: 650; }
.primary-menu a:hover, .primary-menu .current-menu-item > a { background: #e7f1ed; color: var(--zt-primary-dark); }
.primary-menu .sub-menu {
	position: absolute; top: calc(100% + .55rem); left: 0; z-index: 110; display: none;
	width: max-content; min-width: 220px; max-width: 320px; margin: 0; padding: .55rem;
	border: 1px solid var(--zt-border); border-radius: 1rem; background: #fff;
	box-shadow: var(--zt-shadow); list-style: none;
}
.primary-menu .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.65rem; height: .65rem; }
.primary-menu .sub-menu a { padding: .7rem .8rem; font-size: .94rem; white-space: normal; }
.primary-menu .sub-menu .sub-menu { top: -.55rem; left: calc(100% + .6rem); }
.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu,
.primary-menu li.submenu-open > .sub-menu { display: block; }
.primary-menu li.submenu-closed > .sub-menu { display: none; }
.zt-submenu-toggle {
	display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -.3rem;
	padding: 0; border: 0; border-radius: .45rem; background: transparent; color: var(--zt-ink); cursor: pointer;
}
.zt-submenu-toggle:hover { background: #e7f1ed; }
.zt-submenu-toggle svg { transition: transform .18s ease; }
.submenu-open > .zt-submenu-toggle svg { transform: rotate(180deg); }
.primary-menu > .menu-item-has-children { display: flex; align-items: center; }
.zt-nav-toggle { display: none; border: 0; background: transparent; padding: .6rem; color: var(--zt-ink); }
.zt-nav-toggle svg { display: block; }
.zt-button, .ztd-search button, .ztd-translator button, input[type="submit"] {
	display: inline-flex; justify-content: center; align-items: center; gap: .45rem; min-height: 48px;
	padding: .72rem 1.1rem; border: 0; border-radius: .8rem; background: var(--zt-primary);
	color: #fff; font-weight: 750; text-decoration: none; cursor: pointer;
}
.zt-button:hover, .ztd-search button:hover, .ztd-translator button:hover { background: var(--zt-primary-dark); color: #fff; }
.zt-button--gold { background: var(--zt-accent); color: #2f240e; }
.zt-button--ghost { background: transparent; color: var(--zt-primary); border: 1px solid var(--zt-border); }
.zt-hero {
	position: relative; overflow: hidden; padding: clamp(4.2rem, 9vw, 8rem) 0 5rem;
	background: radial-gradient(circle at 82% 20%, rgba(237,184,78,.35), transparent 26%),
		linear-gradient(140deg, #eef8f3 0%, #f9fbf7 55%, #fff7e7 100%);
}
.zt-hero::after {
	content: ""; position: absolute; inset: auto -8rem -14rem auto; width: 34rem; height: 34rem;
	border: 70px solid rgba(23,92,83,.06); border-radius: 50%;
}
.zt-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.zt-eyebrow { margin: 0 0 .8rem; color: var(--zt-primary); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; }
.zt-hero h1 { max-width: 740px; margin: 0; font-size: clamp(2.6rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.055em; }
.zt-hero h1 em { color: var(--zt-primary); font-style: normal; }
.zt-hero-copy { max-width: 650px; margin: 1.4rem 0 2rem; color: var(--zt-muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.zt-search-card { padding: .75rem; border: 1px solid rgba(23,92,83,.12); border-radius: 1rem; background: rgba(255,255,255,.9); box-shadow: var(--zt-shadow); }
.ztd-search { display: flex; gap: .6rem; }
.ztd-search input[type="search"] {
	width: 100%; min-height: 54px; padding: .75rem 1rem; border: 1px solid var(--zt-border);
	border-radius: .8rem; background: #fff; color: var(--zt-ink);
}
.zt-direction { display: flex; gap: .45rem; margin-top: .7rem; }
.zt-direction a { padding: .25rem .55rem; border-radius: .5rem; color: var(--zt-muted); font-size: .8rem; font-weight: 700; text-decoration: none; }
.zt-direction a.is-active { background: #dceddf; color: var(--zt-primary-dark); }
.zt-feature-card { padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid rgba(255,255,255,.55); border-radius: 2rem; background: var(--zt-primary-dark); color: #fff; box-shadow: var(--zt-shadow); transform: rotate(1.5deg); }
.zt-feature-card > * { transform: rotate(-1.5deg); }
.zt-feature-card small { color: #bcd8d2; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.zt-feature-word { margin: .7rem 0 0; font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1; }
.zt-feature-meaning { margin: .7rem 0 1.5rem; color: #e1efeb; }
.zt-section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.zt-section--white { background: #fff; }
.zt-section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.zt-section-head h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.05; letter-spacing: -.035em; }
.zt-section-head p { max-width: 570px; margin: 0; color: var(--zt-muted); }
.zt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.zt-card { padding: 1.5rem; border: 1px solid var(--zt-border); border-radius: var(--zt-radius); background: var(--zt-card); box-shadow: 0 10px 30px rgba(23,37,34,.05); }
.zt-card h3 { margin: .35rem 0 .4rem; font-size: 1.25rem; }
.zt-card p { margin: 0; color: var(--zt-muted); }
.zt-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: .8rem; background: #e6f2ed; color: var(--zt-primary); font-size: 1.25rem; }
.zt-word-list { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.zt-word-list a { display: block; padding: .7rem 1rem; border: 1px solid var(--zt-border); border-radius: 999px; background: #fff; text-decoration: none; font-weight: 700; }
.zt-page-hero { padding: 3.5rem 0 2.2rem; background: linear-gradient(135deg, #e8f3ee, #fff8e8); }
.zt-page-hero h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -.04em; }
.zt-content { padding: 3rem 0 5rem; }
.zt-entry { max-width: 860px; margin-inline: auto; }
.zt-entry--wide { max-width: 1120px; }
.zt-entry-content > :first-child { margin-top: 0; }
.zt-entry-content .login-username,
.zt-entry-content .login-password { max-width: 520px; }
.zt-entry-content .login-username label,
.zt-entry-content .login-password label { display: block; margin-bottom: .35rem; font-weight: 750; }
.zt-entry-content .login-username input,
.zt-entry-content .login-password input {
	width: 100%; min-height: 48px; padding: .65rem .8rem;
	border: 1px solid var(--zt-border); border-radius: .7rem; background: #fff;
}
.ztd-translator { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--zt-border); border-radius: var(--zt-radius); background: #fff; box-shadow: var(--zt-shadow); }
.ztd-translate-direction, .ztd-translate-panels, .ztd-translate-actions { display: flex; gap: .75rem; }
.ztd-translate-direction { align-items: center; margin-bottom: 1rem; }
.ztd-translate-direction button { background: #e7f1ed; color: var(--zt-primary-dark); }
.ztd-translate-direction button.is-active { background: var(--zt-primary); color: #fff; }
.ztd-translate-panels > label { flex: 1; color: var(--zt-primary-dark); font-weight: 800; }
.ztd-translate-panels textarea {
	display: block; width: 100%; min-height: 220px; margin-top: .5rem; padding: 1rem;
	border: 1px solid var(--zt-border); border-radius: 1rem; resize: vertical; color: var(--zt-ink);
}
.ztd-translate-panels small { display: block; margin-top: .4rem; color: var(--zt-muted); font-weight: 400; }
.ztd-translate-actions { margin-top: 1rem; }
.ztd-honeypot { position: absolute; left: -9999px; }
.ztd-recent-translations, [aria-label="Recent translations"] { margin-top: 3rem; }
.zt-word-meta { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 2rem; }
.zt-pill { padding: .35rem .7rem; border-radius: 999px; background: #e6f2ed; color: var(--zt-primary-dark); font-size: .85rem; font-weight: 750; }
.zt-favorite { background: #fff; color: var(--zt-primary); border: 1px solid var(--zt-border); }
.zt-favorite[aria-pressed="true"] { background: #fff2d4; color: #6a4800; }
.site-footer { padding: 3.5rem 0 1.5rem; background: var(--zt-primary-dark); color: #d6e7e2; }
.zt-footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 2rem; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer a { color: #d6e7e2; }
.zt-footer-menu { margin: 0; padding: 0; list-style: none; }
.zt-footer-menu li + li { margin-top: .5rem; }
.zt-copyright { margin-top: 2.5rem; padding-top: 1.3rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }

@media (max-width: 900px) {
	.zt-nav-toggle { display: block; }
	.site-navigation {
		position: absolute; top: 76px; left: 1rem; right: 1rem; display: none; padding: .75rem;
		border: 1px solid var(--zt-border); border-radius: 1rem; background: #fff; box-shadow: var(--zt-shadow);
	}
	.site-navigation.is-open { display: block; }
	.primary-menu { display: block; }
	.primary-menu > .menu-item-has-children { display: grid; grid-template-columns: 1fr auto; }
	.primary-menu .sub-menu,
	.primary-menu .sub-menu .sub-menu {
		position: static; display: none; grid-column: 1 / -1; width: auto; min-width: 0;
		margin: .2rem 0 .45rem .75rem; padding: .25rem 0 .25rem .65rem;
		border: 0; border-left: 2px solid #dce6e0; border-radius: 0; box-shadow: none;
	}
	.primary-menu li:hover > .sub-menu { display: none; }
	.primary-menu li:focus-within > .sub-menu,
	.primary-menu li.submenu-open > .sub-menu { display: block; }
	.primary-menu li.submenu-closed > .sub-menu { display: none; }
	.zt-submenu-toggle { width: 42px; height: 42px; margin: 0; }
	.primary-menu .sub-menu,
	.primary-menu .sub-menu li { list-style: none; }
	.primary-menu .sub-menu a { min-height: 44px; padding: .7rem .8rem; }
	.zt-header-cta { display: none; }
	.zt-hero-grid, .zt-footer-grid { grid-template-columns: 1fr; }
	.zt-feature-card { max-width: 580px; }
	.zt-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
	body { font-size: 16px; }
	.zt-brand-copy small { display: none; }
	.ztd-search, .ztd-translate-panels { flex-direction: column; }
	.ztd-search button { width: 100%; }
	.zt-grid { grid-template-columns: 1fr; }
	.zt-section-head { align-items: start; flex-direction: column; }
	.zt-hero { padding-top: 3.5rem; }
	.zt-feature-card { transform: none; }
	.zt-feature-card > * { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
