/*
 * 55tools Custom Styles
 * Clean Modern - White Cards on Gray Background
 */

/* ===== Reduce content-sidebar gap from 40px to 20px ===== */
body {
    --theme-content-sidebar-gap: 20px !important;
}

/* ===== Root Variables ===== */
:root {
    --theme-color: #3b82f6;
    --theme-hover: #2563eb;
    --theme-body-bg-color: #f0f2f5;
    --theme-el-bg-color: #ffffff;
    --theme-black-color: #1a1a2e;
    --theme-gray-color: #5a6072;
    --theme-light-color: #8b92a5;
    --theme-line-color: rgba(0,0,0,0.06);
    --theme-border-color: rgba(0,0,0,0.08);
    --theme-border-radius: 10px;
    --theme-border-radius-s: 6px;
}

/* ===== Base ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif !important;
    color: #1a1a2e !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    background: #f0f2f5 !important;
    -webkit-font-smoothing: antialiased;
}
html { scroll-behavior: smooth; }

/* ===== Wrap - transparent to show gray bg ===== */
#wrap {
    background: transparent !important;
}

/* ===== Links ===== */
a {
    color: var(--theme-color);
    transition: color 0.25s ease;
}
a:hover { color: var(--theme-hover); }
a:focus { outline: 0; }

/* ===== Header ===== */
body > header.header {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    border-bottom: none !important;
    background: #fff !important;
}
body > header.header .nav > li > a {
    transition: color 0.25s ease, background 0.25s ease;
    border-radius: 6px;
    font-weight: 500;
}
body > header.header .nav > li.active > a {
    color: var(--theme-color);
    font-weight: 600;
}
body > header.header .nav > li > a:hover {
    color: var(--theme-color);
    background: rgba(59,130,246,0.06);
}

/* ===== Section Panels - white cards ===== */
.sec-panel {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.sec-panel:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.sec-panel-head {
    padding: 20px 24px 0 !important;
}
.sec-panel-head h3 span {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
}
.sec-panel-body {
    padding: 16px 24px 24px !important;
}

/* ===== Sidebar Widgets - white cards ===== */
.widget {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}
.widget:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.widget-title {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.02em;
    margin: -20px -20px 16px -20px;
    padding: 12px 16px 10px 16px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(135deg, var(--theme-color), #4f8ff7);
    border-left: none;
    position: relative;
    overflow: hidden;
}
.widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255,255,255,0.35);
    border-radius: 0;
}
.widget-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), transparent);
    border-radius: 0;
}

/* ===== Main content area ===== */
.main {
    background: transparent;
}

/* ===== Post list spacing - fix thumbnail left edge ===== */
.post-loop-default {
    margin: 0 !important;
}
.post-loop-list {
    padding: 0 !important;
}

/* ===== Post list text size - shrink 1~2px ===== */
.post-loop-default .item-title {
    font-size: 18px;
}
.post-loop-default .item-excerpt {
    font-size: 14px;
    max-height: none !important;
    -webkit-line-clamp: 5;
}
.post-loop-default .item-meta {
    font-size: 14px;
    line-height: 28px;
}
.post-loop-default .item-no-thumb .item-excerpt {
    font-size: 13px;
    max-height: none;
}
@media (max-width: 767px) {
    .post-loop-default .item-title {
        font-size: 16px;
    }
    .post-loop-default .item-excerpt {
        display: block;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        max-height: none !important;
        font-size: 13px;
    }
}

/* ===== Force navbar to browser top edge (fix 60-80px top gap) ===== */
/* header-fixed makes header position:fixed; ensure it sticks to top */
body.header-fixed > header.header {
    position: fixed !important;
    top: 0 !important;
}
/* Override any margin/padding that pushes header down */
body.header-fixed {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
/* Admin bar: keep header 32px below top so it doesn't overlap admin bar */
body.admin-bar.header-fixed > header.header {
    top: 32px !important;
}
@media screen and (max-width: 782px) {
    body.admin-bar.header-fixed > header.header {
        top: 46px !important;
    }
}
/* Ensure #wrap padding accounts for fixed header height (theme uses 64px) */
body.header-fixed #wrap {
    padding-top: 64px !important;
}
@media (max-width: 767px) {
    body.header-fixed #wrap {
        padding-top: 50px !important;
    }
}

