/*
Theme Name: 懂法网 Child
Theme URI: https://dongfa.net.cn
Description: Child theme of Astra for 懂法网 (Dongfa)
Template: astra
Version: 1.15.0
Author: 懂法网
*/

:root {
  --zeda-blue: #1a5fb4;
  --zeda-blue-dark: #0f3d7a;
  --zeda-text: #1f2937;
  --zeda-muted: #6b7280;
}
.zeda-hero { background: linear-gradient(135deg, var(--zeda-blue-dark) 0%, var(--zeda-blue) 100%); color:#fff; padding:96px 24px; text-align:center; }
.zeda-hero h1 { color:#fff; font-size:2.6rem; margin-bottom:16px; }
.zeda-hero p { font-size:1.15rem; opacity:.95; max-width:720px; margin:0 auto 28px; }
.zeda-section { padding:64px 24px; }
.zeda-section--alt { background:#f8fafc; }
.zeda-section h2 { color:var(--zeda-blue-dark); font-size:1.9rem; margin-bottom:12px; text-align:center; }
.zeda-section .zeda-lead { text-align:center; color:var(--zeda-muted); max-width:720px; margin:0 auto 40px; }
.zeda-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px,1fr)); gap:24px; max-width:1140px; margin:0 auto; }
.zeda-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:28px 24px; transition:.2s; }
.zeda-card:hover { box-shadow:0 8px 24px rgba(15,61,122,.12); border-color:var(--zeda-blue); }
.zeda-card h3 { color:var(--zeda-blue-dark); margin-bottom:8px; }
.zeda-card p { color:var(--zeda-muted); font-size:.96rem; }
.zeda-cta { background:var(--zeda-blue-dark); color:#fff; padding:48px 24px; text-align:center; }
.zeda-cta h2 { color:#fff; }
.zeda-btn { display:inline-block; background:var(--zeda-blue); color:#fff; padding:12px 28px; border-radius:6px; text-decoration:none; font-weight:600; margin-top:18px; }
.zeda-btn:hover { background:var(--zeda-blue-dark); color:#fff; }
.zeda-contact-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr)); gap:24px; max-width:960px; margin:0 auto; }
.zeda-contact-item { text-align:center; }
.zeda-contact-item h4 { color:var(--zeda-blue-dark); margin-bottom:6px; }
.entry-content { color:var(--zeda-text); line-height:1.75; }

/* ===== v1.1.0 additions: header LOGO, hide home page title ===== */
/* v1.12.0: the custom_logo IMAGE has been removed (phase15_updates.php clears the
   custom_logo theme mod + site_logo option). Astra now falls back to rendering the
   text site title "懂法网" in the masthead. These rules style that text as a clean
   wordmark logo: brand color, bold, sized to sit neatly in the header. The old
   logo-image max-height / hide-text-title rules are removed (no image to constrain,
   and the body.wp-custom-logo class is gone so the title wrapper is visible again). */
.site-branding .site-title,
.ast-site-identity .site-title,
.site-branding .ast-site-title,
.ast-site-identity .ast-site-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.site-branding .site-title a,
.ast-site-identity .site-title a,
.site-branding .ast-site-title a,
.ast-site-identity .ast-site-title a {
  color: var(--zeda-blue-dark);
  text-decoration: none;
  transition: color .2s;
}
.site-branding .site-title a:hover,
.ast-site-identity .site-title a:hover,
.site-branding .ast-site-title a:hover,
.ast-site-identity .ast-site-title a:hover {
  color: var(--zeda-blue);
}
/* Hide the tagline in the header for a clean wordmark look — the hero section on
   the homepage already carries the full title + tagline, so the header does not
   need to repeat "您的法律知识管家" under the logo. */
.site-branding .site-description,
.ast-site-identity .site-description {
  display: none;
}
@media (max-width: 768px) {
  .site-branding .site-title,
  .ast-site-identity .site-title,
  .site-branding .ast-site-title,
  .ast-site-identity .ast-site-title {
    font-size: 1.3rem;
  }
}

/* Hide the "首页" page entry-title on the front page (the hero carries the heading) */
.home .entry-title,
.home .ast-archive-title,
.home .ast-page-title-bar .ast-page-title {
  display: none !important;
}

/* v1.4.2: hide the page entry-title Astra renders in the top-left of the
   content area on the About (关于懂法网) and Contact (联系我们) pages. Both pages
   open with their own <h2> section heading inside the body, so the <h1> page
   title above it is redundant. The body class is added by
   zeda_hide_entry_title_body_class() in functions.php (matches by slug/title,
   covers zh + en). Also neutralize the Astra page-title bar if present. */
.zeda-hide-entry-title .entry-title,
.zeda-hide-entry-title .ast-archive-title,
.zeda-hide-entry-title .ast-page-title-bar .ast-page-title,
.zeda-hide-entry-title .ast-single-post-order .entry-header,
.zeda-hide-entry-title .entry-header {
  display: none !important;
}

/* ===== v1.2.0 additions ===== */

/* Site-wide: remove date / author entry-meta display */
.entry-meta {
  display: none !important;
}

/* ----- Articles page category filter bar ----- */
.zeda-cat-filter {
  max-width: 1140px;
  margin: 0 auto 28px;
  padding: 0 24px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.zeda-cat-tab {
  display: inline-block;
  margin: 4px 2px;
  padding: 8px 18px;
  border-radius: 20px;
  background: #eef2f7;
  color: var(--zeda-text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  transition: .2s;
}
.zeda-cat-tab:hover {
  background: #dbe7f5;
  color: var(--zeda-blue-dark);
}
.zeda-cat-tab.is-active {
  background: var(--zeda-blue);
  color: #fff;
}

/* ----- Contact page: expand-more offices ----- */
.zeda-offices-wrap {
  max-width: 1140px;
  margin: 0 auto;
}
.zeda-offices-more {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.zeda-offices-more.is-open {
  display: grid;
}
/* v1.4.1: the toggle button is wrapped in a <p> by wpautop; neutralize that
   <p>'s default top/bottom margins so the spacing above/below the button is
   controlled only by .zeda-offices-toggle itself (no double margins).
   Uses a plain descendant selector (works in every browser, not just :has()). */
.zeda-offices-wrap > p {
  margin-top: 0;
  margin-bottom: 0;
}
.zeda-offices-toggle {
  display: block;
  margin: 28px auto 8px;
  background: var(--zeda-blue);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.zeda-offices-toggle:hover {
  background: var(--zeda-blue-dark);
}
/* v1.4.0: uniform row spacing for ALL office cards (top grid + "more" grid)
   so the 8 visible cards and the 16 revealed ones share the same rhythm.
   v1.4.1: bumped min-height 168->184px so even 3-line addresses (e.g. the
   Yiwu office) fit without forcing their row taller than the others; both
   grids also get explicit align-items:stretch + identical column tracks.
   NOTE: do NOT set `display` here — .zeda-offices-more relies on
   display:none (closed) / display:grid (.is-open) from the rules above,
   and this higher-specificity selector would override display:none. */
.zeda-offices-wrap .zeda-cards,
.zeda-offices-wrap .zeda-offices-more {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.zeda-offices-wrap .zeda-office-card,
.zeda-cards .zeda-office-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 184px;
  padding: 24px 22px;
  box-sizing: border-box;
}
.zeda-offices-wrap .zeda-office-card h3,
.zeda-cards .zeda-office-card h3 {
  color: var(--zeda-blue-dark);
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.4;
}
.zeda-offices-wrap .zeda-office-card .zeda-office-addr,
.zeda-cards .zeda-office-card .zeda-office-addr {
  color: var(--zeda-muted);
  font-size: .92rem;
  line-height: 1.6;
  margin: 0 0 10px;
  flex-grow: 1;
}
.zeda-offices-wrap .zeda-office-card .zeda-office-tel,
.zeda-cards .zeda-office-card .zeda-office-tel {
  color: var(--zeda-blue);
  font-size: .9rem;
  font-weight: 600;
  margin: 0;
}

/* ===== v1.3.0 additions ===== */

/* Hide the comments / 发表评论 block entirely on single posts */
.single-post .comments-area,
.single-post #comments,
.single-post .ast-comments-area,
.single-post .ast-comment-formwrap,
.single-post .comment-form,
.single-post .comment-respond {
  display: none !important;
}

/* Contact Form 7 lead form — phone + requirement options
   v1.15.0: tightened paddings/margins/gaps so the whole form (tel + 2 radio
   groups + submit) reads as one compact lead-capture unit instead of a tall,
   airy stack. */
.zeda-article-lead .wpcf7,
.entry-content .wpcf7 {
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}
.zeda-article-lead .wpcf7 label,
.entry-content .wpcf7 label {
  display: block;
  font-weight: 600;
  color: var(--zeda-text);
  margin: 0 0 4px;
  font-size: .92rem;
}
.zeda-article-lead .wpcf7 input[type="tel"],
.entry-content .wpcf7 input[type="tel"],
.zeda-article-lead .wpcf7 input[type="text"],
.entry-content .wpcf7 input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
}
.zeda-article-lead .wpcf7 input[type="tel"]:focus,
.entry-content .wpcf7 input[type="tel"]:focus {
  border-color: var(--zeda-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 95, 180, .12);
}

/* Requirement-type radio options: card-style grid so all options are visible.
   Targets Contact Form 7's generated markup (radio with use_label_element). */
.zeda-need-options .wpcf7-form-control-wrap {
  display: block;
}
.zeda-need-options .wpcf7-form-control.wpcf7-radio {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 6px 0 14px;
}
@media (max-width: 560px) {
  .zeda-need-options .wpcf7-form-control.wpcf7-radio { grid-template-columns: 1fr; }
}
.zeda-need-options .wpcf7-list-item {
  margin: 0;
}
.zeda-need-options .wpcf7-list-item label {
  position: relative;
  display: block;
  padding: 10px 12px 10px 38px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: .94rem;
  color: var(--zeda-text);
  background: #fff;
  transition: .15s;
  line-height: 1.35;
  font-weight: normal;
  margin: 0;
}
.zeda-need-options .wpcf7-list-item label:hover {
  border-color: var(--zeda-blue);
  background: #f4f8fd;
}
.zeda-need-options .wpcf7-list-item input[type="radio"] {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  accent-color: var(--zeda-blue);
  margin: 0;
}
.zeda-need-options .wpcf7-list-item input[type="radio"]:checked ~ .wpcf7-list-item-label {
  color: var(--zeda-blue-dark);
  font-weight: 600;
}
.zeda-need-options .wpcf7-list-item label:has(input[type="radio"]:checked) {
  border-color: var(--zeda-blue);
  background: #eaf2fb;
  box-shadow: 0 0 0 1px var(--zeda-blue) inset;
}
.zeda-need-options .wpcf7-list-item-label {
  font-weight: inherit;
}

/* CF7 submit button */
.zeda-article-lead .wpcf7-submit,
.entry-content .wpcf7-submit {
  display: inline-block;
  width: 100%;
  background: var(--zeda-blue);
  color: #fff;
  border: none;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.zeda-article-lead .wpcf7-submit:hover,
.entry-content .wpcf7-submit:hover {
  background: var(--zeda-blue-dark);
}
/* Spinner positioning fix */
.wpcf7-spinner { display: none; }

/* Article lead form — vertical rhythm overrides (the article body is narrow).
   v1.15.0: reduced section padding + heading size so the compact form does not
   sit in an oversized band of whitespace. */
.zeda-article-lead {
  padding: 32px 20px;
  margin-top: 32px;
  border-top: 1px solid #e5e7eb;
}
.zeda-article-lead h2 {
  color: var(--zeda-blue-dark);
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.zeda-article-lead .zeda-lead {
  margin-bottom: 18px;
}

/* ===== v1.4.0 additions ===== */

/* Homepage 业务领域 cards are now clickable links to /category/<slug>/ archives.
   Uses the stretched-link pattern (empty <a> overlaying the card) so WordPress's
   wpautop filter does not mangle block elements nested inside an inline <a>. */
.zeda-card--linked { position: relative; }
.zeda-card-stretch {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1;
  text-indent: 200%;
  white-space: nowrap;
  overflow: hidden;
  background: transparent;
}

/* Contact page: blinking, eye-catching lead text for the "预约律师回电话" section. */
@keyframes zeda-blink {
  0%, 49%   { color: #DC2626; }
  50%, 100% { color: #f59e0b; }
}
.zeda-blink {
  color: #DC2626;
  font-weight: 700;
  animation: zeda-blink 1s steps(1, end) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .zeda-blink { animation: none; color: #DC2626; }
}

/* v1.7.0: the lawyer archive card grid (.zeda-lawyer-grid--cards,
   .zeda-lawyer-card--circle, .zeda-lawyer-avatar, .zeda-lawyer-role,
   .zeda-lawyer-areas) and the lawyer filter dropdowns
   (.zeda-lawyer-filters, .zeda-filter-group, .zeda-filter-select,
   .zeda-filter-reset) have been removed along with the lawyer CPT.
   See functions.php v1.7.0 notes. */

/* ===== v1.10.0 additions =====
   Floating "点此寻找律师帮助" side-tab buttons on the left + right edges
   of every front-end page. Vertical text via writing-mode: vertical-rl
   so each Chinese character stacks upright top-to-bottom and the tab
   stays compact (~44px wide). Fixed position, vertically centered,
   high z-index so the tabs float above page content and stay visible
   while scrolling. Click behavior (handled by zeda_floating_lead_buttons
   in functions.php): smooth-scroll to the nearest lead form on the page,
   or navigate to the Contact page if none is present. */
.zeda-float-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zeda-blue);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.06em;
  padding: 22px 10px;
  box-shadow: 0 4px 16px rgba(15, 61, 122, 0.28);
  transition: background .2s, box-shadow .2s;
  writing-mode: vertical-rl;
  cursor: pointer;
  line-height: 1.4;
}
.zeda-float-btn:hover,
.zeda-float-btn:focus {
  background: var(--zeda-blue-dark);
  color: #fff;
  box-shadow: 0 6px 22px rgba(15, 61, 122, 0.38);
  outline: none;
}
.zeda-float-btn--left {
  left: 0;
  border-radius: 0 10px 10px 0;
}
.zeda-float-btn--right {
  right: 0;
  border-radius: 10px 0 0 10px;
}
.zeda-float-btn__text {
  display: inline-block;
}

/* Narrow screens: shrink the tabs so they do not dominate. */
@media (max-width: 768px) {
  .zeda-float-btn {
    font-size: 0.88rem;
    padding: 16px 8px;
  }
}
/* Very small screens: hide the LEFT tab (keep right only) so the two
   tabs do not pinch the narrow content area on phones. */
@media (max-width: 480px) {
  .zeda-float-btn--left {
    display: none;
  }
}

/* Respect reduced-motion preferences: drop the hover transition. */
@media (prefers-reduced-motion: reduce) {
  .zeda-float-btn,
  .zeda-float-btn:hover,
  .zeda-float-btn:focus {
    transition: none;
  }
}

/* Smooth-scroll targets: leave a little room at the viewport top so the
   form heading is not flush against the edge after scrollIntoView({block:
   'start'}). scroll-margin-top only affects scroll-into-view behavior,
   never layout, so it is safe to apply to the CF7 form wrapper. */
.zeda-article-lead,
.wpcf7 {
  scroll-margin-top: 80px;
}

/* ===== v1.12.0 additions ===== */

/* Articles landing page (is_home) — 12-practice-area card directory, rendered by
   zeda_render_law_area_cards() in functions.php. Reuses .zeda-cards / .zeda-card /
   .zeda-card--linked / .zeda-card-stretch from the base styles; this section only
   tunes spacing so the directory sits comfortably above the (currently empty) post
   loop. The --alt background distinguishes it from the page title bar above. */
.zeda-law-areas-directory {
  margin-top: 0;
}
.zeda-law-areas-directory .zeda-cards {
  /* 12 cards: a 4-column desktop grid reads as a clean "directory" rather than
     the auto-fit ragged grid used on the homepage. Collapses gracefully. */
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 920px) {
  .zeda-law-areas-directory .zeda-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .zeda-law-areas-directory .zeda-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .zeda-law-areas-directory .zeda-cards { grid-template-columns: 1fr; }
}

/* The articles landing page currently has no published posts (articles will be
   added over time). Until then, Astra's "Nothing Found" / .no-results block would
   show under the directory and look broken. Hide it on the posts page (body.blog)
   only — category archives with no posts still show it so editors notice empty
   categories. Once articles exist this rule is harmless (no .no-results to hide). */
.blog .no-results,
.blog .ast-no-results {
  display: none !important;
}

/* ===== v1.13.0 additions ===== */

/* (a) Hide featured images on blog / archive / category / tag / date / author
   listings. The articles feed is now a text-only knowledge directory; the
   律师 directory was already removed (v1.7.0), and the homepage already
   carries its own hero image. We blanket-hide every thumbnail wrapper Astra
   has used across versions (.ast-blog-featured-section, .post-thumb,
   .post-thumb-img-content, .ast-article-post .post-thumb, etc.) because the
   astra_featured_image_enabled PHP filter (functions.php v1.13.0) is the
   first line of defense but does not always fire on every archive template —
   CSS guarantees the image is invisible even if the filter is bypassed.
   Single-post featured images are intentionally NOT hidden (only listings
   match the .blog/.archive/.category body classes). */
.blog .ast-blog-featured-section,
.archive .ast-blog-featured-section,
.category .ast-blog-featured-section,
.tag .ast-blog-featured-section,
.date .ast-blog-featured-section,
.author .ast-blog-featured-section,
.blog .post-thumb,
.archive .post-thumb,
.category .post-thumb,
.tag .post-thumb,
.date .post-thumb,
.author .post-thumb,
.blog .post-thumb-img-content,
.archive .post-thumb-img-content,
.category .post-thumb-img-content,
.blog .ast-article-post .post-thumb,
.archive .ast-article-post .post-thumb,
.category .ast-article-post .post-thumb,
.blog .ast-article-post .ast-blog-featured-section,
.archive .ast-article-post .ast-blog-featured-section,
.category .ast-article-post .ast-blog-featured-section,
.ast-separate-container .blog .ast-article-post .ast-blog-featured-section,
.ast-separate-container .archive .ast-article-post .ast-blog-featured-section,
.ast-separate-container .category .ast-article-post .ast-blog-featured-section {
  display: none !important;
}

/* (b) Search box — v1.15.0 simple version.
   v1.14.0 wrapped the search form in a card panel with a "搜索本分类文章"
   label; v1.15.0 drops the card + label entirely. Every search form on the
   site is now rendered by the zeda_simple_search_form filter (functions.php
   v1.15.0) as a single .zeda-simple-search <form> (input + button, no
   <label>, no fieldset). The .zeda-archive-search wrapper is now just a
   plain centered container that sits quietly under the pill filter tabs.
   The same .zeda-simple-search markup is reused on the search-results page,
   404, and any widget, so ALL search boxes share one simple look. */
.zeda-archive-search {
  max-width: 680px;
  margin: 18px auto 24px;
  text-align: center;
}
.zeda-simple-search {
  display: flex;
  align-items: stretch;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  border: 1px solid var(--zeda-blue);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.zeda-simple-search__input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  padding: 10px 14px;
  font-size: .96rem;
  color: var(--zeda-text);
  background: transparent;
  min-width: 0;
}
.zeda-simple-search__input:focus {
  background: #f4f8fd;
}
.zeda-simple-search__btn {
  border: 0;
  background: var(--zeda-blue);
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  padding: 0 20px;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.zeda-simple-search__btn:hover {
  background: var(--zeda-blue-dark);
}
@media (max-width: 560px) {
  .zeda-simple-search {
    flex-direction: column;
    overflow: visible;
  }
  .zeda-simple-search__input {
    border-radius: 8px 8px 0 0;
    text-align: left;
  }
  .zeda-simple-search__btn {
    border-radius: 0 0 8px 8px;
    padding: 11px 20px;
    justify-content: center;
  }
}

/* (c) CF7 lead form — two radio groups stacked (纠纷类型 6 options + 需求类型
   2 options, internal field name your-urgency). The 需求类型 group reuses
   .zeda-need-options; the divider above it visually separates the two groups
   so the form reads as two distinct fields, not one long radio list. */
.zeda-need-options + .zeda-need-options {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e5e7eb;
}
/* 需求类型 (your-urgency) — only 2 options; 2 equal columns read as a
   side-by-side binary choice rather than a vertical list. */
.zeda-need-options .wpcf7-form-control.wpcf7-radio {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 560px) {
  .zeda-need-options .wpcf7-form-control.wpcf7-radio {
    grid-template-columns: 1fr;
  }
}

/* v1.14.0: 纠纷类型 (your-need) now carries long descriptive labels
   (e.g. "经济纠纷欠款/货款/工程款等"). The default 2-column grid would
   cramp them onto two lines and look ragged. The --long modifier switches
   this single group to a 1-column stack so each option gets the full form
   width; the 需求类型 group below keeps its 2-column binary layout. */
.zeda-need-options--long .wpcf7-form-control.wpcf7-radio {
  grid-template-columns: 1fr;
}
