/* ==========================================================================
   ComeMorocco — article components
   Used by the post HTML template. Loaded on single posts and pages only.

   Everything reads the theme's own tokens, so a colour changed in
   homepage.css changes here too. Fallbacks are given in case this file is
   ever used without the theme.
   ========================================================================== */

.entry-content .cm-lead {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.4;
  color: var(--brand-green, #0c3b2e);
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--brand-gold, #ffba00);
  margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   Key takeaways
   -------------------------------------------------------------------------- */
.entry-content .cm-takeaways {
  margin: 2.5rem 0;
  padding: 1.75rem;
  background: var(--brand-green, #0c3b2e);
  border-radius: var(--radius-lg, 6px);
}
.entry-content .cm-takeaways__label {
  font-family: var(--font-script, cursive);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--brand-gold, #ffba00);
  margin: 0 0 1.25rem;
}
.entry-content .cm-takeaways__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
}
.entry-content .cm-take {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.entry-content .cm-take__num {
  display: block;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.35rem;
  color: var(--brand-gold, #ffba00);
  margin-bottom: 0.35rem;
}
.entry-content .cm-take p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--cream-soft, #d8d2c4);
}

/* --------------------------------------------------------------------------
   Table of contents — a <details>, so it works with no JavaScript at all
   -------------------------------------------------------------------------- */
.entry-content .cm-toc {
  margin: 2.5rem 0;
  padding: 0 1.35rem;
  background: var(--white, #fff);
  border: 1px solid var(--line, rgba(12, 59, 46, 0.14));
  border-left: 3px solid var(--brand-gold, #ffba00);
  border-radius: var(--radius, 3px);
}
.entry-content .cm-toc > summary {
  padding: 1.1rem 0;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-ink, #7a5c12);
  cursor: pointer;
  list-style: none;
}
.entry-content .cm-toc > summary::-webkit-details-marker { display: none; }
.entry-content .cm-toc > summary::after {
  content: "+";
  float: right;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-soft, #4a5750);
}
.entry-content .cm-toc[open] > summary::after { content: "–"; }
.entry-content .cm-toc ol {
  margin: 0;
  padding: 0 0 1.25rem 1.2rem;
  counter-reset: cm-toc;
}
.entry-content .cm-toc li { margin: 0; }
.entry-content .cm-toc li + li { border-top: 1px solid var(--line, rgba(12, 59, 46, 0.14)); }
.entry-content .cm-toc a {
  display: block;
  padding: 0.55rem 0;
  font-size: 0.95rem;
  color: var(--ink-soft, #4a5750);
  text-decoration: none;
}
.entry-content .cm-toc a:hover { color: var(--brand-green, #0c3b2e); }

/* --------------------------------------------------------------------------
   Notes, tips and pull quotes
   -------------------------------------------------------------------------- */
.entry-content .cm-note,
.entry-content .cm-tip {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius, 3px);
  font-size: 1rem;
  line-height: 1.65;
}
.entry-content .cm-note {
  background: var(--grey-light, #f0ede6);
  border-left: 3px solid var(--brand-gold, #ffba00);
}
.entry-content .cm-tip {
  background: var(--white, #fff);
  border: 1px solid var(--line, rgba(12, 59, 46, 0.14));
  border-left: 3px solid var(--green-mid, #2d6e4e);
}
.entry-content .cm-note p:last-child,
.entry-content .cm-tip p:last-child { margin-bottom: 0; }
.entry-content .cm-note strong,
.entry-content .cm-tip strong { color: var(--brand-green, #0c3b2e); }
.entry-content .cm-tip__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-ink, #7a5c12);
  margin-bottom: 0.4rem;
}

.entry-content .cm-quote {
  margin: 2.5rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--brand-gold, #ffba00);
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--brand-green, #0c3b2e);
}
.entry-content .cm-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.9rem;
  font-style: normal;
  color: var(--ink-soft, #4a5750);
}

/* --------------------------------------------------------------------------
   Day-by-day itinerary
   -------------------------------------------------------------------------- */
.entry-content .cm-days { margin: 2.5rem 0; display: grid; gap: 0; }
.entry-content .cm-day {
  background: var(--white, #fff);
  border: 1px solid var(--line, rgba(12, 59, 46, 0.14));
  border-radius: var(--radius, 3px);
  overflow: hidden;
}
.entry-content .cm-day__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--brand-green, #0c3b2e);
  color: var(--white, #fff);
}
.entry-content .cm-day__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand-gold, #ffba00);
  color: var(--brand-green, #0c3b2e);
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  line-height: 1;
}
.entry-content .cm-day__title {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.15rem;
  color: var(--white, #fff);
}
.entry-content .cm-day__sub {
  display: block;
  font-size: 0.8125rem;
  color: var(--cream-soft, #d8d2c4);
  margin-top: 2px;
}
.entry-content .cm-day__body { padding: 1.25rem; }
.entry-content .cm-day__body > *:first-child { margin-top: 0; }
.entry-content .cm-day__body > *:last-child { margin-bottom: 0; }

/* The line joining one day to the next */
.entry-content .cm-days .cm-day + .cm-day { margin-top: 2.25rem; position: relative; }
.entry-content .cm-days .cm-day + .cm-day::before {
  content: "";
  position: absolute;
  left: 42px;
  top: -2.25rem;
  width: 2px;
  height: 2.25rem;
  background: linear-gradient(to bottom, var(--brand-gold, #ffba00), var(--line-strong, rgba(12, 59, 46, 0.3)));
}

/* --------------------------------------------------------------------------
   Comparison tables — scroll rather than stretch the column
   -------------------------------------------------------------------------- */
.entry-content .cm-table {
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid var(--line, rgba(12, 59, 46, 0.14));
  border-radius: var(--radius, 3px);
}
.entry-content .cm-table table {
  display: table;
  width: 100%;
  min-width: 34rem;
  margin: 0;
  border-collapse: collapse;
}

/* --------------------------------------------------------------------------
   Booking block — the affiliate widget lives here
   -------------------------------------------------------------------------- */
.entry-content .cm-book {
  margin: 3rem 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--cream, #f5f0e8);
  border: 1px solid var(--line, rgba(12, 59, 46, 0.14));
  border-top: 3px solid var(--brand-gold, #ffba00);
  border-radius: var(--radius-lg, 6px);
}
.entry-content .cm-book__eyebrow {
  font-family: var(--font-script, cursive);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gold-ink, #7a5c12);
  margin: 0 0 0.35rem;
}
.entry-content .cm-book__title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin: 0 0 0.6rem;
  border: 0;
  padding: 0;
}
.entry-content .cm-book__sub {
  color: var(--ink-soft, #4a5750);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.entry-content .cm-book__widget { min-height: 60px; }
.entry-content .cm-book__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line, rgba(12, 59, 46, 0.14));
  font-size: 0.8125rem;
  color: var(--ink-soft, #4a5750);
}

/* Affiliate disclosure — required wherever a commission link appears */
.entry-content .cm-disclosure {
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-soft, #4a5750);
}

/* --------------------------------------------------------------------------
   FAQ — <details>, so it opens without JavaScript and is accessible by default
   -------------------------------------------------------------------------- */
.entry-content .cm-faq { margin: 3rem 0; }
.entry-content .cm-faq__title { margin-bottom: 1.5rem; }
.entry-content .cm-faq__item {
  border-bottom: 1px solid var(--line, rgba(12, 59, 46, 0.14));
}
.entry-content .cm-faq__item:first-of-type {
  border-top: 1px solid var(--line, rgba(12, 59, 46, 0.14));
}
.entry-content .cm-faq__item > summary {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 1.1rem 2rem 1.1rem 0;
  position: relative;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.1rem;
  color: var(--brand-green, #0c3b2e);
  cursor: pointer;
  list-style: none;
}
.entry-content .cm-faq__item > summary::-webkit-details-marker { display: none; }
.entry-content .cm-faq__item > summary::after {
  content: "+";
  position: absolute;
  right: 0;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 1.3rem;
  line-height: 1;
  color: var(--gold-ink, #7a5c12);
}
.entry-content .cm-faq__item[open] > summary::after { content: "–"; }
.entry-content .cm-faq__num {
  flex: none;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-ink, #7a5c12);
}
.entry-content .cm-faq__a {
  padding: 0 0 1.35rem 2.6rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft, #4a5750);
}
.entry-content .cm-faq__a > *:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Closing call to action
   -------------------------------------------------------------------------- */
.entry-content .cm-cta {
  margin: 3rem 0 0;
  padding: clamp(2rem, 5vw, 3.25rem);
  background: var(--dark-green, #0f2e1c);
  border-radius: var(--radius-lg, 6px);
  text-align: center;
}
.entry-content .cm-cta__eyebrow {
  font-family: var(--font-script, cursive);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gold, #c9a84c);
  margin: 0 0 0.5rem;
}
.entry-content .cm-cta__title {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  color: var(--white, #fff);
  margin: 0 0 0.85rem;
  border: 0;
  padding: 0;
}
.entry-content .cm-cta__text {
  color: var(--cream-soft, #d8d2c4);
  margin: 0 auto 1.75rem;
  max-width: 46ch;
}
.entry-content .cm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0.85rem 2rem;
  background: var(--brand-gold, #ffba00);
  color: var(--brand-green, #0c3b2e);
  border-radius: var(--radius, 3px);
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.28s ease, transform 0.28s ease;
}
.entry-content .cm-btn:hover {
  background: #ffc933;
  color: var(--brand-green, #0c3b2e);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Reading progress
   -------------------------------------------------------------------------- */
.cm-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  height: 3px;
  width: 0;
  background: var(--brand-gold, #ffba00);
  transition: width 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
  .cm-progress { transition: none; }
  .entry-content .cm-btn:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .entry-content .cm-takeaways { padding: 1.35rem; }
  .entry-content .cm-takeaways__grid { grid-template-columns: 1fr; gap: 1rem; }
  .entry-content .cm-day__head { padding: 0.85rem 1rem; }
  .entry-content .cm-days .cm-day + .cm-day::before { left: 32px; }
  .entry-content .cm-day__num { width: 36px; height: 36px; font-size: 1rem; }
  .entry-content .cm-faq__a { padding-left: 0; }
}
