/*
Theme Name: Rfilter
Description: Responsive layout for rfilter.com. Content and URLs stay on the imported legacy records.
Version: 1.3.1
Text Domain: rfilter
*/

:root {
  --ink: #22303a;
  --muted: #5c6b76;
  --blue: #0c4a6e;
  --blue-dark: #08344d;
  --green: #2f8f32;
  --green-dark: #247528;
  --green-tint: #eef6ee;
  --line: #dfe6ec;
  --paper: #f4f6f8;
  --card: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(14, 42, 60, .07);
  --shadow-hover: 0 8px 20px rgba(14, 42, 60, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.75 "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--green-dark); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
.wrap { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 18px; align-items: center; padding: 14px 0; }
.brand-logo img { height: 56px; width: auto; display: block; }
.brand-copy { flex: 1; min-width: 0; }
.brand-copy strong { display: block; font-size: 18px; letter-spacing: .5px; }
.brand-copy span { color: var(--muted); font-size: 13px; }
.brand-badge { height: 44px; width: auto; }
.brand-phone {
  font-weight: 700; white-space: nowrap; font-size: 15px;
  color: var(--green-dark); background: var(--green-tint);
  border: 1px solid #cfe6cf; border-radius: 999px; padding: 6px 16px;
}

/* Nav */
.nav { background: var(--green); position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 8px rgba(20, 80, 25, .25); }
.menu { display: flex; align-items: stretch; min-height: 46px; }
.menu > .menu-link, .menu-item { flex: 1 1 auto; }
.menu-link {
  color: #fff; display: flex; align-items: center; justify-content: center;
  padding: 0 14px; white-space: nowrap; font-size: 16px; letter-spacing: 1px;
}
.menu-link:hover { background: var(--green-dark); color: #fff; }
.menu-item { position: relative; display: flex; }
.menu-item > .menu-link { flex: 1; }
.menu-item > .menu-link::after {
  content: ""; margin-left: 7px;
  border: 4px solid transparent; border-top-color: rgba(255, 255, 255, .85);
}
.menu-sub {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  z-index: 50; min-width: 150px; padding: 6px 0;
  background: #fff; border: 1px solid var(--line); border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-hover);
}
.menu-item:hover .menu-sub, .menu-item:focus-within .menu-sub { display: block; }
.menu-sub a { display: block; color: var(--ink); padding: 9px 18px; font-size: 14px; text-align: center; }
.menu-sub a:hover { background: var(--green-tint); color: var(--green-dark); }

/* Banner */
.banner { margin-top: 18px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.banner img { width: 100%; height: auto; display: block; }

/* Notice */
.notice {
  margin-top: 18px; padding: 10px 16px;
  background: #fffaf0; border: 1px solid #f0ddb0; border-left: 4px solid #e6b93f;
  border-radius: 6px; font-size: 13px; line-height: 1.5; color: #6b5a2b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notice a { color: var(--blue); }

/* Layout & crumbs */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; margin-top: 20px; }
.layout > *, .home-intro > *, .news-columns > *, .product-row > *, .cards > * { min-width: 0; }
.crumbs { margin-top: 16px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green-dark); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Panels & cards */
.panel, .entry {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 16px 18px; }
.panel h2, .panel h2 a { font-size: 17px; color: var(--ink); }
.panel h2 { margin: 0 0 8px; line-height: 1.4; border-left: 4px solid var(--green); padding-left: 10px; }
.panel h2 a:hover { color: var(--green-dark); }
.panel h2 + img { border-radius: 6px; margin: 4px 0 10px; }
.panel ul, .link-list { list-style: none; margin: 0; padding: 0; }
.panel li + li, .link-list li + li { border-top: 1px dashed var(--line); }
.panel li a, .link-list a {
  display: block; padding: 7px 4px; font-size: 14px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px;
}
.panel li a:hover, .link-list a:hover { color: var(--green-dark); background: var(--green-tint); }
.panel .contact {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 14px; line-height: 1.9; color: var(--muted);
}
.side h2:not(:first-child) { margin-top: 18px; }

/* Home */
.home-intro { display: grid; grid-template-columns: 1fr 260px; gap: 20px; margin-bottom: 20px; }
.intro-copy h1 { font-size: 20px; margin: 0 0 12px; border-left: 4px solid var(--green); padding-left: 10px; }
.intro-copy h1 a { color: inherit; }
.factory { width: 200px; float: left; margin: 4px 14px 8px 0; border-radius: 6px; }
.news-photos img { width: 100%; height: auto; border-radius: 6px; }
.product-board { margin-bottom: 20px; }
.product-board h2 {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 0 6px; font-size: 17px; border-left: 4px solid var(--green); padding-left: 10px;
}
.product-board .more { font-size: 13px; font-weight: 400; }
.product-board h3 { font-size: 15px; color: var(--green-dark); margin: 14px 0 10px; }
.product-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 8px; }
.product-row a {
  display: block; text-align: center; color: var(--ink); font-size: 13px; line-height: 1.45;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-row a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: var(--green-dark); }
.product-row img { width: 100%; height: 96px; object-fit: contain; margin-bottom: 6px; }
.cert-banner { margin: 0 0 20px; }
.cert-banner img { width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow); }
.news-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Entry (article / product / company body) */
.entry { padding: 26px 30px; }
.entry h1 { margin: 0 0 16px; padding-bottom: 12px; font-size: 26px; line-height: 1.35; border-bottom: 2px solid var(--green-tint); }
.entry p { margin: 0 0 12px; }
.entry img { border-radius: 6px; }
.entry table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px; }
.entry th, .entry td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.entry th, .entry thead td { background: var(--green-tint); }
.entry ul, .entry ol { padding-left: 22px; }

/* Product detail thumbnail */
.product-hero {
  float: right; width: 240px; margin: 0 0 16px 20px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
}
.product-hero img { width: 100%; height: auto; display: block; }

/* Category cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; margin-bottom: 8px; }
.card h3 {
  font-size: 14px; margin: 0; color: var(--ink); line-height: 1.5; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
a.card:hover h3 { color: var(--green-dark); }

/* Pager */
.pager { display: flex; gap: 12px; margin-top: 20px; }
.pager a { display: inline-block; padding: 6px 18px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.pager a:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* Footer */
.site-footer {
  margin-top: 36px; padding: 26px 0 30px;
  background: var(--blue-dark); border-top: 3px solid var(--green);
  color: #c7d6e0; font-size: 13px; line-height: 2;
}
.site-footer a { color: #e6eef4; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.friend-links {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14);
}
.friend-links a { display: inline; padding: 0; white-space: nowrap; font-size: 13px; color: #cfe0ea; }

@media (max-width: 900px) {
  .layout, .home-intro, .news-columns, .grid { grid-template-columns: 1fr; }
  .layout > aside { order: 2; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .product-row { grid-template-columns: repeat(4, 1fr); }
  .menu { overflow-x: auto; }
  .menu > .menu-link, .menu-item { flex: 0 0 auto; }
  .factory { float: none; width: 100%; margin: 0 0 12px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .brand { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .brand-logo img { height: 40px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy span { font-size: 12px; }
  .brand-badge { height: 32px; }
  .brand-phone { font-size: 13px; padding: 4px 12px; }
  .banner { margin-top: 12px; }
  .entry { padding: 18px; }
  .entry h1 { font-size: 21px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .product-row { grid-template-columns: repeat(3, 1fr); }
  .product-hero { float: none; width: 100%; max-width: 280px; margin: 0 auto 16px; }
}
