/*
 * Mikirduit editorial UI v5 — Ghost Source 1.6.1
 * Kept separate from the stock Source CSS to avoid old overriding breakpoints.
 * No JS required. Sidebar-banner image/link remain editable via Ghost Admin.
 */
:root {
    --md-deep: #164d3d;
    --md-deep-hover: #0f3d31;
    --md-text: #18221e;
    --md-muted: #63706b;
    --md-border: #e1e8e3;
    --md-surface: #f5f8f5;
    --md-max-width: 1180px;
}

/* More breathable navigation on both desktop and mobile. */
.gh-navigation:not(.is-stacked) { height: 82px; }
.gh-navigation-inner { min-width: 0; }
.gh-navigation .gh-navigation-logo img { max-height: 42px; }

/* Important: .gh-outer in Ghost defines horizontal padding. Never override it
   with `padding: XXpx 0` or set .gh-inner to max-width:none. */
.md-home { min-width: 0; overflow: clip; color: var(--md-text); }
.md-home > .gh-outer { padding-inline: clamp(20px, 4vw, 56px); }
.md-home > .gh-outer > .gh-inner,
.md-home > .gh-featured > .gh-inner { width: 100%; max-width: var(--md-max-width); margin-inline: auto; min-width: 0; }
.md-home h1,.md-home h2,.md-home h3 { text-wrap: balance; }
.md-home a { text-underline-offset: 3px; }
.md-home a:focus-visible,.md-social a:focus-visible { outline: 3px solid #2d9d71; outline-offset: 3px; }
.md-eyebrow { display: block; color: var(--md-deep); font-size: 11px; font-weight: 750; line-height: 1.5; letter-spacing: .115em; text-transform: uppercase; }

/* Intro: comfortably aligned with the article grid, never screen-flush. */
.md-intro { padding-block: clamp(28px, 3.5vw, 48px) 18px; }
.md-intro h1 { max-width: 940px; margin: 12px 0 12px; font-size: clamp(34px, 3.25vw, 52px); line-height: 1.13; letter-spacing: -.044em; font-weight: 780; }
.md-intro-description { max-width: 750px; color: var(--md-muted); font-size: clamp(15px, 1.1vw, 17px); line-height: 1.65; }
.md-intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 21px; }
.md-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 11px; padding: 11px 20px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 700; line-height: 1.4; text-align: center; text-decoration: none; transition: background-color .18s ease, border-color .18s ease, transform .18s ease; }
.md-button:hover { transform: translateY(-1px); }
.md-button-primary { background: var(--md-deep); color: white !important; }
.md-button-primary:hover { background: var(--md-deep-hover); }
.md-button-secondary { background: #fff; border-color: #c9d5ce; color: var(--md-text) !important; }
.md-button-secondary:hover { border-color: var(--md-deep); }

/* Main editorial lead and six secondary stories. */
.md-top-stories { padding-block: 15px 27px; }
.md-section-kicker { display: flex; align-items: baseline; gap: 14px; border-top: 1px solid var(--md-border); padding-block: 15px 18px; }
.md-section-kicker h2 { font-size: 13px; letter-spacing: .07em; text-transform: uppercase; font-weight: 760; }
.md-section-kicker > span { font-size: 12px; color: var(--md-muted); }
.md-top-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 22px; }
.md-story { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 13px; align-content: start; border-bottom: 1px solid var(--md-border); padding-bottom: 15px; min-width: 0; }
.md-story-image,.md-latest-image { display: block; overflow: hidden; background: #eef3ef; aspect-ratio: 4/3; border-radius: 9px; min-width: 0; }
.md-story-image img,.md-latest-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.md-story-image:hover img,.md-latest-image:hover img { transform: scale(1.035); }
.md-story-content,.md-latest-content { min-width: 0; }
.md-story-tag { display: inline-block; color: var(--md-deep); font-size: 10px; line-height: 1.4; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; text-decoration: none; }
.md-story h3 { font-size: clamp(14px, 1.05vw, 16px); line-height: 1.36; font-weight: 740; letter-spacing: -.018em; margin: 5px 0 6px; }
.md-story h3 a,.md-latest-card h3 a { color: inherit; text-decoration: none; overflow-wrap: break-word; }
.md-story h3 a:hover,.md-latest-card h3 a:hover { color: var(--md-deep); }
.md-story-meta { color: var(--md-muted); font-size: 11px; line-height: 1.5; }
.md-story-lead { display: block; grid-column: 1/span 8; grid-row: 1/span 3; padding: 0; border: none; }
.md-story-lead .md-story-image { aspect-ratio: 1.78; border-radius: 13px; margin-bottom: 15px; }
.md-story-lead h3 { max-width: 820px; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.16; margin: 6px 0 8px; letter-spacing: -.032em; }
.md-story:nth-child(2),.md-story:nth-child(3),.md-story:nth-child(4) { grid-column: 9/-1; }
.md-story:nth-child(n+5) { grid-column: span 4; padding-block: 15px 7px; border-top: 1px solid var(--md-border); border-bottom: none; }
.md-story:nth-child(4) { border-bottom: none; }

/* The featured Ghost cards are already compact; remove Source's 100px gap. */
.md-home .gh-featured { margin: 18px 0 0; padding-block: 17px 12px; }
.md-home .gh-featured-inner { border-top: 1px solid var(--md-border); padding-top: 17px; }
.md-home .gh-featured-title { margin-bottom: 15px; padding-bottom: 0; border: 0; font-size: 13px; font-weight: 750; letter-spacing: .07em; }
.md-home .gh-featured-feed { gap: 22px; }
.md-home .gh-featured-feed .gh-card-title { font-size: 14px; line-height: 1.4; }
.md-home .gh-featured-feed .gh-card-excerpt { display: none !important; }

/* Topic discovery: service-oriented, clear pathways to existing tags. */
.md-topics { margin-top: 34px; padding-block: clamp(33px, 4vw, 51px); background: var(--md-surface); }
.md-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-top: 6px; margin-bottom: 23px; }
.md-heading-row h2 { max-width: 650px; font-size: clamp(24px, 2.5vw, 35px); line-height: 1.2; letter-spacing: -.032em; }
.md-heading-row p { max-width: 290px; font-size: 13px; color: var(--md-muted); line-height: 1.5; }
.md-topic-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.md-topic { display: flex; flex-direction: column; min-width: 0; min-height: 197px; padding: 21px; background: #fff; border: 1px solid var(--md-border); border-radius: 13px; color: var(--md-text) !important; text-decoration: none; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.md-topic:hover { transform: translateY(-2px); border-color: #9dbfac; box-shadow: 0 10px 20px rgb(10 70 43 / .06); }
.md-topic-icon { color: var(--md-deep); font-size: 22px; line-height: 1; }
.md-topic h3 { font-size: 19px; font-weight: 730; margin: 13px 0 7px; }
.md-topic p { font-size: 13px; color: var(--md-muted); line-height: 1.55; flex-grow: 1; }
.md-topic-more { display: inline-block; margin-top: 14px; font-size: 12px; font-weight: 750; color: var(--md-deep); }

/* Latest posts, anchored advertisement, and more content. */
.md-latest { padding-block: 42px 67px; }
.md-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.md-section-heading h2 { font-size: clamp(25px, 2.4vw, 34px); line-height: 1.2; margin-top: 6px; }
.md-text-link,.md-all-articles { font-size: 13px; font-weight: 730; color: var(--md-deep); text-decoration: none; }
.md-text-link:hover,.md-all-articles:hover { text-decoration: underline; }
.md-latest-with-sidebar { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: clamp(25px, 3vw, 42px); align-items: start; }
.md-latest-main,.md-home-sidebar { min-width: 0; }
.md-latest-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 27px 22px; }
.md-latest-card { min-width: 0; border-bottom: 1px solid var(--md-border); padding-bottom: 18px; }
.md-latest-image { aspect-ratio: 1.7; margin-bottom: 12px; }
.md-latest-card h3 { margin: 5px 0 6px; font-size: 17px; line-height: 1.32; letter-spacing: -.018em; }
.md-all-articles { display: inline-flex; align-items: center; gap: 7px; margin-top: 28px; padding: 11px 14px; border: 1px solid #c6d7cd; border-radius: 8px; }
.md-home-sidebar { position: sticky; top: 24px; }
.md-home-sidebar .md-sidebar-banner { display: block; width: 100%; }
.md-home-sidebar .md-sidebar-banner img { width: 100%; height: auto; border-radius: 13px; }
.md-home-sidebar .gh-recommendations { margin-top: 25px; }

/* Sidebar banner and social gateway also appear outside of the homepage. */
.md-social { width: 100%; padding-block: 22px 26px; }
.gh-footer .md-social { padding: 16px 0 27px; }
.gh-footer .md-social .gh-inner { width: 100%; max-width: none; padding: 0; }
.md-social-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.md-social h2 { font-size: 21px; line-height: 1.2; margin: 6px 0 5px; }
.md-social p:not(.md-eyebrow) { font-size: 13px; color: var(--color-secondary-text); line-height: 1.6; max-width: 470px; }
.md-social-links { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.md-social-link { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 9px; text-decoration: none; font-size: 12px; font-weight: 720; text-transform: capitalize; }
.md-social-link:hover { border-color: currentColor; }

/* Pager: removes duplicate content on /page/2 and improves article discovery. */
.md-archive-intro { padding-block: 30px 0; }
.md-archive-intro .gh-inner { max-width: var(--md-max-width); }
.md-archive-intro h1 { margin-top: 9px; font-size: clamp(30px,3vw,42px); letter-spacing: -.03em; }
.md-archive-intro p:not(.md-eyebrow) { max-width: 750px; margin-top: 7px; color: var(--md-muted); font-size: 15px; }
.md-archive .gh-container { margin-top: 24px; }
.md-archive .gh-container-title { display: none; }
.md-archive > .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; align-items: center; margin: 26px auto 50px; padding: 0 20px; font-size: 14px; }
.md-archive > .pagination a { color: var(--md-deep); font-weight: 700; }

@media (max-width: 1080px) {
    .md-top-grid { gap: 16px; }
    .md-story { grid-template-columns: 92px minmax(0,1fr); gap: 11px; }
    .md-story-lead { grid-column: 1/span 7; }
    .md-story:nth-child(2),.md-story:nth-child(3),.md-story:nth-child(4) { grid-column: 8/-1; }
    .md-latest-with-sidebar { grid-template-columns: minmax(0,1fr) 250px; }
    .md-home .gh-featured-feed { gap: 15px; }
}

@media (max-width: 800px) {
    .gh-navigation:not(.is-stacked) { height: 74px; }
    .md-intro { padding-top: 27px; }
    .md-top-grid { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 18px; row-gap: 0; }
    .md-story-lead { grid-column: 1/-1; grid-row: auto; padding-bottom: 23px; border-bottom: 1px solid var(--md-border); margin-bottom: 10px; }
    .md-story:nth-child(n+2) { grid-column: span 1; display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 11px; padding-block: 15px; border-top: 0; border-bottom: 1px solid var(--md-border); }
    .md-story:nth-child(4) { border-bottom: 1px solid var(--md-border); }
    .md-story-lead .md-story-image { aspect-ratio: 1.8; }
    .md-topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .md-heading-row p { display: none; }
    .md-latest-with-sidebar { grid-template-columns: minmax(0,1fr); }
    .md-home-sidebar { position: static; width: min(100%,410px); margin: 15px auto 0; }
    .md-home .gh-featured-feed { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
}

@media (max-width: 640px) {
    .md-home > .gh-outer { padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
    .md-intro { padding-block: 20px 13px; }
    .md-eyebrow { font-size: 10px; line-height: 1.5; letter-spacing: .08em; }
    .md-intro h1 { font-size: clamp(30px, 7.5vw, 38px); line-height: 1.13; letter-spacing: -.037em; margin: 10px 0; }
    .md-intro-description { font-size: 14px; line-height: 1.6; }
    .md-intro-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
    .md-button { min-height: 48px; padding: 11px 9px; border-radius: 9px; font-size: 11px; gap: 5px; }
    .md-section-kicker { padding-block: 13px 14px; }
    .md-section-kicker > span { display: none; }
    .md-top-stories { padding-block: 16px 18px; }
    .md-top-grid { grid-template-columns: minmax(0,1fr); row-gap: 0; }
    .md-story-lead { grid-column: 1/-1; padding-bottom: 19px; margin-bottom: 2px; }
    .md-story-lead .md-story-image { border-radius: 12px; aspect-ratio: 1.68; margin-bottom: 12px; }
    .md-story-lead h3 { font-size: clamp(23px, 6vw, 29px); line-height: 1.2; margin: 6px 0; }
    .md-story:nth-child(n+2) { grid-column: 1/-1; grid-template-columns: minmax(0,1fr) 96px; align-items: center; gap: 12px; padding-block: 14px; }
    .md-story:nth-child(n+2) .md-story-image { grid-column: 2; grid-row: 1; aspect-ratio: 1.16; }
    .md-story:nth-child(n+2) .md-story-content { grid-column: 1; grid-row: 1; }
    .md-story:nth-child(n+2) h3 { font-size: 15px; line-height: 1.32; }
    .md-story-meta { font-size: 10px; }
    .md-home .gh-featured { margin-top: 8px; padding-block: 10px 6px; }
    .md-home .gh-featured-feed { display: flex; flex-direction: column; gap: 16px; }
    .md-home .gh-featured-feed .gh-card { padding-bottom: 14px; border-bottom: 1px solid var(--md-border); }
    .md-home .gh-featured-feed .gh-card-title { font-size: 14px; }
    .md-topics { margin-top: 24px; padding-block: 29px 32px; }
    .md-heading-row { margin: 5px 0 17px; }
    .md-heading-row h2 { font-size: 25px; }
    .md-topic-grid { gap: 10px; }
    .md-topic { min-height: 175px; padding: 15px 12px; border-radius: 11px; }
    .md-topic-icon { font-size: 19px; }
    .md-topic h3 { margin: 10px 0 5px; font-size: 17px; }
    .md-topic p { font-size: 11.5px; line-height: 1.5; }
    .md-topic-more { font-size: 11px; line-height: 1.4; }
    .md-latest { padding-block: 30px 48px; }
    .md-section-heading { margin-bottom: 10px; }
    .md-section-heading h2 { font-size: 26px; }
    .md-text-link { white-space: nowrap; font-size: 12px; }
    .md-latest-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
    .md-latest-card { display: grid; grid-template-columns: 99px minmax(0,1fr); align-items: center; gap: 13px; padding-block: 15px; }
    .md-latest-image { width: 99px; aspect-ratio: 1.13; border-radius: 9px; margin-bottom: 0; }
    .md-latest-card h3 { font-size: 15px; line-height: 1.33; }
    .md-home-sidebar { border-top: 1px solid var(--md-border); padding-top: 23px; margin-top: 24px; }
    .md-home-sidebar .md-sidebar-banner { max-width: 340px; margin: 0 auto; }
    .md-all-articles { margin-top: 19px; }
    .md-social-inner { flex-direction: column; align-items: flex-start; gap: 15px; }
    .md-social-links { gap: 7px; }
    .md-social-link { padding: 8px 10px; }
}

@media (max-width: 375px) {
    .md-home > .gh-outer { padding-inline: 18px; }
    .md-intro-actions { grid-template-columns: minmax(0,1fr); }
    .md-button { font-size: 12px; }
    .md-story:nth-child(n+2) { grid-template-columns: minmax(0,1fr) 82px; gap: 10px; }
    .md-story:nth-child(n+2) .md-story-image { width: 82px; }
    .md-latest-card { grid-template-columns: 84px minmax(0,1fr); gap: 10px; }
    .md-latest-image { width: 84px; }
    .md-topic { padding: 13px 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .md-button,.md-topic,.md-story-image img,.md-latest-image img { transition: none; }
    .md-button:hover,.md-topic:hover { transform: none; }
}
