/*
Theme Name: QuotesWordz
Theme URI: https://quoteswordz.com/
Author: QuotesWordz
Author URI: https://quoteswordz.com/
Description: A fast, lightweight and SEO-friendly blog theme for messages, quotes and wishes. Minimal JavaScript, clean light design, built-in author box and a modern table of contents.
Version: 1.0.3
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: quoteswordz
Tags: blog, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --green: #2e9e5b;
  --green-dark: #247a46;
  --green-soft: #e8f3ec;
  --green-tint: #eef4ec;
  --blue: #2f6fd0;
  --orange: #f0921f;
  --text: #1d2321;
  --muted: #6b7280;
  --faint: #9ca3af;
  --bg: #ffffff;
  --bg-soft: #f6f7f6;
  --border: #e6e8e6;
  --radius: 10px;
  --radius-lg: 14px;
  --maxw: 1200px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}
h1, h2, h3, h4 { font-family: var(--serif); color: var(--text); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green); color: #fff; border: none;
  padding: 12px 22px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s ease;
}
.btn:hover { background: var(--green-dark); color: #fff; }

/* Accessibility helper */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 10px; top: 10px; background: #fff; padding: 10px 16px; z-index: 999; border-radius: 8px; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 24px; font-weight: 700; }
.logo .mark { width: 42px; height: 42px; border-radius: 12px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.main-nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 16px; }
.main-nav li { position: relative; }
.main-nav a { color: #374151; padding: 6px 2px; display: block; }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--green); border-bottom: 2px solid var(--green); }
.main-nav a:hover { color: var(--green); }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 0; min-width: 180px; box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a { padding: 8px 16px; }
.header-search { display: flex; align-items: center; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 6px 8px 6px 16px; }
.header-search input { border: none; background: transparent; outline: none; font-size: 14px; width: 170px; color: var(--text); }
.header-search button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--text); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(90deg, var(--green-tint) 0%, rgba(238,244,236,.6) 45%, rgba(238,244,236,0) 70%), #eef1ec; position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0 0 0 auto; width: 55%; background-size: cover; background-position: center; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #eef1ec 0%, rgba(238,241,236,0) 40%); }
.hero-inner { position: relative; z-index: 2; padding: 70px 0 64px; max-width: 620px; }
.hero h1 { font-size: 56px; margin: 0 0 16px; letter-spacing: -1px; }
.hero p { font-size: 19px; color: #4b5563; margin: 0 0 28px; max-width: 520px; }
.hero-search { display: flex; gap: 10px; max-width: 560px; }
.hero-search input { flex: 1; border: 1px solid var(--border); background: #fff; border-radius: var(--radius); padding: 14px 18px; font-size: 15px; outline: none; }
.hero-search input:focus { border-color: var(--green); }
.hero-search .btn { padding: 0 20px; font-size: 18px; }

/* ---------- Category strip ---------- */
.cat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 34px 0; }
.cat-card { display: flex; align-items: center; gap: 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 22px; }
.cat-card .icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.cat-card .icon.green  { background: var(--green-soft); color: var(--green); }
.cat-card .icon.blue   { background: #e7effb; color: var(--blue); }
.cat-card .icon.orange { background: #fdeed7; color: var(--orange); }
.cat-card h3 { font-family: var(--sans); font-size: 17px; font-weight: 700; margin: 0; }
.cat-card span { font-size: 14px; color: var(--muted); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding: 10px 0 60px; }
.section-title { display: flex; align-items: center; gap: 20px; font-size: 30px; margin: 0 0 26px; }
.section-title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--green), transparent); }

