/* Blog App Portable Styles */
:root {
  --ba-primary: #0284c7;
  --ba-primary-hover: #0369a1;
  --ba-bg-light: #f9fafb; /* gray-50 */
  --ba-text-main: #111827; /* gray-900 */
  --ba-text-muted: #4b5563; /* gray-600 */
  --ba-border: #f3f4f6; /* gray-100 */
  --ba-white: #ffffff;
}

/* Base resets for container */
.ba-container {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ba-text-main);
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}

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

/* Typography */

/* -------------------------------------------------------------------------- */
/*                                Editor Mode Overrides                       */
/* -------------------------------------------------------------------------- */
/* Remove default Details styling to focus on the inner inputs */
.ba-editor .ba-accordion {
  border: none;
  background: transparent;
  margin-bottom: 2rem;
  padding: 0;
}

/* Question Box (Summary) */
.ba-editor .ba-accordion-header {
  border: 2px solid #3b82f6; /* Blue outline */
  background-color: #f0f9ff; /* Light blue bg */
  padding: 1rem;
  border-radius: 0.5rem;
  width: 100%;
  margin-bottom: 0.5rem;
  font-weight: 600;
  list-style: none;
  cursor: text;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ba-editor .ba-accordion-header:hover {
  background-color: #e0f2fe;
}

/* Hide default markers */
.ba-editor .ba-accordion > summary::marker,
.ba-editor .ba-accordion > summary::-webkit-details-marker {
  display: none;
}

/* Answer Box (Content) */
.ba-editor .ba-accordion > * {
  margin: 0;
}

/* Target paragraphs inside details directly for the "Answer" box look */
.ba-editor .ba-accordion > p {
  border: 2px solid #3b82f6; /* Blue outline */
  background-color: #ffffff;
  padding: 1rem;
  border-radius: 0.5rem;
  min-height: 3rem;
  margin-bottom: 0.5rem;
}

/* Force visibility */
.ba-editor .ba-accordion > *:not(summary) {
  display: block !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Placeholder-like text using CSS pseudo-elements if empty (hard to detect empty p in clean css, skipping for now) */

/* Add labels via pseudo-elements for clarity */
.ba-editor .ba-accordion-header::before {
  content: "Question";
  display: block;
  font-size: 0.75rem;
  color: #3b82f6;
  position: absolute;
  top: -0.6rem;
  left: 0.5rem;
  background: white;
  padding: 0 0.25rem;
  font-weight: bold;
}

.ba-editor .ba-accordion {
  position: relative; /* Context for absolute labels if we wanted them on the wrapper, but header is safer */
  padding-top: 1rem; /* Space for the label */
}

.ba-editor .ba-accordion > p {
  position: relative;
}
/* We can't easily adhere "Answer" label to the arbitrary content P tag strictly via CSS without wrapper. 
   But we can try targeting the first P */
.ba-editor .ba-accordion > p:first-of-type::before {
  content: "Answer";
  display: block;
  font-size: 0.75rem;
  color: #3b82f6;
  position: absolute;
  top: -0.8rem;
  left: 0.5rem;
  background: white;
  padding: 0 0.25rem;
  font-weight: bold;
  z-index: 10;
}

@media (min-width: 768px) {
  .ba-container h1,
  .ba-h1 {
    font-size: 3.75rem;
  }
}

.ba-container h2,
.ba-h2 {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
  color: var(--ba-text-main);
  margin-bottom: 1.5rem;
  margin-top: 2.5rem;
}

.ba-container h3,
.ba-h3 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--ba-text-main);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.ba-container p,
.ba-p {
  font-size: 1.125rem;
  color: var(--ba-text-muted);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.ba-container .lead,
.ba-lead {
  font-size: 1.25rem;
  color: var(--ba-text-muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.ba-container a,
.ba-link {
  color: var(--ba-primary);
  text-decoration: none;
  font-weight: 500;
}

.ba-container a:hover,
.ba-link:hover {
  text-decoration: underline;
}

.ba-container .highlight,
.ba-highlight {
  color: var(--ba-primary);
}

/* Components */

/* Buttons */
.ba-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9999px; /* rounded-full */
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.ba-btn-primary {
  background-color: var(--ba-primary);
  color: var(--ba-white);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.ba-btn-primary:hover {
  background-color: var(--ba-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ba-btn-secondary {
  background-color: rgba(59, 130, 246, 0.1); /* blue-50/50 approx */
  color: var(--ba-primary);
}

.ba-btn-secondary:hover {
  background-color: rgba(59, 130, 246, 0.2);
}

/* Cards */
/* Force block display and background for visibility */
.ba-card {
  display: block;
  background-color: var(--ba-white);
  border-radius: 1rem; /* rounded-2xl */
  padding: 2rem;
  border: 1px solid var(--ba-border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.ba-panel-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.ba-panel-group .ba-card {
  /* Default to flexible, but allow overrides via inline styles or specific sizing if needed later */
  /* flex: 1 1 200px; Grow, shrink, base 200px */
  width: auto; /* Let flex control width */
  max-width: 100%;
  margin-bottom: 0;
}

/* Lists */
/* Override client resets */
.ba-container ul {
  list-style-type: disc !important;
  padding-left: 1.75rem !important;
  margin-bottom: 1.5rem !important;
  font-size: 1.125rem;
  margin-left: 0 !important; /* Reset margin, rely on padding */
}

.ba-container ol {
  list-style-type: decimal !important;
  padding-left: 1.75rem !important;
  margin-bottom: 1.5rem !important;
  font-size: 1.125rem;
  margin-left: 0 !important;
}

.ba-container li {
  margin-bottom: 0.5rem;
  display: list-item !important; /* Enforce list-item display */
  padding-left: 0.25rem;
}

/* Nested lists */
.ba-container ul ul,
.ba-container ol ul {
  list-style-type: circle !important;
  margin-bottom: 0 !important;
}

.ba-container ol ol,
.ba-container ul ol {
  list-style-type: lower-alpha !important;
  margin-bottom: 0 !important;
}

/* Fix for Tiptap wrapping li content in p - make sure it aligns */
.ba-container li p {
  margin-bottom: 0;
  display: inline-block;
  font-size: inherit;
  vertical-align: top;
}

/* Task Lists - Removed */

/* Lists with Icons */
.ba-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ba-list-item {
  display: flex;
  align-items: start;
  margin-bottom: 1rem;
}

.ba-icon-check {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: #dbeafe; /* blue-100 */
  color: var(--ba-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  margin-right: 1rem;
}

.ba-icon-check::before {
  content: "✓";
  font-weight: bold;
  font-size: 0.875rem;
}

/* Standard FAQ (Details/Summary) */
.ba-faq-section {
  width: 100%;
  margin-bottom: 3rem;
  background: var(--ba-white);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle shadow definition */
  border: 1px solid var(--ba-border);
}

.ba-accordion-item {
  border-bottom: 1px solid var(--ba-border);
  padding: 0;
  margin: 0;
}

.ba-accordion-item:last-child {
  border-bottom: none;
}

.ba-accordion-header {
  display: block; /* Ensure it behaves like a block for click area */
  list-style: none !important; /* Hide default marker */
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ba-text-main);
  padding: 1.25rem 1rem 1.25rem 3rem !important; /* Space for icon, forceful padding */
  position: relative;
  outline: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  margin: 0;
}

.ba-accordion-header:hover {
  background-color: var(--ba-bg-light);
}

.ba-accordion-header::-webkit-details-marker {
  display: none;
}

/* Custom Icon (Chevron style) */
.ba-accordion-header::before,
.ba-accordion-header::after {
  content: "";
  position: absolute;
  background-color: var(--faq-theme-color, var(--ba-primary));
  width: 2px;
  height: 8px;
  left: 1.25rem; /* Adjusted alignment */
  top: 50%;
  margin-top: -4px;
  transition: all 0.25s ease-in-out;
  border-radius: 1px;
}

.ba-accordion-header::before {
  transform: translate(2px, 0) rotate(45deg);
  height: 8px;
}

.ba-accordion-header::after {
  transform: translate(-2px, 0) rotate(-45deg);
  height: 8px;
}

/* Open State Transform to a 'Minus' or flatter chevron */
.ba-accordion-item[open] > .ba-accordion-header::before {
  transform: translate(2px, 0) rotate(-45deg);
}

.ba-accordion-item[open] > .ba-accordion-header::after {
  transform: translate(-2px, 0) rotate(45deg);
}

.ba-accordion-content {
  color: var(--ba-text-muted);
  font-size: 1rem;
  line-height: 1.625rem;
  padding: 0 1rem 1.5rem 3rem; /* Align text with header text */
  width: 100%;
  word-wrap: break-word;
  animation: ba-fade-in 0.3s ease-out;
  display: block; /* Force block */
}

@keyframes ba-fade-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Call to Action Section */
.ba-cta {
  background-color: var(--ba-primary);
  color: var(--ba-white);
  border-radius: 1.5rem; /* rounded-3xl */
  padding: 4rem 1.5rem;
  text-align: center;
  margin-top: 4rem;
}

.ba-cta-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

.ba-cta-text {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: #dbeafe; /* blue-100 */
}

.ba-cta .ba-btn-white {
  background-color: var(--ba-white);
  color: var(--ba-primary);
}

.ba-cta .ba-btn-white:hover {
  background-color: #f3f4f6;
  transform: translateY(-2px);
}

/* Helpers */
.ba-grid-2 {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .ba-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ba-text-center {
  text-align: center;
}

/* Code Blocks */
.ba-container pre {
  background-color: #1e293b; /* Slate-800 - distinct dark bg */
  color: #f8fafc; /* Slate-50 */
  padding: 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  border: 1px solid #334155; /* Slight border definition */
}

/* Inline Code */
.ba-container code {
  background-color: #f1f5f9; /* Slate-100 */
  color: #0f172a; /* Slate-900 */
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  font-weight: 500;
}

/* Reset for code inside pre */
.ba-container pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
}
