/* ==========================================================================
   1. Import Fonts
   ========================================================================== */
/* Import Fonts - Matching Theme (IBM Plex Sans & Lora) */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

/* ==========================================================================
   2. Main Container
   ========================================================================== */
/* Modern Blog Container */
.monarch-content {
  margin: 0 auto;
  color: #1a202c;
}

/* ==========================================================================
   3. Typography - Headings
   ========================================================================== */
/* Modern Headings */
.monarch-content h1,
.monarch-content h2,
.monarch-content h3,
.monarch-content h4,
.monarch-content h5,
.monarch-content h6 {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #0f172a;
}

.monarch-content h1 {
  font-size: 2.75rem;
  color: #000000;
  margin-top: 0;
}

.monarch-content h2 {
  font-size: 2rem;
  color: #1a202c;
  padding-bottom: 0.5em;
  border-bottom: 3px solid #e2e8f0;
}

.monarch-content h3 {
  font-size: 1.5rem;
  color: #334155;
}

.monarch-content h4 {
  font-size: 1.25rem;
  color: #475569;
}

.monarch-content h5 {
  font-size: 1.1rem;
  color: #64748b;
}

.monarch-content h6 {
  font-size: 1rem;
  color: #94a3b8;
}

/* ==========================================================================
   4. Typography - Body Text & Inline Elements
   ========================================================================== */
/* Typography - Beautiful Reading Experience */
.monarch-content p {
  font-family: "Lora", serif;
  font-size: 1.25rem;
  line-height: 1.85;
  color: #2d3748;
  margin-bottom: 1.75em;
  font-weight: 400;
}

/* Strong and Emphasis */
.monarch-content strong {
  font-weight: 700;
  color: #0f172a;
}

.monarch-content em {
  font-style: italic;
  color: #475569;
}

/* Links */
.monarch-content a {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 500;
  border-bottom: none;
  transition: all 0.2s ease;
}

.monarch-content a:hover {
  color: #e17055; /* Subtle nod to social or just primary hover check */
  text-decoration-color: #e17055;
}

/* ==========================================================================
   5. Blockquotes & Pullquotes
   ========================================================================== */
/* Modern Blockquote with Accent Bar */
.monarch-content blockquote {
  background: #f4f2ed;
  border-left: 4px solid #000000;
  margin: 2em 0;
  padding: 1.25em 2em;
  border-radius: 4px;
  font-family: "Lora", serif;
  font-size: 1.25rem;
  color: #334155;
  position: relative;
  box-shadow: none;
  font-style: italic;
}

.monarch-content blockquote p:last-child {
  margin-bottom: 0;
}

.monarch-content blockquote::before {
  content: "“";
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 6rem;
  color: rgba(0, 0, 0, 0.1);
  font-family: Georgia, serif;
  line-height: 1;
}

.monarch-content cite {
  display: block;
  margin-top: 1em;
  font-size: 0.95rem;
  color: #64748b;
  font-style: normal;
  font-weight: 500;
  font-family: "IBM Plex Sans", sans-serif;
}

/* Pullquote Specific Optimizations */
.monarch-content .wp-block-pullquote {
  margin: 0.5em 0;
  padding: 0;
}

.monarch-content .wp-block-pullquote blockquote {
  margin: 0;
}

/* ==========================================================================
   6. Lists (Ordered & Unordered)
   ========================================================================== */
/* Beautiful Lists */
.monarch-content ul,
.monarch-content ol {
  margin-bottom: 2em;
  font-family: "Lora", serif;
  font-size: 1.15rem;
  color: #334155;
}

.monarch-content ol {
  padding-left: 1.5em;
  list-style: decimal;
  margin-left: 1em;
}

/* Unordered List Design */
.monarch-content ul {
  list-style: none;
  padding-left: 0.5em;
}

.monarch-content ul li {
  position: relative;
  padding-left: 1.75em;
  margin-bottom: 0.75em;
  line-height: 1.75;
}

.monarch-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background-color: #000000;
  transform: rotate(45deg); /* Diamond Bullet */
}

.monarch-content ol > li::marker {
  color: #000000;
  font-weight: 700;
}

.monarch-content ol li {
  margin-bottom: 0.75em;
  line-height: 1.75;
}

/* ==========================================================================
   7. Tables
   ========================================================================== */
/* Modern Table Design */
.monarch-content table {
  width: 100%;
  border-collapse: separate; /* Use separate to allow border-radius */
  border-spacing: 0;
  margin: 2.5em 0;
  font-size: 0.95rem;
  border: 1px solid #e2e8f0; /* Outer border */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
  table-layout: fixed;
  background: transparent;
}

.monarch-content th {
  background: #000000;
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 16px 24px;
  font-family: "IBM Plex Sans", sans-serif;
  border-bottom: 1px solid #1a202c;
  border-right: 1px solid rgba(255, 255, 255, 0.15); /* Subtle separator */
}

/* Ensure nested elements in table headers are visible against black background */
.monarch-content th strong,
.monarch-content th b,
.monarch-content th a,
.monarch-content th span,
.monarch-content th p {
  color: white;
}

.monarch-content th:last-child {
  border-right: none;
}

.monarch-content caption {
  caption-side: top;
  margin-bottom: 1em;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  color: #1a202c;
  text-align: left;
  font-size: 1.1rem;
}

.monarch-content td {
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  border-right: none; /* Removed vertical dividers for cleaner look */
  background: transparent;
  font-family: "Lora", serif;
  color: #334155;
  text-align: left;
}

.monarch-content td:last-child {
  border-right: none;
}

.monarch-content tr:last-child td {
  border-bottom: none;
}

.monarch-content tr:nth-child(even) td {
  background: #f9fafb; /* Zebra striping */
}

