/* ═══════════════════════════════════════════════════════════════════════════
   FRAMESIE LEARN STYLES
   Extends article.css for /learn hub pages
   ═══════════════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────────────────
   1. LEARN INDEX PAGE
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── Learn Intro ─── */
.learn-intro {
  text-align: center;
  padding-top: 60px;
  margin-bottom: 40px;
}

.learn-headline {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 56px);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 20px;
}

.learn-intro-prose {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
  text-align: left;
}

/* ─── Article List (vertical stack) ─── */
.learn-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 48px;
}

/* ─── Learn Card (row with left accent) ─── */
.learn-card {
  position: relative;
  display: block;
  padding: 16px 0 16px 16px;
  text-decoration: none;
  color: inherit;
}

/* Accent bar as pseudo-element (breaks between entries) */
.learn-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: calc(100% - 16px);
  background: var(--teal);
  opacity: 0.65;
  border-radius: 2px;
  transition: opacity 0.15s ease;
}

.learn-card:hover::before {
  opacity: 1;
}

.learn-card:hover .learn-card-title {
  color: var(--teal);
}

.learn-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.learn-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
  transition: color 0.15s ease;
}

.learn-card-desc {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.learn-card-meta {
  font-size: 13px;
  color: var(--muted);
  opacity: 0.7;
  margin: 4px 0 0;
}

/* ─── Cross-link Section ─── */
.learn-crosslink {
  padding: 28px 0 40px;
}

.learn-crosslink p {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.learn-crosslink a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.learn-crosslink a:hover {
  text-decoration: underline;
}

/* ─── Category Sections ─── */
.learn-section {
  margin-bottom: 48px;
}

.learn-section:last-of-type {
  margin-bottom: 0;
}

.learn-section-header {
  margin-bottom: 20px;
}

.learn-section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

/* Section header with "See all" link */
.learn-section-header--with-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.learn-section-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0;
}

.learn-see-all {
  font-size: 14px;
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
  flex-shrink: 0;
}

.learn-see-all:hover {
  text-decoration: underline;
}


/* ─────────────────────────────────────────────────────────────────────────────
   2. LEARN ARTICLE PAGE
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── Title Block ─── */
.learn-title-block {
  padding: 60px 0 0;
  margin-bottom: 40px;
}

.learn-title-block h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 16px;
  text-wrap: balance;
}

.learn-title-block .meta {
  font-size: 14px;
  color: var(--muted);
}

.learn-title-block .meta span + span::before {
  content: '·';
  margin: 0 8px;
}

/* ─── Quick Answer (typography-driven, no container) ─── */
.learn-takeaway {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.learn-takeaway-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
  margin: 0 0 12px;
}

.learn-takeaway-text {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 16px;
}

.learn-takeaway-text strong {
  font-weight: 600;
}

.learn-takeaway-cta {
  font-size: 15px;
  margin: 0;
}

.learn-takeaway-cta a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.learn-takeaway-cta a:hover {
  text-decoration: underline;
}

/* ─── Table of Contents (inline horizontal) ─── */
.learn-toc {
  margin-bottom: 48px;
}

.learn-toc-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}

.learn-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.learn-toc-list li {
  margin: 0;
}

.learn-toc-list a {
  font-size: 15px;
  color: var(--teal);
  text-decoration: none;
}

.learn-toc-list a:hover {
  text-decoration: underline;
}

/* ─── Article Sections ─── */
.learn-prose h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 56px 0 16px;
  padding-top: 8px;
}

.learn-prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
}

.learn-prose p {
  margin: 0 0 16px;
  line-height: 1.7;
}

.learn-prose p:last-child {
  margin-bottom: 0;
}

.learn-prose a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.learn-prose a:hover {
  border-bottom-color: var(--teal);
}

.learn-prose ul,
.learn-prose ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.learn-prose li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.learn-prose li:last-child {
  margin-bottom: 0;
}

.learn-prose strong {
  font-weight: 600;
}

