.study-guides-container {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-brand-sg {
  width: 100%;
  max-width: 1000px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 1rem;
}

.brand-logo-sg {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-name-sg {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: var(--fg);
}

.header-nav-sg {
  width: 100%;
  max-width: 1000px;
  margin-bottom: 2rem;
}

.back-btn-sg {
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
  margin-bottom: 1rem;
}

.back-btn-sg:hover {
  color: var(--fg);
  text-decoration: underline;
}

.content-inner {
  max-width: 1000px;
  width: 100%;
}

.content-inner h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Controls (Tabs & Search) */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--fg);
  padding: 8px 20px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tab-btn:hover {
  background: var(--highlight);
}

.tab-btn.active {
  background: var(--fg);
  color: var(--bg);
}

.search-wrapper {
  flex-grow: 1;
  max-width: 400px;
}

.search-bar {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  background: var(--bg);
  outline: none;
}

.search-bar:focus {
  background: var(--highlight);
}

.no-results {
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Flex Layout */
.blogs-flex-col {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 24px;
  margin-bottom: 3rem;
}

.blogs-flex-col > .guide-card {
  flex: 1 1 calc(33.333% - 24px);
  min-width: 300px;
}

.guide-card {
  border: 2px solid var(--border);
  background: var(--bg);
  padding: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  animation: fadeUp 0.25s ease both;
}

.clickable-card {
  cursor: pointer;
  height: 100%;
  justify-content: space-between;
}

.clickable-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--card-shadow);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-top h2 {
  font-size: 1.3rem;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.blog-summary {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.read-more {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  color: var(--fg);
  text-transform: uppercase;
}

/* Detail View */
.blog-detail-view {
  animation: fadeUp 0.25s ease both;
}

.blog-detail-content {
  margin-top: 1rem;
  cursor: default;
}

.blog-detail-content:hover {
  transform: none;
  box-shadow: none;
}

.guide-body {
  font-size: 1.05rem;
  line-height: 1.7;
}

.guide-body h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  margin-top: 0;
  line-height: 1.1;
  letter-spacing: -1px;
}

.guide-body h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--highlight);
  padding-bottom: 0.5rem;
}

.guide-body h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.guide-body strong {
  color: var(--fg);
}

.guide-body p {
  margin-bottom: 1rem;
}

.guide-body ul, .guide-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.guide-body h1, .guide-body h2, .guide-body h3 {
  color: var(--fg);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.guide-body pre {
  background: var(--highlight);
  padding: 1rem;
  border: 2px solid var(--border);
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
}

.guide-body code {
  font-family: 'DM Mono', monospace;
  background: var(--highlight);
  padding: 2px 4px;
}

.cta-section {
  border: 2px solid var(--border);
  background: var(--highlight);
  padding: 2rem;
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.cta-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}

.cta-btn {
  border: 2px solid var(--border);
  background: var(--fg);
  color: var(--bg);
  padding: 14px 24px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.12s;
  display: inline-block;
}

.cta-btn:hover {
  background: var(--bg);
  color: var(--fg);
  transform: translate(-2px, -2px);
  box-shadow: var(--card-shadow);
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
  width: 100%;
}

.page-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--fg);
  padding: 10px 24px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.page-btn:hover:not(:disabled) {
  background: var(--fg);
  color: var(--bg);
  transform: translate(-4px, -4px);
  box-shadow: var(--card-shadow);
}

.page-btn:active:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--card-shadow);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--highlight);
  border-color: var(--muted);
  color: var(--muted);
}

.page-info {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  background: var(--highlight);
  padding: 8px 16px;
  border: 1px dashed var(--border);
}

/* Paywall specific styles */
.paywall-container {
  position: relative;
  overflow: hidden;
  padding-bottom: 0 !important;
}

.guide-body.paywall-restricted {
  max-height: 800px; /* limits reading to the first part of the blog */
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.paywall-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 350px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3rem;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 40%, rgba(255,255,255,1) 80%);
}

.paywall-content {
  text-align: center;
  background: white;
  padding: 2rem;
  border: 2px solid var(--border);
  box-shadow: var(--card-shadow);
  max-width: 500px;
  margin: 0 1rem;
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.2s;
}

.paywall-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  margin-top: 0;
}

.paywall-content p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.guide-body.paywall-restricted {
  min-height: 500px;
}

@media(max-width: 768px) {
  .study-guides-container {
    padding: 1.5rem 1rem;
  }

  .header-nav-sg {
    margin-bottom: 1.5rem;
  }
}

