/*
Theme Name: Stronic
Theme URI: https://stronic.vn
Author: Stronic
Description: Lightweight custom theme for stronic.vn (KNX smart home). Replaces Divi: no page builder required, keeps the "project" post type and its URLs.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: stronic
*/

:root {
	--ink: #0f1b24;
	--slate: #273845;
	--mute: #5a6a76;
	--paper: #f4f6f5;
	--white: #ffffff;
	--line: #d6dde1;
	--signal: #0a8f7e;
	--signal-dark: #076c5f;
	--radius: 3px;
	--wrap: 1180px;
	--font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	color: var(--slate);
	background: var(--white);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--signal-dark); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--white); color: var(--ink); padding: 12px 16px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Buttons and links */
.btn {
	display: inline-block; padding: .8em 1.7em; border: 2px solid var(--signal);
	background: var(--signal); color: var(--white); font: 600 1rem/1.2 var(--font);
	text-decoration: none; border-radius: var(--radius); cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--signal-dark); border-color: var(--signal-dark); color: var(--white); }
.btn--ghost { background: transparent; color: var(--signal-dark); }
.btn--ghost:hover { background: var(--signal-dark); color: var(--white); }
.text-link { font-weight: 600; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--paper); }
.admin-bar .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand img { max-height: 44px; width: auto; }
.brand__text { color: var(--white); font-weight: 700; font-size: 1.3rem; text-decoration: none; }
.primary-nav { display: flex; align-items: center; gap: 28px; }
.primary-nav .menu, .footer-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.primary-nav a { color: var(--paper); text-decoration: none; padding: 10px 12px; display: block; font-size: .95rem; font-weight: 500; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a { color: #6fe0cf; }
.primary-nav .menu > li { position: relative; }
.primary-nav .sub-menu {
	list-style: none; margin: 0; padding: 8px 0; position: absolute; left: 0; top: 100%;
	min-width: 240px; background: var(--ink); border-top: 2px solid var(--signal);
	display: none; box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.primary-nav__hotline { border: 1px solid var(--signal); border-radius: var(--radius); white-space: nowrap; font-weight: 600 !important; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
	content: ""; position: absolute; left: 10px; right: 10px; height: 2px; background: var(--white); transition: transform .2s;
}
.nav-toggle__bar { top: 21px; }
.nav-toggle__bar::before { top: -7px; left: 0; right: 0; }
.nav-toggle__bar::after { top: 7px; left: 0; right: 0; }

/* Hero */
.hero { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.hero::before {
	content: ""; position: absolute; inset: 0; z-index: 0;
	background: linear-gradient(90deg, rgba(15,27,36,.96) 25%, rgba(15,27,36,.55)), var(--hero-image, none) center / cover no-repeat;
}
.hero > * { position: relative; z-index: 1; }
.hero__inner { padding-top: clamp(72px, 12vw, 150px); padding-bottom: 72px; }
.hero__title { color: var(--white); font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -.02em; max-width: 14ch; margin-bottom: .4em; }
.hero__text { max-width: 56ch; font-size: 1.15rem; color: #c9d4da; margin-bottom: 1.6em; }

/* The 24V bus line: brands as devices on one cable */
.bus { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.bus::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--signal); }
.bus__node { position: relative; padding: 28px 16px 28px 0; display: flex; flex-direction: column; font-size: .9rem; color: #9fb0ba; }
.bus__node::before { content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid var(--signal); }
.bus__node strong { color: var(--white); font-size: 1.05rem; font-weight: 600; }

/* Sections */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tint { background: var(--paper); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section__head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; }
.split__head { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.split__body { max-width: 62ch; }

.feature { display: grid; grid-template-columns: 1fr 1.6fr; gap: 56px; padding: 40px 0; border-top: 1px solid var(--line); }
.feature:last-child { border-bottom: 1px solid var(--line); }
.feature__title { font-size: 1.5rem; margin: 0; }
.feature__body { max-width: 62ch; }

.partners { margin-top: 48px; }
.partners__names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.partners__names li { padding: 28px 16px; text-align: center; font-weight: 600; color: var(--mute); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.partners .wp-block-gallery img, .partners img { max-height: 56px; width: auto; margin: 0 auto; filter: grayscale(1); opacity: .8; transition: filter .15s, opacity .15s; }
.partners img:hover { filter: none; opacity: 1; }

/* Projects */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
.project-card__link { display: block; text-decoration: none; color: var(--ink); }
.project-card__img { display: block; aspect-ratio: 4 / 3; background: var(--line); overflow: hidden; border-radius: var(--radius); }
.project-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.project-card__link:hover .project-card__img img { transform: scale(1.03); }
.project-card__title { font-size: 1.05rem; margin: 14px 0 0; font-weight: 600; }
.project-card__link:hover .project-card__title { color: var(--signal-dark); }
.filter { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 32px; padding: 0; }
.filter a { display: block; padding: 6px 16px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; font-size: .92rem; }
.filter a[aria-current] { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; }
.contact h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.contact address { font-style: normal; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.contact label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; color: var(--ink); }
.contact input[type=text], .contact input[type=email], .contact textarea {
	width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #aab6bd; border-radius: var(--radius); background: var(--white); color: var(--ink);
}
.hp { position: absolute; left: -9999px; }
.notice { padding: 12px 16px; border-left: 4px solid; margin-bottom: 20px; background: var(--paper); }
.notice--ok { border-color: var(--signal); }
.notice--error { border-color: #b3261e; }

/* Inner pages */
.page { padding-top: 56px; padding-bottom: 88px; }
.page__head { margin-bottom: 32px; }
.page__head h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin: 0; }
.meta { color: var(--mute); font-size: .9rem; margin: .5em 0 0; }
.entry { max-width: 820px; }
.entry__image { margin-bottom: 32px; }
.entry__content > * + * { margin-top: 1.2em; }
.entry__content img { border-radius: var(--radius); }
.alignwide { max-width: var(--wrap); }
.post-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-list { display: grid; gap: 40px; }
.post-row { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.post-row:not(:has(.post-row__img)) { grid-template-columns: 1fr; }
.post-row h2 { font-size: 1.35rem; margin-bottom: 0; }
.post-row h2 a { color: var(--ink); text-decoration: none; }
.post-row h2 a:hover { color: var(--signal-dark); }
.navigation.pagination { margin-top: 48px; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.page-numbers { padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.page-numbers.current { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Footer */
.site-footer { background: var(--ink); color: #b7c4cc; padding-top: 56px; }
.site-footer a { color: #b7c4cc; }
.site-footer a:hover { color: var(--white); }
.site-footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.site-footer__name { color: var(--white); font-weight: 700; font-size: 1.15rem; }
.footer-menu { flex-direction: column; gap: 6px; }
.footer-widget__title { color: var(--white); font-size: 1rem; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid #25343f; padding-top: 20px; padding-bottom: 28px; font-size: .9rem; }
.site-footer__bottom p { margin: 0; }
.social { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }

/* Responsive */
@media (max-width: 980px) {
	.nav-toggle { display: block; }
	.primary-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink);
		flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 24px; border-top: 1px solid #25343f;
		max-height: calc(100vh - 72px); overflow-y: auto;
	}
	.site-header.is-open .primary-nav { display: flex; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .sub-menu { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; }
	.primary-nav__hotline { text-align: center; margin-top: 12px; }
	.site-header.is-open .nav-toggle__bar { background: transparent; }
	.site-header.is-open .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
	.site-header.is-open .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }
	.split, .feature, .contact { grid-template-columns: 1fr; gap: 20px; }
	.contact { gap: 40px; }
	.grid { grid-template-columns: repeat(2, 1fr); }
	.site-footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) {
	body { font-size: 16px; }
	.grid { grid-template-columns: 1fr; }
	.bus { grid-template-columns: 1fr 1fr; }
	.post-row { grid-template-columns: 1fr; }
}
