/* ==========================================================================
   FEATURES.CSS — Mega Menu, Author Box, Related Posts, Sticky Share,
   Reading Progress Bar, Web Stories, Footer Tags, Accessibility.
   ========================================================================== */

/* --- Accessibility: Skip to content --- */
.screen-reader-text {
    position: absolute !important;
    left: -9999px;
    top: -9999px;
}
.pkp-skip-link:focus {
    position: fixed;
    left: 10px;
    top: 10px;
    z-index: 100000;
    background: #111111;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
}

/* --- Mega Menu: dropdown for menu-item-has-children --- */
.main-horizontal-menu li.menu-item-has-children { position: relative; }
.main-horizontal-menu li.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
    margin-left: 6px;
    vertical-align: middle;
}
.main-horizontal-menu .sub-menu {
    display: none;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-radius: 0 0 6px 6px;
    z-index: 200;
    padding: 6px 0;
}
.main-horizontal-menu li.menu-item-has-children:hover > .sub-menu,
.main-horizontal-menu li.menu-item-has-children:focus-within > .sub-menu,
.main-horizontal-menu li.menu-item-has-children.pkp-touch-open > .sub-menu {
    display: block;
}
.main-horizontal-menu .sub-menu li { background: #ffffff !important; }
.main-horizontal-menu .sub-menu li a {
    color: #111111 !important;
    background: #ffffff !important;
    padding: 10px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap;
}
.main-horizontal-menu .sub-menu li a:hover {
    background: #f1f5f9 !important;
    color: #e10600 !important;
}

/* --- Reading Progress Bar --- */
.pkp-reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: #e10600;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* --- Sticky Share Buttons --- */
.pkp-share-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    position: sticky;
    top: 90px;
    z-index: 50;
    margin-bottom: 18px;
    background: transparent;
}
.pkp-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
}
.pkp-share-btn svg { width: 18px; height: 18px; fill: currentColor; }
.pkp-share-btn:hover { transform: scale(1.1); }
.pkp-share-fb { background: #1877f2; }
.pkp-share-wa { background: #25d366; }
.pkp-share-tg { background: #229ed9; }
.pkp-share-x  { background: #111111; }

@media (max-width: 1300px) {
    .pkp-share-buttons {
        position: static;
    }
}

/* --- Author Box --- */
.pkp-author-box {
    display: flex;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px;
    margin: 25px 0;
    align-items: flex-start;
}
.pkp-author-avatar img { border-radius: 50%; display: block; }
.pkp-author-label {
    font-size: 11px;
    font-weight: 700;
    color: #e10600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pkp-author-name { margin: 2px 0 8px 0; font-size: 16px; }
.pkp-author-name a { color: #111111; text-decoration: none; }
.pkp-author-bio { font-size: 13px; color: #475569; line-height: 1.6; margin: 0 0 8px 0; }
.pkp-author-link { font-size: 12px; font-weight: 700; color: #e10600; text-decoration: none; }

/* --- Related Posts --- */
.pkp-related-posts-section { margin: 30px 0; }
.pkp-related-posts-title {
    font-size: 18px;
    font-weight: 800;
    border-bottom: 2px solid #e10600;
    padding-bottom: 10px;
    margin: 0 0 18px 0;
}
.pkp-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.pkp-related-post-card { display: block; }
.pkp-related-post-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9 !important;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
    margin-bottom: 8px;
}
.pkp-related-post-thumb img { width: 100% !important; height: 100% !important; aspect-ratio: 16 / 9 !important; object-fit: cover !important; display: block !important; }
.pkp-related-post-title { font-size: 13px; font-weight: 700; line-height: 1.4; margin: 0 0 6px 0; }
.pkp-related-post-title a { color: #1e293b; text-decoration: none; }
.pkp-related-post-date { font-size: 11px; color: #94a3b8; }

@media (max-width: 991px) {
    .pkp-related-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Web Stories Strip (Homepage) --- */
.pkp-web-stories-section {
    background: #ffffff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.pkp-web-stories-title { font-size: 15px; font-weight: 800; margin: 0 0 12px 0; color: #111111; }
.pkp-web-stories-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.pkp-story-card {
    flex: 0 0 auto;
    width: 100px;
    text-decoration: none;
    text-align: center;
}
.pkp-story-thumb {
    width: 100px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    border: 3px solid #e10600;
}
.pkp-story-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pkp-story-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pkp-web-stories-empty {
    width: 100%;
    margin: 0;
    padding: 18px 0;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

/* --- Generic Ad Slot wrapper (keeps ad network markup centered/contained) ---
   PERF FIX (mobile CLS 0.422 -> reserved space): pehle is slot ki koi
   min-height nahi thi, isliye jab tak AdSense ka ad load hoke render nahi
   hota, container ki height 0 rehti thi — aur jaise hi ad load hota tha,
   page achanak neeche shift ho jaata tha (layout shift). Ab har slot ke
   liye uske ASAL ad-format ke hisaab se sahi size reserve ki gayi hai
   (neeche 3 groups mein baanta gaya hai), taaki reserved space aur asal
   ad ka size match kare — na zyada khaali jagah bache, na layout shift ho. */
.pkp-ad-slot { display: block; width: 100%; text-align: center; overflow: hidden; }

/* GROUP 1: Fixed 300x250 boxes (dono sidebar ad) — inka size ab code me
   bhi FIXED hai (width:300px;height:250px), isliye box ko bhi exactly
   utna hi rakhte hain — na ye poori chaudai (100%) tak stretch ho, na
   koi extra khaali jagah bache (jaise pehle 297x600 ban jaata tha). */
.pkp-ad-slot.pkp-ad-sidebar_300x250,
.pkp-ad-slot.pkp-ad-sidebar_secondary {
    width: 300px;
    height: 250px;
    max-width: 100%; /* chhoti mobile screen par bhi na toote */
    margin-left: auto;
    margin-right: auto;
}
.pkp-ad-slot.pkp-ad-sidebar_300x250 .adsbygoogle,
.pkp-ad-slot.pkp-ad-sidebar_secondary .adsbygoogle {
    width: 300px !important;
    height: 250px !important;
    max-width: 100%;
}

/* GROUP 2: Poori-chaudai wale horizontal banner (header, mid-banner,
   home-mid-categories) — inki chaudai screen ke hisaab se badalti hai
   (responsive), isliye width:100% theek hai, lekin height sirf ek patli
   banner jitni honi chahiye (~90-100px), 250px ka bada reserve galat
   size dikhata tha. */
.pkp-ad-slot.pkp-ad-header_728x90,
.pkp-ad-slot.pkp-ad-mid_970x90,
.pkp-ad-slot.pkp-ad-home_mid_categories {
    min-height: 100px;
}
.pkp-ad-slot.pkp-ad-header_728x90 .adsbygoogle,
.pkp-ad-slot.pkp-ad-mid_970x90 .adsbygoogle,
.pkp-ad-slot.pkp-ad-home_mid_categories .adsbygoogle {
    display: block !important;
    width: 100% !important;
}

/* GROUP 3: Article ke andar wale "auto"/native ads (in_content,
   before_related, before_comments, after_title, category_infeed,
   home_infeed) — inki koi fixed size nahi hoti (text ke saath fit hote
   hain), isliye ek realistic average height (jo asal me in-article
   responsive ad units aksar lete hain) reserve ki hai. */
.pkp-ad-slot.pkp-ad-in_content,
.pkp-ad-slot.pkp-ad-in_content_2,
.pkp-ad-slot.pkp-ad-before_related,
.pkp-ad-slot.pkp-ad-before_comments,
.pkp-ad-slot.pkp-ad-after_title,
.pkp-ad-slot.pkp-ad-category_infeed,
.pkp-ad-slot.pkp-ad-home_infeed {
    min-height: 280px;
}
.pkp-ad-slot.pkp-ad-in_content .adsbygoogle,
.pkp-ad-slot.pkp-ad-in_content_2 .adsbygoogle,
.pkp-ad-slot.pkp-ad-before_related .adsbygoogle,
.pkp-ad-slot.pkp-ad-before_comments .adsbygoogle,
.pkp-ad-slot.pkp-ad-after_title .adsbygoogle,
.pkp-ad-slot.pkp-ad-category_infeed .adsbygoogle,
.pkp-ad-slot.pkp-ad-home_infeed .adsbygoogle {
    display: block !important;
    width: 100% !important;
}

/* Ad initialize hote hi (ads-init.js se .pkp-ad-initialized class lagti
   hai) Group 2/3 wala min-height reserve hata dete hain taaki asal ad
   content apni natural height le sake bina extra khaali white space ke.
   Group 1 (fixed 300x250) ki height hamesha fixed hi rehti hai, isliye
   yahan usse touch nahi karte. */
.pkp-ad-slot.pkp-ad-initialized:not(.pkp-ad-sidebar_300x250):not(.pkp-ad-sidebar_secondary) {
    min-height: 0;
}

/* NOTE: Pehle yahan ek rule tha jo "unfilled" ad ke waqt poora sidebar
   box (heading + border) hi hide kar deta tha — lekin isse box hamesha
   ke liye gayab lagne laga (jab tak koi naya unique ad-unit ID na lag
   jaaye). Ab hata diya hai: box hamesha visible rahega, chahe ad filled
   ho ya na ho — jaisa aapki site par pehle tha. */

/* Ad initialize hone ke baad (ads-init.js se) placeholder ki dashed/striped
   background hata dete hain, taaki real ad ke aas-paas woh na dikhe. */
.pkp-ad-slot.pkp-ad-initialized {
    background: none !important;
    border: none !important;
}

/* --- Responsive tweaks --- */
@media (max-width: 991px) {
    .pkp-related-posts-grid { grid-template-columns: repeat(2, 1fr); }
    .main-horizontal-menu .sub-menu { position: static; box-shadow: none; }
}
