/* ManoPress — editorial theme for ManoBlog
   Warm ink + saffron. Designed for Manorath Aryal.
*/

:root {
  --ink: #0c0b0a;
  --ink-soft: #1a1816;
  --paper: #f6f1e8;
  --paper-2: #efe7d8;
  --cream: #faf7f1;
  --ember: #e85d04;
  --ember-deep: #c2410c;
  --crimson: #9b2226;
  --sage: #52796f;
  --muted: #6b6358;
  --line: rgba(12, 11, 10, 0.12);
  --shadow: 0 18px 50px rgba(12, 11, 10, 0.14);
  --radius: 18px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Outfit", "Segoe UI", system-ui, sans-serif;
  --max: 1180px;
  --header-h: 76px;
}

[data-theme="dark"] {
  --ink: #f6f1e8;
  --ink-soft: #1f1c19;
  --paper: #12100e;
  --paper-2: #1b1815;
  --cream: #171411;
  --muted: #b7aea2;
  --line: rgba(246, 241, 232, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ember);
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Progress */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--ember), var(--crimson));
  z-index: 80;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: max-content;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.brand-title span { color: var(--ember); }
.brand-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.nav-primary {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-primary ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-primary a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 999px;
}
.nav-primary a:hover,
.nav-primary .current-menu-item > a {
  color: var(--ink);
  background: color-mix(in srgb, var(--ember) 12%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:hover { border-color: var(--ember); color: var(--ember); }

.nav-toggle { display: none; }

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
  z-index: 70;
  display: none;
  place-items: center;
  padding: 24px;
}
.search-overlay.is-open { display: grid; }
.search-overlay form {
  width: min(720px, 100%);
}
.search-overlay input[type="search"] {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--ink);
  padding: 16px 4px;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 48px);
  color: var(--ink);
  outline: none;
}

/* Hero */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 16px;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 36px;
  align-items: stretch;
}

.hero-featured {
  position: relative;
  min-height: 420px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--ink-soft);
  color: #f6f1e8;
  isolation: isolate;
}
.hero-featured img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.hero-featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12,11,10,0.1) 10%, rgba(12,11,10,0.86) 78%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ember);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  width: max-content;
}
.chip.ghost {
  background: color-mix(in srgb, var(--ember) 16%, transparent);
  color: var(--ember-deep);
}
[data-theme="dark"] .chip.ghost { color: #ffb38a; }

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 16px 0 12px;
  font-weight: 560;
}
.hero-meta { color: #d8cfc2; font-size: 14px; }

.author-panel {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.author-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 700;
}
.author-panel h2 {
  font-family: var(--font-display);
  font-size: 32px;
  margin: 8px 0 10px;
  letter-spacing: -0.03em;
}
.author-panel p { color: var(--muted); margin: 0 0 18px; }
.author-links { display: flex; gap: 10px; flex-wrap: wrap; }
.author-links a {
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--ember);
  padding-bottom: 2px;
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 34px;
  margin: 0;
  letter-spacing: -0.03em;
}

.cat-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-filter button,
.cat-filter a {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.cat-filter .is-active,
.cat-filter button:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
[data-theme="dark"] .cat-filter .is-active {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media {
  aspect-ratio: 16/10;
  background:
    linear-gradient(135deg, #c2410c 0%, #0c0b0a 68%);
  position: relative;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card-meta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* Newsletter */
.newsletter {
  max-width: var(--max);
  margin: 12px auto 40px;
  padding: 0 24px;
}
.newsletter-box {
  background: var(--ink-soft);
  color: #f6f1e8;
  border-radius: 28px;
  padding: 36px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}
.newsletter-box h2 {
  font-family: var(--font-display);
  font-size: 36px;
  margin: 0 0 8px;
}
.newsletter-box p { margin: 0; color: #d8cfc2; }
.newsletter-box form { display: flex; gap: 8px; }
.newsletter-box input {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
}
.newsletter-box button {
  border: 0;
  background: var(--ember);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

/* Layout with sidebar */
.with-sidebar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
}

.entry-header { margin-bottom: 24px; }
.entry-header h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 12px 0;
}
.entry-meta { color: var(--muted); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; }

.featured-full {
  border-radius: 24px;
  overflow: hidden;
  margin: 0 0 28px;
}
.featured-full img { width: 100%; max-height: 460px; object-fit: cover; }

.entry-content {
  font-size: 18.5px;
  line-height: 1.75;
}
.entry-content h2,
.entry-content h3 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.entry-content a { color: var(--ember-deep); text-decoration: underline; text-underline-offset: 3px; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content img { border-radius: 16px; }

.author-box {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--cream);
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  align-items: center;
}
.author-box img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.author-box h3 { margin: 0 0 6px; font-family: var(--font-display); }

.comments-area { margin-top: 40px; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.comment-form .submit {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
}

/* Sidebar */
.sidebar .widget {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 18px;
}
.sidebar .widget-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 12px;
}
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 24px 28px;
  background: var(--ink-soft);
  color: #f6f1e8;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px;
}
.site-footer a { color: #f6f1e8; }
.site-footer h3 {
  font-family: var(--font-display);
  margin: 0 0 12px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 34px;
  margin: 0 0 8px;
}
.motif {
  text-align: center;
  margin-top: 36px;
  opacity: 0.7;
}
.motif svg { width: 160px; height: 36px; }
.copyright {
  text-align: center;
  color: #b7aea2;
  font-size: 13px;
  margin-top: 10px;
}

/* 404 / empty */
.empty-state {
  max-width: 720px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
.empty-state h1 {
  font-family: var(--font-display);
  font-size: 64px;
  margin: 0 0 8px;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px 0 40px;
}
.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.pagination .current {
  background: var(--ember);
  color: #fff;
  border-color: var(--ember);
}

@media (max-width: 960px) {
  .hero, .with-sidebar, .posts-grid, .newsletter-box, .footer-inner {
    grid-template-columns: 1fr;
  }
  .nav-primary { display: none; }
  .nav-primary.is-open {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }
  .nav-primary.is-open ul { flex-direction: column; width: 100%; }
  .nav-toggle { display: grid; }
  .hero-featured { min-height: 360px; }
}
