/*
Theme Name: Minedit
Theme URI: https://minedit.com
Author: Minedit
Author URI: https://minedit.com
Description: An extremely lightweight, fast, SEO-optimized minimalist blog theme. Features a featured hero (post/page/category or fully manual), a masonry category grid with fixed-size thumbnails, per-page custom HTML/CSS/JS injection, and category thumbnails.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minedit
Tags: blog, minimalist, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root{
  --orange:#FF4500;
  --orange-dark:#e03d00;
  --ink:#1a1a1b;
  --muted:#7c7c7c;
  --line:#ececec;
  --bg:#ffffff;
  --soft:#f6f6f6;
  --radius:10px;
  --max:1180px;
  --thumb-h:200px;          /* fixed category thumbnail height */
  --post-thumb-h:220px;     /* fixed post thumbnail height (category page grid) */
  --ease:cubic-bezier(.4,0,.2,1);
}

*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background:var(--bg);
  color:var(--ink);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%;height:auto}
.wrap{max-width:var(--max);margin:0 auto;padding:0 24px}
.screen-reader-text{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- SCROLL PROGRESS BAR ---------- */
#minedit-progress{
  position:fixed;top:0;left:0;height:3px;width:0;background:var(--orange);
  z-index:100;transition:width .1s linear;
}

