/* ==========================================================================
   Ethantheme - Category Page Styles
   B2B/SaaS aesthetic, flat design system
   Uses theme CSS variables (--eth-* prefix)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Generic Section
   -------------------------------------------------------------------------- */

/* 覆盖 GeneratePress .grid-container 宽度：本页使用全宽，避免文章页 1350px 限制影响布局 */
.grid-container {
    max-width: 100% !important;
}

.eth-section {
    padding-block: var(--eth-section-space-y);
    padding-inline: var(--eth-section-space-x);
}
.eth-container {
    max-width: var(--eth-container);
    margin-inline: auto;
    padding-inline: var(--eth-space-m);
}
.eth-container--narrow {
    max-width: var(--eth-container-narrow);
}
.eth-section__title {
    font-size: var(--eth-fs-h2);
    font-weight: var(--eth-fw-semibold);
    color: var(--eth-text-title);
    margin-bottom: var(--eth-space-m);
    line-height: var(--eth-lh-heading);
}

/* --------------------------------------------------------------------------
   2. Breadcrumb
   -------------------------------------------------------------------------- */
.eth-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--eth-space-2xs);
    font-size: var(--eth-fs-small);
    color: var(--eth-text-muted);
    margin-bottom: var(--eth-space-m);
}
.eth-breadcrumb a {
    color: var(--eth-text-muted);
    text-decoration: none;
    transition: color var(--eth-transition-s);
}
.eth-breadcrumb a:hover {
    color: var(--eth-primary);
}
.eth-breadcrumb__sep {
    opacity: 0.5;
}
.eth-breadcrumb__current {
    color: var(--eth-text-title);
    font-weight: var(--eth-fw-medium);
}

/* --------------------------------------------------------------------------
   4. Hero Module
   -------------------------------------------------------------------------- */
.eth-hero {
    padding-top: var(--eth-space-xl);
}
.eth-hero__grid {
    align-items: center;
}
.eth-hero__title {
    font-size: var(--eth-fs-hero);
    font-weight: var(--eth-fw-bold);
    color: var(--eth-text-title);
    line-height: var(--eth-lh-tight);
    margin-bottom: var(--eth-space-xs);
}
.eth-hero__subtitle {
    font-size: var(--eth-fs-h3);
    font-weight: var(--eth-fw-regular);
    color: var(--eth-text-muted);
    margin-bottom: var(--eth-space-m);
}
.eth-hero__content > p {
    color: var(--eth-text-body);
    line-height: var(--eth-lh-body);
    margin-bottom: var(--eth-space-m);
}
.eth-hero__features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--eth-space-m);
    display: grid;
    gap: var(--eth-space-2xs);
}
.eth-hero__features li {
    display: flex;
    align-items: center;
    gap: var(--eth-space-2xs);
    font-size: var(--eth-fs-body);
    color: var(--eth-text-body);
}
.eth-hero__features li svg {
    color: var(--eth-success);
    flex-shrink: 0;
}
.eth-hero__media {
    border-radius: var(--eth-radius-l);
    overflow: hidden;
    box-shadow: var(--eth-shadow-l);
}
.eth-hero__media img,
.eth-hero__media video {
    width: 100%;
    height: auto;
    display: block;
}
.eth-hero__actions {
    margin-top: var(--eth-space-l);
}

/* --------------------------------------------------------------------------
   5. Button Group
   -------------------------------------------------------------------------- */
.eth-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eth-space-s);
}
.eth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75em 1.5em;
    border-radius: var(--eth-radius-m);
    font-size: var(--eth-fs-body);
    font-weight: var(--eth-fw-semibold);
    text-decoration: none;
    transition: all var(--eth-transition-s);
    cursor: pointer;
    border: 1.5px solid transparent;
}
.eth-btn--primary {
    background: var(--eth-primary);
    color: var(--eth-text-invert);
}
.eth-btn--primary:hover {
    background: var(--eth-primary-d-1);
    transform: translateY(-1px);
    box-shadow: var(--eth-shadow-m);
}
.eth-btn--outline {
    background: transparent;
    border-color: var(--eth-border-strong);
    color: var(--eth-text-title);
}
.eth-btn--outline:hover {
    border-color: var(--eth-primary);
    color: var(--eth-primary);
}

