/* ==========================================================================
   Dr. Surendra Narayan Saxena — Vintage Archive Design System
   ========================================================================== */

:root {
  --color-parchment: #f4f1ea;
  --color-parchment-dark: #e8e2d6;
  --color-ink: #3e362e;
  --color-ink-muted: #5c5348;
  --color-accent: #8b3a3a;
  --color-accent-light: #a85454;
  --color-gold: #9a7b4f;
  --color-border: #c9bfb0;
  --color-card: rgba(255, 252, 245, 0.92);
  --font-script: "Great Vibes", cursive;
  --font-serif: "EB Garamond", "Noto Serif Devanagari", Georgia, serif;
  --font-body: "Noto Serif Devanagari", "EB Garamond", Georgia, serif;
  --shadow-soft: 0 4px 24px rgba(62, 54, 46, 0.08);
  --shadow-card: 0 2px 12px rgba(62, 54, 46, 0.1);
  --radius: 4px;
  --max-width: 1200px;
  --sidebar-width: 300px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--color-ink);
  background-color: var(--color-parchment);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(154, 123, 79, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139, 58, 58, 0.04) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

.lang-hi {
  font-family: var(--font-body);
}

.lang-en {
  font-family: var(--font-serif);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-light);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-accent);
  line-height: 1.3;
  margin-top: 0;
}

.page-title {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  text-align: center;
  color: var(--color-ink-muted);
  font-style: italic;
  margin-bottom: 2rem;
}

.section-heading {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin: 2rem 0 1rem;
  position: relative;
}

.section-heading::after {
  content: "❧";
  position: absolute;
  right: 0;
  bottom: -0.1rem;
  color: var(--color-gold);
  font-size: 1rem;
}

.sr-only {
  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: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.brand-ornament {
  text-align: center;
  color: var(--color-gold);
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  margin: 0 0 0.25rem;
}

.brand-title {
  font-family: var(--font-script);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 400;
  margin: 0;
  text-align: center;
  flex: 1 1 100%;
}

.brand-title a {
  color: var(--color-accent);
  text-decoration: none;
}

.brand-tagline {
  text-align: center;
  font-style: italic;
  color: var(--color-ink-muted);
  margin: 0.25rem 0 0;
  font-size: 1rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  font-size: 0.95rem;
}

.lang-btn {
  text-decoration: none;
  color: var(--color-ink-muted);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
}

.lang-btn.is-active {
  color: var(--color-accent);
  font-weight: 700;
  border-bottom: 2px solid var(--color-accent);
}

.lang-sep {
  color: var(--color-border);
}

.header-divider {
  height: 12px;
  margin: 1rem 0 0;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-border) 20%,
    var(--color-gold) 50%,
    var(--color-border) 80%,
    transparent
  );
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 12'%3E%3Cpath d='M0 6 Q50 0 100 6 T200 6 T300 6 T400 6' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
  opacity: 0.7;
}

/* Navigation */
.main-nav {
  position: relative;
  margin-top: 1rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-ink);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
}

.nav-list a {
  display: block;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  color: var(--color-ink);
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.nav-list a:hover,
.nav-list a.is-active {
  color: var(--color-accent);
  border-color: var(--color-border);
  background: var(--color-card);
}

/* Layout */
.layout-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
  align-items: start;
}

.main-column {
  min-width: 0;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 1rem;
}

.sidebar-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
  position: relative;
}

.portrait-card .portrait-img {
  width: 100%;
  border: 3px double var(--color-border);
  filter: sepia(0.15);
  margin-bottom: 1rem;
}

.sidebar-heading {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.sidebar-bio {
  font-size: 0.95rem;
  color: var(--color-ink-muted);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
}

.contact-list li {
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--color-border);
}

.contact-list li:last-child {
  border-bottom: none;
}

.stamp {
  position: absolute;
  width: 56px;
  height: 56px;
  border: 2px dashed var(--color-accent);
  border-radius: 50%;
  opacity: 0.25;
  transform: rotate(-12deg);
}

.stamp-tl {
  top: 8px;
  left: 8px;
}

/* Content blocks */
.content-paper {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.excerpt {
  color: var(--color-ink-muted);
}

.excerpt p {
  margin: 0 0 0.75rem;
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--color-border);
  padding-left: 1.5rem;
}

.timeline li {
  position: relative;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-parchment);
}

.timeline-year {
  font-weight: 700;
  color: var(--color-gold);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.timeline-title {
  font-size: 1.15rem;
  margin: 0.15rem 0;
  color: var(--color-accent);
}

/* Works grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.work-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.work-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.work-cover {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
  background: var(--color-parchment-dark);
  border-bottom: 1px solid var(--color-border);
}

.work-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--color-parchment-dark), var(--color-parchment));
  color: var(--color-ink-muted);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.work-body {
  padding: 1rem 1.15rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.work-title {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.work-type {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}

.work-excerpt {
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.btn:hover {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent-light);
  color: #fff;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Posts */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
}