/* ---------- HEADER ---------- */
header.site{
  border-bottom:1px solid var(--line);
  position:sticky;top:0;background:rgba(255,255,255,.9);
  backdrop-filter:saturate(180%) blur(10px);
  -webkit-backdrop-filter:saturate(180%) blur(10px);
  z-index:60;transition:box-shadow .25s var(--ease);
}
header.site.scrolled{box-shadow:0 2px 14px rgba(0,0,0,.06)}
.header-inner{height:64px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.logo{
  font-family:'Reddit Sans','Inter',sans-serif;
  font-weight:800;font-size:26px;letter-spacing:-.5px;color:var(--orange);
  transition:opacity .15s;
}
.logo:hover{opacity:.85}
.logo img{max-height:34px;width:auto}
.nav{display:flex;gap:28px;align-items:center}
.nav a{font-size:14px;font-weight:500;color:#3a3a3a;transition:color .15s;position:relative}
.nav a::after{content:"";position:absolute;left:0;bottom:-6px;width:0;height:2px;background:var(--orange);transition:width .2s var(--ease)}
.nav a:hover{color:var(--orange)}
.nav a:hover::after{width:100%}
.search{
  display:flex;align-items:center;gap:8px;background:var(--soft);
  border:1px solid var(--line);border-radius:999px;padding:0;
  transition:border-color .15s,box-shadow .15s;overflow:hidden;
}
.search:focus-within{border-color:var(--orange);box-shadow:0 0 0 3px rgba(255,69,0,.12)}
.search svg{width:15px;height:15px;flex:none;color:var(--muted);margin-left:14px}
.search input{
  border:0;background:transparent;padding:9px 14px 9px 8px;font-size:13px;
  color:var(--ink);min-width:190px;outline:none;font-family:inherit;
}
.menu-toggle{display:none;background:none;border:0;cursor:pointer;padding:6px}
.menu-toggle span{display:block;width:22px;height:2px;background:var(--ink);margin:4px 0;transition:.25s var(--ease)}
.menu-toggle.open span:nth-child(1){transform:translateY(6px) rotate(45deg)}
.menu-toggle.open span:nth-child(2){opacity:0}
.menu-toggle.open span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}

/* ---------- REVEAL ANIMATION ---------- */
.reveal{opacity:0;transform:translateY(16px);transition:opacity .55s var(--ease),transform .55s var(--ease)}
.reveal.in{opacity:1;transform:none}

/* ---------- HERO ---------- */
.hero{padding:44px 0 20px}
.hero-card{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:36px;align-items:center}
.hero-thumb{
  aspect-ratio:16/10;border-radius:var(--radius);overflow:hidden;
  background:linear-gradient(135deg,#ffd9c7,#ffb08a);
  box-shadow:0 1px 3px rgba(0,0,0,.06);position:relative;
}
.hero-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .5s var(--ease)}
.hero-card:hover .hero-thumb img{transform:scale(1.04)}
.hero-tag{
  display:inline-block;font-size:12px;font-weight:700;letter-spacing:.6px;
  text-transform:uppercase;color:var(--orange);margin-bottom:12px;
}
.hero-title{
  font-family:'Reddit Sans','Inter',sans-serif;
  font-size:34px;line-height:1.15;font-weight:800;letter-spacing:-.6px;margin-bottom:14px;
}
.hero-title a{transition:color .15s}
.hero-title a:hover{color:var(--orange)}
.hero-excerpt{font-size:16px;color:#444;margin-bottom:18px}
.hero-meta{font-size:13px;color:var(--muted);display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.hero-meta .dot{width:3px;height:3px;border-radius:50%;background:var(--muted)}

/* ---------- SECTION HEAD ---------- */
.section-head{display:flex;align-items:center;justify-content:space-between;margin:52px 0 24px}
.section-head h2{font-family:'Reddit Sans','Inter',sans-serif;font-size:20px;font-weight:700;letter-spacing:-.3px}
.section-head .rule{flex:1;height:1px;background:var(--line);margin-left:20px}

/* ---------- MASONRY CATEGORIES (fixed thumb size) ---------- */
.masonry-cats{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}
.cat{
  display:block;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;
  background:#fff;transition:transform .18s var(--ease),box-shadow .18s var(--ease),border-color .18s;
}
.cat:hover{transform:translateY(-3px);box-shadow:0 8px 24px rgba(0,0,0,.08);border-color:#e0e0e0}
.cat-thumb{width:100%;height:var(--thumb-h);background:var(--soft) center/cover no-repeat;overflow:hidden}
.cat-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .4s var(--ease)}
.cat:hover .cat-thumb img{transform:scale(1.05)}
.cat-body{padding:14px 16px}
.cat-title{font-family:'Reddit Sans','Inter',sans-serif;font-weight:700;font-size:16px;display:flex;align-items:center;gap:8px}
.cat-title::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--orange);flex:none}
.cat-count{font-size:12px;color:var(--muted);margin-top:3px}

/* ---------- CATEGORY / ARCHIVE PAGE ---------- */
.archive-head{padding:48px 0 8px;text-align:center;max-width:720px;margin:0 auto}
.archive-title{font-family:'Reddit Sans','Inter',sans-serif;font-size:38px;font-weight:800;letter-spacing:-.8px;margin-bottom:14px}
.archive-title .dot{color:var(--orange)}
.archive-excerpt{font-size:17px;color:#555}
.archive-divider{width:60px;height:3px;background:var(--orange);margin:26px auto 0;border-radius:2px}

/* post grid — fixed height/width thumbnails */
.post-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;margin-top:40px}
.pcard{
  border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:#fff;
  display:flex;flex-direction:column;transition:transform .18s var(--ease),box-shadow .18s var(--ease),border-color .18s;
}
.pcard:hover{transform:translateY(-4px);box-shadow:0 10px 28px rgba(0,0,0,.09);border-color:#e0e0e0}
.pcard-thumb{width:100%;height:var(--post-thumb-h);overflow:hidden;background:var(--soft)}
.pcard-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .45s var(--ease)}
.pcard:hover .pcard-thumb img{transform:scale(1.05)}
.pcard-body{padding:18px;display:flex;flex-direction:column;flex:1}
.pcard-cat{font-size:11px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--orange);margin-bottom:8px}
.pcard-title{font-family:'Reddit Sans','Inter',sans-serif;font-size:18px;font-weight:700;line-height:1.3;margin-bottom:8px;letter-spacing:-.2px}
.pcard:hover .pcard-title{color:var(--orange)}
.pcard-excerpt{font-size:14px;color:#555;margin-bottom:14px;flex:1}
.pcard-meta{font-size:12px;color:var(--muted);display:flex;gap:10px;align-items:center}
.pcard-meta .dot{width:3px;height:3px;border-radius:50%;background:var(--muted)}

/* ---------- SINGLE POST / PAGE ---------- */
.single-wrap{max-width:760px;margin:0 auto;padding:48px 24px}
.single-cat{font-size:12px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--orange);margin-bottom:14px;display:inline-block}
.single-title{font-family:'Reddit Sans','Inter',sans-serif;font-size:40px;line-height:1.15;font-weight:800;letter-spacing:-.8px;margin-bottom:18px}
.single-meta{font-size:13px;color:var(--muted);display:flex;gap:14px;align-items:center;margin-bottom:30px;flex-wrap:wrap}
.single-meta .dot{width:3px;height:3px;border-radius:50%;background:var(--muted)}
.single-feature{border-radius:var(--radius);overflow:hidden;margin-bottom:34px;max-height:460px}
.single-feature img{width:100%;height:100%;object-fit:cover}
.entry-content{font-size:17px;line-height:1.8;color:#242424}
.entry-content > *{margin-bottom:1.2em}
.entry-content h2{font-family:'Reddit Sans','Inter',sans-serif;font-size:27px;font-weight:700;margin-top:1.6em;letter-spacing:-.4px}
.entry-content h3{font-family:'Reddit Sans','Inter',sans-serif;font-size:21px;font-weight:700;margin-top:1.4em}
.entry-content a{color:var(--orange);text-decoration:underline;text-underline-offset:2px}
.entry-content img{border-radius:8px;margin:1.4em 0}
.entry-content blockquote{border-left:3px solid var(--orange);padding:6px 0 6px 20px;color:#555;font-style:italic}
.entry-content ul,.entry-content ol{padding-left:1.4em}
.entry-content li{margin-bottom:.5em}
.entry-content code{background:var(--soft);padding:2px 6px;border-radius:4px;font-size:.9em}
.entry-content pre{background:#1a1a1b;color:#f2f2f2;padding:18px;border-radius:8px;overflow:auto;font-size:14px}
.entry-content pre code{background:none;padding:0;color:inherit}

/* custom-code injected pages: let author's HTML/CSS control width fully */
.minedit-custom-canvas{width:100%}

/* ---------- PAGINATION ---------- */
.pagination{display:flex;gap:8px;justify-content:center;margin:50px 0;flex-wrap:wrap}
.pagination a,.pagination span{
  min-width:40px;height:40px;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--line);border-radius:8px;font-size:14px;font-weight:600;color:#444;
  transition:.15s var(--ease);padding:0 12px;
}
.pagination a:hover{border-color:var(--orange);color:var(--orange)}
.pagination .current{background:var(--orange);border-color:var(--orange);color:#fff}

/* ---------- COMMENTS ---------- */
.comments-area{max-width:760px;margin:20px auto 0;padding:0 24px 40px}
.comments-title{font-family:'Reddit Sans','Inter',sans-serif;font-size:22px;font-weight:700;margin-bottom:22px}
.comment-list{list-style:none}
.comment-list li{border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;margin-bottom:14px}
.comment-author{font-weight:700;font-size:14px}
.comment-meta{font-size:12px;color:var(--muted);margin-bottom:8px}
.comment-form input,.comment-form textarea{
  width:100%;border:1px solid var(--line);border-radius:8px;padding:11px 14px;
  font-family:inherit;font-size:14px;margin-bottom:12px;outline:none;transition:border-color .15s,box-shadow .15s;
}
.comment-form input:focus,.comment-form textarea:focus{border-color:var(--orange);box-shadow:0 0 0 3px rgba(255,69,0,.1)}
.comment-form .submit,.btn{
  background:var(--orange);color:#fff;border:0;border-radius:8px;padding:11px 22px;
  font-weight:700;font-size:14px;cursor:pointer;font-family:inherit;transition:background .15s;
}
.comment-form .submit:hover,.btn:hover{background:var(--orange-dark)}

/* ---------- FOOTER ---------- */
footer.site{border-top:1px solid var(--line);margin-top:64px;padding:44px 0;font-size:13px;color:var(--muted)}
.footer-inner{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:16px}
.footer-logo{font-family:'Reddit Sans','Inter',sans-serif;font-weight:800;color:var(--orange);font-size:18px}
.footer-nav{display:flex;gap:20px;flex-wrap:wrap}
.footer-nav a{transition:color .15s}
.footer-nav a:hover{color:var(--orange)}

/* ---------- BACK TO TOP ---------- */
#to-top{
  position:fixed;right:24px;bottom:24px;width:44px;height:44px;border-radius:50%;
  background:var(--orange);color:#fff;border:0;cursor:pointer;display:flex;align-items:center;justify-content:center;
  opacity:0;pointer-events:none;transform:translateY(10px);transition:.25s var(--ease);z-index:60;
  box-shadow:0 4px 14px rgba(255,69,0,.4);
}
#to-top.show{opacity:1;pointer-events:auto;transform:none}
#to-top svg{width:20px;height:20px}

/* ---------- EMPTY STATE ---------- */
.empty{text-align:center;padding:80px 24px;color:var(--muted)}
.empty h2{font-family:'Reddit Sans','Inter',sans-serif;color:var(--ink);margin-bottom:10px}

/* ---------- RESPONSIVE ---------- */
@media(max-width:960px){
  .masonry-cats{grid-template-columns:repeat(3,1fr)}
  .post-grid{grid-template-columns:repeat(2,1fr)}
  .hero-card{grid-template-columns:1fr;gap:20px}
  .hero-title{font-size:28px}
}
@media(max-width:720px){
  .nav,.search{
    position:fixed;top:64px;left:0;right:0;background:#fff;flex-direction:column;
    align-items:flex-start;gap:0;border-bottom:1px solid var(--line);
    padding:8px 24px;transform:translateY(-140%);transition:transform .3s var(--ease);
    box-shadow:0 12px 24px rgba(0,0,0,.06);
  }
  .nav.open{transform:none}
  .nav a{padding:12px 0;width:100%;font-size:15px}
  .nav a::after{display:none}
  .search{display:none}
  .menu-toggle{display:block}
  .masonry-cats{grid-template-columns:repeat(2,1fr)}
  .single-title{font-size:30px}
  .archive-title{font-size:30px}
}
@media(max-width:480px){
  .masonry-cats{grid-template-columns:1fr}
  .post-grid{grid-template-columns:1fr}
  :root{--thumb-h:180px;--post-thumb-h:200px}
}

/* respect reduced motion */
@media(prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important;scroll-behavior:auto!important}
  .reveal{opacity:1;transform:none}
}
