/*
Theme Name: GS1TJ
Theme URI: https://gs1tj.org
Author: GS1 Tajikistan
Description: Theme replicating the structure of gs1tj.org — Association for Item Numbering (GS1 Tajikistan). Header with logo, search and account login, primary navigation, hero carousel, lead intro, latest-news grid, and footer.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gs1tj
*/

/* ---------- GS1 brand palette ----------
   --blue   #002c6c   GS1 primary blue
   --orange #f26334   GS1 orange
   --green  #7ac143   GS1 green (kermit)
   --lblue  #008dbd   GS1 light blue
   --grey   #b1b3b3
---------------------------------------- */
:root {
	--blue:   #002c6c;
	--orange: #f26334;
	--green:  #7ac143;
	--lblue:  #008dbd;
	--grey:   #b1b3b3;
	--ink:    #333333;
	--line:   #e2e5e9;
	--bg:     #f4f6f8;
}

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

body {
	margin: 0;
	font-family: Arial, Helvetica, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: var(--ink);
	background: #fff;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { color: var(--blue); line-height: 1.25; margin: 0 0 .5em; }

.row {
	max-width: 1160px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: center;
}

.skip { position: absolute; left: -9999px; }
.skip a:focus { position: fixed; left: 12px; top: 12px; z-index: 999; background: #fff; padding: 8px 14px; border: 2px solid var(--blue); }

/* ---------- Buttons ---------- */
.button {
	display: inline-block;
	background: var(--blue);
	color: #fff;
	padding: 12px 22px;
	border-radius: 4px;
	font-weight: bold;
	line-height: 1.2;
	transition: background .15s ease;
}
.button:hover { background: #001f4d; text-decoration: none; color: #fff; }
.button.kermit { background: var(--green); border-radius: 999px; }
.button.kermit:hover { background: #6aab39; }
.button.member-login { background: var(--orange); border-radius: 999px; }
.button.member-login:hover { background: #d9542a; }

/* ---------- Header ---------- */
.site-header { border-bottom: 3px solid var(--blue); }
.header-top { padding: 14px 0; }
.header-top .row { justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 14px; }
.logo img { display: block; width: auto; height: 64px; }
.site-title { margin: 0; font-weight: bold; color: var(--blue); font-size: 16px; max-width: 320px; }

.header-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.barcode-search a { color: var(--orange); font-weight: bold; }

/* Language switcher flags */
.lang .lang-link { display: inline-flex; align-items: center; gap: 6px; }
.lang .lang-flag { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; display: block; }

/* Search form */
.site-search form { display: flex; gap: 6px; }
.site-search input[type="text"],
.site-search input[type="search"] { padding: 8px 12px; border: 1px solid var(--grey); border-radius: 4px; }
.site-search input[type="submit"],
.site-search .btn-submit { padding: 8px 12px; border: 0; border-radius: 4px; background: var(--blue); color: #fff; cursor: pointer; }

/* ---------- Primary navigation (inline in the white header row) ---------- */
.navigation-primary { background: transparent; }
.main-nav {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px;
}
.main-nav li { position: relative; }
.main-nav a {
	display: block;
	color: var(--blue);
	padding: 8px 14px;
	font-weight: bold;
	border-radius: 999px;
	transition: background .15s ease, color .15s ease;
}
.main-nav a:hover { background: rgba(0,44,108,.08); color: var(--blue); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--orange); }
.main-nav .menu-item-has-children > a::after { content: " \25BE"; font-size: .85em; }
.main-nav .sub-menu {
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 220px;
	background: var(--blue);
	list-style: none;
	margin: 0;
	padding: 0;
	display: none;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 12px 30px rgba(0,44,108,.20);
	z-index: 20;
}
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a { color: #fff; padding: 10px 18px; font-weight: normal; border-radius: 0; border-top: 1px solid rgba(255,255,255,.1); }
.main-nav .sub-menu a:hover { background: rgba(255,255,255,.12); }

/* Search in the top utility bar — rounded pill with icons */
.topbar .search-form {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 260px;
	max-width: 100%;
	padding: 3px 4px 3px 12px;
	background: #fff;
	border: 1px solid #cdd8e6;
	border-radius: 999px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.topbar .search-form:hover { border-color: var(--lblue); }
.topbar .search-form:focus-within { border-color: var(--lblue); box-shadow: 0 0 0 3px rgba(0,141,189,.18); }
.topbar .search-form .search-ico { flex: 0 0 auto; color: #8a97a8; }
.topbar .search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	padding: 6px 2px;
	font-size: 13px;
	color: var(--ink);
}
.topbar .search-form input[type="search"]::placeholder { color: #97a3b4; }
.topbar .search-form input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.topbar .search-form .btn-submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--blue);
	color: #fff;
	cursor: pointer;
	transition: background .15s ease, transform .1s ease;
}
.topbar .search-form .btn-submit:hover { background: var(--orange); }
.topbar .search-form .btn-submit:active { transform: scale(.94); }

/* ---------- Hero carousel ---------- */
.hero { position: relative; }
.hero-slides {
	list-style: none;
	margin: 0;
	padding: 0;
	min-height: 340px;
	background-color: #043873;
	background-image: url('assets/images/hero-element.svg');
	background-repeat: no-repeat;
	background-position: center 65%;
	background-size: 1700px auto;
}
.hero-slide { display: none; }
.hero-slide.active { display: block; }
.hero-slide .row { flex-direction: row-reverse; justify-content: space-between; align-items: center; min-height: 340px; padding-top: 24px; padding-bottom: 24px; }
.hero-content { flex: 1 1 340px; color: #fff; }
.hero-content h2 { font-size: 30px; color: #fff; }
.hero-content p { margin-bottom: 24px; color: rgba(255,255,255,.92); }
.hero-content .button { background: var(--orange); border-radius: 999px; }
.hero-content .button:hover { background: #d9542a; }
.hero-image { flex: 0 0 auto; }
.hero-image img { border-radius: 8px; max-height: 260px; width: auto; }

.hero-dots { display: flex; justify-content: center; gap: 10px; padding: 16px 0; background: #043873; }
.hero-dots button { width: 12px; height: 12px; border-radius: 50%; border: 0; background: rgba(255,255,255,.4); cursor: pointer; padding: 0; }
.hero-dots button.active { background: #fff; }

/* Single static page hero (GLN / GTIN): same layout as the carousel above,
   GS1 orange instead of the dark blue. Keeps the hero-element.svg pattern. */
.hero--page .hero-slides { background-color: var(--orange); }
/* The CTA is orange-on-orange here, so flip it to white with orange text. */
.hero--page .hero-content .button { background: #fff; color: var(--orange); }
.hero--page .hero-content .button:hover { background: rgba(255,255,255,.88); color: var(--orange); }

/* ---------- Lead intro ---------- */
.wysiwyg-lead { padding: 40px 0; }
.wysiwyg-lead p { margin: 0 0 1em; }

/* ---------- Content / news ---------- */
.content-wrapper { padding: 20px 0 60px; }
.section-title { font-size: 26px; margin-bottom: 8px; }
.section-title::after { content: ""; display: block; width: 64px; height: 4px; background: var(--orange); border-radius: 2px; margin-top: 10px; }

/* Uniform news cards */
.news-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
	width: 100%;
}
.news-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.news-card:hover { box-shadow: 0 14px 34px rgba(0,44,108,.14); transform: translateY(-4px); border-color: #cfdcec; }
.news-card__thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.news-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.news-card:hover .news-card__thumb img { transform: scale(1.04); }

.news-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.news-card__date { margin: 0 0 8px; color: var(--lblue); font-size: 12px; font-weight: bold; letter-spacing: .02em; text-transform: uppercase; }
.news-card__title {
	font-size: 17px;
	line-height: 1.35;
	margin: 0 0 10px;
	min-height: 2.7em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.news-card__title a { color: var(--blue); }
.news-card__title a:hover { color: var(--orange); text-decoration: none; }
.news-card__excerpt {
	margin: 0;
	color: #667;
	font-size: 14px;
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.news-card__more { margin-top: auto; padding-top: 14px; color: var(--orange); font-weight: bold; font-size: 14px; }
.news-card__more:hover { text-decoration: none; color: #d9542a; }

.news-more { margin-top: 32px; text-align: center; }

/* ---------- Single / page ---------- */
.entry { width: 100%; }
.article-body { padding: 24px 0; }
.article-body h1 { font-size: 28px; }
.article-body .meta { color: var(--lblue); font-weight: bold; margin-top: -6px; }
.article-body p { margin: 0 0 1em; }
.article-body img { border-radius: 6px; }

/* Download rows: label on the left, file icon and "Скачать" link kept together
   on the right so they line up across consecutive rows. */
.article-body .dl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 .6em; }
.article-body .dl-row__label { min-width: 0; }
.article-body .dl-row__icon { flex: none; width: 22px; height: 22px; border-radius: 0; }
.article-body .dl-row__action { flex: none; white-space: nowrap; }

/* Contact line: phone icon and numbers on one baseline-free row. */
.article-body .phone-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 1em; }
.article-body .phone-row img { flex: none; width: 31px; height: 31px; border-radius: 0; }

/* Tailwind's Preflight resets h1–h6 to inherit and strips list markers, so
   editor content needs its own typography restored. */
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 { color: var(--blue); font-weight: 600; line-height: 1.3; margin: 1.4em 0 .5em; }
.article-body h2 { font-size: 24px; }
.article-body h3 { font-size: 20px; }
.article-body h4 { font-size: 17px; }
.article-body h5 { font-size: 15px; }
.article-body h6 { font-size: 14px; }
.article-body :is(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }

.article-body ul,
.article-body ol { margin: 0 0 1em; padding-left: 24px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body ul ul { list-style: circle; }
.article-body li { margin-bottom: .4em; }
.article-body li:last-child { margin-bottom: 0; }

.article-body blockquote {
	margin: 0 0 1em;
	padding: 4px 0 4px 16px;
	border-left: 3px solid var(--line);
	color: #556;
}
.article-body table { border-collapse: collapse; margin: 0 0 1em; }
.article-body th,
.article-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }

/* Partner / member list */
.partner-list { display: flex; flex-direction: column; gap: 20px; margin: 24px 0; }
.partner-item {
	display: flex;
	gap: 24px;
	align-items: center;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 20px 24px;
	transition: box-shadow .15s ease;
}
.partner-item:hover { box-shadow: 0 10px 26px rgba(0,44,108,.10); }
.partner-logo { flex: 0 0 150px; display: flex; align-items: center; justify-content: center; }
.partner-logo img { max-width: 150px; max-height: 110px; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.partner-info { flex: 1; min-width: 0; }
.partner-info h3 { margin: 0 0 6px; font-size: 20px; }
.partner-info p { margin: 0 0 10px; color: #555; }
.partner-info ul { margin: 0; padding: 0; list-style: none; }
.partner-info li { padding: 2px 0; color: #444; font-size: 15px; }
@media (max-width: 600px) {
	.partner-item { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- Footer ---------- */
.site-footer { color: var(--ink); margin-top: 40px; border-top: 1px solid var(--line); }
.site-footer .row { justify-content: space-between; align-items: flex-start; padding-top: 36px; padding-bottom: 36px; }
.site-footer a { color: var(--blue); }
.footer-legal { flex: 1 1 480px; }
.footer-legal h6 { color: #667; font-size: 13px; font-weight: normal; line-height: 1.6; margin: 0 0 14px; }

.footer-social { flex: 0 0 auto; text-align: right; }
.social { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 10px; justify-content: flex-end; }
.social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--blue);
	color: #fff;
	font-size: 13px;
	font-weight: bold;
}
.social a:hover { background: var(--orange); text-decoration: none; color: #fff; }
.footer-copy { color: #667; font-size: 13px; }

/* Footer menu, with submenus expanded as columns (below the legal block) */
.footer-menu .row { padding-top: 28px; padding-bottom: 28px; align-items: flex-start; }
.footer-navigation { width: 100%; }
.footer-nav {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 32px 56px;
}
.footer-nav > li { min-width: 150px; }
.footer-nav > li > a { color: var(--blue); font-weight: bold; display: inline-block; margin-bottom: 12px; }
.footer-nav > li > a:hover { color: var(--orange); text-decoration: none; }
.footer-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: block;
}
.footer-nav .sub-menu a { color: #556; font-weight: normal; display: block; padding: 4px 0; }
.footer-nav .sub-menu a:hover { color: var(--blue); text-decoration: none; }

/* Footer contacts column (styled like the GS1 reference) */
.footer-menu .row { gap: 32px 56px; }
.footer-navigation { flex: 1 1 520px; width: auto; }
.footer-contacts { flex: 0 1 300px; min-width: 240px; }
.footer-contacts h4 { color: var(--blue); font-size: 15px; font-weight: bold; margin: 0 0 12px; }
.footer-contacts ul { list-style: none; margin: 0; padding: 0; }
.footer-contacts li { display: flex; gap: 10px; align-items: baseline; color: #556; font-size: 14px; padding: 5px 0; }
.footer-contacts a { color: #556; }
.footer-contacts a:hover { color: var(--blue); }
.footer-contacts .fc-label {
	flex: 0 0 auto;
	width: 20px;
	color: var(--orange);
	font-weight: bold;
	text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.news-grid { grid-template-columns: 1fr 1fr; }
	.hero-slide .row { flex-direction: column-reverse; text-align: center; }
}
@media (max-width: 640px) {
	.news-grid { grid-template-columns: 1fr; }
	.site-footer .row { flex-direction: column; }
	.footer-social, .social { text-align: left; justify-content: flex-start; }
}

/* ---------- Home two-column split (main + right block) ---------- */
.home-split { align-items: flex-start; margin-top: 40px; }
.home-main { flex: 1 1 0; min-width: 0; }
.home-aside { flex: 0 0 320px; max-width: 320px; }

/* When the right column is present, news fits 2-up instead of 3-up. */
.home-aside ~ .home-main .news-grid,
.home-split:has(.home-aside) .news-grid { grid-template-columns: repeat(2, 1fr); }

/* Content blocks */
.block { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.block__thumb img { width: 100%; height: auto; border-radius: 8px; margin-bottom: 12px; }
.block__title { margin: 0 0 8px; font-size: 22px; color: var(--blue); }
.block__body { color: #556; font-size: 15px; }
.block__body h2 { font-size: 22px; margin: .6em 0 .4em; }
.block__body h3 { font-size: 19px; margin: .6em 0 .4em; }
.block__body h4 { font-size: 16px; margin: .6em 0 .4em; }
.block__body :first-child { margin-top: 0; }
.block__body :last-child { margin-bottom: 0; }
/* collapse stray empty headings/paragraphs from pasted content (NOT void
   elements like <img>, which are always :empty) */
.block__body :is(h1, h2, h3, h4, h5, h6, p):empty { display: none; }
.home-main .block,
.home-aside .block { border: 0; padding: 0; background: none; }

@media (max-width: 900px) {
	.home-split { flex-direction: column; }
	.home-aside { flex-basis: auto; max-width: 100%; width: 100%; }
	.home-split:has(.home-aside) .news-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Home feature modules (1 full-width row + 2-up row) ---------- */
.home-modules { margin: 40px 0 0; }
.home-modules__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
	width: 100%;
}
.home-modules__full { grid-column: 1 / -1; }
.home-modules__title {
	margin: 0 0 14px;
	font-size: 24px;
	font-weight: 300;
	color: var(--blue);
}

.home-modules__full .content ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.home-modules__full .content li { margin: 0 0 10px; }
.home-modules__full .content li:last-child { margin-bottom: 0; }
.home-modules__full .content a {
	color: var(--ink);
	text-decoration: none;
	font-size: 16px;
	border-bottom: 2px solid transparent;
	padding-bottom: 2px;
}
.home-modules__full .content a:hover { color: var(--blue); border-bottom-color: var(--orange); }

.content-module-container { display: flex; }
.content-module {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
}
.content-module .img-thumbnail {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
}
.content-module-padding .content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px;
}
.content-module .content h4 { margin: 0 0 10px; font-size: 20px; color: var(--blue); }
.content-module .content p { margin: 0 0 14px; color: #556; font-size: 15px; }
.content-module .content p:empty { display: none; }
.content-module__body :last-child { margin-bottom: 0; }
.content-module .content .align-bottom { margin-top: auto; margin-bottom: 0; padding-top: 14px; }

.content-module .btn-primary {
	background: var(--blue);
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	padding: 12px 20px;
	font-size: 15px;
	transition: background .15s ease;
}
.content-module .btn-primary:hover { background: var(--lblue); }
.content-module .btn-block { display: block; width: 100%; }
.content-module .text-center { text-align: center; }

@media (max-width: 900px) {
	.home-modules__grid { grid-template-columns: 1fr; }
}

/* ---------- Standards & solutions landing (mirrors gs1uz.org/ru/standards) ---------- */
.std-hero { margin: 8px 0 40px; }
.std-page .std-hero h2 { margin: 0 0 16px; font-size: 34px; font-weight: 300; line-height: 1.25; color: var(--blue); }
.std-hero p { margin: 0; font-size: 19px; font-weight: 300; color: #556; }

.std-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-bottom: 56px; }
.std-card { display: flex; gap: 16px; align-items: flex-start; }
.std-card__icon { flex: 0 0 56px; width: 56px; color: var(--blue); }
.std-card__icon svg { width: 100%; height: auto; display: block; }
/* Scoped under .std-page so these win over the generic .article-body h2–h6
   typography above (equal specificity would otherwise be decided by order). */
.std-page .std-card__body h3 { margin: 0 0 8px; font-size: 20px; font-weight: 400; }
.std-card__body h3 a { color: var(--blue); text-decoration: none; }
.std-card__body h3 a:hover { color: var(--orange); }
.std-card__body p { margin: 0; color: #556; }

.std-page .std-section-title { font-size: 24px; font-weight: 400; margin: 0 0 24px; color: var(--blue); }
.std-resources { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.std-resource {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 20px;
	transition: border-color .15s ease;
}
.std-resource:hover { border-color: var(--blue); }
.std-page .std-resource h4 { margin: 0 0 8px; font-size: 17px; font-weight: 400; }
.std-resource h4 a { color: var(--blue); text-decoration: none; }
.std-resource h4 a:hover { color: var(--orange); }
.std-resource p { margin: 0; color: #556; font-size: 15px; }

@media (max-width: 900px) {
	.std-cards { grid-template-columns: 1fr; gap: 24px; }
	.std-resources { grid-template-columns: 1fr; }
	.std-page .std-hero h2 { font-size: 27px; }
	.std-hero p { font-size: 17px; }
}