/* ===== Unified navbar-to-content spacing (12px on all pages) ===== */
/* Header is position:fixed at 64px; #wrap{padding-top:64px} provides clearance. */
/* The visible gap = #wrap padding-top (64px, for fixed header) + .wrap.container padding-top (12px). */
/* Total visual gap from header bottom to content top = 12px, consistent across all page types. */

/* Universal: 12px gap on every page type (cover both class orderings) */
/* index.php/single.php use "wrap container", category.php uses "container wrap" */
.wrap.container,
.container.wrap {
    padding-top: 12px !important;
    margin-top: 0 !important;
}

/* Explicit: ensure #wrap has no extra margin that could shift content */
body.header-fixed #wrap {
    margin: 0 !important;
}

/* Home page: neutralize any slider top margin */
.home .slider-wrap,
.home .main > .slider-wrap {
    margin-top: 0 !important;
}

/* Category/Archive page: neutralize base theme's negative breadcrumb margin */
/* Base theme sets .archive.category .breadcrumb{margin-top:-20px} which pulls content up */
.archive .breadcrumb,
.category .breadcrumb,
.search .breadcrumb {
    margin-top: 0 !important;
}

/* Single page: remove all top spacing on article entry elements */
.single .entry-main,
.single .entry-head {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.single .entry,
.single article.post,
.single article.hentry,
.single .main > article {
    margin-top: 0 !important;
}
.single .main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Breadcrumb: universal top margin/padding reset */
.breadcrumb {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ===== Post list meta enhancements ===== */
.item-meta-li.likes,
.item-meta-li.comments {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    color: var(--theme-light-color);
    font-size: 14px;
}
.item-meta-li.likes .wpcom-icon,
.item-meta-li.comments .wpcom-icon {
    margin-right: 4px;
    font-size: 15px;
}
.item-meta-tags {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-right: 15px;
}
.item-meta-tags a {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(59,130,246,0.08);
    color: var(--theme-color);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    transition: all 0.2s ease;
}
.item-meta-tags a:hover {
    background: var(--theme-color);
    color: #fff;
}
.item-meta .author .avatar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.item-meta .author .avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* ===== Post Items ===== */
.item {
    border-radius: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.item-thumb img {
    border-radius: 8px 8px 0 0;
    transition: transform 0.35s ease, opacity 0.25s ease;
}
.item-inner:hover .item-thumb img {
    transform: scale(1.03);
    opacity: 1 !important;
}
.item-heading, .item-heading a {
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: -0.01em;
}
.post-loop-default .item {
    border-radius: 8px;
    overflow: hidden;
}

/* ===== Single Post Entry ===== */
.entry {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 30px;
    margin-bottom: 20px;
}
.entry-content {
    font-size: 16px;
    line-height: 1.85;
    color: #2d2d3a;
}
.entry-content h2, .entry-content h3, .entry-content h4 {
    font-weight: 700;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    letter-spacing: -0.02em;
}
.entry-content h2 { font-size: 1.5em; }
.entry-content h3 { font-size: 1.25em; }
.entry-content p { margin-bottom: 1.2em; }
.entry-content img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.entry-content blockquote {
    border-left: 3px solid var(--theme-color);
    background: rgba(59,130,246,0.04);
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 1.5em 0;
    color: var(--theme-gray-color);
}
.entry-content code {
    background: rgba(59,130,246,0.08);
    color: var(--theme-hover);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
}
.entry-content pre {
    border-radius: 8px;
    border: 1px solid var(--theme-line-color);
}

/* ===== Entry Meta ===== */
.entry-meta {
    color: var(--theme-light-color);
    font-size: 13px;
}
.entry-meta a { color: var(--theme-gray-color); }
.entry-meta a:hover { color: var(--theme-color); }

/* ===== Entry Bar (prev/next) ===== */
.entry-bar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin: 20px 0;
    overflow: hidden;
}
.el-boxed .entry-bar-inner {
    padding: 16px 24px;
}
/* Disable fixed floating - keep in normal document flow */
.entry-bar.fixed .entry-bar-inner {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
}

/* ===== Related Posts ===== */
.entry-related-posts {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    padding: 24px;
}

/* ===== Comments ===== */
.comments-area {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 24px;
    margin-bottom: 20px;
}
.comment-list .comment {
    border-bottom: 1px solid var(--theme-line-color);
    padding: 16px 0;
}
.comment-list .comment:last-child {
    border-bottom: none;
}

/* ===== Pagination ===== */
ul.pagination,
ul.page-numbers {
    margin: 40px 0 !important;
    text-align: center;
    display: flex !important;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 !important;
    list-style: none;
}
ul.pagination > li,
ul.page-numbers > li {
    border-radius: 10px !important;
    font-weight: 500;
    transition: all 0.25s ease;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}
ul.pagination > li > a,
ul.pagination > li > span,
ul.page-numbers > li > a,
ul.page-numbers > li > span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
    border: 1px solid var(--theme-border-color) !important;
    min-width: 42px;
    height: 42px;
    padding: 0 14px !important;
    font-size: 15px;
    background: #fff;
    color: var(--theme-gray-color);
    transition: all 0.25s ease;
    box-sizing: border-box;
}
ul.pagination > li > a:hover,
ul.page-numbers > li > a:hover {
    background: var(--theme-color);
    color: #fff;
    border-color: var(--theme-color) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}
ul.pagination > .current,
ul.page-numbers > .current,
ul.pagination > li > span.current,
ul.page-numbers > li > span.current {
    background: var(--theme-color) !important;
    color: #fff !important;
    border-color: var(--theme-color) !important;
    box-shadow: 0 2px 8px rgba(59,130,246,0.35);
    font-weight: 700;
    transform: scale(1.05);
}
ul.pagination > li.next,
ul.pagination > li.prev,
ul.page-numbers > li.next,
ul.page-numbers > li.prev {
    display: inline-flex !important;
    align-items: center;
}
ul.pagination > li.next > a,
ul.pagination > li.prev > a,
ul.page-numbers > li.next > a,
ul.page-numbers > li.prev > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
ul.page-numbers > li.next > a:after,
ul.page-numbers > li.prev > a:before,
ul.pagination > li.next > a:after,
ul.pagination > li.prev > a:before {
    display: inline-flex !important;
    font-size: 16px;
    margin: 0 !important;
}
ul.pagination > li.disabled,
ul.page-numbers > li.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
@media (max-width: 767px) {
    ul.pagination,
    ul.page-numbers {
        gap: 6px;
    }
    ul.pagination > li > a,
    ul.pagination > li > span,
    ul.page-numbers > li > a,
    ul.page-numbers > li > span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px !important;
        font-size: 13px;
        border-radius: 8px !important;
    }
    ul.pagination > .current,
    ul.page-numbers > .current,
    ul.pagination > li > span.current,
    ul.page-numbers > li > span.current {
        transform: scale(1.03);
    }
}