/* ─── Key Insight (factual highlight, not a quote) ─── */
/* Centered text with breathing room and subtle visual break */
.learn-insight {
  margin: 48px 0;
  padding: 32px 24px;
  text-align: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.learn-insight p {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── FAQ Section ─── */
.learn-faq {
  margin: 56px 0 0;
}

.learn-faq-header {
  margin-bottom: 24px;
}

.learn-faq-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}

.faq-list {
  /* Clean separation from header */
}

.faq-item {
  border-bottom: 1px solid var(--rule);
}

.faq-item:first-child {
  border-top: 1px solid var(--rule);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: color 0.15s ease;
  /* Ensure no browser default margins affect width */
  margin: 0;
}

.faq-question:hover {
  color: var(--teal);
}

.faq-icon {
  font-size: 20px;
  color: var(--teal);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  font-weight: 300;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.faq-answer p {
  margin: 0;
}

.faq-answer a {
  color: var(--teal);
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ─── Learn Note (inline callout for dissolved Q&A content) ─── */
.learn-note {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--wash);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.learn-note p {
  margin: 0;
}

.learn-note strong {
  color: var(--ink);
  font-weight: 600;
}

/* ─── Related Section (accent bar list) ─── */
.learn-related {
  margin: 56px 0 0;
}

.learn-related-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.learn-related-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.learn-related-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
}

.learn-related-link:hover {
  text-decoration: underline;
}

/* Related list reuses .learn-list and .learn-card from index */
.learn-related .learn-list {
  margin-bottom: 0;
}


/* ─────────────────────────────────────────────────────────────────────────────
   3. TABLES (for reference articles)
   ───────────────────────────────────────────────────────────────────────────── */

.learn-prose table {
  width: 90%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
  table-layout: fixed;
}

/* Fixed column 1 width for consistent alignment across tables */
.learn-prose table th:nth-child(1),
.learn-prose table td:nth-child(1) {
  width: 25%;
}

.learn-prose th,
.learn-prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}

.learn-prose th {
  font-weight: 600;
  color: var(--ink);
  background: var(--wash);
}

.learn-prose td {
  color: var(--muted);
}

.learn-prose td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.learn-prose h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 40px 0 12px;
}

.learn-prose h3:first-of-type {
  margin-top: 24px;
}

.learn-prose .frame-note {
  font-size: 14px;
  color: var(--muted);
  margin: -16px 0 32px;
  font-style: italic;
}

/* Code blocks */
.learn-prose code {
  font-family: var(--font-mono, 'SF Mono', Monaco, 'Cascadia Code', monospace);
  font-size: 13px;
  background: var(--wash);
  padding: 2px 6px;
  border-radius: 4px;
}

.learn-prose pre {
  background: var(--wash);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0 24px;
}

.learn-prose pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

/* Image placeholders */
.image-placeholder {
  background: var(--wash);
  border: 2px dashed var(--rule);
  border-radius: 8px;
  padding: 32px 24px;
  margin: 24px 0;
  text-align: center;
}

.image-placeholder p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  font-style: italic;
}


/* ─────────────────────────────────────────────────────────────────────────────
   4. RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .learn-intro {
    padding-top: 40px;
    margin-bottom: 40px;
  }

  .learn-card {
    padding: 16px 0 16px 14px;
  }

  .learn-card-title {
    font-size: 20px;
  }

  .learn-title-block {
    padding-top: 40px;
    margin-bottom: 32px;
  }

  .learn-takeaway {
    margin-bottom: 40px;
    padding-bottom: 28px;
  }

  .learn-takeaway-text {
    font-size: 18px;
  }

  .learn-prose h2 {
    font-size: 20px;
    margin-top: 48px;
  }

  .learn-insight {
    margin: 40px 0;
  }

  .learn-faq {
    margin-top: 48px;
  }

  .learn-related {
    margin-top: 48px;
  }
}

@media (max-width: 600px) {
  .learn-intro {
    padding-top: 32px;
    margin-bottom: 32px;
  }

  .learn-intro-prose {
    font-size: 17px;
  }

  .learn-prose table {
    font-size: 13px;
  }

  .learn-prose th,
  .learn-prose td {
    padding: 8px 8px;
  }

  .image-placeholder {
    padding: 24px 16px;
  }

  .learn-card {
    padding: 14px 0 14px 12px;
  }

  .learn-card::before {
    width: 3px;
    height: calc(100% - 12px);
  }

  .learn-card-title {
    font-size: 18px;
  }

  .learn-card-desc {
    font-size: 14px;
  }

  .learn-card-meta {
    font-size: 12px;
  }

  .learn-section {
    margin-bottom: 40px;
  }

  .learn-section-header {
    margin-bottom: 16px;
  }

  .learn-section-title {
    font-size: 18px;
  }

  .learn-section-subtitle {
    font-size: 13px;
  }

  .learn-see-all {
    font-size: 13px;
  }

  .learn-title-block {
    padding-top: 32px;
    margin-bottom: 28px;
  }

  .learn-title-block h1 {
    font-size: 28px;
  }

  .learn-takeaway {
    margin-bottom: 32px;
    padding-bottom: 24px;
  }

  .learn-takeaway-text {
    font-size: 17px;
  }

  .learn-toc {
    margin-bottom: 32px;
  }

  .learn-prose h2 {
    font-size: 19px;
    margin-top: 40px;
  }

  .learn-insight {
    margin: 32px 0;
    padding: 24px 16px;
  }

  .learn-insight p {
    font-size: 16px;
  }

  .learn-faq {
    margin-top: 40px;
  }

  .learn-faq-header h2 {
    font-size: 18px;
  }

  .faq-question {
    font-size: 15px;
    padding: 16px 0;
  }

  .faq-answer {
    font-size: 14px;
    padding-bottom: 16px;
  }

  .learn-related {
    margin-top: 40px;
  }

  .learn-related-title {
    font-size: 16px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. CROP PREVIEW VISUALIZATION
   ───────────────────────────────────────────────────────────────────────────── */

