/* =====================================================================
   medium.css — Reading-first redesign (Medium-inspired typography)
   Layered ON TOP of bootstrap.min.css + index.css.
   Scope: blog reading surfaces (post, feeds, nav, footer).
   Does NOT touch the legacy .section-container scroll model.
   ===================================================================== */

:root {
  --m-reading: 1100px;         /* article content column (actual readable width) */
  --m-feed: 1148px;            /* feed container = 1100px content + 2×24px padding */
  --m-ink: #242424;            /* primary text                      */
  --m-ink-2: #6b6b6b;          /* secondary / meta text             */
  --m-ink-3: #767676;          /* tertiary / captions (AA: 4.54:1 on #fff) */
  --m-rule: #ececec;           /* hairline dividers                 */
  --m-brand: #bb778d;          /* Pâmela accent (links/active)      */
  --m-brand-d: #8b4560;        /* darker accent                     */
  --m-bg-soft: #fafafa;        /* soft surfaces (faq/cta)           */
  --m-serif: "Charter", "Iowan Old Style", source-serif-pro, Georgia, Cambria, "Times New Roman", Times, serif;
  --m-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------------
   1. BASE — quiet the legacy body color/weight for reading surfaces
   --------------------------------------------------------------------- */

/* Override index.css `a:not(.btn):link` (#6284c5) — match specificity with brand rose */
a:not(.btn):link, a:not(.btn):visited { color: var(--m-brand); }
a:not(.btn):hover, a:not(.btn):focus { color: var(--m-brand-d); }

body {
  color: var(--m-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection      { background: #f3e3ea; }
::-moz-selection { background: #f3e3ea; }

/* =====================================================================
   2. NAV / HEADER  (about.njk .menu-container)
   ===================================================================== */
.menu-container {
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--m-rule);
  min-height: 0;
}
.menu-container .logo,
.menu-container .logo img {
  min-height: 0;
}
.menu-container .logo img {
  width: 260px;
  height: auto;
  max-width: 70%;
  border-radius: 0;
  margin-bottom: 14px;
}
.menu-container .menu ul { gap: 4px; }
.menu-container .menu ul li a,
.menu-container .menu-dropdown-btn {
  font-family: var(--m-sans);
  font-size: 14px;
  letter-spacing: .2px;
  color: var(--m-ink-2) !important;
  font-weight: 500;
  padding: 8px 14px;
  min-height: 0;
  border-radius: 999px;
  transition: color .15s ease, background-color .15s ease;
}
.menu-container .menu ul li a:hover,
.menu-container .menu-dropdown-btn:hover { color: var(--m-ink) !important; background: #f5f5f5; }
.menu-container .menu ul li a.active {
  color: var(--m-ink) !important;
  font-weight: 600;
  background: #f2eef0;
}
.menu-container .menu-dropdown-content { border: 1px solid var(--m-rule); box-shadow: 0 6px 24px rgba(0,0,0,.10); }
.menu-container .menu-dropdown-content a { font-family: var(--m-sans); font-size: 14px; }

/* =====================================================================
   3. ARTICLE  (post.njk  #post / .post-content)
   ===================================================================== */
article#post {
  max-width: calc(var(--m-reading) + 48px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* --- title (serif, samuel-blog .article__title) -------------------- */
#post .post-title {
  font-family: var(--m-serif);
  font-weight: 700;
  font-size: 42px;
  line-height: 1.18;
  letter-spacing: -.014em;
  color: var(--m-ink);
  margin: 26px 0 18px;
}

/* --- byline (avatar-less brand byline, samuel-blog .byline) --------- */
#post .byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 30px;
}
#post .byline__name {
  font-family: var(--m-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--m-ink);
  display: block;
  line-height: 1.35;
}
#post .byline__sub {
  font-family: var(--m-sans);
  font-size: 13.5px;
  color: var(--m-ink-2);
  display: block;
  line-height: 1.5;
}
#post .byline__sub time { color: var(--m-ink-2); }
#post .chip {
  display: inline-block;
  vertical-align: baseline;
  font-family: var(--m-sans);
  font-size: 12px;
  font-weight: 600;
  background: #f3e8ee;
  color: var(--m-brand-d) !important;
  border-radius: 100px;
  padding: 2px 11px;
  line-height: 1.7;
  text-decoration: none;
  margin-left: 8px;
}
#post a.chip:hover { background: #ecd9e2; color: var(--m-brand-d) !important; }

/* fallback styling for the legacy meta block if a post still renders it */
#post .post-meta-info,
#post .post-meta-info .text-muted,
#post .post-date {
  font-family: var(--m-sans);
  font-size: 14px;
  color: var(--m-ink-2);
}
#post .post-meta-info { gap: 6px 10px; padding-bottom: 0; }
#post .post-meta-info a { color: var(--m-brand-d); }