/* ===== Pagination: unify page-jump input with button style ===== */
ul.page-numbers > li.pagination-go,
ul.pagination > li.pagination-go {
    background: #fff !important;
    border: 1px solid var(--theme-border-color) !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 8px !important;
    position: relative;
    overflow: hidden;
}
ul.page-numbers > li.pagination-go .pgo-input,
ul.pagination > li.pagination-go .pgo-input {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: var(--theme-gray-color);
    font-size: 14px;
    height: 100% !important;
    line-height: 42px !important;
    padding: 0 28px 0 10px !important;
    width: 66px;
    outline: none;
    box-shadow: none !important;
}
ul.page-numbers > li.pagination-go .pgo-input::placeholder,
ul.pagination > li.pagination-go .pgo-input::placeholder {
    color: var(--theme-light-color);
    font-size: 13px;
}
ul.page-numbers > li.pagination-go .pgo-input:focus,
ul.pagination > li.pagination-go .pgo-input:focus {
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25) !important;
}
ul.page-numbers > li.pagination-go .pgo-btn,
ul.pagination > li.pagination-go .pgo-btn {
    background: transparent !important;
    border: none !important;
    color: var(--theme-gray-color);
    cursor: pointer;
    height: 100% !important;
    width: 28px;
    position: absolute;
    right: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0 10px 10px 0 !important;
    transition: background 0.2s ease, color 0.2s ease;
}
ul.page-numbers > li.pagination-go .pgo-btn:hover,
ul.pagination > li.pagination-go .pgo-btn:hover {
    background: var(--theme-color) !important;
    color: #fff !important;
}
ul.page-numbers > li.pagination-go .pgo-btn:after,
ul.pagination > li.pagination-go .pgo-btn:after {
    content: "\e654";
    display: block;
    font-family: iconbg;
    font-size: 15px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    font-size: 13px;
    color: var(--theme-light-color);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--theme-gray-color); }