.post-item:first-child {
  padding-top: 0;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-gold);
  margin-bottom: 0.25rem;
}

.post-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 2px;
  margin-left: 0.5rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Media */
.media-grid {
  display: grid;
  gap: 2rem;
}

.media-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  border-radius: var(--radius);
}

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.photo-gallery img {
  border: 1px solid var(--color-border);
  filter: sepia(0.1);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--color-ink-muted);
  font-style: italic;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-ink-muted);
  font-size: 0.9rem;
  position: relative;
}

.footer-stamp {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border: 3px double var(--color-accent);
  border-radius: 50%;
  opacity: 0.2;
}

.footer-note {
  font-family: var(--font-script);
  font-size: 1.25rem;
  color: var(--color-accent);
}

/* Admin styles */
.admin-body {
  background: #2a2622;
  color: #f4f1ea;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.admin-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #4a443c;
}

.admin-header h1 {
  color: #e8dcc8;
  font-size: 1.5rem;
  margin: 0;
}

.admin-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.admin-card {
  background: #3e362e;
  border: 1px solid #5c5348;
  padding: 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: #f4f1ea;
  transition: border-color 0.2s;
}

.admin-card:hover {
  border-color: #a85454;
  color: #fff;
}

.admin-card h2 {
  color: #e8dcc8;
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.admin-form {
  background: #3e362e;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid #5c5348;
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #e8dcc8;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="url"],
.form-row input[type="datetime-local"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #5c5348;
  border-radius: var(--radius);
  background: #2a2622;
  color: #f4f1ea;
  font-family: inherit;
  font-size: 1rem;
}

.form-row textarea {
  min-height: 120px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-error {
  background: #5c2a2a;
  border: 1px solid #8b3a3a;
}

.alert-success {
  background: #2a4a3a;
  border: 1px solid #3a6b4a;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem;
  text-align: left;
  border-bottom: 1px solid #5c5348;
}

.admin-table th {
  color: #e8dcc8;
}

.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: #3e362e;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid #5c5348;
}

.login-box h1 {
  text-align: center;
  color: #e8dcc8;
  font-size: 1.35rem;
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: -1;
  }

  .portrait-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: start;
  }

  .portrait-card .portrait-img {
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    z-index: 100;
    box-shadow: var(--shadow-soft);
  }

  .nav-list.is-open {
    display: flex;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .portrait-card {
    grid-template-columns: 1fr;
  }
}

/* --- Recent Posts Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.post-grid-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.post-card-img {
    width: 100%;
    height: 260px; /* Increased height */
    object-fit: cover;
    object-position: top; /* Ensures the top part of the image stays visible */
    border-bottom: 1px solid #e2e8f0;
}

.post-card-content {
    padding: 1rem;
}

.post-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Mobile Sticky Bottom Navigation --- */
.mobile-sticky-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 0.25rem 0;
}

.mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    max-width: 100%;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.15rem;
    text-decoration: none;
    color: #64748b;
    transition: color 0.2s ease;
    border-radius: 0;
    border-right: 1px solid #e5e7eb;
}

.mobile-nav-item:last-child {
    border-right: none;
}

.mobile-nav-item:hover {
    color: #334155;
    background-color: #f9fafb;
}

.mobile-nav-item.is-active {
    color: #1e3a5f;
    background-color: #f3f4f6;
}

.mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.15rem;
    color: inherit;
}

.mobile-nav-text {
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    text-align: center;
}

/* Hide mobile nav on desktop/tablet */
@media (min-width: 768px) {
    .mobile-sticky-nav {
        display: none;
    }
}

/* Add bottom padding to main content on mobile to account for sticky nav */
@media (max-width: 767px) {
    .main-column {
        padding-bottom: 65px;
    }
}

/* --- Refined Mobile Header Repositioning --- */
@media (max-width: 767px) {
    /* Reset body flex to let the default structural order work naturally */
    body.is-inner-page {
        display: block !important;
    }

    /* Convert the site-header itself into a flex container to split its inner components */
    body.is-inner-page .site-header {
        display: flex !important;
        flex-direction: column !important;
        border-bottom: none !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Keep the top brand identity section at the very top */
    body.is-inner-page .site-header .header-inner {
        order: 1 !important;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 1rem;
    }

    /* Push the navigation bar to the bottom */
    body.is-inner-page .site-header .main-nav {
        order: 3 !important;
        margin-top: 2rem;
        border-top: 1px solid var(--color-border);
        padding-top: 1rem;
    }

    /* Handle the header-divider ornament if present */
    body.is-inner-page .site-header .header-divider {
        order: 4 !important;
        margin-bottom: 1.5rem;
    }

    /* Control the main layout shell placement */
    body.is-inner-page .layout-shell {
        display: flex !important;
        flex-direction: column !important;
        margin-top: 1rem;
    }

    /* Main content article remains on top right after the brand header */
    body.is-inner-page .layout-shell .main-column {
        order: 1 !important;
    }

    /* The profile bio sidebar component renders beautifully at the bottom */
    body.is-inner-page .layout-shell .sidebar {
        order: 2 !important;
        margin-top: 2.5rem;
        border-top: 1px solid var(--color-border);
        padding-top: 1.5rem;
    }
}

/* --- Featured Book Section --- */
.featured-book-section {
    background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 100%);
    border: 2px solid #d4c4a8;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
}

