/*
Theme Name: KOVRA
Theme URI: https://example.com/
Author: KOVRA
Description: B2B product-catalogue theme for steel furniture exporters. Classic theme, no build step. Products are a custom post type with CSV import, series taxonomy, spec fields and an inquiry form.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: kovra
Tags: business, portfolio, custom-post-type
*/

/* ---------------------------------------------------------------------------
   主设计系统在 assets/css/site.css，这里只放 WordPress 必须的样式和菜单适配。
   --------------------------------------------------------------------------- */

/* 无障碍：屏幕阅读器专用文本 */
.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 !important;
  width: 1px;
  word-wrap: normal !important;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 18px;
  background: #0f1418;
  color: #fff;
  font-size: 13px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* WordPress 菜单输出为 <ul><li><a>，把 li 里的 a 映射成设计里的 .nav__link */
.nav__links { list-style: none; margin: 0; padding: 0; }
.nav__links li { display: flex; align-items: center; position: relative; }
.nav__links li > a {
  display: block;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
  border-radius: 2px;
  color: inherit;
}
.nav__links li > a:hover { background: #f0ece5; }
.nav__links .current-menu-item > a,
.nav__links .current_page_item > a,
.nav__links .current-menu-parent > a { color: #0d5da8; }
.nav__links .current-menu-item > a::after,
.nav__links .current_page_item > a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 1.5px;
  background: #0d5da8;
}

/* 二级菜单（下拉） */
.nav__links .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid #ddd6cb;
  box-shadow: 0 18px 40px -22px rgba(15, 20, 24, 0.35);
  z-index: 50;
}
.nav__links li:hover > .sub-menu,
.nav__links li:focus-within > .sub-menu { display: block; }
.nav__links .sub-menu li > a { padding: 9px 12px; font-size: 13px; }

/* 系列筛选 chip（链接版，和按钮版外观一致） */
a.chip { display: inline-flex; align-items: center; text-decoration: none; color: #1b2228; }
a.chip.is-active { background: #0f1418; border-color: #0f1418; color: #fff; }

/* 分页 */.pagination { margin-top: 44px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd6cb;
  border-radius: 2px;
  font-size: 13px;
  color: #1b2228;
}
.pagination .page-numbers:hover { background: #f0ece5; }
.pagination .page-numbers.current { background: #0f1418; border-color: #0f1418; color: #fff; }

/* 内页正文（wp_editor 输出） */
.entry-content { max-width: 74ch; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin-top: 1.8em; }
.entry-content h3 { font-size: 1.1rem; margin-top: 1.6em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-top: 0.4em; }
.entry-content a { color: #0d5da8; text-decoration: underline; text-underline-offset: 2px; }
.entry-content img { border-radius: 3px; }
.entry-content blockquote {
  border-left: 2px solid #b4703a;
  padding-left: 18px;
  color: rgba(15, 20, 24, 0.62);
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.entry-content th, .entry-content td { border-bottom: 1px solid #ebe6de; padding: 10px 0; text-align: left; }

/* 图片对齐（经典编辑器/区块用） */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: rgba(15, 20, 24, 0.42); margin-top: 6px; }

/* 表单提交成功提示 */
.notice-box {
  border: 1px solid #0d5da8;
  border-left-width: 3px;
  background: #f4f8f9;
  border-radius: 2px;
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 22px;
}
.notice-box--error { border-color: #b4302a; background: #fdf5f4; }

/* 管理栏存在时的固定导航修正 */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* ---------------------------------------------------------------------------
   Navigation polish (v1.1): two-column dropdown on desktop, click/tap friendly.
   --------------------------------------------------------------------------- */
.nav__links li.menu-item-has-children > .sub-menu {
	grid-template-columns: 1fr 1fr;
	min-width: 430px;
	padding: 10px;
	gap: 0 4px;
}
.nav__links li.menu-item-has-children:hover > .sub-menu,
.nav__links li.menu-item-has-children:focus-within > .sub-menu {
	display: grid;
}
.nav__links .sub-menu li > a {
	white-space: nowrap;
}
@media (max-width: 860px) {
	.nav__links li.menu-item-has-children > .sub-menu {
		grid-template-columns: 1fr;
		min-width: 0;
		position: static;
		box-shadow: none;
		border: 0;
		padding: 4px 0 4px 14px;
	}
}

/* ---------------------------------------------------------------------------
   v1.1 small-screen typography: keep long headlines inside the viewport.
   Verified at 360px / 768px / 1440px with iframe renders.
   --------------------------------------------------------------------------- */
@media (max-width: 480px) {
	.hero__title {
		font-size: clamp(1.7rem, 9vw, 2.4rem);
		line-height: 1.12;
		letter-spacing: -0.01em;
	}
	.hero__lead,
	.page-head .lead {
		font-size: 15px;
		line-height: 1.55;
	}
	.h-section,
	.page-head h1 {
		font-size: clamp(1.45rem, 7vw, 1.9rem);
	}
	.container {
		padding-left: 16px;
		padding-right: 16px;
	}
	.hero {
		padding-top: 36px;
		padding-bottom: 32px;
	}
	.hero__stats {
		gap: 18px 22px;
	}
}
@media (max-width: 380px) {
	.hero__title {
		font-size: clamp(1.55rem, 8.4vw, 2rem);
	}
}

/* v1.1: allow long words to wrap on narrow screens (no clipping) */
@media (max-width: 480px) {
	.hero__title,
	.h-section,
	.page-head h1 {
		overflow-wrap: break-word;
		word-break: break-word;
	}
	.topbar__list {
		flex-wrap: wrap;
	}
}

/* v1.1: 360px hero — hard size cap + allow the hero to grow instead of clipping */
@media (max-width: 480px) {
	.hero {
		overflow: visible;
	}
	.hero__title {
		font-size: 30px;
		line-height: 1.16;
		letter-spacing: -0.02em;
		overflow-wrap: anywhere;
	}
	.hero__inner {
		max-width: 100%;
	}
}
