/* ==========================================================================
   Untold Story of Pakistan: blog, article and shared component styles.
   Loaded after untold.css. Brand colours come from the :root tokens there.
   ========================================================================== */

/* ---------- Homepage tile text: keep cards tidy ---------- */
.story-content p,
.mini-story-card p,
.card-copy p,
.city-card p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.story-content h3,
.mini-story-card h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}
.culture-card strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.15;
    margin-bottom: 4px;
}
.culture-card span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ---------- Header extras ---------- */
.search-btn { display: grid; place-items: center; color: var(--green); border: 1px solid rgba(7, 63, 52, .12) !important; }
.search-btn:hover { background: var(--cream); }
.header-search { position: absolute; left: 0; right: 0; top: 100%; background: #fbfaf5; border-bottom: 1px solid rgba(7, 63, 52, .1); box-shadow: 0 18px 30px rgba(7, 63, 52, .08); padding: 16px 0; }
.header-search[hidden] { display: none; }
.header-search .container { display: flex; gap: 10px; }
.header-search input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 13px 20px; font: inherit; font-size: 15px; background: #fff; }
.header-search input:focus { outline: 2px solid rgba(7, 63, 52, .25); border-color: var(--green); }
.header-search button { border: 0; background: var(--green); color: #fff; border-radius: 999px; padding: 0 24px; font: inherit; font-weight: 700; cursor: pointer; }

.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; display: none; }
.has-progress .read-progress { display: block; }
.read-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #e8c17d); }

/* ---------- Shared bits ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: #7a847f; margin-bottom: 22px; }
.breadcrumbs a { color: var(--green); font-weight: 600; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span { color: #a7ada9; }
.breadcrumbs--light, .breadcrumbs--light span { color: rgba(255, 255, 255, .7); }
.breadcrumbs--light a { color: #fff; }

.aside-card { background: #fff; border: 1px solid #e8e1d4; border-radius: 14px; padding: 22px; }
.aside-card h3 { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--green); margin: 0 0 14px; }

.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chips a { font-size: 13px; font-weight: 600; color: var(--green); background: var(--cream); border-radius: 999px; padding: 7px 13px; transition: .2s; }
.topic-chips a:hover { background: var(--green); color: #fff; }

/* ---------- Post card (journal, latest, related) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.post-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #ebe4d8; border-radius: 14px; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(25, 45, 38, .12); }
.post-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #e9e3d6; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-card-media img { transform: scale(1.05); }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.post-card-tag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9a6f28; }
.post-card-tag:hover { color: var(--green); }
.post-card h3 { font-family: 'Playfair Display', serif; font-size: 22px; line-height: 1.2; font-weight: 600; color: #153f34; margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.post-card h3 a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s; }
.post-card h3 a:hover { background-size: 100% 1px; }
.post-card p { margin: 0; font-size: 14.5px; line-height: 1.6; color: #5f6a65; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.post-card-meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: #8a938f; }
.post-card-meta > * + *::before { content: "·"; margin-right: 14px; color: #c2c7c4; }

/* Lead (first) story on the journal page */
.post-card--lead { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); margin-bottom: 34px; }
.post-card--lead .post-card-media { aspect-ratio: auto; height: 460px; }
.post-card--lead .post-card-body { padding: 44px 44px 40px; justify-content: center; gap: 16px; }
.post-card--lead h3 { font-size: 38px; line-height: 1.1; -webkit-line-clamp: 4; }
.post-card--lead p { font-size: 16.5px; -webkit-line-clamp: 4; }
.post-card--lead .post-card-meta { margin-top: 8px; }

/* ---------- Homepage: latest stories ---------- */
.latest-section { background: var(--paper); }
.latest-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; align-items: start; }
.latest-layout .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.latest-layout .post-card h3 { font-size: 19px; }
.latest-layout .post-card p { font-size: 13.5px; -webkit-line-clamp: 2; }
.latest-aside { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 110px; }

