/* ==========================================================================
   ComeMorocco — site styles
   Everything outside the homepage: page headers, articles, archives,
   sidebar, comments, pagination, 404.
   Loads after homepage.css and reuses its tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page header — archives, search, 404, article intros
   -------------------------------------------------------------------------- */
.page-head {
  background: var(--brand-green);
  color: var(--cream);
  padding-block: clamp(2.75rem, 6vw, 4.5rem) clamp(2.25rem, 5vw, 3.5rem);
}
.page-head .head__kicker { color: var(--gold); }
.page-head__title {
  font-size: clamp(2rem, 4vw, 3.1rem);
  color: var(--white);
  max-width: 24ch;
}
.page-head__intro {
  margin-top: 1rem;
  max-width: 62ch;
  color: var(--cream-soft);
  font-size: var(--fs-lead);
}
.page-head__intro p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   2. Two-column layout — collapses to one when the sidebar is empty
   -------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.has-no-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
.layout__main { min-width: 0; }

/* --------------------------------------------------------------------------
   3. Article
   -------------------------------------------------------------------------- */
.entry__head {
  background: var(--brand-green);
  color: var(--cream);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 4rem);
}
/* The gutter is inside .wrap, so the header measure includes it — that puts
   the title on exactly the same axis as the body text below. */
.entry__head-inner { max-width: calc(44rem + var(--gutter) * 2); }

/* The reading column is centred and shares its measure with the header above,
   so the title, the image and the text all sit on the same axis. */
.has-no-sidebar .layout--article .layout__main {
  max-width: 44rem;
  margin-inline: auto;
}

.entry__kicker {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-gold);
  text-decoration: none;
}
.entry__kicker:hover { text-decoration: underline; }

.entry__title {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  color: var(--white);
  line-height: 1.08;
}
.entry__standfirst {
  margin-top: 1.1rem;
  font-size: var(--fs-lead);
  color: var(--cream-soft);
  max-width: 58ch;
}
.entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
  font-size: var(--fs-sm);
  color: var(--cream-soft);
}
.entry__author { font-weight: 600; color: var(--white); }

/* Featured image straddles the header and the body */
.entry__media { margin: 0; }
.entry__media .wrap { max-width: 56rem; margin-top: clamp(-3.5rem, -5vw, -2rem); }
.entry__media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(12, 59, 46, 0.16);
}
.entry__media figcaption {
  margin-top: 0.65rem;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
}
.entry .layout { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem); }

/* --------------------------------------------------------------------------
   4. Article content — the typography of the actual writing
   -------------------------------------------------------------------------- */
.entry-content {
  max-width: 42rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--ink);
}
.entry-content > * + * { margin-top: 1.35rem; }
.entry-content p { max-width: none; margin: 0; }

.entry-content h2 {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  margin-top: 2.75rem;
  padding-top: 0.35rem;
  border-top: 2px solid var(--brand-gold);
}
.entry-content h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); margin-top: 2.25rem; }
.entry-content h4 { font-size: 1.15rem; margin-top: 1.85rem; }
.entry-content h2 + *, .entry-content h3 + *, .entry-content h4 + * { margin-top: 0.85rem; }

.entry-content a {
  color: var(--brand-green);
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}
.entry-content a:hover { color: var(--green-mid); text-decoration-color: var(--brand-gold); }

.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li + li { margin-top: 0.5rem; }
.entry-content li::marker { color: var(--gold-ink); }

.entry-content blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--brand-gold);
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--brand-green);
}
.entry-content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-style: normal;
  color: var(--ink-soft);
}

.entry-content img,
.entry-content .wp-block-image img { border-radius: var(--radius); height: auto; }
.entry-content figure { margin: 2rem 0; }
.entry-content figcaption {
  margin-top: 0.6rem;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  text-align: left;
}

/* Wide and full-width blocks stay readable rather than edge-to-edge */
.entry-content .alignwide { width: min(100%, 52rem); margin-inline: auto; }
.entry-content .alignfull { width: min(100%, 60rem); margin-inline: auto; }
.entry-content .alignleft { float: left; margin: 0.4rem 1.75rem 1.25rem 0; max-width: 45%; }
.entry-content .alignright { float: right; margin: 0.4rem 0 1.25rem 1.75rem; max-width: 45%; }
.entry-content .aligncenter { margin-inline: auto; }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.entry-content th, .entry-content td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.entry-content th { font-weight: 600; color: var(--brand-green); background: var(--grey-light); }

.entry-content code {
  padding: 0.15em 0.4em;
  background: var(--grey-light);
  border-radius: 2px;
  font-size: 0.9em;
}
.entry-content pre {
  padding: 1.1rem 1.25rem;
  background: var(--dark-green);
  color: var(--cream);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.entry-content pre code { background: none; color: inherit; padding: 0; }

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin-block: 2.5rem;
}

/* --------------------------------------------------------------------------
   5. Tags and post-to-post navigation
   -------------------------------------------------------------------------- */
.entry__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.entry__tags-label { color: var(--ink-soft); margin-right: 0.25rem; }
.entry__tags a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.25rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--brand-green);
  text-decoration: none;
}
.entry__tags a:hover { background: var(--brand-green); color: var(--cream); border-color: var(--brand-green); }

