/* ==========================================================================
   站内搜索 —— 导航入口 / 展开面板 / 搜索结果页
   唯一实现，勿在页面模板内复制这些样式。
   独立 CSS 而非 Tailwind 工具类：assets/css/tailwind.css 是静态编译产物，
   新写的工具类（sr-only / py-2.5 等）并不在其中，用类名会静默失效。
   ========================================================================== */

/* ---------- 1. 导航栏里的搜索入口按钮 ---------- */
.cc-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 8px 2px;
    background: none;
    border: 0;
    cursor: pointer;
    color: #4A7C6F;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.18em;
    line-height: 1;
    transition: color 0.25s ease;
}
.cc-search-toggle:hover,
.cc-search-toggle:focus-visible,
.cc-search-toggle[aria-expanded="true"] { color: #1A281F; }
.cc-search-toggle:focus-visible { outline: 1px solid #4A7C6F; outline-offset: 4px; }
.cc-search-toggle svg { display: block; width: 18px; height: 18px; flex: none; }
/* 移动端只留图标，标签隐藏 */
.cc-search-toggle .cc-search-toggle__label { display: none; }
@media (min-width: 768px) {
    .cc-search-toggle .cc-search-toggle__label { display: inline; }
}
/* 拉丁字母 / 日文在小字号下需要不同字距，沿用 latin-type.css 的分语种思路 */
:is(html:lang(en), html:lang(es), html:lang(fr)) .cc-search-toggle {
    font-size: 15px;
    letter-spacing: 0.05em;
}
html:lang(ja) .cc-search-toggle {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.06em;
}

/* ---------- 2. 导航下方的展开面板 ---------- */
/* 注意：不要给 .cc-search-panel 设 display，否则 [hidden] 会失效 */
.cc-search-panel {
    background: rgba(250, 248, 245, 0.98);
    border-bottom: 1px solid rgba(26, 40, 31, 0.1);
}
.cc-search-panel[hidden] { display: none; }

/* ---------- 3. 搜索表单（面板 + 结果页共用） ---------- */
.cc-search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 auto;
    padding: 14px 16px;
}
.cc-search-form__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.cc-search-form__icon { display: flex; flex: none; color: #6B7A6F; }
.cc-search-form__icon svg { display: block; width: 20px; height: 20px; }
.cc-search-form__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 2px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(26, 40, 31, 0.15);
    border-radius: 0;
    color: #1A281F;
    font-family: inherit;
    font-size: 16px;
    letter-spacing: 0.04em;
    line-height: 1.4;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.25s ease;
}
.cc-search-form__input::placeholder { color: rgba(107, 122, 111, 0.65); }
.cc-search-form__input:focus { border-bottom-color: #4A7C6F; }
/* 去掉 WebKit 自带的放大镜/清除按钮，避免和自定义图标重复 */
.cc-search-form__input::-webkit-search-decoration,
.cc-search-form__input::-webkit-search-cancel-button,
.cc-search-form__input::-webkit-search-results-button { -webkit-appearance: none; appearance: none; }
.cc-search-form__submit {
    flex: none;
    padding: 11px 20px;
    background: #3E5344;
    border: 0;
    border-radius: 2px;
    color: #FAF8F5;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    line-height: 1;
    transition: background 0.25s ease;
}
.cc-search-form__submit:hover,
.cc-search-form__submit:focus-visible { background: #1A281F; }

/* 面板态：宽度跟随导航栏（导航是整宽无 max-width） */
.cc-search-form--panel { max-width: none; padding: 14px 16px; }
@media (min-width: 768px) {
    .cc-search-form--panel { padding: 18px 48px; gap: 1rem; }
    .cc-search-form--panel .cc-search-form__input { font-size: 17px; }
}
/* 结果页态：与主题内容容器对齐 */
.cc-search-form--page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
    gap: 0.875rem;
}

/* ---------- 4. 搜索结果页 ---------- */
.cc-search-hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 56px 24px 8px;
}
.cc-search-hero__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    color: #6B7A6F;
    text-transform: uppercase;
}
.cc-search-hero__title {
    margin: 14px 0 0;
    font-family: inherit;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.25;
    color: #1A281F;
}
.cc-search-hero__title em { font-style: normal; color: #9E3B30; }
.cc-search-hero__count {
    margin: 14px 0 0;
    font-size: 13px;
    letter-spacing: 0.14em;
    color: #6B7A6F;
}
.cc-search-hero__form { margin-top: 28px; }
@media (min-width: 768px) {
    .cc-search-hero { padding: 72px 48px 12px; }
    .cc-search-hero__title { font-size: 42px; }
}

/* 结果列表 */
.cc-search-list {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 64px;
    display: grid;
    gap: 1px;
    background: rgba(26, 40, 31, 0.08);
}
@media (min-width: 768px) {
    .cc-search-list { padding: 28px 48px 88px; }
}
.cc-search-hit {
    display: block;
    padding: 22px 24px;
    background: #FFFFFF;
    text-decoration: none;
    transition: background 0.22s ease;
}
.cc-search-hit:hover { background: #F5F2EC; }
.cc-search-hit:focus-visible { outline: 1px solid #4A7C6F; outline-offset: -2px; }
.cc-search-hit__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: #6B7A6F;
}
.cc-search-hit__type { color: #4A7C6F; }
.cc-search-hit__title {
    margin: 10px 0 0;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.35;
    color: #1A281F;
}
.cc-search-hit__excerpt {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.85;
    color: rgba(26, 40, 31, 0.72);
}
.cc-search-hit__more {
    display: inline-block;
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: #9E3B30;
}
@media (min-width: 768px) {
    .cc-search-hit { padding: 26px 32px; }
    .cc-search-hit__title { font-size: 23px; }
}

/* 空结果 */
.cc-search-empty {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    text-align: center;
}
.cc-search-empty__title {
    margin: 0;
    font-family: inherit;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #1A281F;
}
.cc-search-empty__hint {
    margin: 14px 0 0;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: #6B7A6F;
}
.cc-search-empty__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 28px;
}
.cc-search-empty__links a {
    padding: 11px 22px;
    border: 1px solid rgba(26, 40, 31, 0.15);
    border-radius: 2px;
    color: #3E5344;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-decoration: none;
    transition: all 0.25s ease;
}
.cc-search-empty__links a:hover { background: #3E5344; border-color: #3E5344; color: #FAF8F5; }
@media (min-width: 768px) {
    .cc-search-empty { padding: 56px 48px 120px; }
    .cc-search-empty__title { font-size: 30px; }
}

/* 分页 */
.cc-search-pager {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.cc-search-pager a,
.cc-search-pager span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-decoration: none;
    color: #3E5344;
}
.cc-search-pager a:hover { color: #9E3B30; }
.cc-search-pager .is-disabled { color: rgba(26, 40, 31, 0.25); }
.cc-search-pager__nums { display: flex; gap: 0.9rem; }
/* paginate_links() 的输出类名就是这个，不要换成自定义类 */
.cc-search-pager__nums .page-numbers {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: #6B7A6F;
}
.cc-search-pager__nums a.page-numbers:hover { color: #9E3B30; }
.cc-search-pager__nums .page-numbers.current {
    color: #9E3B30;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.cc-search-pager__nums .page-numbers.dots { color: rgba(26, 40, 31, 0.3); }
@media (min-width: 768px) {
    .cc-search-pager { padding: 0 48px 112px; }
}