/* ---------- Ad slots ---------- */
.ad-slot { display: block; margin: 0 auto; text-align: center; }
.ad-label { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #a3a9a6; margin-bottom: 6px; }
.ad-band { margin: 6px auto 34px; max-width: 970px; }
.section + .container > .ad-band, .container > .ad-band:only-child { margin: 0 auto; padding: 10px 0 40px; }
.ad-inline { margin: 34px 0; }
.ad-in-grid { grid-column: 1 / -1; margin: 6px 0; }
.ad-tall .ad-box { min-height: 280px; }
.ad-placeholder .ad-box { min-height: 110px; border: 2px dashed #d6ccb9; border-radius: 12px; background: repeating-linear-gradient(45deg, #faf6ee, #faf6ee 12px, #f5efe3 12px, #f5efe3 24px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 18px; color: #8c7b5a; }
.ad-placeholder .ad-box strong { font-size: 14px; }
.ad-placeholder .ad-box small { font-size: 12px; color: #a39477; }

/* ---------- Journal (stories index) ---------- */
.journal-hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(200, 154, 80, .22), transparent 60%), linear-gradient(135deg, #0a4a3d, #062f28); color: #fff; padding: 46px 0 54px; }
.journal-hero .breadcrumbs, .journal-hero .breadcrumbs span { color: rgba(255, 255, 255, .6); }
.journal-hero .breadcrumbs a { color: #fff; }
.journal-hero h1 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 58px; line-height: 1.05; margin: 10px 0 14px; max-width: 900px; }
.journal-hero p { font-size: 17px; color: rgba(255, 255, 255, .8); max-width: 680px; margin: 0 0 28px; }
.journal-search { display: flex; align-items: center; gap: 10px; max-width: 620px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 20px; color: #6d7672; box-shadow: 0 20px 40px rgba(0, 0, 0, .18); }
.journal-search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 15px; padding: 10px 4px; color: var(--ink); min-width: 0; background: transparent; }
.journal-search button { border: 0; background: var(--green); color: #fff; border-radius: 999px; padding: 12px 24px; font: inherit; font-weight: 700; cursor: pointer; }
.journal-search button:hover { background: var(--green2); }

.topic-bar { background: #fbfaf5; border-bottom: 1px solid #e8e1d4; position: sticky; top: 86px; z-index: 20; }
.topic-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0; scrollbar-width: none; }
.topic-scroll::-webkit-scrollbar { display: none; }
.topic-scroll a { flex: none; font-size: 13.5px; font-weight: 600; color: #3b4c46; padding: 8px 16px; border-radius: 999px; border: 1px solid #e0d8c9; background: #fff; transition: .2s; }
.topic-scroll a:hover { border-color: var(--green); color: var(--green); }
.topic-scroll a.is-active { background: var(--green); border-color: var(--green); color: #fff; }

.journal-section { padding: 42px 0 70px; background: var(--paper); }
.results-note { margin: 0 0 22px; color: #5f6a65; font-size: 15px; }
.results-note a { color: var(--green); font-weight: 700; }
.archive-empty a { color: var(--green); font-weight: 700; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 46px; padding-top: 26px; border-top: 1px solid #e8e1d4; }
.pager-pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pager-btn, .pager-page, .pager-dots { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.pager-btn { border: 1px solid #dcd3c3; color: var(--green); background: #fff; }
.pager-btn:hover { border-color: var(--green); }
.pager-btn.is-disabled { opacity: .4; }
.pager-page { padding: 0; color: #3b4c46; }
.pager-page:hover { background: var(--cream); }
.pager-page.is-current { background: var(--green); color: #fff; }
.pager-dots { padding: 0; color: #a3a9a6; }

.newsletter-band { background: var(--cream); padding: 54px 0; }
.newsletter-band .container { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.newsletter-band .eyebrow { color: #9a6f28; margin-bottom: 8px; }
.newsletter-band h2 { font-family: 'Playfair Display', serif; font-size: 32px; color: var(--green); margin: 0 0 6px; font-weight: 600; }
.newsletter-band p { margin: 0; color: #5f6a65; }
.newsletter-band .newsletter { flex: 0 0 420px; margin: 0; }
.newsletter-band .newsletter input { border: 1px solid #dcd3c3; }
.newsletter-band .newsletter button { background: var(--green); }

/* ---------- Article page ---------- */
.post-hero { background: linear-gradient(180deg, #f6f1e8 0, #f6f1e8 72%, var(--paper) 72%); padding-top: 38px; }
.post-hero-inner { max-width: 900px; text-align: center; }
.post-hero .breadcrumbs { justify-content: center; }
.post-tag { display: inline-block; background: #d5a852; color: #173a31; border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.post-hero h1 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 54px; line-height: 1.08; color: #153f34; margin: 18px 0 16px; letter-spacing: -.01em; }
.post-dek { font-size: 19px; line-height: 1.6; color: #5b6661; max-width: 760px; margin: 0 auto; }
.post-byline { display: inline-flex; align-items: center; gap: 12px; margin: 26px 0 34px; text-align: left; }
.post-byline .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #e8c17d; display: grid; place-items: center; font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; }
.post-byline strong { display: block; color: var(--ink); font-size: 14.5px; }
.post-byline span { font-size: 13.5px; color: #7a847f; }
.post-byline a { color: var(--green); font-weight: 600; }
.post-cover { margin: 0 auto; }
.post-cover img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 18px; box-shadow: 0 30px 60px rgba(25, 45, 38, .18); }

.post-layout { display: grid; grid-template-columns: 56px minmax(0, 720px) 320px; justify-content: center; gap: 48px; padding: 52px 0 70px; }
.post-share { position: sticky; top: 120px; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.post-share span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9aa19d; writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 4px; }
.post-share a, .post-share button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #e0d8c9; background: #fff; display: grid; place-items: center; font: inherit; font-size: 13px; font-weight: 700; color: var(--green); cursor: pointer; transition: .2s; }
.post-share a:hover, .post-share button:hover, .post-share .is-copied { background: var(--green); color: #fff; border-color: var(--green); }

.post-main { min-width: 0; }
.post-body { font-size: 18px; line-height: 1.85; color: #26302c; }
.post-body > p:first-child::first-letter { float: left; font-family: 'Playfair Display', serif; font-size: 74px; line-height: .82; padding: 8px 12px 0 0; color: var(--green); font-weight: 700; }
.post-body p { margin: 0 0 1.35em; }
.post-body h2 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 32px; line-height: 1.2; color: #153f34; margin: 1.8em 0 .6em; scroll-margin-top: 110px; }
.post-body h3 { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 24px; color: #153f34; margin: 1.6em 0 .5em; }
.post-body strong { color: #153f34; }
.post-body ul, .post-body ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.post-body li { margin-bottom: .45em; }
.post-body li::marker { color: var(--gold); }
.post-body blockquote { margin: 2em 0; padding: 26px 30px 26px 34px; background: var(--cream); border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; font-family: 'Playfair Display', serif; font-style: italic; font-size: 23px; line-height: 1.5; color: #153f34; }
.post-body blockquote p:last-child { margin: 0; }
.post-body img { border-radius: 12px; margin: 1.5em 0; }

.post-footer { margin-top: 42px; padding-top: 26px; border-top: 1px solid #e8e1d4; display: flex; flex-direction: column; gap: 18px; }
.post-footer-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-footer-tags a, .post-footer-tags span { background: var(--cream); color: var(--green); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; }
.post-footer-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: #5f6a65; }
.post-footer-share a { border: 1px solid #dcd3c3; border-radius: 999px; padding: 7px 16px; font-weight: 700; color: var(--green); }
.post-footer-share a:hover { background: var(--green); color: #fff; border-color: var(--green); }

.post-sidebar { display: flex; flex-direction: column; gap: 24px; align-self: start; position: sticky; top: 110px; }
.toc-card ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: flex; flex-direction: column; gap: 2px; }
.toc-card li { counter-increment: toc; }
.toc-card a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 14px; line-height: 1.4; color: #4a5752; border-left: 2px solid transparent; }
.toc-card a::before { content: counter(toc, decimal-leading-zero); font-size: 12px; font-weight: 700; color: #b7a37d; padding-top: 2px; }
.toc-card a:hover { background: var(--cream); }
.toc-card a.is-active { background: var(--cream); color: var(--green); font-weight: 700; border-left-color: var(--gold); }
.popular-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.popular-list a { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; }
.popular-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: #e9e3d6; }
.popular-list strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-family: 'Playfair Display', serif; font-size: 15.5px; line-height: 1.3; color: #153f34; }
.popular-list a:hover strong { text-decoration: underline; }
.popular-list small { display: block; font-size: 12.5px; color: #8a938f; margin-top: 3px; }
.related-section .section-head { margin-bottom: 24px; }

/* ---------- City page ---------- */
.page-city .detail-hero { min-height: 480px; }
.page-city .detail-body { background: var(--paper); }
.page-city .detail-grid aside { background: none; padding: 0; border-radius: 0; }
.page-city .detail-grid article h2 { margin-top: 0; }
.city-story-links a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #ece5d8; font-weight: 600; color: #153f34; }
.city-story-links a:last-child { border-bottom: 0; }
.city-story-links a:hover { color: #9a6f28; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .post-layout { grid-template-columns: 48px minmax(0, 1fr) 290px; gap: 36px; }
    .latest-layout { grid-template-columns: minmax(0, 1fr) 280px; }
    .latest-layout .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .post-layout { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 auto; }
    .post-share { position: static; flex-direction: row; justify-content: flex-start; order: 2; }
    .post-share span { writing-mode: horizontal-tb; transform: none; margin: 0 6px 0 0; }
    .post-sidebar { position: static; order: 3; }
    .post-main { order: 1; }
    .post-card--lead { grid-template-columns: 1fr; }
    .post-card--lead .post-card-media { height: auto; aspect-ratio: 16 / 9; }
    .post-card--lead .post-card-body { padding: 28px; }
    .post-card--lead h3 { font-size: 30px; }
    .latest-layout { grid-template-columns: 1fr; }
    .latest-aside { position: static; }
    .post-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .newsletter-band .container { flex-direction: column; align-items: flex-start; }
    .newsletter-band .newsletter { flex: none; width: 100%; }
    .page-city .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .topic-bar { top: 74px; }
    .journal-hero { padding: 30px 0 40px; }
    .journal-hero h1 { font-size: 40px; }
    .post-hero { padding-top: 26px; }
    .post-hero h1 { font-size: 36px; }
    .post-dek { font-size: 17px; }
    .post-cover img { aspect-ratio: 4 / 3; border-radius: 12px; }
    .post-body { font-size: 17px; }
    .post-body h2 { font-size: 27px; }
    .post-body blockquote { font-size: 20px; padding: 20px 22px; }
    .post-grid, .post-grid--3, .latest-layout .post-grid { grid-template-columns: 1fr; }
    .post-card h3 { font-size: 21px; }
    .pager { flex-wrap: wrap; justify-content: center; }
    .header-search .container { flex-direction: column; }
    .header-search button { padding: 12px; }
}
@media (max-width: 520px) {
    .journal-search { padding-left: 14px; }
    .journal-search button { padding: 11px 16px; }
    .post-hero h1 { font-size: 31px; }
    .post-card--lead h3 { font-size: 25px; }
    .post-card--lead .post-card-body { padding: 22px; }
    .newsletter-band h2 { font-size: 26px; }
}
