/*
Theme Name: Ravikant Raut Diya
Theme URI: https://ravikantraut.in
Author: Ravikant Raut
Author URI: https://ravikantraut.in
Description: रविकान्त राऊत की साहित्यिक वेबसाइट के लिए बना हुआ कस्टम थीम — पूरी तरह मोबाइल-फ्रेंडली, वर्किंग ड्रॉप-डाउन/ड्रॉअर मेनू के साथ। "दीया और स्याही" डिज़ाइन।
Version: 1.0.2
Requires at least: 5.9
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: ravikant-raut
*/

@import url('https://fonts.googleapis.com/css2?family=Eczar:wght@500;600;700&family=Hind:wght@400;500;600;700&family=Kalam:wght@400;700&display=swap');

:root {
  --bg: #1b1714;
  --bg-elevated: #241e19;
  --bg-elevated-2: #2c231c;
  --surface: #f2e8d6;
  --surface-2: #e9dcc2;
  --surface-text: #241b12;
  --surface-text-muted: #6b5d48;
  --text: #ede3d3;
  --text-muted: #b7a890;
  --accent: #e2871f;
  --accent-strong: #f2a63f;
  --accent-2: #c1432b;
  --border: rgba(237, 227, 211, 0.14);
  --border-strong: rgba(237, 227, 211, 0.26);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --font-display: 'Eczar', 'Noto Serif Devanagari', Georgia, serif;
  --font-body: 'Hind', 'Noto Sans Devanagari', system-ui, sans-serif;
  --font-accent: 'Kalam', 'Noto Sans Devanagari', cursive;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ede6d6; --bg-elevated: #e4dac5; --bg-elevated-2: #ddd0b6;
    --surface: #fffbf2; --surface-2: #f6eeda;
    --surface-text: #241b12; --surface-text-muted: #6b5d48;
    --text: #2a2118; --text-muted: #6b5d48;
    --accent: #c1601c; --accent-strong: #a24e15; --accent-2: #8b2e2b;
    --border: rgba(42, 33, 24, 0.14); --border-strong: rgba(42, 33, 24, 0.26);
    --shadow: 0 18px 40px rgba(90, 70, 40, 0.16);
  }
}
:root[data-theme="light"] {
  --bg: #ede6d6; --bg-elevated: #e4dac5; --bg-elevated-2: #ddd0b6;
  --surface: #fffbf2; --surface-2: #f6eeda;
  --surface-text: #241b12; --surface-text-muted: #6b5d48;
  --text: #2a2118; --text-muted: #6b5d48;
  --accent: #c1601c; --accent-strong: #a24e15; --accent-2: #8b2e2b;
  --border: rgba(42, 33, 24, 0.14); --border-strong: rgba(42, 33, 24, 0.26);
  --shadow: 0 18px 40px rgba(90, 70, 40, 0.16);
}
:root[data-theme="dark"] {
  --bg: #1b1714; --bg-elevated: #241e19; --bg-elevated-2: #2c231c;
  --surface: #f2e8d6; --surface-2: #e9dcc2;
  --surface-text: #241b12; --surface-text-muted: #6b5d48;
  --text: #ede3d3; --text-muted: #b7a890;
  --accent: #e2871f; --accent-strong: #f2a63f; --accent-2: #c1432b;
  --border: rgba(237, 227, 211, 0.14); --border-strong: rgba(237, 227, 211, 0.26);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.screen-reader-text, .skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #1b1714;
  padding: 0.75rem 1.25rem; z-index: 999; font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus, .screen-reader-text:focus { left: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; margin: 0; }

.eyebrow {
  font-family: var(--font-body); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.78rem; color: var(--accent);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 76px; }

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--text); }
.brand-mark, .custom-logo-link img {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent-strong), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: #1b1714; font-size: 1.15rem;
  flex-shrink: 0; object-fit: cover;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.brand-text span { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-accent); }

/* ---------- Nav menu (shared: desktop bar + mobile drawer) ---------- */
.main-navigation ul.menu {
  list-style: none; display: flex; align-items: center; gap: 0.2rem; margin: 0; padding: 0;
}
.main-navigation .menu-item { position: relative; }
.main-navigation .menu-item > a {
  font-weight: 600; font-size: 0.96rem; text-decoration: none; color: var(--text);
  padding: 0.6rem 0.85rem; border-radius: 8px; display: inline-flex; align-items: center; gap: 0.3rem;
}
.main-navigation .menu-item > a:hover { background: var(--bg-elevated); color: var(--accent-strong); }