/* --------------------------------------------------------------------------
   6. Image-Text Module (modules 2/3/6/7)
   -------------------------------------------------------------------------- */
.eth-image-text { }
.eth-image-text__media {
    border-radius: var(--eth-radius-l);
    overflow: hidden;
    box-shadow: var(--eth-shadow-m);
}
.eth-image-text__media img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--eth-transition-l);
}
.eth-image-text__media:hover img {
    transform: scale(1.03);
}
.eth-image-text__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.eth-image-text__content > p {
    color: var(--eth-text-body);
    line-height: var(--eth-lh-body);
    margin-bottom: var(--eth-space-s);
}
.eth-image-text__actions {
    margin-top: var(--eth-space-m);
}

/* --------------------------------------------------------------------------
   7. Custom HTML Module (modules 4/8)
   -------------------------------------------------------------------------- */
.eth-custom-html {
    background: transparent;
}
.eth-custom-html > .eth-container > * + * {
    margin-top: var(--eth-space-m);
}

/* --------------------------------------------------------------------------
   8. Loop Section Layout (with sidebar)
   -------------------------------------------------------------------------- */
.eth-loop-section {
    background: var(--eth-bg-body);
}
.eth-loop-layout {
    display: grid;
    gap: var(--eth-space-l);
}
/* Sidebar moved to the left: 300px sidebar column first, main content second. */
.eth-loop-layout--with-sidebar {
    grid-template-columns: 300px 1fr;
}
.eth-loop-layout--with-sidebar .eth-loop-layout__main {
    min-width: 0;
    order: 2;
}
.eth-loop-layout--with-sidebar .eth-loop-layout__sidebar {
    order: 1;
}
.eth-loop-layout__sidebar {
    /* 0.7.5：移除卡片样式（边框/背景/内边距/阴影），
       避免与内部 .eth-widget 卡片形成双重边框/背景。 */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: start;
    position: sticky;
    top: var(--eth-space-l);
}
@media (max-width: 992px) {
    .eth-loop-layout--with-sidebar {
        grid-template-columns: 1fr;
    }
    .eth-loop-layout--with-sidebar .eth-loop-layout__main,
    .eth-loop-layout--with-sidebar .eth-loop-layout__sidebar {
        order: 0;
    }
    .eth-loop-layout__sidebar {
        position: static;
    }
}

/* --------------------------------------------------------------------------
   9. Sidebar Widgets
   -------------------------------------------------------------------------- */
.eth-widget {
    margin-bottom: var(--eth-space-m);
}
.eth-widget:last-child {
    margin-bottom: 0;
}
.eth-widget__title {
    font-size: var(--eth-fs-h4);
    font-weight: var(--eth-fw-semibold);
    color: var(--eth-text-title);
    margin-bottom: var(--eth-space-s);
    padding-bottom: var(--eth-space-2xs);
    border-bottom: 1px solid var(--eth-border);
}
.eth-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.eth-widget li {
    margin-bottom: var(--eth-space-2xs);
}
.eth-widget a {
    color: var(--eth-text-body);
    text-decoration: none;
    transition: color var(--eth-transition-s);
}
.eth-widget a:hover {
    color: var(--eth-primary);
}

/* --------------------------------------------------------------------------
   10. Contact Module
   -------------------------------------------------------------------------- */
.eth-contact {
    background: var(--eth-bg-surface);
}
.eth-contact__info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.eth-contact-info {
    list-style: none;
    padding: 0;
    margin: var(--eth-space-m) 0;
    display: grid;
    gap: var(--eth-space-s);
}
.eth-contact-info li {
    display: flex;
    gap: var(--eth-space-s);
    font-size: var(--eth-fs-body);
    color: var(--eth-text-body);
}
.eth-contact-info strong {
    color: var(--eth-text-title);
    min-width: 100px;
}
.eth-contact-info a {
    color: var(--eth-primary);
    text-decoration: none;
}
.eth-contact-info a:hover {
    text-decoration: underline;
}
.eth-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eth-space-2xs);
    margin-top: var(--eth-space-m);
}
.eth-social-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5em 1em;
    border-radius: var(--eth-radius-s);
    background: var(--eth-bg-muted);
    color: var(--eth-text-body);
    font-size: var(--eth-fs-small);
    text-decoration: none;
    transition: all var(--eth-transition-s);
}
.eth-social-link:hover {
    background: var(--eth-primary);
    color: var(--eth-text-invert);
}

