/*
Theme Name: GIFCompressor Blog
Theme URI: https://gifcompressor.io/blog/
Author: GIFCompressor.io
Author URI: https://gifcompressor.io
Description: Custom blog theme for GIFCompressor.io — matches the main site design with gradient branding, sticky header, popular & latest posts sidebar, search, animated cards and full responsive layout. No plugins required.
Version: 1.0
Requires at least: 5.9
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gifcompressor-blog
*/

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  --dark: #0f172a;
  --text: #334155;
  --text-light: #64748b;
  --heading: #0f172a;
  --bg: #f8fafc;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(15, 23, 42, .07);
  --shadow-lg: 0 12px 40px rgba(99, 102, 241, .16);
  --tr: all .3s cubic-bezier(.25, .8, .35, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16.5px;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; transition: var(--tr); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.3; font-weight: 800; letter-spacing: -.015em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.22rem; color: var(--heading); flex-shrink: 0; }
.logo:hover { color: var(--heading); }
.logo-icon { width: 40px; height: 40px; border-radius: 11px; overflow: hidden; box-shadow: 0 4px 14px rgba(99, 102, 241, .35); transition: var(--tr); }
.logo-icon svg { width: 100%; height: 100%; display: block; }
.logo:hover .logo-icon { transform: rotate(-8deg) scale(1.06); }
.logo em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; }
.main-nav ul ul { display: none; } /* dropdowns handled simply */
.main-nav a { display: inline-block; padding: 9px 14px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: .95rem; position: relative; }
.main-nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; background: var(--grad); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.main-nav a:hover { color: var(--primary); background: #eef2ff; }
.main-nav a:hover::after, .main-nav .current-menu-item > a::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2.6px; background: var(--heading); margin: 5px 0; border-radius: 3px; transition: var(--tr); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.6px) rotate(-45deg); }

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .main-nav { position: fixed; top: 68px; left: 0; right: 0; bottom: 0; background: #fff; padding: 18px 22px; overflow-y: auto; transform: translateX(100%); transition: transform .35s cubic-bezier(.25, .8, .35, 1); }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav a { display: block; padding: 13px 14px; font-size: 1.02rem; }
}

/* ---------- Page hero ---------- */
.page-hero { background: var(--grad-soft); padding: 46px 0 38px; text-align: center; border-bottom: 1px solid var(--border); }
.page-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.page-hero .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.page-hero p { color: var(--text-light); max-width: 620px; margin: 10px auto 0; }
.breadcrumb { font-size: .87rem; color: var(--text-light); margin-bottom: 10px; }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- Layout ---------- */
.blog-layout { display: grid; grid-template-columns: 1fr 330px; gap: 36px; padding: 44px 0 64px; align-items: start; }
@media (max-width: 980px) { .blog-layout { grid-template-columns: 1fr; } }

/* ---------- Post cards ---------- */
.post-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 26px; transition: var(--tr);
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: #c7d2fe; }
.post-card .card-thumb { display: block; overflow: hidden; max-height: 320px; }
.post-card .card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; display: block; }
.post-card:hover .card-thumb img { transform: scale(1.05); }
.post-card .card-thumb.placeholder { background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 3rem; height: 200px; }
.card-body { padding: 26px 28px; }
.post-meta { font-size: .8rem; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.post-meta a { color: var(--primary); }
.card-body h2 { font-size: 1.35rem; margin-bottom: 8px; }
.card-body h2 a { color: var(--heading); }
.card-body h2 a:hover { color: var(--primary); }
.card-body p { color: var(--text-light); font-size: .96rem; margin-bottom: 14px; }
.read-more-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad); color: #fff !important; font-weight: 700; font-size: .92rem;
  padding: 10px 22px; border-radius: 10px; box-shadow: 0 5px 16px rgba(99, 102, 241, .3); transition: var(--tr);
}
.read-more-btn:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(99, 102, 241, .42); }