/* --- breadcrumbs: strip the boxed gradient, make it a quiet line ---- */
#post .breadcrumb-visible {
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 18px;
}
#post .breadcrumb-item a,
#post .breadcrumb-current span {
  font-family: var(--m-sans);
  font-size: 13px;
}
#post .breadcrumb-item a { color: var(--m-ink-2); }
#post .breadcrumb-item a:hover { color: var(--m-brand-d); }

/* --- hero image: centered, height-capped (Pâmela heroes are often square,
   so width:100% on the 975px column blew them up — cap by max-height) ------ */
#post .post-hero-figure { margin: 8px 0 30px; }
#post .post-hero-figure .text-center { padding: 0 !important; }
#post .post-hero-image {
  width: auto !important;
  max-width: 100% !important;
  max-height: 540px;
  border-radius: 6px;
  box-shadow: none;
}
#post .post-hero-caption { font-family: var(--m-sans); color: var(--m-ink-3); margin-top: 8px; }

@media screen and (max-width: 768px) {
  #post .post-hero-image { max-height: none; width: 100% !important; }
}

/* --- body copy ------------------------------------------------------ */
.post-content { font-family: var(--m-serif); }
#post .post-content p,
#post .post-content li {
  font-family: var(--m-serif);
  font-size: 20px;
  line-height: 1.7;
  color: var(--m-ink);
  letter-spacing: -.003em;
  padding-bottom: 0;
  margin: 0 0 1.45rem;
}
#post .post-content li { margin-bottom: .5rem; }
#post .post-content ul,
#post .post-content ol { margin: 0 0 1.45rem; padding-left: 1.4em; }

/* headings inside body — clean sans, no borders/decorations */
#post .post-content h2,
#post .post-content h3,
#post .post-content h4 {
  font-family: var(--m-sans);
  color: var(--m-ink);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.014em;
}
#post .post-content h2 { font-size: 30px; margin: 2.2rem 0 .9rem; }
#post .post-content h3 { font-size: 24px; margin: 1.9rem 0 .7rem; }
#post .post-content h4 { font-size: 20px; margin: 1.6rem 0 .6rem; }
#post .post-content h2.h2-style { text-align: left; }

/* links in body */
#post .post-content a {
  color: var(--m-ink);
  text-decoration: underline;
  text-decoration-color: rgba(36,36,36,.35);
  text-underline-offset: 2px;
  transition: text-decoration-color .15s ease, color .15s ease;
}
#post .post-content a:hover { color: var(--m-brand-d); text-decoration-color: var(--m-brand-d); }

/* images + figures */
#post .post-content img { border-radius: 6px; }
#post .post-content figure { margin: 30px 0; }
#post .post-content figcaption {
  font-family: var(--m-sans);
  color: var(--m-ink-3);
  text-align: center;
  font-size: 14px;
}

/* blockquote — Medium pull style */
#post .post-content blockquote {
  font-family: var(--m-serif);
  font-style: normal;
  border-left: 3px solid var(--m-ink);
  padding: 2px 0 2px 22px;
  margin: 30px 0;
  color: #515151;
}
#post .post-content blockquote p { color: #515151; }

