/*
 * static/css/blog.css
 * Blog-specific styles for Gen-Z Constructors blog system.
 *
 * Scope: styles for CKEditor 5 rendered content (.blog-content),
 *        stretched-link utility, and prose typography enhancements
 *        not covered by Tailwind CDN.
 */

/* ─── Stretched link utility (card click targets) ─── */
.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ─── Blog article body — CKEditor 5 output styling ─── */
.blog-content {
  color: #172033;
  font-family: "Plus Jakarta Sans", sans-serif;
  line-height: 1.8;
  font-size: 1rem;
}

.blog-content h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #010B20;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #B98F3D30;
}

.blog-content h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #010B20;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-content h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #42331E;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.blog-content p {
  margin-bottom: 1.25rem;
  color: #374151;
}

.blog-content ul,
.blog-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.blog-content ul {
  list-style-type: disc;
}

.blog-content ol {
  list-style-type: decimal;
}

.blog-content li {
  margin-bottom: 0.5rem;
  color: #374151;
  line-height: 1.7;
}

.blog-content a {
  color: #B98F3D;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.blog-content a:hover {
  color: #896321;
}

.blog-content strong {
  font-weight: 700;
  color: #010B20;
}

.blog-content em {
  font-style: italic;
}

.blog-content blockquote {
  border-left: 4px solid #B98F3D;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: #B98F3D08;
  border-radius: 0 12px 12px 0;
  color: #42331E;
  font-style: italic;
}

.blog-content blockquote strong {
  color: #B98F3D;
  font-style: normal;
}

/* ─── Responsive Data Tables (Markdown, HTML & CKEditor 5) ─── */
.blog-content .table-responsive,
.blog-content figure.table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: 12px;
  border: 1px solid rgba(185, 143, 61, 0.25);
  box-shadow: 0 4px 18px rgba(1, 11, 32, 0.05);
  background: #ffffff;
}

.blog-content table {
  width: 100%;
  min-width: 580px; /* guarantees columns don't crush into illegible slivers on mobile */
  border-collapse: collapse;
  font-size: 0.925rem;
  margin: 0 !important;
}

.blog-content table thead tr,
.blog-content table th {
  background-color: #010B20;
  color: #EDDAA0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.9rem 1.25rem;
  border-bottom: 2px solid #B98F3D;
  border-top: none;
  border-left: none;
  border-right: 1px solid rgba(237, 218, 160, 0.15);
  text-align: left;
  white-space: nowrap;
}

.blog-content table th:last-child {
  border-right: none;
}

.blog-content table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(185, 143, 61, 0.12);
  border-left: none;
  border-right: 1px solid rgba(185, 143, 61, 0.08);
  color: #172033;
  line-height: 1.6;
  vertical-align: top;
}

.blog-content table td:last-child {
  border-right: none;
}

.blog-content table tbody tr:nth-child(even) td {
  background-color: rgba(241, 237, 223, 0.35);
}

.blog-content table tbody tr:hover td {
  background-color: rgba(185, 143, 61, 0.09);
}

.blog-content table caption {
  caption-side: bottom;
  font-size: 0.8rem;
  color: #64748b;
  padding: 0.5rem 1rem;
  font-style: italic;
  text-align: left;
}

/* ─── Callout & Alert Boxes (Pro-Tips, Warnings, Notes) ─── */
.blog-content .callout {
  position: relative;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 12px;
  border-left: 5px solid;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(1, 11, 32, 0.04);
}

.blog-content .callout-gold {
  border-color: #B98F3D;
  background-color: rgba(185, 143, 61, 0.06);
  border: 1px solid rgba(185, 143, 61, 0.25);
  border-left-width: 5px;
  border-left-color: #B98F3D;
}

.blog-content .callout-gold .callout-title,
.blog-content .callout-gold strong:first-child {
  color: #896321;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

.blog-content .callout-info {
  border-color: #2563EB;
  background-color: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-left-width: 5px;
  border-left-color: #2563EB;
}

.blog-content .callout-info .callout-title,
.blog-content .callout-info strong:first-child {
  color: #1d4ed8;
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

.blog-content .callout-success {
  border-color: #16A34A;
  background-color: rgba(22, 163, 74, 0.05);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-left-width: 5px;
  border-left-color: #16A34A;
}

.blog-content .callout-warning {
  border-color: #D97706;
  background-color: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-left-width: 5px;
  border-left-color: #D97706;
}

.blog-content .callout-dark {
  border-color: #B98F3D;
  background-color: #010B20;
  color: #F1EDDF;
  border: 1px solid rgba(185, 143, 61, 0.35);
  border-left-width: 5px;
  border-left-color: #B98F3D;
}

.blog-content .callout-dark p {
  color: #F1EDDF;
}

/* ─── Highlights & Color Markers ─── */
.blog-content mark,
.blog-content .marker-gold {
  background-color: rgba(237, 218, 160, 0.6);
  color: #010B20;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.blog-content .marker-yellow {
  background-color: #fef08a;
  color: #854d0e;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.blog-content .marker-green {
  background-color: #bbf7d0;
  color: #166534;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.blog-content .marker-blue {
  background-color: #bfdbfe;
  color: #1e40af;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ─── Todo / Checklists ─── */
.blog-content ul.todo-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.blog-content ul.todo-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.blog-content ul.todo-list input[type="checkbox"] {
  margin-top: 0.3rem;
  accent-color: #B98F3D;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ─── Construction Statistics Grid ─── */
.blog-content .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.blog-content .stat-card {
  background: #ffffff;
  border: 1px solid rgba(185, 143, 61, 0.25);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(1, 11, 32, 0.04);
}

.blog-content .stat-card .stat-number {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #B98F3D;
  display: block;
}

.blog-content .stat-card .stat-label {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.25rem;
  display: block;
}

/* ─── Responsive Media Embeds (YouTube, Vimeo, Iframes) ─── */
.blog-content .video-responsive,
.blog-content .media-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(1, 11, 32, 0.12);
}

.blog-content .video-responsive iframe,
.blog-content .media-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

/* ─── Images & Figures ─── */
.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem auto;
  box-shadow: 0 4px 16px rgba(1, 11, 32, 0.1);
  display: block;
}

.blog-content figure {
  margin: 2rem 0;
  text-align: center;
}

.blog-content figure figcaption,
.blog-content .image-caption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
  text-align: center;
}

.blog-content code {
  background: #F1EDDF;
  color: #896321;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.875em;
}

.blog-content pre {
  background: #010B20;
  color: #EDDAA0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.blog-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.blog-content hr {
  border: none;
  border-top: 2px solid #B98F3D30;
  margin: 2.5rem 0;
}

/* Line clamp utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