/* ---------- Single post ---------- */
.single-article { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; }
@media (max-width: 640px) { .single-article { padding: 26px 20px; } }
.single-article .featured { border-radius: 12px; overflow: hidden; margin: 22px 0; }
.single-article .featured img { display: block; width: 100%; }
.entry-content { font-size: 1.05rem; }
.entry-content h2 { margin: 2em 0 .6em; padding-bottom: .3em; border-bottom: 2px solid var(--border); }
.entry-content h3 { margin: 1.6em 0 .5em; }
.entry-content p { margin-bottom: 1.1em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em 1.5em; }
.entry-content li { margin-bottom: .45em; }
.entry-content a { font-weight: 600; text-decoration: underline; text-decoration-color: #c7d2fe; text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-color: var(--primary); }
.entry-content img { border-radius: 12px; }
.entry-content blockquote { background: var(--grad-soft); border-left: 4px solid var(--primary); border-radius: 0 12px 12px 0; padding: 18px 24px; margin: 1.4em 0; }
.entry-content code { background: #eef2ff; color: var(--primary-dark); border-radius: 6px; padding: 2px 8px; font-size: .92em; }
.entry-content pre { background: var(--dark); color: #e2e8f0; border-radius: 12px; padding: 20px; overflow-x: auto; margin-bottom: 1.2em; }
.entry-content pre code { background: none; color: inherit; padding: 0; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 1.2em 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.entry-content th { background: var(--grad-soft); color: var(--heading); font-weight: 700; padding: 12px 16px; text-align: left; }
.entry-content td { padding: 12px 16px; border-bottom: 1px solid var(--border); }

.tag-row { margin-top: 26px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag-row a { background: #eef2ff; color: var(--primary); font-size: .82rem; font-weight: 700; padding: 6px 14px; border-radius: 100px; transition: var(--tr); }
.tag-row a:hover { background: var(--grad); color: #fff; transform: translateY(-2px); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.post-nav a { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; font-weight: 700; color: var(--heading); font-size: .93rem; transition: var(--tr); }
.post-nav a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); }
.post-nav .nav-label { display: block; font-size: .75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 90px; }
@media (max-width: 980px) { .sidebar { position: static; } }
.widget { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: var(--tr); }
.widget:hover { box-shadow: var(--shadow-lg); }
.widget-title { font-size: .92rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 18px; padding-bottom: 10px; position: relative; }
.widget-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px; border-radius: 3px; background: var(--grad); transition: width .35s ease; }
.widget:hover .widget-title::after { width: 58px; }

.search-form { display: flex; gap: 8px; }
.search-form input[type=search] {
  flex: 1; min-width: 0; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: .95rem; transition: var(--tr);
}
.search-form input[type=search]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.search-form button {
  background: var(--grad); color: #fff; border: none; border-radius: 10px; padding: 0 16px;
  font-size: 1.05rem; cursor: pointer; box-shadow: 0 4px 12px rgba(99, 102, 241, .3); transition: var(--tr);
}
.search-form button:hover { transform: translateY(-2px); box-shadow: 0 7px 18px rgba(99, 102, 241, .42); }

.mini-post { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.mini-post:last-child { border-bottom: none; padding-bottom: 0; }
.mini-post:first-child { padding-top: 0; }
.mini-thumb { flex: 0 0 62px; width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.mini-post:hover .mini-thumb img { transform: scale(1.1); }
.mini-body h4 { font-size: .9rem; line-height: 1.4; margin-bottom: 3px; }
.mini-body h4 a { color: var(--heading); }
.mini-post:hover .mini-body h4 a { color: var(--primary); }
.mini-body .mini-date { font-size: .76rem; color: var(--text-light); font-weight: 600; }
.mini-rank { flex: 0 0 auto; font-size: 1.3rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; width: 26px; text-align: center; }

.cat-list { list-style: none; }
.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a { display: flex; justify-content: space-between; padding: 10px 2px; color: var(--text); font-weight: 600; font-size: .93rem; }
.cat-list a:hover { color: var(--primary); padding-left: 8px; }
.cat-list .count { color: var(--text-light); font-weight: 700; font-size: .8rem; background: #eef2ff; border-radius: 100px; padding: 2px 10px; }

.tools-promo { background: var(--grad); color: #fff; border: none; }
.tools-promo .widget-title { color: #fff; }
.tools-promo .widget-title::after { background: #fff; }
.tools-promo p { color: rgba(255, 255, 255, .9); font-size: .92rem; margin-bottom: 14px; }
.tools-promo .tool-links { display: flex; flex-wrap: wrap; gap: 8px; }
.tools-promo .tool-links a {
  background: rgba(255, 255, 255, .16); color: #fff; font-size: .84rem; font-weight: 700;
  padding: 7px 14px; border-radius: 100px; transition: var(--tr);
}
.tools-promo .tool-links a:hover { background: #fff; color: var(--primary); transform: translateY(-2px); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pagination .page-numbers {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 17px; font-weight: 700; color: var(--text); font-size: .95rem; transition: var(--tr);
}
.pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.pagination .page-numbers.current { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 34px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.comments-area .comments-title { font-size: 1.2rem; margin-bottom: 20px; }
.comment-list { list-style: none; }
.comment-list .comment { border-bottom: 1px solid var(--border); padding: 18px 0; }
.comment-list .children { list-style: none; margin-left: 34px; }
.comment-author { font-weight: 700; color: var(--heading); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 10px; }
.comment-metadata { font-size: .8rem; color: var(--text-light); margin: 4px 0 8px; }
.comment-form label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 5px; color: var(--heading); }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: .95rem; margin-bottom: 14px; transition: var(--tr);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.comment-form .submit {
  background: var(--grad); color: #fff; border: none; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 1rem; padding: 12px 30px; border-radius: 10px;
  box-shadow: 0 5px 16px rgba(99, 102, 241, .3); transition: var(--tr);
}
.comment-form .submit:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(99, 102, 241, .42); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #94a3b8; margin-top: 40px; position: relative; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #8b5cf6, #6366f1); background-size: 300% 100%; animation: gradslide 7s linear infinite; }
@keyframes gradslide { from { background-position: 0% 0 } to { background-position: 300% 0 } }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding: 54px 0 40px; }
@media (max-width: 920px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { color: #fff; margin-bottom: 14px; }
.footer-brand p { font-size: .92rem; }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 18px; position: relative; padding-bottom: 10px; }
.site-footer h4::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px; border-radius: 3px; background: var(--grad); transition: width .35s ease; }
.footer-col:hover h4::after { width: 58px; }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 10px; }
.site-footer ul a { color: #94a3b8; font-size: .93rem; position: relative; transition: color .28s ease, padding-left .28s ease; }
.site-footer ul a::before { content: "→"; position: absolute; left: -4px; opacity: 0; color: var(--secondary); transition: opacity .28s ease, left .28s ease; }
.site-footer ul a:hover { color: #fff; padding-left: 20px; }
.site-footer ul a:hover::before { opacity: 1; left: 0; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .88rem; }
.footer-heart { color: var(--accent); display: inline-block; animation: beat 1.6s ease infinite; }
@keyframes beat { 0%, 100% { transform: scale(1) } 12% { transform: scale(1.25) } 24% { transform: scale(1) } }

/* ---------- Misc ---------- */
.not-found-box { text-align: center; padding: 70px 20px; }
.not-found-box .code { font-size: 5rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
::selection { background: #c7d2fe; color: var(--heading); }