.monarch-content tr:hover td {
  background: #f1f5f9; /* Darker hover */
}

/* Mobile Table Optimization */
@media (max-width: 640px) {
  .monarch-content th,
  .monarch-content td {
    padding: 10px 2px;
    font-size: 0.8rem;
  }

  .monarch-content table {
    margin: 1.5em 0;
  }
}

/* Reset specific WordPress block table wrapper */
.monarch-content .wp-block-table {
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  margin: 2.5em 0;
  width: 100%;
}
.monarch-content figure.wp-block-table {
  box-shadow: none !important;
  background: transparent !important;
}

/* ==========================================================================
   8. Code, Verse & Preformatted Blocks
   ========================================================================== */
/* VS Code Style Code Blocks */
.monarch-code-wrapper {
  position: relative;
  margin: 2.5em 0;
  border-radius: 16px;
  overflow: hidden;
  background: #1e1e2e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.monarch-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2d2d3a;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.8rem;
  color: #a0a8b7;
  font-weight: 500;
}

.monarch-code-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.monarch-code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: transform 0.2s;
}

.monarch-code-dot:hover {
  transform: scale(1.2);
}

.dot-red {
  background: #ff5f56;
  box-shadow: 0 0 8px rgba(255, 95, 86, 0.5);
}

.dot-yellow {
  background: #ffbd2e;
  box-shadow: 0 0 8px rgba(255, 189, 46, 0.5);
}

.dot-green {
  background: #27c93f;
  box-shadow: 0 0 8px rgba(39, 201, 63, 0.5);
}

.monarch-copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a0a8b7;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-family: "IBM Plex Sans", sans-serif;
}

.monarch-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: #fff;
  transform: translateY(-1px);
}

.monarch-content pre {
  margin: 0;
  padding: 24px;
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}

.monarch-content pre::-webkit-scrollbar {
  height: 10px;
}

.monarch-content pre::-webkit-scrollbar-track {
  background: #1e1e2e;
}

.monarch-content pre::-webkit-scrollbar-thumb {
  background: #4a5568;
  border-radius: 5px;
}

.monarch-content pre::-webkit-scrollbar-thumb:hover {
  background: #718096;
}

/* Verse Block Design */
.monarch-content .wp-block-verse {
  background: #f4f2ed;
  color: #334155;
  font-family: "Lora", serif;
  font-size: 1.2rem;
  line-height: 1.9;
  padding: 1.5em 2em;
  border-radius: 8px;
  border-left: 4px solid #94a3b8;
  margin: 2em 0;
  white-space: pre-wrap;
  box-shadow: none;
  font-style: italic;
}

/* Preformatted Block Design */
.monarch-content .wp-block-preformatted {
  background: #f1f5f9;
  color: #1e293b;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 1.5em; /* Simple padding */
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin: 2em 0;
  white-space: pre-wrap; /* Wrap text */
  box-shadow: none;
  overflow-x: auto; /* Scroll if too wide */
}
/* ==========================================================================
   9. Media (Images, Gallery, Video)
   ========================================================================== */
/* Beautiful Images */
/* Minimalist Images */
.monarch-content img,
.monarch-content video,
.monarch-content figure {
  border-radius: 6px;
  box-shadow: none; /* Flat design */
  margin: 2.5em auto;
  max-width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease;
}

.monarch-content img:hover {
  opacity: 0.9; /* Subtle hover effect */
  transform: none;
  box-shadow: none;
}

.monarch-content figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: #718096;
  margin-top: 0.75em;
  font-family: "IBM Plex Sans", sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Optimizing Gallery Block */
.monarch-content .wp-block-gallery {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3em 0;
  padding: 0;
  list-style-type: none;
}

/* Gallery Item Styling */
.monarch-content .wp-block-gallery .wp-block-image,
.monarch-content .wp-block-gallery figure {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  cursor: pointer;
}

/* Hover Effects */
.monarch-content .wp-block-gallery figure:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.monarch-content .wp-block-gallery img {
  margin: 0 !important;
  width: 100%;
  height: 250px; /* Fixed height for uniformity */
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.monarch-content .wp-block-gallery figure:hover img {
  transform: scale(1.08);
}

.monarch-content .wp-block-gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  padding: 1em;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  text-align: left;
  margin: 0;
  font-size: 0.85rem;
}

.monarch-content .wp-block-gallery figure:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .monarch-content .wp-block-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .monarch-content .wp-block-gallery img {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .monarch-content .wp-block-gallery {
    grid-template-columns: 1fr;
  }

  .monarch-content .wp-block-gallery img {
    height: auto;
    aspect-ratio: 16/9;
  }
}
/* ==========================================================================
   10. Components (Buttons, Separators, Accordions)
   ========================================================================== */
/* Elegant Separator */
.monarch-content hr {
  border: 0;
  height: 1px;
  background: #e2e8f0;
  margin: 3em 0;
}

/* Modern Buttons */
.monarch-content .wp-block-button__link,
.monarch-content .btn {
  background: #000000;
  color: white;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 6px;
  font-weight: 600;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
}

.monarch-content .wp-block-button__link:hover,
.monarch-content .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  background: #1a1a1a;
}

/* Modern Details/Accordion */
.monarch-content details {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5em;
  margin: 2em 0;
  transition: all 0.3s ease;
}

.monarch-content details:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.monarch-content summary {
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: "IBM Plex Sans", sans-serif;
  list-style: none;
  color: #334155;
  font-size: 1.1rem;
}

.monarch-content summary::-webkit-details-marker {
  display: none;
}

.monarch-content summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 10px;
  color: #000000;
  transition: transform 0.3s;
}

.monarch-content details[open] summary::before {
  transform: rotate(90deg);
}