.featured-book-section::before {
    content: '✦';
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    color: #b8860b;
}

.featured-book-section::after {
    content: '✦';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #b8860b;
}

.book-flex-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.book-cover-column {
    flex: 0 0 280px;
}

.book-frame {
    background: linear-gradient(145deg, #e8e0d5, #d4c4b8);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.book-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(139, 90, 43, 0.2);
    border-radius: 8px;
    pointer-events: none;
}

.featured-book-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    display: block;
}

.book-details-column {
    flex: 1;
    padding: 0.5rem;
}

.book-badge-type {
    display: inline-block;
    background: linear-gradient(135deg, #8b4513, #b8860b);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(139, 69, 19, 0.3);
}

.book-main-title {
    font-family: 'Noto Serif Devanagari', 'EB Garamond', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #2c1810;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.book-author-sub {
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    color: #5c4033;
    font-style: italic;
    margin: 0 0 1.5rem 0;
}

.book-meta-table {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px dashed #d4c4a8;
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    font-weight: 600;
    color: #5c4033;
    font-size: 0.95rem;
}

.meta-value {
    color: #2c1810;
    font-size: 0.95rem;
    text-align: right;
    max-width: 60%;
}

.book-action-wrap {
    margin-top: 1rem;
}

.btn-flipkart-buy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2874f0, #5a9fd4);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 116, 240, 0.3);
}

.btn-flipkart-buy:hover {
    background: linear-gradient(135deg, #1a5dc2, #4a8bc4);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 116, 240, 0.4);
}

.fk-icon {
    width: 20px;
    height: 20px;
}

.btn-flipkart-yellow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ffeb3b, #ffc107);
    color: #212121;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    border: 2px solid #ff9800;
}

.btn-flipkart-yellow:hover {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

.fk-prominent-icon {
    width: 24px;
    height: 24px;
}

.book-toc-section {
    border-top: 2px solid #d4c4a8;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.toc-heading {
    font-family: 'Noto Serif Devanagari', 'EB Garamond', serif;
    font-size: 1.4rem;
    color: #2c1810;
    margin: 0 0 0.5rem 0;
    text-align: center;
    font-weight: 600;
}

.toc-heading span {
    color: #b8860b;
    margin: 0 0.5rem;
}

.toc-sub {
    text-align: center;
    color: #5c4033;
    font-style: italic;
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    border-left: 3px solid #b8860b;
}

.toc-dot {
    color: #b8860b;
    font-size: 0.9rem;
}

.toc-text {
    color: #2c1810;
    font-size: 0.95rem;
    font-family: 'Noto Serif Devanagari', 'EB Garamond', serif;
}

/* Mobile responsive for featured book */
@media (max-width: 768px) {
    .book-flex-container {
        flex-direction: column;
        align-items: center;
    }

    .book-cover-column {
        flex: 0 0 auto;
        width: 100%;
        max-width: 280px;
    }

    .book-details-column {
        width: 100%;
        padding: 0;
    }

    .book-main-title {
        font-size: 1.6rem;
        text-align: center;
    }

    .book-author-sub {
        text-align: center;
    }

    .book-meta-table {
        font-size: 0.9rem;
    }

    .meta-value {
        max-width: 55%;
    }

    .book-action-wrap {
        text-align: center;
    }

    .toc-grid {
        grid-template-columns: 1fr;
    }

    .featured-book-section {
        padding: 1.5rem 1rem;
    }
}

/* --- Recent Posts 1x1 Mobile Optimization --- */
@media (max-width: 767px) {
    /* Force the grid to stack 1x1 (one post per row) */
    .posts-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
        margin-top: 1rem !important;
    }

    /* Adjust the card design to look balanced in full width */
    .post-grid-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Keep the image height well-proportioned for a 1-column view */
    .post-card-img {
        height: 280px !important; /* Slightly increased for better layout balance on wider mobile viewports */
        object-fit: cover !important;
        object-position: top !important;
    }

    /* Refine padding inside the card details */
    .post-card-content {
        padding: 1.15rem !important;
    }

    .post-card-title {
        font-size: 1.15rem !important;
        margin-bottom: 0.6rem !important;
    }

    .post-card-excerpt {
        font-size: 0.92rem !important;
        line-height: 1.55 !important;
    }
}