#post hr {
  border: 0;
  border-top: 1px solid var(--m-rule);
  margin: 44px 0;
}

/* =====================================================================
   4. FAQ + RELATED + CTA  (restyled from inline → calmer surfaces)
   ===================================================================== */
.faq-section,
.related-posts-section {
  background: var(--m-bg-soft) !important;
  border: 1px solid var(--m-rule);
  border-radius: 10px !important;
  padding: 28px !important;
  margin-top: 44px !important;
}
.faq-section h2,
.related-posts-section h2 {
  font-family: var(--m-sans);
  font-size: 22px !important;
  color: var(--m-ink) !important;
  font-weight: 700 !important;
}
.faq-section h2 i,
.related-posts-section h2 i { color: var(--m-brand) !important; }
.faq-item { box-shadow: none !important; border: 1px solid var(--m-rule); }
.faq-item summary { font-family: var(--m-sans); color: var(--m-ink) !important; font-size: 16px !important; }
.faq-item > div { font-family: var(--m-serif); }

.related-post-card { box-shadow: none !important; border: 1px solid var(--m-rule); border-radius: 8px; }
.related-post-card:hover { transform: none !important; box-shadow: 0 6px 20px rgba(0,0,0,.08) !important; }
.related-post-card h3 { font-family: var(--m-sans); }
.related-post-card p { font-family: var(--m-serif); }

/* Cap related-post card + thumbnail max size on the wide 975px column
   (otherwise the auto-fit 1fr tracks stretch each thumb to ~305x160). */
.related-posts-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 230px)) !important;
  justify-content: center;
}
.related-post-card a > div:has(> img) {
  height: 140px !important;
  aspect-ratio: auto !important;
}

/* CTA — soften from heavy pink gradient to a quiet brand card */
.contact-form-section {
  background: var(--m-bg-soft) !important;
  border: 1px solid var(--m-rule);
  box-shadow: none !important;
  border-radius: 12px !important;
}
.contact-form-section h2 { font-family: var(--m-sans); }
.contact-form { box-shadow: none !important; border: 1px solid var(--m-rule); }
.contact-form-section button[type="submit"] {
  background: var(--m-brand-d) !important;  /* #8b4560 -> white = 6.7:1 (AA) */
  text-transform: none !important;
  letter-spacing: .2px !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

/* =====================================================================
   5. FEED / LISTING  (index.html, posts.njk, categories.njk)
   Medium row: text left, thumb right, hairline divider, no card chrome.
   ===================================================================== */
.m-feed {
  max-width: var(--m-feed);
  margin: 0 auto;
  padding: 0 24px;
}
.m-feed-head { margin: 30px 0 8px; }
.m-feed-head h1,
.m-feed-head h2 {
  font-family: var(--m-sans);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--m-ink);
  font-size: 30px;
  text-align: left;
  margin: 0 0 6px;
}
/* Neutralise the legacy decorated .h2-style (uppercase, centered, colored
   dash ::before/::after). The legacy rule lives at
   `.section-container-wrapper .section-container section .h2-style` (0,3,1),
   so the neutralizer is prefixed with `.section-container` to win on
   specificity + source order regardless of whether a feed head keeps the class. */
.section-container .m-feed-head .h2-style:before,
.section-container .m-feed-head .h2-style:after { display: none; }
.section-container .m-feed-head .h2-style {
  text-transform: none;
  letter-spacing: -.02em;
  text-align: left;
  font-size: 30px;
  margin: 0 0 6px;
  color: var(--m-ink);
}
.m-feed-sub {
  font-family: var(--m-sans);
  color: var(--m-ink-2);
  font-size: 15px;
  text-align: left !important;
  margin: 0 0 8px !important;
}

