/* Sahitya Ganga - Ultra Premium Editorial Magazine Design System */
/* Inspired by Electric Literature & Open Library */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;0,900;1,400;1,700&family=Inter:wght@300;400;500;600;700;800&family=Noto+Serif+Devanagari:wght@400;500;600;700;800&display=swap');

:root {
  /* Spacing Tokens */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-xl: 80px;

  /* Border Radii - Sharp & Book-like */
  --radius-sm: 0px; /* Zero radius for strict editorial brutalism */
  --radius-md: 2px;
  --radius-lg: 4px;
  --radius-full: 9999px;

  /* Shadows - Minimalist High Contrast (Offset Borders) */
  --shadow-sm: 3px 3px 0px #0f172a;
  --shadow-md: 6px 6px 0px #0f172a;
  --shadow-lg: 12px 12px 0px #0f172a;
  --border-dark: 2px solid #0f172a;

  /* Color Palette - Logo Peacock Quill Derived + High Contrast Editorial */
  --bg-primary: #fcfbf7;      /* Warm Vintage Book Paper */
  --bg-secondary: #ffffff;    /* Pure White for highlighted sections */
  --bg-tertiary: #f4f2e6;     /* Darker Book Paper tint */
  
  --text-primary: #0f172a;    /* High-contrast ink dark */
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  
  /* Brand Colors from Logo */
  --primary: #d9252c;         /* Logo Quill Red */
  --secondary: #2b50a2;       /* Logo Peacock Blue */
  --accent: #068d74;          /* Peacock Teal */
  --gold: #d4af37;            /* Antique Gold */

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
.dark-theme {
  --bg-primary: #0c0f16;
  --bg-secondary: #131722;
  --bg-tertiary: #191f2d;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;

  --primary: #ff4a50;
  --secondary: #4872d8;
  --accent: #09be9f;
  
  --shadow-sm: 3px 3px 0px #ffffff;
  --shadow-md: 6px 6px 0px #ffffff;
  --shadow-lg: 12px 12px 0px #ffffff;
  --border-dark: 2px solid #ffffff;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Serif Devanagari', serif;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', 'Noto Serif Devanagari', serif;
  color: var(--text-primary);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 2px solid var(--secondary);
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* Layout Utilities */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Magazine Asymmetric Layout Grid (Electric Literature style) */
.asymmetric-feed {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 992px) {
  .asymmetric-feed {
    grid-template-columns: 1fr;
  }
}

/* Brutalist Premium Card Styling */
.glass-card {
  background: var(--bg-secondary);
  border: var(--border-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3);
  position: relative;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-md);
}

/* Editorial Drop-Cap */
.drop-cap::first-letter {
  font-family: 'Playfair Display', serif;
  float: left;
  font-size: 75px;
  line-height: 60px;
  padding-top: 4px;
  padding-right: 8px;
  padding-left: 3px;
  color: var(--primary);
  font-weight: 900;
}

/* Category Badge */
.editorial-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: white;
  background: var(--primary);
  padding: 4px 12px;
  margin-bottom: var(--space-1);
  border: 1px solid var(--text-primary);
}

.editorial-badge.teal {
  background: var(--accent);
}

.editorial-badge.blue {
  background: var(--secondary);
}

/* Virtual Bookshelf Layout (Open Library style) */
.bookshelf-container {
  background: var(--bg-tertiary);
  border: var(--border-dark);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-3);
  margin: var(--space-4) 0;
  position: relative;
}

.bookshelf-title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: var(--space-3);
  border-bottom: 3px double var(--text-primary);
  padding-bottom: var(--space-1);
  display: inline-block;
}

.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}

/* Gorgeous Hardcover Book Spine / Cover Layout */
.book-cover-card {
  background: var(--bg-secondary);
  border: var(--border-dark);
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-2);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* Simulated Spine shadow crease */
.book-cover-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12px;
  width: 5px;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  z-index: 2;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1);
}

.book-cover-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background: rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.book-cover-card:hover {
  transform: translateY(-8px) rotate(-1deg);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.book-cover-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: var(--space-1);
  z-index: 1;
}

.book-cover-title {
  font-family: 'Playfair Display', 'Noto Serif Devanagari', serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-top: auto;
  z-index: 1;
  text-align: center;
}

.book-cover-author {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  z-index: 1;
}

/* Elegant Ribbon bookmark */
.ribbon {
  position: absolute;
  top: 0;
  right: 15px;
  width: 12px;
  height: 35px;
  background: var(--primary);
  z-index: 3;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

/* Custom premium buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 30px;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
  border: var(--border-dark);
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
  background: var(--text-primary);
  color: var(--bg-secondary);
  border-color: var(--text-primary);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
}

/* Poetry Highlight Frame */
.poetry-block {
  text-align: center;
  font-family: 'Noto Serif Devanagari', 'Playfair Display', serif;
  font-size: 22px;
  line-height: 2.2;
  font-style: italic;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: var(--border-dark);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  position: relative;
  border-left: 6px solid var(--primary);
}

.poetry-block::before {
  content: "“";
  font-size: 120px;
  position: absolute;
  top: -20px;
  left: 20px;
  color: rgba(217, 37, 44, 0.08);
  font-family: serif;
}

.article-heading-2 {
  font-size: 32px;
  font-weight: 900;
  margin: var(--space-4) 0 var(--space-2) 0;
  border-bottom: 2px solid var(--text-primary);
  padding-bottom: 8px;
  display: block;
}

/* Editorial Column Dividing Rules */
.vertical-divider {
  border-left: 2px solid var(--text-primary);
  padding-left: var(--space-3);
}

@media (max-width: 768px) {
  .vertical-divider {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--text-primary);
    padding-top: var(--space-3);
  }
}

/* Centered Outline Styling for Body Images */
article img {
  display: block;
  max-width: 80%;
  height: auto;
  margin: var(--space-4) auto;
  border: var(--border-dark);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  border-radius: var(--radius-sm);
}

article img:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* Remove underline borders from image link wrappers */
article a[href*=".png"], 
article a[href*=".jpg"], 
article a[href*=".jpeg"] {
  border-bottom: none !important;
  display: block;
  text-align: center;
  transition: var(--transition-smooth);
}

