/* ============================================================================
   MINDPRINT BLOG STYLES
   Responsive dark mode design for blog articles, guides, and case studies
   Mobile-first approach with dark theme matching Mindprint brand
   ============================================================================ */

/* ============================================================================
   CSS VARIABLES & ROOT STYLES
   ============================================================================ */

:root {
  /* Color Palette */
  --bg-dark: #0f172a;
  --bg-darker: #0a0f1a;
  --bg-card: #1a2240;
  --bg-hover: #243354;

  /* Text Colors */
  --text-light: #e5e7eb;
  --text-primary: #f3f4f6;
  --text-muted: #9ca3af;
  --text-light-muted: #6b7280;

  /* Brand Colors */
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #5b21b6;
  --secondary: #06b6d4;
  --accent: #f59e0b;

  /* Borders & Dividers */
  --border: #1f2937;
  --border-light: #374151;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --line-height-tight: 1.3;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* ============================================================================
   BASE / RESET
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-sans);
  line-height: var(--line-height-normal);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   ARTICLE & CONTAINER STYLES
   ============================================================================ */

article {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  background-color: var(--bg-dark);
}

.blog-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.blog-listing {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ============================================================================
   TYPOGRAPHY - HEADINGS
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  font-weight: 700;
  margin: 2rem 0 1rem;
  scroll-margin-top: 100px;
}

h1 {
  font-size: 2.5rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 2rem;
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

h4 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

h5 {
  font-size: 1.125rem;
  color: var(--text-light);
}

h6 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================================
   TYPOGRAPHY - PARAGRAPHS & TEXT
   ============================================================================ */

p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  line-height: var(--line-height-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  color: var(--text-primary);
  font-weight: 600;
}

em, i {
  font-style: italic;
  color: var(--text-light);
}

small {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================================================
   LINKS & ANCHORS
   ============================================================================ */

a {
  color: var(--primary-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(167, 139, 250, 0.3);
  transition: all var(--transition-fast);
}

a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: rgba(124, 58, 237, 0.1);
  padding-bottom: 2px;
}

/* External link styling */
a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.875em;
  opacity: 0.7;
}

/* Internal links */
a[href^="#"] {
  border-bottom-color: var(--primary);
}

/* ============================================================================
   IMAGES & MEDIA
   ============================================================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background-color: var(--bg-card);
  padding: 4px;
}

figure {
  margin: 2rem 0;
}

figcaption {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* ============================================================================
   LISTS
   ============================================================================ */

ul, ol {
  margin-bottom: 1.5rem;
  margin-left: 1.5rem;
}

ul ul, ol ol, ul ol, ol ul {
  margin-bottom: 0;
  margin-top: 0.5rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--text-light);
  line-height: var(--line-height-relaxed);
}

li p {
  margin-bottom: 0.5rem;
}

/* Unordered list styling */
ul {
  list-style-type: disc;
}

ul ul {
  list-style-type: circle;
}

ul ul ul {
  list-style-type: square;
}

/* Ordered list styling */
ol {
  list-style-type: decimal;
}

ol ol {
  list-style-type: lower-alpha;
}

ol ol ol {
  list-style-type: lower-roman;
}

/* ============================================================================
   CODE & PREFORMATTED TEXT
   ============================================================================ */

code {
  background-color: var(--bg-card);
  color: var(--secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875em;
  word-break: break-word;
}

pre {
  background-color: var(--bg-darker);
  color: var(--text-light);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 2rem 0;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-md);
  line-height: 1.5;
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* ============================================================================
   BLOCKQUOTES
   ============================================================================ */

blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  padding-left: 2rem;
  border-left: 4px solid var(--primary);
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-style: italic;
  line-height: var(--line-height-relaxed);
}