.m-feed-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 28px 0;
  border-bottom: 1px solid var(--m-rule);
}
.m-feed-item__body { flex: 1 1 auto; min-width: 0; }
.m-feed-item__title {
  font-family: var(--m-sans);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: -.015em;
  margin: 0 0 8px;
}
.m-feed-item__title a:link,
.m-feed-item__title a:visited { color: var(--m-brand-d); text-decoration: none; }
.m-feed-item__title a { color: var(--m-brand-d); text-decoration: none; }
.m-feed-item__title a:hover { color: var(--m-brand); }
.m-feed-item__dek {
  font-family: var(--m-serif);
  font-size: 16px;
  line-height: 1.55;
  color: #4a4a4a;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m-feed-item__meta {
  font-family: var(--m-sans);
  font-size: 13px;
  color: var(--m-ink-2);
}
.m-feed-item__meta a { color: var(--m-ink-2); }
.m-feed-item__thumb {
  flex: 0 0 auto;
  width: 160px;
  height: 107px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}
.m-feed-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.m-feed-more { padding: 28px 0 8px; }
.m-feed-more a {
  display: inline-block;
  font-family: var(--m-sans);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--m-ink);
  border-radius: 999px;
  padding: 10px 22px;
  text-decoration: none;
}
.m-feed-more a:hover { background: #000; color: #fff; }

.m-pager-link {
  font-family: var(--m-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--m-ink) !important;
  border: 1px solid var(--m-rule);
  border-radius: 999px;
  padding: 9px 18px;
  text-decoration: none;
}
.m-pager-link:hover { background: #f5f5f5; color: var(--m-ink) !important; }

/* archive grid (posts.njk all-posts) — light cards, Medium-quiet */
.m-grid {
  max-width: var(--m-feed);
  margin: 24px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px 24px;
}
.m-grid__item a { text-decoration: none; color: inherit; display: block; }
.m-grid__thumb {
  height: 150px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
  margin-bottom: 12px;
}
.m-grid__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.m-grid__item a:hover .m-grid__thumb img { transform: scale(1.04); }
.m-grid__title {
  font-family: var(--m-sans);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.32;
  color: var(--m-ink);
  margin: 0;
}
.m-grid__item a:hover .m-grid__title { color: var(--m-brand-d); }

/* =====================================================================
   6. FOOTER  (footer.html) — lighter, quieter
   ===================================================================== */
.footer { font-family: var(--m-sans); }
.footer .text-white,
.footer .copyright__text p,
.footer__social a,
.contact__widget__item__text span { font-family: var(--m-sans); }

/* =====================================================================
   7. FOCUS VISIBLE  (legacy index.css `a:focus{outline:none}` strips the
   keyboard focus ring sitewide — restore it for redesigned controls.
   medium.css loads last, so these win. WCAG 2.4.7.)
   ===================================================================== */
.menu-container .menu ul li a:focus-visible,
.menu-container .menu-dropdown-btn:focus-visible,
.m-feed-item__title a:focus-visible,
.m-grid__item a:focus-visible,
.m-feed-more a:focus-visible,
.m-pager-link:focus-visible,
#post .post-content a:focus-visible,
#post .breadcrumb-item a:focus-visible,
#post a.chip:focus-visible,
.contact-form-section button:focus-visible {
  outline: 2px solid var(--m-brand-d);
  outline-offset: 2px;
  border-radius: 3px;
}

/* =====================================================================
   8. RESPONSIVE
   ===================================================================== */
@media screen and (max-width: 768px) {
  #post .post-title { font-size: 30px; line-height: 1.22; margin-top: 20px; }
  #post .post-content p,
  #post .post-content li { font-size: 19px; }
  #post .post-content h2 { font-size: 25px; }
  #post .post-content h3 { font-size: 21px; }
  article#post { padding-left: 16px; padding-right: 16px; }

  .m-feed-item { gap: 16px; padding: 20px 0; }
  .m-feed-item__thumb { width: 104px; height: 78px; }
  .m-feed-item__title { font-size: 18px; }
  .m-feed-item__dek { display: none; }
  .m-feed-head h1, .m-feed-head h2,
  .section-container .m-feed-head .h2-style { font-size: 24px; }
}