/* Featured + cards */
.featured { display: grid; grid-template-columns: 300px 1fr; gap: 24px; margin-bottom: 30px; }
.featured .thumb { border-radius: var(--radius-lg); overflow: hidden; height: 100%; min-height: 220px; }
.featured .thumb img, .featured .thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured h3 { font-size: 26px; margin: 10px 0; }
.featured p { color: #4b5563; margin: 0 0 14px; }

.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; }
.post-card { display: flex; gap: 16px; }
.post-card .thumb { width: 110px; height: 110px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.post-card .thumb img, .post-card .thumb svg { width: 100%; height: 100%; object-fit: cover; }
.post-card h3 { font-size: 19px; margin: 8px 0; }

/* Pills + meta */
.pill { display: inline-block; font-family: var(--sans); font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 999px; }
.pill.messages { background: var(--green-soft); color: var(--green-dark); }
.pill.quotes   { background: #e7f3ea; color: var(--green-dark); }
.pill.wishes   { background: #fdeed7; color: #b26b06; }
.pill.news, .pill.blog { background: #e7effb; color: #1e4f9c; }
.meta { font-family: var(--sans); font-size: 13px; color: var(--faint); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.meta i { margin-right: 5px; }

/* ---------- Sidebar ---------- */
.widget { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 26px; }
.widget .widget-title, .widget h3 { font-size: 20px; font-family: var(--serif); background: var(--green-tint); margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.widget .widget-body, .widget ul { padding: 6px 18px 14px; }
.widget ul { list-style: none; margin: 0; }
.widget ul li { padding: 11px 0; border-bottom: 1px solid var(--border); font-family: var(--sans); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text); }
.widget ul li a:hover { color: var(--green); }
.cat-list .folder { color: var(--green); font-size: 18px; }
.cat-list .count { margin-left: auto; background: var(--bg-soft); color: var(--muted); border-radius: 6px; font-size: 13px; padding: 2px 10px; }
.pop-post { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pop-post:last-child { border-bottom: none; }
.pop-post .thumb { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.pop-post .thumb img, .pop-post .thumb svg { width: 100%; height: 100%; object-fit: cover; }
.pop-post h4 { font-size: 15px; margin: 0 0 4px; line-height: 1.35; font-family: var(--sans); font-weight: 600; }
.pop-post .date { font-family: var(--sans); font-size: 12px; color: var(--faint); }

/* ---------- Single post ---------- */
.article-wrap { max-width: 820px; margin: 0 auto; padding: 40px 0 60px; }
.article-head { margin-bottom: 24px; }
.article-head h1 { font-size: 40px; margin: 14px 0; }
.article-hero { border-radius: var(--radius-lg); margin: 24px 0 32px; width: 100%; overflow: hidden; }
.article-hero img, .article-hero svg { width: 100%; display: block; }
.article-body { font-size: 17px; color: #333; }
.article-body h2, .article-body h3 { scroll-margin-top: 90px; }
.article-body h2 { font-size: 26px; margin: 34px 0 12px; }
.article-body h3 { font-size: 21px; margin: 26px 0 10px; }
.article-body p { margin: 0 0 18px; }
.article-body img { border-radius: 10px; margin: 20px 0; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; }
.article-body blockquote { border-left: 4px solid var(--green); background: var(--green-tint); margin: 24px 0; padding: 16px 22px; font-family: var(--serif); font-style: italic; font-size: 20px; border-radius: 0 8px 8px 0; }

/* ---------- Table of contents (modern) ---------- */
.toc { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: 0 12px 12px 0; padding: 18px 22px 20px; margin: 0 0 32px; }
.toc-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.toc-head .label { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; color: var(--green-dark); }
.toc-head .toc-toggle { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; }
.toc ol { counter-reset: toc; list-style: none; margin: 14px 0 0; padding: 0; }
.toc ol li { counter-increment: toc; margin: 0; }
.toc ol li.lvl-3 { padding-left: 26px; }
.toc ol li a { font-family: var(--sans); font-size: 15px; color: #4b5563; display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.toc ol li:last-child a { border-bottom: none; }
.toc ol li a::before { content: counter(toc, decimal-leading-zero); color: var(--green); font-weight: 600; font-size: 13px; min-width: 22px; }
.toc ol li.lvl-3 a::before { content: "–"; }
.toc ol li a:hover { color: var(--green); }
.toc ol li a.active { color: var(--green-dark); font-weight: 600; }
.toc.collapsed ol { display: none; }

/* ---------- Author box ---------- */
.author-box { display: flex; gap: 20px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin: 44px 0 10px; }
.author-box .avatar { border-radius: 50%; flex-shrink: 0; }
.author-box .avatar img { border-radius: 50%; }
.author-box .about-label { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 2px; }
.author-box h4 { font-size: 22px; margin: 0 0 6px; }
.author-box p { font-size: 15px; color: #4b5563; margin: 0 0 10px; }
.author-box .author-link { font-family: var(--sans); font-size: 14px; color: var(--green); font-weight: 600; }

/* Post navigation + comments */
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin: 30px 0; font-family: var(--sans); font-size: 14px; }
.post-nav a { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; max-width: 48%; }
.post-nav a:hover { border-color: var(--green); }
.comments-area { max-width: 820px; margin: 0 auto; padding: 0 0 50px; }
.comments-area h2 { font-size: 24px; margin: 30px 0 16px; }
.comment-list { list-style: none; padding: 0; }
.comment-list li { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0 0 14px; }
.comment-form input, .comment-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-family: var(--sans); font-size: 15px; margin: 0 0 14px; }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: var(--green-tint); text-align: center; padding: 50px 0; border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: 44px; margin: 0 0 8px; }
.page-head p { color: var(--muted); margin: 0; }

/* ---------- Archive / blog grid ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 50px 0 60px; }
.blog-item { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; transition: transform .15s ease, box-shadow .15s ease; }
.blog-item:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.blog-item .thumb { height: 190px; overflow: hidden; }
.blog-item .thumb img, .blog-item .thumb svg { height: 100%; width: 100%; object-fit: cover; }
.blog-item .body { padding: 16px 18px 20px; }
.blog-item h3 { font-size: 20px; margin: 10px 0; }
.blog-item p { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.cat-chips a { font-family: var(--sans); font-size: 14px; color: #4b5563; background: #fff; border: 1px solid var(--border); padding: 7px 16px; border-radius: 999px; }
.cat-chips a:hover, .cat-chips a.active { background: var(--green); color: #fff; border-color: var(--green); }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; padding: 0 0 50px; font-family: var(--sans); }
.pagination .page-numbers { border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; color: #4b5563; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- About / Contact ---------- */
.about-sec { max-width: 820px; margin: 0 auto; padding: 50px 0; font-size: 17px; color: #333; }
.about-sec h2 { font-size: 28px; margin: 30px 0 12px; }
.values { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin: 30px 0; }
.value { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; }
.value i { font-size: 32px; color: var(--green); }
.value h3 { font-size: 19px; margin: 12px 0 6px; }
.value p { font-size: 14px; color: var(--muted); margin: 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 1000px; margin: 0 auto; padding: 50px 0 60px; }
.contact-info .info-row { display: flex; gap: 14px; margin-bottom: 22px; }
.contact-info .info-row i { font-size: 22px; color: var(--green); margin-top: 3px; }
.contact-info h4 { font-family: var(--sans); font-size: 16px; margin: 0 0 2px; }
.contact-info p { margin: 0; color: var(--muted); }
.contact-form label { font-family: var(--sans); font-size: 14px; font-weight: 600; display: block; margin: 0 0 6px; }
.contact-form input, .contact-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 15px; font-family: var(--sans); margin-bottom: 18px; outline: none; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--green); }
.notice { padding: 12px 16px; border-radius: 10px; font-family: var(--sans); font-size: 14px; margin-bottom: 18px; }
.notice.ok { background: var(--green-soft); color: var(--green-dark); }
.notice.err { background: #fdecec; color: #b42323; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 40px 0 0; font-family: var(--sans); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.site-footer .logo { font-size: 22px; margin-bottom: 10px; }
.footer-col h4 { font-family: var(--sans); font-size: 16px; margin: 0 0 14px; }
.footer-col p { color: var(--muted); font-size: 14px; margin: 0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: #4b5563; font-size: 14px; }
.socials { display: flex; gap: 12px; margin-top: 4px; }
.socials a { width: 38px; height: 38px; border-radius: 50%; background: #e4e7e4; color: #4b5563; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.socials a:hover { background: var(--green); color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0; font-size: 13px; color: var(--faint); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: repeat(2,1fr); }
  .hero-bg { display: none; }
  .hero h1 { font-size: 42px; }
}
@media (max-width: 760px) {
  .main-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 10px 24px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; padding: 10px 0; }
  .main-nav .sub-menu { position: static; border: none; box-shadow: none; padding-left: 14px; }
  .nav-toggle { display: block; }
  .header-search { display: none; }
  .cat-strip, .post-grid, .blog-grid, .featured, .contact-grid, .values, .footer-grid { grid-template-columns: 1fr; }
  .featured { gap: 14px; }
  .hero h1 { font-size: 34px; }
  .author-box { flex-direction: column; }
}

/* ---------- Copy buttons on post lists (single posts only) ---------- */
.qw-copy-wrap { margin: 0 0 22px; }
.qw-copy-bar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.qw-copy-all {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--green-soft); color: var(--green-dark);
  border: 1px solid #cfe6d8; border-radius: 999px;
  padding: 7px 15px; font-family: var(--sans); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.qw-copy-all:hover { background: var(--green); color: #fff; border-color: var(--green); }
.qw-copy-all.done { background: var(--green); color: #fff; border-color: var(--green); }

.article-body .qw-copy-wrap ul,
.article-body .qw-copy-wrap ol { margin: 0; }
.article-body li.qw-li {
  position: relative;
  padding-right: 92px;
  padding-top: 6px; padding-bottom: 6px;
}
.qw-copy {
  position: absolute; right: 0; top: 6px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 11px; font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .15s ease; line-height: 1;
}
.qw-copy:hover { border-color: var(--green); color: var(--green-dark); }
.qw-copy.done { background: var(--green); color: #fff; border-color: var(--green); }
.qw-copy i { font-size: 13px; }

@media (max-width: 600px) {
  .article-body li.qw-li { padding-right: 0; }
  .qw-copy { position: static; margin-top: 8px; }
}
/* ---------- Redesigned archive/blog post cards ---------- */
.blog-grid { gap: 30px; }
.blog-item {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.blog-item:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(16,24,40,.10); border-color: #d6ebdd; }

.blog-item .blog-thumb {
  position: relative; display: block;
  aspect-ratio: 3 / 2; height: auto; overflow: hidden;
}
.blog-item .blog-thumb .thumb { position: absolute; inset: 0; height: 100%; width: 100%; }
.blog-item .blog-thumb img, .blog-item .blog-thumb svg {
  height: 100%; width: 100%; object-fit: cover; display: block;
  transition: transform .4s ease;
}
.blog-item:hover .blog-thumb img { transform: scale(1.05); }

.pill-float {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.blog-item .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.blog-item .body h3 {
  font-size: 20px; line-height: 1.3; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-item .body p {
  font-size: 14.5px; color: var(--muted); margin: 0 0 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.blog-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
}
.blog-foot .meta { font-size: 13px; color: var(--faint); }
.read-more {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--green);
  display: inline-flex; align-items: center; gap: 6px;
}
.read-more i { transition: transform .15s ease; font-size: 12px; }
.read-more:hover { color: var(--green-dark); }
.read-more:hover i { transform: translateX(3px); }
