/* Premium Custom Journal Stylesheet */
:root {
  --cj-blue: #1d4ed8;
  --cj-blue-light: #eff6ff;
  --cj-navy: #0f172a;
  --cj-gray-dark: #334155;
  --cj-gray-light: #64748b;
  --cj-border: #e2e8f0;
  --cj-bg-card: #ffffff;
  --cj-bg-page: #f9fafb;
  --cj-shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
  --cj-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --cj-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
  --cj-shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
}

/* ─── Framer container overflow fix ────────────────────────────────────────
   The Framer SSR page sets .framer-au5gle to overflow:visible, which lets
   decorative SVG/icon elements (the large arrow background) bleed outside
   their bounds and render at full screen size. We clip it here. ---------- */
.framer-au5gle,
.framer-UKDkJ .framer-au5gle,
.framer-vP0Cg .framer-au5gle {
  overflow: hidden !important;
}

/* Also clip the outer Framer page wrapper so decorative elements
   in the background don't escape above/below the journal content */
#main,
#main > div,
.framer-UKDkJ,
.framer-vP0Cg {
  overflow-x: hidden !important;
}

/* Fix decorative SVG component scaling and positioning */
.framer-bmtyae,
.framer-bmtyae .svgContainer,
.framer-bmtyae svg {
  width: 119px !important;
  height: 107px !important;
  max-width: 119px !important;
  max-height: 107px !important;
}

.framer-bmtyae {
  position: absolute !important;
  overflow: hidden !important;
  flex: none !important;
}

.framer-MbfZN {
  position: relative !important;
  overflow: hidden !important;
}

/* Reserve space for journal images while stylesheet loads */
#journal-wrapper img {
  display: block;
  max-width: 100%;
}

.cj-hero-visual {
  overflow: hidden;
  min-width: 0;
}

.cj-hero-visual img {
  aspect-ratio: 1 / 1;
}

.cj-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 140px 24px 80px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--cj-navy);
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

/* Hero Section */
.cj-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  margin-bottom: 80px;
}

.cj-hero-content {
  flex: 1;
  max-width: 580px;
}

.cj-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--cj-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.cj-hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 20px 0;
  color: var(--cj-navy);
}

.cj-hero-desc {
  font-size: 18px;
  line-height: 1.6;
  color: var(--cj-gray-light);
  margin: 0 0 32px 0;
}

.cj-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cj-blue);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.25);
}

.cj-btn-primary:hover {
  background: #1e40af;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
}

.cj-btn-primary svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.cj-btn-primary:hover svg {
  transform: translateX(4px);
}

.cj-hero-visual {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  max-width: 520px;
}

.cj-hero-visual img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

/* Filters Bar */
.cj-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--cj-border);
  margin-bottom: 50px;
}

.cj-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--cj-gray-dark);
  border: 1px solid var(--cj-border);
  border-radius: 9999px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.cj-filter-btn svg {
  width: 16px;
  height: 16px;
  color: var(--cj-gray-light);
  transition: color 0.2s ease;
}

.cj-filter-btn:hover {
  border-color: var(--cj-gray-light);
  background: var(--cj-bg-page);
}

.cj-filter-btn.is-active {
  background: var(--cj-blue);
  color: #ffffff;
  border-color: var(--cj-blue);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15);
}

.cj-filter-btn.is-active svg {
  color: #ffffff;
}

.cj-filterable.is-hidden,
.cj-featured-card.is-hidden,
.cj-article-card.is-hidden,
.cj-small-card.is-hidden {
  display: none !important;
}

/* Featured Card */
.cj-featured-card {
  display: flex;
  background: var(--cj-bg-card);
  border: 1px solid var(--cj-border);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 50px;
  box-shadow: var(--cj-shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}

.cj-featured-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--cj-shadow-hover);
  border-color: #cbd5e1;
}

.cj-featured-content {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cj-featured-tag {
  color: var(--cj-blue);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.cj-featured-content h2 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px 0;
  color: var(--cj-navy);
}

.cj-featured-content p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--cj-gray-light);
  margin: 0 0 24px 0;
}

.cj-meta {
  font-size: 13px;
  color: var(--cj-gray-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cj-meta-dot {
  width: 4px;
  height: 4px;
  background-color: var(--cj-border);
  border-radius: 50%;
}

.cj-featured-visual {
  flex: 1.1;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  background-color: #0b1329;
}

.cj-featured-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.cj-featured-card:hover .cj-featured-visual img {
  transform: scale(1.03);
}

/* Grid of 3 Main Articles */
.cj-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 50px;
}

.cj-article-card {
  display: flex;
  flex-direction: column;
  background: var(--cj-bg-card);
  border: 1px solid var(--cj-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--cj-shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}

.cj-article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--cj-shadow-hover);
  border-color: #cbd5e1;
}

.cj-card-visual {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #f8fafc;
}

.cj-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.cj-article-card:hover .cj-card-visual img {
  transform: scale(1.03);
}

.cj-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cj-card-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Category colors */
.cj-tag-web { color: #2563eb; }
.cj-tag-mobile { color: #7c3aed; }
.cj-tag-ai { color: #059669; }
.cj-tag-design { color: #db2777; }
.cj-tag-engineering { color: #d97706; }
.cj-tag-cases { color: #4b5563; }

.cj-card-body h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px 0;
  color: var(--cj-navy);
}

.cj-card-body p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cj-gray-light);
  margin: 0 0 20px 0;
  flex: 1;
}

.cj-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cj-arrow-link {
  color: var(--cj-blue);
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.cj-article-card:hover .cj-arrow-link {
  transform: translateX(4px);
}

/* Smaller Articles Grid */
.cj-grid-small {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.cj-small-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--cj-bg-card);
  border: 1px solid var(--cj-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--cj-shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}

.cj-small-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cj-shadow-hover);
  border-color: #cbd5e1;
}

.cj-small-visual {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #f8fafc;
}

.cj-small-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cj-small-body {
  flex: 1;
}

.cj-small-body h4 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px 0;
  color: var(--cj-navy);
}

/* Animation utilities for filtering */
.cj-item-hidden {
  display: none !important;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .cj-grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .cj-grid-small {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .cj-container {
    padding: 60px 16px;
  }
  .cj-hero {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }
  .cj-hero-content {
    max-width: 100%;
  }
  .cj-hero h1 {
    font-size: 38px;
  }
  .cj-hero-visual {
    max-width: 100%;
    justify-content: center;
  }
  .cj-featured-card {
    flex-direction: column;
  }
  .cj-featured-visual {
    min-height: 240px;
  }
  .cj-featured-content {
    padding: 28px;
  }
  .cj-featured-content h2 {
    font-size: 24px;
  }
  .cj-grid-3 {
    grid-template-columns: 1fr;
  }
  .cj-grid-small {
    grid-template-columns: 1fr;
  }
}
