/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;600;700&family=Joan&family=Montecarlo&display=swap');

.article-container * {
  font-family:
    'Hanken Grotesk',
    system-ui,
    -apple-system,
    sans-serif !important;
}

.article-container a {
  text-decoration: underline !important;
}

.article-container {
  line-height: 1.8;
  color: #1a1a1a;
  background: white;
  padding: 2rem 1.5rem; /* Mobile first - more compact */
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  position: relative;
  z-index: 10;
}

/* Tablet */
@media (min-width: 640px) {
  .article-container {
    padding: 3.5rem 3rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .article-container {
    padding: 4rem 3.5rem;
  }
}

/* Article Header */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f3f4f6;
}

.article-title {
  font-family: 'Joan', Georgia, serif !important;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.article-description {
  color: #4b5563;
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: #6b7280;
  flex-wrap: wrap;
}

.article-author {
  font-weight: 600;
  color: #374151;
  text-decoration: underline;
}

.article-meta-separator {
  color: #d1d5db;
}

.article-date {
  color: #6b7280;
}

.article-reading-time {
  color: #9ca3af;
  font-style: italic;
}

/* Responsive table wrapper */
.article-container table {
  width: 100% !important;
  border-collapse: collapse;
  margin: 1.5rem 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

/* Table on desktop */
@media (min-width: 768px) {
  .article-container table {
    width: auto !important;
    display: table;
    overflow-x: visible;
  }
}

.article-container table th,
.article-container table td {
  border: 1px solid #e5e7eb;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  min-width: 100px;
}

/* Allow text wrap on desktop */
@media (min-width: 768px) {
  .article-container table th,
  .article-container table td {
    white-space: normal;
  }
}

.article-container table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

.article-container table td {
  color: #1f2937;
}

.article-container table tbody tr:hover {
  background-color: #f3f4f6;
}

/* Scroll hint for mobile */
@media (max-width: 767px) {
  .article-container table::after {
    content: '→ Scroll';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95));
    padding: 8px 12px;
    font-size: 0.75rem;
    color: #6b7280;
    pointer-events: none;
    border-radius: 4px;
  }
}

.article-container .bn-inline-content:is(:empty, :blank) {
  margin-bottom: 1.5rem;
}

.wrapper-video-embed {
  width: 100%;
  position: relative;
  height: auto;
  outline: none !important;
}

.video-embed {
  width: 100%;
  position: relative;
  cursor: default;
  user-select: none;
}

.video-embed.left {
  margin-right: auto;
}

.video-embed.center {
  margin: 0 auto;
}

.video-embed.right {
  margin-left: auto;
}

.video-embed.showed {
  width: max-content;
}

.video-embed.full-width {
  width: 100% !important;
}

.video-embed .default-state {
  width: 100%;
  min-height: 50px;
  background-color: #f2f1ee;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  color: #7d797a;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.video-embed .default-state .default-state-content {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.video-embed .default-state:hover {
  background-color: #e1e1e1;
}

.video-embed .default-state.showed {
  background-color: black !important;
  width: max-content !important;
  padding: 24px 32px;
}

.video-embed.full-width .default-state {
  width: 100% !important;
}

.video-embed .popup {
  position: absolute;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
  z-index: 11;
  min-width: 500px;
  width: 70%;
  max-width: 500px;
  display: none;
  left: 50%;
  transform: translateX(-50%);
  cursor: default;
}

.video-embed .popup.show {
  display: block;
}

.video-embed .popup.top {
  bottom: 100%;
  margin-bottom: 8px;
}

.video-embed .popup.bottom {
  top: 100%;
  margin-top: 8px;
}

.video-embed .tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
  position: relative;
}

.video-embed .tabs .styles {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  display: flex;
  flex-direction: row;
  gap: 4px;
}

.video-embed .tabs .styles .style-item {
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
  gap: 4px;
  padding: 0 4px;
}

.video-embed .tabs .styles .style-item p {
  font-size: 12px;
}

.video-embed .tabs .styles .style-item:hover {
  background-color: #efefef;
}

.video-embed .tabs .styles .style-item.active {
  background-color: #efefef;
  border-color: #3f3f3f;
}

.video-embed .tab {
  padding: 8px 16px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.video-embed .tab.active {
  color: #3f3f3f;
  border-bottom-color: #3f3f3f;
  font-weight: 600;
}

.video-embed .tab:hover {
  background-color: #efefef;
}

.video-embed .tab-content {
  display: none;
}

.video-embed .tab-content.active {
  display: block;
}

.video-embed .input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.video-embed .popup input {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.video-embed .popup input:focus {
  outline: none;
}

.video-embed .popup button {
  height: 30px;
  padding: 0 16px;
  background: white;
  color: #3f3f3f;
  border: 1px solid #efefef;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 50%;
}

.video-embed .popup button:hover {
  background: #efefef;
}

.video-embed .video-container {
  position: relative;
  aspect-ratio: 16/9;
  min-height: 200px;
  overflow: hidden;
}

.video-embed .video-container.full-width {
  width: 100% !important;
}

.video-embed .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 10;
}

.video-embed .video-container .loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
  z-index: 12;
}

.video-embed .video-container.no-loading .loading {
  display: none;
}

.video-embed.showed .video-container-resize-control,
.video-embed.showed .video-container-resize-control {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 8px;
  height: 50px;
  border-radius: 4px;
  border: 1px solid #e1e1e1;
  transform: translateY(-50%);
  cursor: col-resize;
  opacity: 0;
  transition: opacity 0.2s;
}

.video-embed.showed .video-container-resize-control.control-right {
  left: auto;
  right: 10px;
}

.video-embed.showed:hover .video-container-resize-control {
  opacity: 1;
}

.wrapper-video-embed.viewable .video-container-resize-control {
  display: none;
}

.wrapper-video-embed.viewable .default-state {
  padding: 0 !important;
  background-color: transparent !important;
}

/* Hide BlockNote formatting toolbar when video popup is open */
.bn-toolbar.bn-formatting-toolbar[style*='display: none'] {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