.entry__nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.entry__nav-link {
  display: block;
  padding: 1.15rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease);
}
.entry__nav-link:hover { border-color: var(--brand-green); }
.entry__nav-link span {
  display: block;
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 0.35rem;
}
.entry__nav-link strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-green);
}
.entry__nav-link--next { text-align: right; grid-column: 2; }

/* --------------------------------------------------------------------------
   6. Archives
   -------------------------------------------------------------------------- */
.posts--archive {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem 1.75rem;
}
.has-no-sidebar .posts--archive { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout__aside ~ * .posts--archive,
.layout:has(.layout__aside) .posts--archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --------------------------------------------------------------------------
   7. Sidebar widgets
   -------------------------------------------------------------------------- */
.layout__aside { display: grid; gap: 1.5rem; }
.widget {
  padding: 1.4rem 1.35rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}
.widget__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand-green);
  margin-bottom: 0.9rem;
}
.widget ul { list-style: none; }
.widget li + li { margin-top: 0.15rem; border-top: 1px solid var(--line); }
.widget a {
  display: block;
  padding: 0.5rem 0;
  min-height: 40px;
  color: var(--ink-soft);
  text-decoration: none;
}
.widget a:hover { color: var(--brand-green); }
.widget select,
.widget input[type="search"],
.widget input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   8. Search form
   -------------------------------------------------------------------------- */
.searchform { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.searchform input[type="search"] {
  flex: 1 1 240px;
  min-height: 50px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  font: inherit;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   9. Empty and 404 states
   -------------------------------------------------------------------------- */
.empty {
  max-width: 40rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.empty__hint { margin-top: 1.25rem; color: var(--ink-soft); font-size: var(--fs-sm); }
.empty__links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }

/* --------------------------------------------------------------------------
   10. Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--brand-green);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pagination .page-numbers:hover { background: var(--brand-green); color: var(--cream); border-color: var(--brand-green); }
.pagination .page-numbers.current {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: var(--brand-green);
  font-weight: 600;
}
.pagination .dots { border-color: transparent; }
.pagination--inline { margin-top: 1.75rem; }

/* --------------------------------------------------------------------------
   11. Comments
   -------------------------------------------------------------------------- */
.comments {
  max-width: none;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}
.comments__title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--brand-green);
  margin-bottom: 1.5rem;
}
.comments__list, .comments__list .children { list-style: none; padding: 0; }
.comments__list .children { margin-left: clamp(1rem, 4vw, 2.5rem); }
.comments__list li { margin-bottom: 1.5rem; }
.comment-body {
  padding: 1.25rem 1.35rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
}
.comment-author img { border-radius: 50%; }
.comment-author .fn { font-style: normal; font-weight: 600; color: var(--brand-green); }
.comment-metadata a { color: var(--ink-soft); }
.comment-content { font-size: var(--fs-sm); line-height: 1.7; }
.comment-content p + p { margin-top: 0.85rem; }
.reply { margin-top: 0.75rem; font-size: var(--fs-xs); font-weight: 600; }
.reply a { color: var(--gold-ink); text-decoration: none; }
.reply a:hover { text-decoration: underline; }
.bypostauthor > .comment-body { border-left: 3px solid var(--brand-gold); }

.comment-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.comment-form p { margin: 0; max-width: none; }
.comment-form label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-soft); margin-bottom: 0.35rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] { min-height: 48px; }
.comment-form textarea { min-height: 160px; resize: vertical; }
.comment-form .comment-notes,
.comment-form .comment-form-cookies-consent label { font-size: var(--fs-xs); color: var(--ink-soft); }
.comment-form .form-submit { margin: 0; }
.comment-form input[type="submit"] { cursor: pointer; border: 0; }

/* --------------------------------------------------------------------------
   12. Breadcrumbs (Rank Math)
   -------------------------------------------------------------------------- */
.breadcrumbs {
  margin-bottom: 1rem;
  font-size: var(--fs-xs);
  color: var(--cream-soft);
}
.breadcrumbs a { color: var(--brand-gold); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   13. Compact mega menu — used when navigation comes from a WordPress menu
   -------------------------------------------------------------------------- */
.mega--compact .mega__inner {
  grid-template-columns: repeat(auto-fit, minmax(190px, 220px));
  justify-content: start;
  padding-block: 1.5rem 1.75rem;
}

/* --------------------------------------------------------------------------
   14. WordPress core classes
   -------------------------------------------------------------------------- */
.sticky .post__title::after { content: " ★"; color: var(--brand-gold); }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  width: auto; height: auto;
  clip: auto;
  margin: 0;
  padding: 0.75rem 1.25rem;
  background: var(--brand-gold);
  color: var(--brand-green);
  z-index: 999;
}
.wp-caption { max-width: 100%; }
.gallery-caption { font-size: var(--fs-xs); color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1079px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout__aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column dense;
  }
  .posts--archive,
  .has-no-sidebar .posts--archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .entry-content { font-size: 1.0625rem; }
  .entry-content .alignleft,
  .entry-content .alignright { float: none; margin-inline: 0; max-width: 100%; }
  .entry__nav { grid-template-columns: 1fr; }
  .entry__nav-link--next { grid-column: 1; text-align: left; }
  .layout__aside { grid-template-columns: 1fr; }

  /* Archive cards stack instead of becoming a side-scrolling rail */
  .posts--archive,
  .has-no-sidebar .posts--archive {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-auto-columns: auto;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    gap: 2rem;
  }
}