.submenu-toggle {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 0.4rem; margin-left: -0.4rem; font-size: 0.65rem; display: inline-flex; align-items: center;
}
.submenu-toggle .caret { transition: transform 0.2s ease; display: inline-block; }
.menu-item.submenu-open > .submenu-toggle .caret { transform: rotate(180deg); }

.main-navigation ul.sub-menu {
  list-style: none; margin: 0; padding: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.main-navigation .menu-item > .sub-menu a {
  display: block; padding: 0.55rem 0.75rem; border-radius: 8px;
  text-decoration: none; color: var(--text); font-size: 0.92rem;
}
.main-navigation .menu-item > .sub-menu a:hover { background: var(--bg-elevated-2); color: var(--accent-strong); }

.drawer-social { display: none; gap: 0.6rem; margin-top: 1.5rem; }
.drawer-social a {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg-elevated-2);
  display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); font-size: 0.85rem;
}

.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.hamburger {
  display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--bg-elevated); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); transition: transform 0.25s ease, opacity 0.25s ease; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  position: fixed; inset: 0; background: rgba(10, 8, 6, 0.55); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

/* Desktop dropdown behaviour */
@media (min-width: 881px) {
  .main-navigation ul.sub-menu {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
    display: none; flex-direction: column; gap: 0.15rem; z-index: 10;
  }
  .menu-item.submenu-open > .sub-menu { display: flex; }
  .main-navigation ul.sub-menu ul.sub-menu { top: 0; right: calc(100% + 8px); }
}

/* Mobile drawer behaviour: the SAME nav tree becomes an off-canvas panel */
@media (max-width: 880px) {
  .hamburger { display: flex; }
  .main-navigation {
    position: fixed; top: 0; right: 0; width: min(86vw, 360px);
    height: 100vh; height: 100dvh;
    background: var(--bg-elevated); border-left: 1px solid var(--border-strong);
    z-index: 200; transform: translateX(100%); transition: transform 0.3s ease;
    overflow-y: auto; padding: 5.5rem 1.25rem 2rem;
  }
  body.nav-open .main-navigation { transform: translateX(0); }
  .main-navigation ul.menu { flex-direction: column; align-items: stretch; gap: 0; }
  .main-navigation .menu-item > a {
    display: flex; justify-content: space-between; width: 100%;
    padding: 0.85rem 0.4rem; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 1.02rem;
  }
  .main-navigation .menu-item { display: flex; flex-wrap: wrap; align-items: center; }
  .main-navigation .menu-item > a { flex: 1; }
  .submenu-toggle { border-bottom: 1px solid var(--border); height: 100%; padding: 0.85rem 0.6rem; }
  .main-navigation ul.sub-menu {
    flex-basis: 100%; max-height: 0; overflow: hidden; border: none; box-shadow: none;
    background: transparent; padding: 0 0 0 0.8rem; transition: max-height 0.3s ease;
  }
  .menu-item.submenu-open > .sub-menu { max-height: 600px; padding: 0.3rem 0 0.3rem 0.8rem; }
  .main-navigation .menu-item > .sub-menu a { color: var(--text-muted); border-bottom: 1px dashed var(--border); }
  .drawer-social { display: flex; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.22; margin: 0.6rem 0 1rem; }
.hero h1 .accent-word { color: var(--accent); }
.hero-tagline { font-family: var(--font-accent); font-size: 1.2rem; color: var(--text-muted); margin: 0 0 1.7rem; }
.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.5rem; border-radius: 999px;
  font-weight: 700; font-size: 0.98rem; text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(135deg, var(--accent-strong), var(--accent-2)); color: #1b1310; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }

.fact-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.fact-chip { background: var(--bg-elevated); border: 1px solid var(--border); padding: 0.55rem 1rem; border-radius: 999px; font-size: 0.85rem; color: var(--text-muted); }
.fact-chip strong { color: var(--text); font-weight: 700; }

.portrait-wrap { position: relative; justify-self: center; }
.portrait-ring {
  position: relative; width: min(320px, 100%); aspect-ratio: 1; border-radius: 50%; padding: 10px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent-strong), var(--accent));
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.portrait-inner { background: var(--bg); border-radius: 50%; overflow: hidden; width: 100%; height: 100%; }
.portrait-inner img { width: 100%; height: 100%; object-fit: cover; animation: spin-reverse 16s linear infinite; }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }

