/*
Theme Name: Betting Khabar | Edition
Description: Persian RTL magazine theme for Betting Khabar.
Version: 1.1.0
Text Domain: bettingkhabar-edition
*/
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 100; font-display: swap; src: url('assets/fonts/IRANSansX-Thin.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 200; font-display: swap; src: url('assets/fonts/IRANSansX-UltraLight.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 300; font-display: swap; src: url('assets/fonts/IRANSansX-Light.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/IRANSansX-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/IRANSansX-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/IRANSansX-DemiBold.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/IRANSansX-Bold.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 800; font-display: swap; src: url('assets/fonts/IRANSansX-ExtraBold.woff2') format('woff2'); }
@font-face { font-family: 'IRANSansX'; font-style: normal; font-weight: 900; font-display: swap; src: url('assets/fonts/IRANSansX-Black.woff2') format('woff2'); }

body.bk-edition {
    --paper: #131619;
    --panel: #1b2024;
    --deep: #101214;
    --ink: #faf8f3;
    --subtle: #c3c7c9;
    --line: #383d3f;
    --accent: #ffbc55;
    --type: 'IRANSansX', IRANSans, Vazirmatn, Tahoma, Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
    margin: 0;
}
.bk-surface, .bk-surface :is(h1,h2,h3,h4,p,button,input,textarea,select) { font-family: var(--type); }
.bk-surface { color: var(--ink); line-height: 1.7; text-align: start; }
.bk-surface *, .bk-surface *::before, .bk-surface *::after { box-sizing: border-box; }
.bk-surface a { color: inherit; text-decoration: none; }
.bk-surface a:hover { color: var(--accent); }
.bk-surface :is(a,button,input,textarea,summary):focus-visible, .bk-skip:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.bk-shell { width: min(1240px, calc(100% - 72px)); margin-inline: auto; min-width: 0; }
.bk-sr, .bk-skip:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.bk-skip:focus { position: absolute; z-index: 100; background: #171717; color: white; padding: .6em 1em; }
.bk-mast { background: var(--deep); }
.bk-nameplate { display: flex; gap: 24px; align-items: center; padding-block: 16px; }
.bk-brand { display: inline-flex; align-items: center; gap: 15px; margin-inline-end: auto; }
.bk-brand img { width: clamp(86px, 10vw, 126px); height: auto; display: block; }
.bk-brand span, .bk-footer-name { font-weight: 900; font-size: clamp(1.65rem, 3.4vw, 2.7rem); line-height: 1.3; color: var(--ink); }
.bk-utility ul, .bk-footer ul { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; gap: .5rem 1.3rem; }
.bk-utility a, .bk-footer nav a, .bk-resources a { font-size: .86rem; font-weight: 550; color: var(--subtle); }
.bk-utility .current-menu-item > a { color: var(--accent); }
.bk-search { position: relative; }
.bk-search summary { display: flex; align-items: center; gap: .6rem; padding: .43rem .85rem; border: 1px solid #52575b; border-radius: 5px; font-size: .85rem; font-weight: 650; cursor: pointer; }
.bk-search summary::-webkit-details-marker { display: none; }
.bk-search i { display: block; width: .85rem; height: .85rem; border-radius: 50%; border: 1.6px solid currentColor; position: relative; }
.bk-search i::after { content: ''; position: absolute; height: 1.6px; width: .38rem; background: currentColor; left: -.28rem; bottom: -.1rem; transform: rotate(-48deg); }
.bk-searchform { display: flex; gap: .5rem; align-items: stretch; max-width: 26rem; }
.bk-searchform label { flex: 1; min-width: 0; }
.bk-searchform input, .bk-comments :is(input:not([type="checkbox"]),textarea) { width: 100%; background: #111517; border: 1px solid #666f73; color: var(--ink); padding: .65rem; font: inherit; border-radius: 4px; }
.bk-searchform button, .bk-comments input[type="submit"] { border: 0; background: var(--accent); color: #211a0e; font-weight: 750; border-radius: 4px; padding: .5rem .8rem; cursor: pointer; }
.bk-search .bk-searchform { position: absolute; z-index: 15; top: calc(100% + 7px); inset-inline-end: 0; width: min(310px, 83vw); padding: .7rem; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 25px #0005; }
.bk-topic-nav { background: var(--panel); border-block: 1px solid var(--line); }
.bk-topic-row { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem 1.85rem; position: relative; }
.bk-topic-row a { display: inline-flex; align-items: center; min-height: 46px; font-size: .85rem; font-weight: 650; white-space: nowrap; }
.bk-topic-row a[aria-current] { color: var(--accent); box-shadow: inset 0 -2px var(--accent); }

body.bk-edition main.bk-main { margin: 0; padding: clamp(18px, 2.4vw, 32px) 0 clamp(36px, 5vw, 70px); width: 100%; max-width: none; background: var(--paper); }
.bk-cover-grid { display: grid; grid-template-columns: 1.55fr 1fr; grid-auto-rows: minmax(160px, auto); gap: 10px; margin-bottom: clamp(30px, 4vw, 52px); }
.bk-story { isolation: isolate; position: relative; min-width: 0; }
.bk-feature { display: grid; align-items: end; border: 1px solid #3a4046; border-radius: 6px; overflow: hidden; min-height: 176px; background: linear-gradient(130deg, #32434b, #1b252a 60%, #14191d); }
.bk-feature.is-lead { grid-row: span 2; min-height: clamp(355px, 36vw, 460px); }
.bk-art { overflow: hidden; }
.bk-feature .bk-art, .bk-feature::after { position: absolute; inset: 0; z-index: -2; }
.bk-art img, .bk-article-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bk-feature::after { content: ''; z-index: -1; background: linear-gradient(to top, #090b10f7 0%, #0b0e14d9 26%, #0e111b42 74%, #070b1112); pointer-events: none; }
.bk-feature.is-lead::after { background: linear-gradient(0deg, #080b14fa 0%, #0a101ad9 26%, #0a102640 74%, #080b1417); }
.bk-feature .bk-story-content { padding: clamp(14px, 2vw, 27px); }
.bk-feature.is-lead .bk-story-content { padding: clamp(19px, 3vw, 37px); }
.bk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .48rem .8rem; font-size: .75rem; font-weight: 550; color: var(--subtle); }
.bk-meta time { white-space: nowrap; }
.bk-meta a.bk-category { color: var(--accent); font-weight: 750; position: relative; z-index: 2; }
.bk-feature .bk-meta { color: #e8e8e6; }
.bk-feature .bk-category { background: #121416d9; border-inline-start: 3px solid var(--accent); padding: .05rem .5rem; }
.bk-story h2 { color: var(--ink); margin: .45rem 0 0; font-size: clamp(1.12rem, 1.68vw, 1.48rem); font-weight: 800; line-height: 1.58; }
.bk-story.is-lead h2 { max-width: 24em; font-weight: 900; font-size: clamp(1.7rem, 3.05vw, 2.75rem); line-height: 1.46; }
.bk-story-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.bk-story p { color: var(--subtle); margin: .55rem 0 0; font-size: .9rem; line-height: 1.95; text-align: start; }
.bk-feature p { color: #e1e4e9; }
.bk-feature:focus-within { outline: 2px solid var(--accent); }
.bk-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 27%); gap: clamp(22px, 4vw, 58px); align-items: start; }
.bk-columns > * { min-width: 0; }
.bk-rule, .bk-side h2 { display: flex; gap: .8rem; align-items: center; margin: 0 0 1rem; font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 850; }
.bk-rule::before, .bk-side h2::before { content: ''; display: block; width: 6px; height: 1.07em; transform: skew(-11deg); background: var(--accent); }
.bk-rule::after { content: ''; flex: 1; border-block-start: 1px solid var(--line); }
.bk-feed { display: grid; }
.bk-feed-story { padding: 1.25rem 0; border-block-end: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; }
.bk-feed-story .bk-art { width: clamp(90px, 16vw, 175px); aspect-ratio: 1.48; flex: none; border-radius: 4px; }
.bk-feed-story .bk-story-content { flex: 1; min-width: 0; }
.bk-feed-story h2 { margin-block-start: .25rem; }
.bk-feed-story p { margin-block-start: .25rem; }
.bk-side-box { padding: clamp(15px, 2vw, 25px); background: var(--panel); border: 1px solid var(--line); border-radius: 5px; }
.bk-side h2 { font-size: 1.13rem; }
.bk-side nav { display: grid; }
.bk-side nav a { display: flex; justify-content: space-between; gap: .75rem; align-items: center; border-block-start: 1px solid var(--line); padding: .66rem 0; font-size: .87rem; }
.bk-side nav a::after { content: ''; width: 7px; height: 7px; border: solid var(--accent); border-width: 0 0 1.5px 1.5px; transform: rotate(45deg); }
.bk-banner { display: block; margin-block-start: 1rem; padding: .85rem; background: #080808; border: 1px solid var(--line); border-radius: 5px; }
.bk-banner img { width: 100%; max-width: 300px; height: auto; display: block; margin-inline: auto; }
.bk-page-head { padding-block: .35rem clamp(20px, 2.3vw, 35px); border-block-end: 1px solid var(--line); margin-block-end: clamp(16px, 2vw, 25px); }
.bk-page-head h1 { color: var(--ink); font-size: clamp(1.7rem, 3.8vw, 3.3rem); font-weight: 900; line-height: 1.45; margin: .12em 0; }
.bk-page-head .bk-meta { margin-block-end: .75rem; }
.bk-page-head p, .bk-prose { color: #d9dbdc; line-height: 2.05; }
.bk-prose { font-size: clamp(1rem, 1.3vw, 1.08rem); overflow-wrap: anywhere; max-width: 78ch; }
.bk-prose p { text-align: start; margin: 0 0 1.15em; }
.bk-prose :is(h2,h3,h4) { color: var(--ink); font-weight: 800; line-height: 1.65; margin: 1.45em 0 .6em; }
.bk-prose h2 { font-size: clamp(1.27rem, 2.35vw, 1.85rem); }
.bk-prose h3 { font-size: 1.2em; }
.bk-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: .22em; }
.bk-prose :is(img,video,iframe) { max-width: 100%; }
.bk-prose img { height: auto; }
.bk-prose :is(table,pre), .bk-prose .wp-block-table { display: block; max-width: 100%; overflow-x: auto; }
.bk-prose :is(td,th) { border: 1px solid var(--line); padding: .6em; }
.bk-article-photo { aspect-ratio: 2.35; margin-bottom: 1.5rem; border-radius: 5px; overflow: hidden; }
.bk-home-copy { padding-top: 1rem; }
.bk-comments { margin-block-start: 2rem; }
.bk-comments :is(input:not([type="checkbox"]),textarea) { max-width: 32rem; }
.bk-comments input[type="submit"] { width: auto; }
.bk-footer { background: var(--deep); border-block-start: 2px solid #746445; padding: clamp(22px, 3.5vw, 45px) 0; }
.bk-footer-inner { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 1.4rem 2rem; }
.bk-footer-name { font-size: 1.65rem; }
.bk-footer p { color: var(--subtle); font-size: .83rem; margin: .3rem 0 0; max-width: 34ch; }
.bk-resources { display: grid; gap: .4rem; }
.bk-surface .pagination { margin: 1.5rem 0; }
.bk-surface .page-numbers { padding: .3rem .6rem; }
@media (max-width: 850px) {
    .bk-shell { width: calc(100% - 36px); }
    .bk-columns { grid-template-columns: 1fr; }
    .bk-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); align-items: start; gap: 1rem; }
    .bk-banner { margin: 0; }
    .bk-topic-row { gap: 0 1.2rem; }
    .bk-feature.is-lead { min-height: 340px; }
}
@media (max-width: 660px) {
    .bk-shell { width: calc(100% - 28px); }
    .bk-nameplate { flex-wrap: wrap; gap: .55rem 1rem; padding-block: .65rem; }
    .bk-brand { gap: .55rem; }
    .bk-brand img { width: 78px; }
    .bk-brand span { font-size: 1.48rem; }
    .bk-utility { order: 3; flex: 0 0 100%; }
    .bk-utility ul { gap: .35rem 1.2rem; }
    .bk-topic-row { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-inline: 14px; scrollbar-width: thin; scrollbar-color: #615948 var(--panel); }
    .bk-topic-row a { min-height: 44px; font-size: .8rem; }
    .bk-cover-grid { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 8px; }
    .bk-feature, .bk-feature.is-lead { grid-row: auto; }
    .bk-feature.is-lead { min-height: 315px; }
    .bk-feature:not(.is-lead) { display: flex; flex-direction: row-reverse; align-items: stretch; min-height: 112px; background: var(--panel); }
    .bk-feature:not(.is-lead) .bk-art { position: static; width: 28%; min-width: 78px; flex: none; z-index: auto; }
    .bk-feature:not(.is-lead)::after { display: none; }
    .bk-feature:not(.is-lead) .bk-story-content { flex: 1; min-width: 0; padding: .75rem; align-self: center; }
    .bk-feature:not(.is-lead) h2 { font-size: 1rem; }
    .bk-feature:not(.is-lead) .bk-meta time { color: var(--subtle); }
    .bk-feature:not(.is-lead) .bk-category { border: 0; padding: 0; background: transparent; }
    .bk-feed-story { gap: .65rem; padding-block: 1rem; }
    .bk-meta { gap: .2rem .55rem; }
    .bk-story p { font-size: .87rem; }
    .bk-footer-inner { display: grid; }
}

/* Scope these rules to the new templates so the legacy global article CSS
   cannot cap cover photos or stretch Persian headlines. */
body.bk-edition .bk-surface :is(.bk-art, .bk-article-photo) img {
    display: block;
    width: 100%;
    max-width: 100% !important;
    height: 100%;
    object-fit: cover;
}
body.bk-edition .bk-surface :is(.bk-story-content, .bk-story h2, .bk-story-link, .bk-page-head h1, .bk-rule, .bk-prose p) {
    text-align: start !important;
    word-spacing: normal;
}
body.bk-edition .bk-surface :is(.bk-meta, .bk-meta time, .bk-category, .bk-side a, .bk-utility a, .bk-topic-row a) {
    font-family: var(--type);
    word-spacing: normal;
}