.breadcrumb a:hover { color: var(--theme-color); }

/* ===== Buttons ===== */
.btn, button, input[type="submit"] {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.25s ease;
}
.btn-theme, .btn-primary {
    box-shadow: 0 2px 6px rgba(59,130,246,0.2);
}
.btn-theme:hover, .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
    transform: translateY(-1px);
}

/* ===== Search ===== */
.search-form input[type="search"] {
    border-radius: 8px;
    border: 1px solid var(--theme-border-color);
    padding: 10px 16px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.search-form input[type="search"]:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    outline: none;
}

/* ===== Footer ===== */
.footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    margin-top: 20px;
}
.footer a { color: rgba(255,255,255,0.8); }
.footer a:hover { color: #fff; }
.footer-bar { background: #141425 !important; }

/* ===== Tag Cloud ===== */
.tag-cloud a, .tags a {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px;
    background: rgba(59,130,246,0.06);
    color: var(--theme-gray-color);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}
.tag-cloud a:hover, .tags a:hover {
    background: var(--theme-color);
    color: #fff;
    border-color: var(--theme-color);
    box-shadow: 0 2px 6px rgba(59,130,246,0.2);
}

/* ===== Dropdown ===== */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border: none !important;
    padding: 8px 0;
}
.dropdown-menu > li > a {
    padding: 8px 20px;
    transition: background 0.2s ease, color 0.2s ease;
}
.dropdown-menu > li > a:hover {
    background: rgba(59,130,246,0.06);
    color: var(--theme-color);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

/* ===== Selection ===== */
::selection { background: rgba(59,130,246,0.15); color: #1a1a2e; }
::-moz-selection { background: rgba(59,130,246,0.15); color: #1a1a2e; }

/* ===== Mix Tabs ===== */
.mix-tabs .sec-panel-head {
    border-bottom: 1px solid var(--theme-line-color);
}
.mix-tabs .list.tabs .tab a {
    font-weight: 500;
    transition: color 0.25s ease;
}
.mix-tabs .list.tabs .tab.active a {
    color: var(--theme-color);
    font-weight: 600;
}

/* ===== Poster overlay - fix centering ===== */
.mobile-share-wrap {
    overflow-y: auto;
}
.mobile-share-container {
    margin: 0 auto;
    left: auto;
    transform: none;
}

/* ===== Home page post list - match category archive side padding ===== */
.main-list .tab-wrap.active {
    padding: 0 24px;
}

/* ===== Slider spacing ===== */
.slider-wrap {
    margin-bottom: 20px;
}

/* ===== Container width override ===== */
@media (min-width: 1240px) {
    :root {
        --theme-container-width: 1320px !important;
    }
}

/* ===== Fix thumbnail container to match backend size setting (210x140) ===== */
/* Theme sets .item-img width:30% which stretches the image; override to fixed size */
.post-loop-default .item-img {
    width: 210px !important;
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    body { font-size: 14px !important; }
    .sec-panel-body { padding: 12px 16px 16px !important; }
    .widget { padding: 16px; }
    .sec-panel-head { padding: 16px 16px 0 !important; }
    .entry { padding: 20px; }
    .comments-area { padding: 16px; }
    .entry-related-posts { padding: 16px; }
    .main-list .tab-wrap.active { padding: 0 16px; }
    .post-loop-default .item-img {
        width: 33% !important;
    }
}