.crop-preview-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin: 40px 0 24px;
}

.crop-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.crop-preview-frame {
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(31, 27, 22, 0.12);
}

.crop-preview-frame--portrait {
  width: 200px;
  height: 250px;
}

.crop-preview-frame--landscape {
  width: 250px;
  height: 167px;
}

.crop-preview-frame img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.crop-preview-boundary {
  position: absolute;
  border: 2px solid var(--accent);
  pointer-events: none;
  z-index: 2;
}

/* Overlay segments: top, bottom, left, right around the crop window */
.crop-preview-overlay-top,
.crop-preview-overlay-bottom,
.crop-preview-overlay-left,
.crop-preview-overlay-right {
  position: absolute;
  background: var(--bg);
  opacity: 0.75;
  pointer-events: none;
  z-index: 1;
}

.crop-preview-label {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--teal);
}

.crop-preview-bestfit {
  font-size: 12px;
  font-style: italic;
  color: var(--teal);
  margin-top: 2px;
}

/* Portrait crops (3212×4000 source, 4:5 best fit) */
/* 4:5 — nearly full frame, tiny side crops */
.crop-portrait-4x5 .crop-preview-boundary {
  top: 0%; left: 0.19%; width: 99.44%; height: 100%;
}
.crop-portrait-4x5 .crop-preview-overlay-left {
  top: 0; left: 0; width: 0.19%; height: 100%;
}
.crop-portrait-4x5 .crop-preview-overlay-right {
  top: 0; right: 0; width: 0.37%; height: 100%;
}

/* 2:3 — crops sides */
.crop-portrait-2x3 .crop-preview-boundary {
  top: 0%; left: 8.48%; width: 83.04%; height: 100%;
}
.crop-portrait-2x3 .crop-preview-overlay-left {
  top: 0; left: 0; width: 8.48%; height: 100%;
}
.crop-portrait-2x3 .crop-preview-overlay-right {
  top: 0; right: 0; width: 8.48%; height: 100%;
}

/* 1:1 — crops bottom */
.crop-portrait-1x1 .crop-preview-boundary {
  top: 0%; left: 0%; width: 100%; height: 80.3%;
}
.crop-portrait-1x1 .crop-preview-overlay-bottom {
  bottom: 0; left: 0; width: 100%; height: 19.7%;
}

/* Landscape crops (3600×2400 source, 2:3 best fit) */
/* 2:3 — full frame, no overlay needed */
.crop-landscape-2x3 .crop-preview-boundary {
  top: 0%; left: 0%; width: 100%; height: 100%;
}

/* 4:5 — crops sides equally */
.crop-landscape-4x5 .crop-preview-boundary {
  top: 0%; left: 8.33%; width: 83.34%; height: 100%;
}
.crop-landscape-4x5 .crop-preview-overlay-left {
  top: 0; left: 0; width: 8.33%; height: 100%;
}
.crop-landscape-4x5 .crop-preview-overlay-right {
  top: 0; right: 0; width: 8.33%; height: 100%;
}

/* 1:1 — crops left side (right-aligned) */
.crop-landscape-1x1 .crop-preview-boundary {
  top: 0%; left: 33.33%; width: 66.67%; height: 100%;
}
.crop-landscape-1x1 .crop-preview-overlay-left {
  top: 0; left: 0; width: 33.33%; height: 100%;
}

@media (max-width: 800px) {
  .crop-preview-row {
    gap: 20px;
  }

  .crop-preview-frame--portrait {
    width: 140px;
    height: 175px;
  }

  .crop-preview-frame--landscape {
    width: 180px;
    height: 120px;
  }

  .crop-preview-label {
    font-size: 14px;
    margin-top: 10px;
  }

  .crop-preview-bestfit {
    font-size: 11px;
  }
}

@media (max-width: 500px) {
  .crop-preview-row {
    gap: 12px;
  }

  .crop-preview-frame--portrait {
    width: 90px;
    height: 112px;
  }

  .crop-preview-frame--landscape {
    width: 100px;
    height: 67px;
  }

  .crop-preview-label {
    font-size: 13px;
    margin-top: 8px;
  }

  .crop-preview-boundary {
    border-width: 1px;
  }

  .crop-preview-bestfit {
    font-size: 10px;
  }
}


/* ─────────────────────────────────────────────────────────────────────────────
   BROCHURE MODE
   ───────────────────────────────────────────────────────────────────────────── */

/* In brochure mode, inline /app links appear as plain text */
.brochure-mode .learn-prose a[href="/app"],
.brochure-mode .learn-takeaway-cta a[href="/app"],
.brochure-mode .faq-answer a[href="/app"] {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
  cursor: text;
}
