/* Constructions Pilot Learn — public reader styles
   Uses --cp-orange tokens from landing.css. Magazine-style typography,
   ~680px reading column. No new orange shades introduced. */

.cp-learn-shell {
  background: #fafaf7;
  color: #1a1a1a;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.cp-learn-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--cp-orange, #D18501); color: #fff; padding: 10px 16px;
  z-index: 9999; border-radius: 0 0 6px 0;
}
.cp-learn-skip:focus { left: 0; }

.cp-learn-container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Masthead */
.cp-learn-masthead {
  background: #fff;
  border-bottom: 1px solid #ececec;
  padding: 18px 0;
  position: sticky; top: 0; z-index: 50;
}
.cp-learn-masthead .cp-learn-container {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cp-learn-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #1a1a1a; }
.cp-learn-brand__mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--cp-orange, #D18501); color: #fff;
  border-radius: 8px; font-weight: 800; font-family: 'Georgia', serif;
}
.cp-learn-brand__name { font-size: 1.05rem; letter-spacing: 0.2px; }
.cp-learn-brand__name strong { color: var(--cp-orange-dark, #B8750A); }
.cp-learn-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cp-learn-nav a {
  text-decoration: none; color: #333; font-weight: 500; font-size: 0.95rem;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.cp-learn-nav a:hover, .cp-learn-nav a.is-active {
  color: var(--cp-orange-dark, #B8750A);
  border-bottom-color: var(--cp-orange, #D18501);
}
.cp-learn-search { display: flex; align-items: center; }
.cp-learn-search input {
  border: 1px solid #ddd; border-right: 0; padding: 8px 12px;
  border-radius: 24px 0 0 24px; min-width: 200px; font-size: 0.9rem;
}
.cp-learn-search button {
  border: 1px solid var(--cp-orange, #D18501); background: var(--cp-orange, #D18501);
  color: #fff; padding: 8px 14px; border-radius: 0 24px 24px 0; cursor: pointer;
}

/* Hero */
.cp-learn-hero { padding: 56px 24px 24px; }
.cp-learn-hero__copy { max-width: 820px; }
.cp-learn-eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.75rem; font-weight: 700; color: var(--cp-orange-dark, #B8750A);
  margin-bottom: 8px;
}
.cp-learn-hero h1 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin: 6px 0 12px;
  color: #111;
}
.cp-learn-hero p { font-size: 1.15rem; color: #555; max-width: 720px; }

/* Featured */
.cp-learn-featured { margin: 24px auto 56px; }
.cp-learn-featured__link {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px;
  background: #fff; border: 1px solid #ececec; border-radius: 16px;
  overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 4px 18px rgba(0,0,0,0.04);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.cp-learn-featured__link:hover { box-shadow: 0 10px 28px rgba(0,0,0,0.08); transform: translateY(-2px); }
.cp-learn-featured__media { aspect-ratio: 16 / 11; overflow: hidden; background: #f0ece2; }
.cp-learn-featured__media img { width: 100%; height: 100%; object-fit: cover; }
.cp-learn-featured__placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cp-orange-light, #E09520), var(--cp-orange-dark, #B8750A));
  color: #fff; font-size: 5rem; font-family: 'Georgia', serif;
}
.cp-learn-featured__copy { padding: 36px 36px 36px 0; align-self: center; }
.cp-learn-featured__copy h2 {
  font-family: 'Georgia', serif; font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.2;
  margin: 10px 0 14px;
}
.cp-learn-featured__copy p { color: #555; font-size: 1.05rem; line-height: 1.55; }
.cp-learn-featured__meta { display: block; margin-top: 16px; color: #888; font-size: 0.88rem; }
.cp-learn-chip {
  display: inline-block; background: rgba(209,133,1,0.12); color: var(--cp-orange-dark, #B8750A);
  padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}
@media (max-width: 800px) {
  .cp-learn-featured__link { grid-template-columns: 1fr; }
  .cp-learn-featured__copy { padding: 24px; }
}

/* Sections + grids */
.cp-learn-section { margin: 56px auto; }
.cp-learn-section__head {
  display: flex; align-items: end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; padding-bottom: 14px; border-bottom: 2px solid #1a1a1a;
}
.cp-learn-section__head h1, .cp-learn-section__head h2 {
  font-family: 'Georgia', serif; font-size: 1.6rem; margin: 0;
}
.cp-learn-section__more { color: var(--cp-orange-dark, #B8750A); font-weight: 600; text-decoration: none; }
.cp-learn-section__more:hover { text-decoration: underline; }

.cp-learn-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.cp-learn-grid--rail { grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 980px) { .cp-learn-grid, .cp-learn-grid--rail { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cp-learn-grid, .cp-learn-grid--rail { grid-template-columns: 1fr; } }

/* Card */
.cp-learn-card {
  background: #fff; border: 1px solid #ececec; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cp-learn-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.06); }
.cp-learn-card__media {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background: #f0ece2;
}
.cp-learn-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cp-learn-card__placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cp-orange-light, #E09520), var(--cp-orange-dark, #B8750A));
  color: #fff; font-size: 3rem; font-family: 'Georgia', serif;
}
.cp-learn-card__chip {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,0.94); color: var(--cp-orange-dark, #B8750A);
  padding: 4px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
}
.cp-learn-card__saved {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--cp-orange-dark, #B8750A); color: #fff;
  padding: 4px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.cp-learn-card__saved svg { display: block; }
.cp-learn-card__body { padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cp-learn-card__title { font-family: 'Georgia', serif; font-size: 1.18rem; margin: 0; line-height: 1.3; }
.cp-learn-card__title a { color: #111; text-decoration: none; }
.cp-learn-card__title a:hover { color: var(--cp-orange-dark, #B8750A); }
.cp-learn-card__excerpt { color: #555; font-size: 0.95rem; line-height: 1.5; margin: 0; }
.cp-learn-card__meta { color: #999; font-size: 0.82rem; display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* Most read */
.cp-learn-mostread { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.cp-learn-mostread li {
  display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: center;
  background: #fff; padding: 16px 20px; border: 1px solid #ececec; border-radius: 12px;
}
.cp-learn-mostread__rank {
  font-family: 'Georgia', serif; font-size: 2rem; font-weight: 700;
  color: var(--cp-orange, #D18501); line-height: 1;
}
.cp-learn-mostread a { color: #111; font-weight: 600; text-decoration: none; }
.cp-learn-mostread a:hover { color: var(--cp-orange-dark, #B8750A); }
.cp-learn-mostread small { display: block; color: #999; margin-top: 4px; font-size: 0.82rem; }

.cp-learn-pagination {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  margin-top: 36px; color: #555;
}
.cp-learn-pagination a { color: var(--cp-orange-dark, #B8750A); font-weight: 600; text-decoration: none; }

.cp-learn-empty { color: #777; padding: 32px 0; }

/* Article reading view */
.cp-learn-article { margin-bottom: 48px; }
.cp-learn-article__head { padding: 48px 24px 24px; max-width: 760px; }
.cp-learn-article__head h1 {
  font-family: 'Georgia', serif; font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.15; margin: 8px 0 14px; color: #111;
}
.cp-learn-article__deck { font-size: 1.2rem; color: #555; line-height: 1.5; margin: 0 0 18px; }
.cp-learn-article__meta { color: #888; font-size: 0.9rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cp-learn-article__meta a { color: #555; text-decoration: none; font-weight: 600; }
.cp-learn-article__role { background: #f0ece2; padding: 2px 8px; border-radius: 4px; color: #555; }

.cp-learn-article__hero { margin: 0 auto 36px; max-width: 1180px; padding: 0 24px; }
.cp-learn-article__hero img {
  width: 100%; max-height: 520px; object-fit: cover; border-radius: 16px;
}

.cp-learn-article__layout {
  display: grid; grid-template-columns: 220px 200px 1fr; gap: 32px; align-items: start;
}
.cp-learn-article__toc {
  position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto;
  border-left: 2px solid #ececec; padding: 4px 0 4px 16px;
}
.cp-learn-article__toc-title {
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem;
  font-weight: 700; color: #888; margin: 0 0 8px;
}
.cp-learn-article__toc ol { list-style: none; padding: 0; margin: 0; }
.cp-learn-article__toc li { margin: 6px 0; line-height: 1.3; }
.cp-learn-article__toc a {
  color: #555; text-decoration: none; font-size: 0.9rem;
  display: block; padding: 2px 0;
}
.cp-learn-article__toc a:hover { color: var(--cp-orange-dark, #B8750A); }
.cp-learn-article__toc-l3 { padding-left: 14px; }
.cp-learn-article__toc-l3 a { font-size: 0.84rem; color: #777; }
.cp-learn-article__rail {
  position: sticky; top: 96px;
  display: flex; flex-direction: column; gap: 18px;
}
.cp-learn-article__share {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px;
}
.cp-learn-article__share a {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid #ddd; border-radius: 50%;
  color: #666; text-decoration: none;
}
.cp-learn-article__share a:hover { color: var(--cp-orange-dark, #B8750A); border-color: var(--cp-orange, #D18501); }

.cp-learn-article__save { display: flex; flex-direction: column; gap: 8px; }
.cp-learn-save-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  border: 1px solid #ddd; background: #fff; color: #333;
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all 0.15s ease;
}
.cp-learn-save-btn:hover {
  border-color: var(--cp-orange, #D18501);
  color: var(--cp-orange-dark, #B8750A);
}
.cp-learn-save-btn.is-saved {
  background: var(--cp-orange, #D18501); color: #fff; border-color: var(--cp-orange, #D18501);
}
.cp-learn-save-btn.is-saved:hover { background: var(--cp-orange-dark, #B8750A); color: #fff; }
.cp-learn-save-link {
  font-size: 0.82rem; color: #777; text-decoration: none;
}
.cp-learn-save-link:hover { color: var(--cp-orange-dark, #B8750A); }
.cp-learn-article__body {
  max-width: 720px; font-size: 1.125rem; line-height: 1.7; color: #2a2a2a;
}
.cp-learn-article__body h2 { font-family: 'Georgia', serif; font-size: 1.85rem; margin: 2.2em 0 0.6em; }
.cp-learn-article__body h3 { font-family: 'Georgia', serif; font-size: 1.4rem; margin: 1.8em 0 0.4em; }
.cp-learn-article__body p { margin: 1em 0; }
.cp-learn-article__body a { color: var(--cp-orange-dark, #B8750A); text-decoration: underline; text-underline-offset: 3px; }
.cp-learn-article__body ul, .cp-learn-article__body ol { padding-left: 1.5em; margin: 1em 0; }
.cp-learn-article__body li { margin: 0.4em 0; }
.cp-learn-article__body hr.cp-learn-divider { border: 0; border-top: 1px solid #e5e5e5; margin: 2.5em 0; }
.cp-learn-article__body pre.cp-learn-code {
  background: #1a1a1a; color: #f5f5f5; padding: 16px; border-radius: 8px;
  overflow-x: auto; font-size: 0.92rem;
}
.cp-learn-article__body blockquote.cp-learn-quote {
  border-left: 4px solid var(--cp-orange, #D18501); padding: 8px 18px;
  background: rgba(209,133,1,0.05); margin: 1.5em 0; font-style: italic;
}

/* Image alignment classes from EditorJS renderer */
.cp-learn-figure { margin: 1.6em 0; }
.cp-learn-figure img { width: 100%; height: auto; border-radius: 8px; display: block; }
.cp-learn-figure figcaption { color: #888; font-size: 0.88rem; margin-top: 8px; text-align: center; }
.cp-learn-figure--center { text-align: center; }
.cp-learn-figure--full {
  margin-left: calc(-1 * ((100vw - 720px) / 2 - 32px));
  margin-right: calc(-1 * ((100vw - 720px) / 2 - 32px));
  max-width: none;
}
.cp-learn-figure--full img { border-radius: 12px; }
.cp-learn-figure--left {
  float: left; max-width: 48%; margin: 0.5em 1.6em 1em 0;
}
.cp-learn-figure--right {
  float: right; max-width: 48%; margin: 0.5em 0 1em 1.6em;
}
@media (max-width: 700px) {
  .cp-learn-figure--left, .cp-learn-figure--right {
    float: none; max-width: 100%; margin: 1.6em 0;
  }
  .cp-learn-figure--full { margin-left: 0; margin-right: 0; }
}

/* Callouts */
.cp-learn-callout {
  border: 1px solid; border-radius: 12px; padding: 18px 20px; margin: 1.6em 0;
  background: #fffbf2; border-color: #f1d99e;
}
.cp-learn-callout--warning { background: #fff5f0; border-color: #f5b88a; }
.cp-learn-callout--mistake { background: #fff0f0; border-color: #f1a5a5; }
.cp-learn-callout__head { display: flex; gap: 10px; align-items: center; font-weight: 700; margin-bottom: 6px; }
.cp-learn-callout__icon { font-size: 1.2rem; }
.cp-learn-callout__body p { margin: 0; }

/* Embeds */
.cp-learn-embed { margin: 1.6em 0; }
.cp-learn-embed__frame { position: relative; padding-bottom: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.cp-learn-embed__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Article tags + CTA */
.cp-learn-article__tags { margin-top: 2.5em; }
.cp-learn-article__tags a {
  display: inline-block; margin-right: 8px; margin-bottom: 6px;
  background: #f3efe6; color: #555; text-decoration: none;
  padding: 4px 10px; border-radius: 999px; font-size: 0.85rem;
}
.cp-learn-article__tags a:hover { background: var(--cp-orange, #D18501); color: #fff; }

.cp-learn-article__cta {
  margin: 3em 0 0; padding: 28px; border-radius: 14px;
  background: linear-gradient(135deg, var(--cp-orange-dark, #B8750A), var(--cp-orange, #D18501));
  color: #fff; text-align: center;
}
.cp-learn-article__cta h3 { margin: 0 0 6px; font-family: 'Georgia', serif; font-size: 1.4rem; }
.cp-learn-article__cta p { margin: 0 0 14px; opacity: 0.95; }
.cp-learn-cta-btn {
  display: inline-block; background: #fff; color: var(--cp-orange-dark, #B8750A);
  padding: 12px 26px; border-radius: 999px; font-weight: 700; text-decoration: none;
}

@media (max-width: 1080px) {
  .cp-learn-article__layout { grid-template-columns: 200px 1fr; }
  .cp-learn-article__toc { display: none; }
}
@media (max-width: 800px) {
  .cp-learn-article__layout { grid-template-columns: 1fr; }
  .cp-learn-article__rail {
    flex-direction: row; position: static;
    justify-content: space-between; align-items: center;
    flex-wrap: wrap; margin-bottom: 16px; gap: 12px;
  }
  .cp-learn-article__share { justify-content: flex-end; }
}

/* Admin preview banner */
.cp-learn-banner {
  background: #fff8e1; border-left: 4px solid var(--cp-orange, #D18501);
  padding: 12px 20px; margin: 0 auto; max-width: 1180px;
}
.cp-learn-banner a { color: var(--cp-orange-dark, #B8750A); margin-left: 12px; }
