/*
Theme Name: Category Home
Theme URI: https://decobry.com/
Author: Decobry
Author URI: https://decobry.com/
Description: WordPress theme jiska homepage sirf ek chuni hui category ki posts dikhata hai — images, sidebar (latest posts + categories) aur related articles ke sath.
Version: 1.2
Requires at least: 5.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: category-home
*/

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #1f2a2b;
  --paper: #f6f2ea;
  --paper-raised: #ffffff;
  --line: #e4ddcd;
  --clay: #c1652e;
  --clay-dark: #a5501f;
  --teal: #2c4a4c;
  --sage: #7c8b6f;
  --muted: #706a5c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--teal);
  color: #f6f2ea;
}

.site-header-top {
  padding: 18px 24px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 1180px;
  margin: 0 auto;
}

.site-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  color: #fff;
}

.site-description {
  color: #cfd8d3;
  font-size: 13px;
  font-style: italic;
}

.site-header-bottom {
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header-bottom-inner {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.main-nav a {
  color: #dfe6e2;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 13px 14px;
  display: inline-block;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: #fff;
  border-bottom-color: var(--clay);
}

.search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 6px 4px 14px;
  margin: 10px 0;
}

.search-form input[type="search"] {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  width: 150px;
  font-family: 'Inter', sans-serif;
}

.search-form input[type="search"]::placeholder { color: #c7d0cb; }

.search-form button {
  background: var(--clay);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.search-form button:hover { background: var(--clay-dark); }

@media (max-width: 640px) {
  .search-form input[type="search"] { width: 100px; }
}

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 44px 24px 60px; }

.page-heading {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 36px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-heading .eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 600;
  margin-bottom: 6px;
}

.page-heading h1 { font-size: 34px; margin: 0; color: var(--teal); }

.page-heading .count-tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  background: #fff;
}

/* ---------- Swatch tag ---------- */
.swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--clay-dark);
  margin-bottom: 10px;
}

.swatch::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px 3px 0 3px;
  background: var(--clay);
  display: inline-block;
}

/* ---------- Post grid (homepage/category) ---------- */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.post-card:hover { box-shadow: 0 10px 24px rgba(31,42,43,0.12); transform: translateY(-3px); }

.post-card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--line);
}

.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }

.post-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
.post-card.featured .thumb { aspect-ratio: auto; height: 100%; }
.post-card.featured .body { padding: 32px; justify-content: center; }
.post-card.featured h2 { font-size: 28px; }

.post-card h2 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; color: var(--ink); }
.post-card h2 a:hover { color: var(--clay); }

.post-meta { color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 14px; }
.post-excerpt { color: #46433b; font-size: 14px; }

@media (max-width: 720px) {
  .post-card.featured { grid-template-columns: 1fr; }
}

/* ---------- Two-column: content + sidebar ---------- */
.content-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 860px) {
  .content-layout { grid-template-columns: 1fr; }
}

/* ---------- Single post ---------- */
.solo-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.solo-card .thumb { aspect-ratio: 16 / 8; overflow: hidden; }
.solo-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.solo-card .body { padding: 32px 34px 36px; }
.solo-card h1 { font-size: 30px; margin: 4px 0 14px; color: var(--teal); }

.post-content { font-size: 16px; margin-top: 20px; }
.post-content img { border-radius: 8px; margin: 14px 0; }
.post-content p { margin: 0 0 16px; }

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--clay-dark);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 28px; }

.widget {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}

.widget h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--clay);
}

.widget-post {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.widget-post:last-child { border-bottom: none; }

.widget-post .w-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--line);
}

.widget-post .w-thumb img { width: 100%; height: 100%; object-fit: cover; }

.widget-post h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
  font-family: 'Inter', sans-serif;
}

.widget-post h4 a:hover { color: var(--clay); }

.widget-post .w-date { font-size: 11px; color: var(--muted); }

.widget-cat-list { list-style: none; margin: 0; padding: 0; }
.widget-cat-list li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.widget-cat-list li:last-child { border-bottom: none; }
.widget-cat-list a:hover { color: var(--clay); }
.widget-cat-list .cat-count { color: var(--muted); font-size: 12px; }

/* ---------- Related posts ---------- */
.related-section { margin-top: 48px; }

.related-section h3 {
  font-size: 20px;
  color: var(--teal);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.related-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.related-card .thumb { aspect-ratio: 16/10; background: var(--line); }
.related-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-card .body { padding: 14px 16px 18px; }
.related-card h4 { font-size: 14px; margin: 0 0 6px; line-height: 1.35; font-family: 'Inter', sans-serif; font-weight: 600; }
.related-card h4 a:hover { color: var(--clay); }
.related-card .w-date { font-size: 11px; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination-wrap { margin-top: 34px; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination-wrap .page-numbers {
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 13px;
  background: var(--paper-raised);
  border-radius: 6px;
}
.pagination-wrap .page-numbers.current { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
}

.empty-msg { text-align: center; color: var(--muted); padding: 40px 0; }

@media (max-width: 640px) {
  .post-card.featured h2 { font-size: 22px; }
  .page-heading h1 { font-size: 26px; }
}