blockquote p {
  margin-bottom: 0.5rem;
  color: inherit;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite {
  display: block;
  font-style: normal;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ============================================================================
   HORIZONTAL RULE
   ============================================================================ */

hr {
  margin: 2rem 0;
  border: none;
  border-top: 2px solid var(--border);
  height: 0;
}

/* ============================================================================
   TABLES
   ============================================================================ */

table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead {
  background-color: var(--bg-card);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
}

tbody tr:hover {
  background-color: var(--bg-card);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================================
   METADATA & ARTICLE INFO
   ============================================================================ */

.article-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-date,
.article-author,
.article-reading-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-author {
  color: var(--primary-light);
}

.article-author strong {
  color: var(--text-primary);
}

/* ============================================================================
   TAGS
   ============================================================================ */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.tag {
  display: inline-block;
  background-color: var(--bg-card);
  color: var(--text-light);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  text-decoration: none;
  border-bottom: none;
}

.tag:hover {
  background-color: var(--primary-dark);
  color: var(--text-primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.tag-featured {
  background-color: rgba(124, 58, 237, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

.tag-featured:hover {
  background-color: var(--primary);
  color: var(--bg-dark);
}

/* ============================================================================
   FAQ / DETAILS & SUMMARY
   ============================================================================ */

details {
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.5rem;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color var(--transition-fast);
}

summary:hover {
  color: var(--primary-light);
}

summary::marker {
  color: var(--primary);
}

details[open] > summary {
  color: var(--primary-light);
  margin-bottom: 1rem;
}

details > *:not(summary) {
  margin-left: 0;
  animation: slideDown var(--transition-fast) ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   BUTTONS & CALL-TO-ACTION
   ============================================================================ */

button, .btn, .button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  text-align: center;
  font-family: inherit;
}

/* Primary Button */
.btn-primary, button[type="submit"] {
  background-color: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
}

.btn-primary:hover, button[type="submit"]:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active, button[type="submit"]:active {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background-color: transparent;
  color: var(--primary-light);
  border: 2px solid var(--primary-light);
}

.btn-secondary:hover {
  background-color: rgba(167, 139, 250, 0.1);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: var(--text-light);
  border: 2px solid var(--border-light);
}

.btn-outline:hover {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--text-light);
}

/* Button groups */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

form {
  margin: 2rem 0;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  line-height: var(--line-height-normal);
  transition: all var(--transition-fast);
  margin-bottom: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--bg-darker);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

select {
  cursor: pointer;
}

/* ============================================================================
   NEWSLETTER SIGNUP
   ============================================================================ */

.newsletter-box {
  margin: 3rem 0;
  padding: 2rem;
  background-color: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  text-align: center;
}

.newsletter-box h3 {
  margin-top: 0;
  color: var(--text-primary);
}

.newsletter-box p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.newsletter-form input {
  padding: 0.875rem;
  font-size: 1rem;
}

.newsletter-form button {
  padding: 0.875rem;
  font-size: 1rem;
}

/* ============================================================================
   SOCIAL SHARING BUTTONS
   ============================================================================ */

.social-share {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
  align-items: center;
}

.share-label {
  font-weight: 600;
  color: var(--text-primary);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
}

.share-btn.twitter {
  background-color: #1DA1F2;
  color: white;
}

.share-btn.twitter:hover {
  background-color: #1a8cd8;
  transform: scale(1.1);
}

.share-btn.facebook {
  background-color: #1877f2;
  color: white;
}

.share-btn.facebook:hover {
  background-color: #0a66c2;
  transform: scale(1.1);
}

.share-btn.linkedin {
  background-color: #0077b5;
  color: white;
}

.share-btn.linkedin:hover {
  background-color: #005a8f;
  transform: scale(1.1);
}

.share-btn.copy {
  background-color: var(--border-light);
  color: var(--text-light);
}

.share-btn.copy:hover {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* ============================================================================
   RELATED POSTS SECTION
   ============================================================================ */

.related-posts {
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.related-posts h3 {
  margin-top: 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.post-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-base);
  overflow: hidden;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.post-card h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.post-card p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: var(--line-height-normal);
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light-muted);
}

.post-card a {
  color: var(--primary-light);
}

/* ============================================================================
   CALL-TO-ACTION BOXES
   ============================================================================ */

.cta-box {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  text-align: center;
}

.cta-box h3 {
  margin-top: 0;
  color: var(--text-primary);
}

.cta-box p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.cta-box .btn {
  margin: 0 auto;
}

/* ============================================================================
   CALLOUT / HIGHLIGHT BOXES
   ============================================================================ */

.callout {
  margin: 1.5rem 0;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  border-left: 4px solid var(--primary);
}

.callout.info {
  border-left-color: var(--secondary);
  background-color: rgba(6, 182, 212, 0.08);
}

.callout.warning {
  border-left-color: var(--accent);
  background-color: rgba(245, 158, 11, 0.08);
}

.callout.success {
  border-left-color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}

.callout.error {
  border-left-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
}

.callout strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ============================================================================
   RESPONSIVE TYPOGRAPHY ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
  article {
    padding: 20px 16px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  p {
    font-size: 16px;
  }

  .article-metadata {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .social-share {
    flex-direction: column;
    align-items: flex-start;
  }

  .share-buttons {
    justify-content: flex-start;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  article {
    padding: 16px 12px;
  }

  h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 1.35rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  p {
    font-size: 15px;
    line-height: 1.6;
  }

  ul, ol {
    margin-left: 1.25rem;
  }

  pre {
    padding: 1rem;
    font-size: 0.85rem;
  }

  code {
    font-size: 0.8em;
  }

  .newsletter-box {
    padding: 1.5rem 1rem;
  }

  .cta-box {
    padding: 1.5rem 1rem;
  }

  .btn, button, .button {
    width: 100%;
    padding: 0.875rem 1rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }

  input, textarea, select {
    font-size: 16px;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.5rem 0.25rem;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  article {
    max-width: 100%;
    background: white;
    color: black;
  }

  a {
    color: #0066cc;
    text-decoration: underline;
  }

  h1, h2, h3, h4, h5, h6 {
    color: black;
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
    page-break-inside: avoid;
  }

  pre, blockquote, table {
    page-break-inside: avoid;
  }

  button, .newsletter-box, .cta-box {
    display: none;
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.text-muted {
  color: var(--text-muted);
}

.text-primary {
  color: var(--primary);
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: var(--spacing-sm) !important;
}

.mt-2 {
  margin-top: var(--spacing-md) !important;
}

.mt-3 {
  margin-top: var(--spacing-lg) !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: var(--spacing-sm) !important;
}

.mb-2 {
  margin-bottom: var(--spacing-md) !important;
}

.mb-3 {
  margin-bottom: var(--spacing-lg) !important;
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Skip to main content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode preference - explicitly set for blog (already dark) */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--bg-dark);
    color: var(--text-light);
  }
}

/* ============================================================================
   SCHEMA MARKUP SUPPORT (JSON-LD styled elements)
   ============================================================================ */

script[type="application/ld+json"] {
  display: none;
}

/* Support for structured data about articles */
article[itemtype*="schema.org/Article"],
article[itemtype*="schema.org/BlogPosting"] {
  /* Already styled as normal article */
}

/* ============================================================================
   GA4 ANALYTICS SUPPORT
   ============================================================================ */

/* No special styling needed, but elements should be trackable */
.blog-click-event {
  cursor: pointer;
}

/* ============================================================================
   ANIMATION KEYFRAMES
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================================================
   END OF STYLES
   ============================================================================ */