/* --------------------------------------------------------------------------
   11. Responsive Supplements
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .eth-hero__title {
        font-size: var(--eth-fs-h1);
    }
    .eth-section__title {
        font-size: var(--eth-fs-h3);
    }
    .eth-btn {
        width: 100%;
    }
    .eth-btn-group {
        flex-direction: column;
    }
}

/* --------------------------------------------------------------------------
   11. Gradient utility classes for custom HTML modules (module 4 / 8)
   Apply by adding the class to the section or container in the wysiwyg content.
   -------------------------------------------------------------------------- */
.eth-custom-html.eth-bg-grad-1 {
    background: linear-gradient(135deg, var(--eth-primary-5), var(--eth-primary-10));
}
.eth-custom-html.eth-bg-grad-2 {
    background: linear-gradient(135deg, var(--eth-tertiary-5), var(--eth-primary-10));
}
.eth-custom-html.eth-bg-grad-3 {
    background: linear-gradient(135deg, var(--eth-bg-muted), var(--eth-light));
}
.eth-custom-html.eth-bg-grad-4 {
    background: linear-gradient(135deg, var(--eth-secondary-5), var(--eth-primary-10));
}

/* --------------------------------------------------------------------------
   12. Sidebar collapsible nav (multi-level click to expand/collapse)
   Applies to category widget (ul.children) and custom menu widget (ul.sub-menu)
   inside .eth-loop-layout__sidebar only.
   -------------------------------------------------------------------------- */
.eth-loop-layout__sidebar .eth-collapsible > ul.children,
.eth-loop-layout__sidebar .eth-collapsible > ul.sub-menu {
    display: none;
    margin-top: var(--eth-space-2xs);
    padding-left: var(--eth-space-s);
}
.eth-loop-layout__sidebar .eth-collapsible.eth-open > ul.children,
.eth-loop-layout__sidebar .eth-collapsible.eth-open > ul.sub-menu {
    display: block;
}

.eth-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.4rem;
    height: 1.4rem;
    margin-left: 0.5rem;   /* 与文字拉开间距（0.7.5） */
    padding: 0;
    border: 1px solid var(--eth-border);
    border-radius: var(--eth-radius-xs);
    background: var(--eth-bg-surface);
    color: var(--eth-text-muted);
    cursor: pointer;
    vertical-align: middle;
    transition: transform var(--eth-transition-s), background var(--eth-transition-s), color var(--eth-transition-s);
}
.eth-sidebar-toggle svg {
    width: 0.85rem;
    height: 0.85rem;
}
.eth-sidebar-toggle:hover {
    background: var(--eth-primary-10);
    color: var(--eth-primary);
    border-color: var(--eth-primary-40);
}
.eth-sidebar-toggle--open {
    transform: rotate(180deg);
    background: var(--eth-primary-10);
    color: var(--eth-primary);
    border-color: var(--eth-primary-40);
}

/* 0.7.5：折叠项 li 横向排布，链接占左侧、按钮靠右 */
.eth-loop-layout__sidebar .eth-collapsible {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.eth-loop-layout__sidebar .eth-collapsible > a {
    flex: 1;
    display: block;
    min-width: 0;
}
.eth-loop-layout__sidebar .eth-widget li {
    padding: var(--eth-space-3xs) 0;
}
.eth-loop-layout__sidebar .eth-widget li.eth-collapsible > ul.children li,
.eth-loop-layout__sidebar .eth-widget li.eth-collapsible > ul.sub-menu li {
    padding: var(--eth-space-3xs) 0;
}