/* ---------- Section shell ---------- */
section, .content-section { padding: clamp(3rem, 6vw, 5rem) 0; scroll-margin-top: 90px; }
.section-head { max-width: 640px; margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin-top: 0.5rem; }
.section-head p { color: var(--text-muted); margin-top: 0.7rem; }

/* ---------- Category chips ---------- */
.chip-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.chip {
  border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text-muted);
  padding: 0.5rem 1.05rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  text-decoration: none; display: inline-block;
}
.chip:hover { color: var(--accent-strong); }
.chip.active { background: linear-gradient(135deg, var(--accent-strong), var(--accent-2)); color: #1b1310 !important; border-color: transparent; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.post-card {
  background: var(--surface); color: var(--surface-text); border-radius: 16px; padding: 1.5rem;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.8rem; border: 1px solid rgba(0,0,0,0.04);
}
.post-card .tag-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.post-tag {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; background: rgba(193, 67, 43, 0.12);
  color: var(--accent-2); padding: 0.25rem 0.6rem; border-radius: 999px; text-decoration: none;
}
.post-card h3 { font-size: 1.25rem; line-height: 1.4; }
.post-card h3 a { text-decoration: none; color: inherit; }
.post-card h3 a:hover { color: var(--accent-2); }
.post-date { font-size: 0.78rem; color: var(--surface-text-muted); font-weight: 600; }
.post-excerpt { font-size: 0.94rem; color: var(--surface-text-muted); flex-grow: 1; }
.post-more { font-size: 0.88rem; font-weight: 700; color: var(--accent-2); text-decoration: none; }
.post-more:hover { text-decoration: underline; }

.pagination-row { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination-row .page-numbers {
  border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text);
  padding: 0.5rem 0.95rem; border-radius: 8px; text-decoration: none; font-size: 0.9rem; font-weight: 600;
}
.pagination-row .page-numbers.current { background: linear-gradient(135deg, var(--accent-strong), var(--accent-2)); color: #1b1310; }

/* ---------- Single post ---------- */
.single-post-wrap { max-width: 760px; margin: 0 auto; }
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0.7rem 0 1rem; }
.post-meta { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; color: var(--text-muted); font-size: 0.9rem; }
.post-body {
  background: var(--surface); color: var(--surface-text); border-radius: 20px; padding: clamp(1.5rem, 5vw, 3rem);
  box-shadow: var(--shadow); font-size: 1.08rem; line-height: 1.9;
}
.post-body p { margin: 0 0 1.3rem; }
.post-body h2, .post-body h3 { margin: 1.8rem 0 1rem; }
.post-body img { border-radius: 12px; margin: 1.5rem 0; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.post-nav a {
  text-decoration: none; color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 0.9rem 1.3rem; font-size: 0.92rem; max-width: 45%;
}
.post-nav a:hover { border-color: var(--accent); color: var(--accent-strong); }
.back-to-blog { display: inline-block; margin-bottom: 1.5rem; color: var(--accent-strong); text-decoration: none; font-weight: 600; font-size: 0.92rem; }

/* ---------- Generic page ---------- */
.page-wrap { max-width: 800px; margin: 0 auto; }
.page-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 2rem; }
.page-content {
  background: var(--surface); color: var(--surface-text); border-radius: 20px; padding: clamp(1.5rem, 5vw, 3rem);
  box-shadow: var(--shadow); font-size: 1.05rem; line-height: 1.85;
}
.page-content p { margin: 0 0 1.2rem; }
.page-content h1, .page-content h2, .page-content h3 { margin: 1.8rem 0 1rem; }
.page-content img { border-radius: 12px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2.5rem; padding: clamp(3rem, 6vw, 4rem) 0 2rem; }
.footer-grid h4 { font-size: 1rem; margin-bottom: 1rem; color: var(--accent-strong); }
.footer-grid p, .footer-grid a { color: var(--text-muted); font-size: 0.92rem; text-decoration: none; }
.footer-contact-line { display: flex; gap: 0.6rem; margin-bottom: 0.7rem; align-items: flex-start; }
.footer-social { display: flex; gap: 0.6rem; margin-top: 1rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 0.85rem;
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent-strong); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.3rem 0; text-align: center; font-size: 0.82rem; color: var(--text-muted); }

.no-posts { color: var(--text-muted); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait-wrap { order: -1; }
  .footer-grid { grid-template-columns: 1fr; }
}
}