/*
Theme Name: Keygor News
Theme URI: https://example.com/keygor
Author: Keygor Team
Author URI: https://example.com
Description: A modern, fully-featured news and blog WordPress theme with Bootstrap 5. Features include: full Customizer support, Gutenberg compatible, page builder ready (Elementor, etc.), WooCommerce support, custom widgets, multiple page templates, social media integration, and SEO optimized.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: keygor
Tags: blog, news, custom-background, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks
*/

/* 
 * Main styles are in css/style.css
 * This file contains WordPress-specific overrides
 */

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

.skip-link {
    background-color: #012964;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    left: 0;
    padding: 15px 23px;
    position: fixed;
    top: -100%;
    z-index: 999999;
}

.skip-link:focus {
    top: 0;
}

/* Custom Logo */
.custom-logo-link {
    display: inline-block;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
}

.site-branding .custom-logo-link {
    margin-right: 15px;
}

/* WordPress Alignment Classes */
.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1em;
}

.alignwide {
    margin-left: -80px;
    margin-right: -80px;
    max-width: calc(100% + 160px);
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* WordPress Captions */
.wp-caption {
    margin-bottom: 1.5em;
    max-width: 100%;
}

.wp-caption img[class*="wp-image-"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption .wp-caption-text {
    margin: 0.8075em 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* WordPress Galleries */
.gallery {
    margin-bottom: 1.5em;
    display: grid;
    grid-gap: 1em;
}

.gallery-item {
    display: inline-block;
    text-align: center;
    width: 100%;
}

.gallery-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.gallery-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.gallery-caption {
    display: block;
    font-size: 14px;
    color: #666;
}

/* WordPress Blocks */
.wp-block-button__link {
    background-color: #012964;
    border-radius: 4px;
}

.wp-block-button__link:hover {
    background-color: #001a42;
}

.has-primary-blue-background-color {
    background-color: #012964;
}

.has-primary-blue-color {
    color: #012964;
}

.has-light-blue-background-color {
    background-color: #dfe3ee;
}

.has-light-blue-color {
    color: #dfe3ee;
}

/* Widget Styles */
.widget {
    margin-bottom: 30px;
}

.widget ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #012964;
    text-decoration: none;
}

.widget ul li a:hover {
    color: #1261d6;
}

/* Page Builder Compatibility */
.blank-canvas-page .site-header,
.blank-canvas-page .site-footer {
    display: none;
}

.blank-canvas-page .site-content {
    padding: 0;
}

.elementor-page .site-content {
    padding: 0;
}

/* WooCommerce Compatibility */
.woocommerce .products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

@media (max-width: 991px) {
    .woocommerce .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .woocommerce .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .woocommerce .products {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   COMPREHENSIVE RESPONSIVE STYLES
   ============================================ */

/* Large Devices (Desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .topthreenews .newsbox.bigpost .titlebox h2 {
        font-size: 22px;
    }
    
    .mostpopular_newsbox .listnewsbox .newsbox .contntbox .titlebox h3 {
        font-size: 14px;
    }
}

/* Medium Devices (Tablets, less than 992px) */
@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    /* Header */
    .header_mainsec .menubox .navbar-brand {
        font-size: 24px;
    }
    
    .header_mainsec .menubox .navbar-nav .nav-item .nav-link {
        padding: 10px 15px;
    }
    
    /* Top Banner */
    .topbanner_newssec {
        padding: 30px 0;
    }
    
    .topthreenews .newsbox.bigpost {
        margin-bottom: 20px;
    }
    
    .topthreenews .newsbox.bigpost .titlebox h2 {
        font-size: 20px;
    }
    
    .topthreenews .newsbox.rowpost .titlebox h2 {
        font-size: 14px;
    }
    
    /* Most Popular Sidebar */
    .mostpopular_newsbox {
        margin-top: 30px;
    }
    
    /* Section Titles */
    .maintitlebox h2 {
        font-size: 24px;
    }
    
    /* Recent News Slider */
    .recentnews_slider .recentnewsbox .newsbox {
        flex-direction: column;
    }
    
    /* Most Viewed */
    .mostviewed_newsbox .mostviewed_box .titlebox h3 {
        font-size: 14px;
    }
    
    /* Featured Stories */
    .featuredstories_news .stories_newsbox .storiesbox {
        margin-bottom: 30px;
    }
    
    /* Media News Tabs */
    .medianews_mainbox .medianewsbox .news_tabs .nav-tabs .nav-link {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    /* Footer */
    .footer_mainsec .footer_widget {
        margin-bottom: 30px;
    }
}

/* Small Devices (Landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    /* Header */
    .header_topbar {
        padding: 8px 0;
    }
    
    .header_topbar .social_sec ul li {
        margin-left: 10px;
    }
    
    .header_mainsec {
        padding: 10px 0;
    }
    
    .header_mainsec .menubox .navbar-brand {
        font-size: 20px;
    }
    
    .navbar-toggler {
        border-color: var(--keygor-primary, #012964);
    }
    
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23012964' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
    
    .navbar-collapse {
        background-color: #fff;
        padding: 15px;
        margin-top: 10px;
        border-radius: 8px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    
    .header_mainsec .menubox .navbar-nav .nav-item .nav-link {
        padding: 12px 0;
        border-bottom: 1px solid #eee;
    }
    
    /* Top Banner - Fix for tablets */
    .topbanner_newssec {
        padding: 20px 0;
    }
    
    .topbanner_newssec .topthreenews .row {
        margin: 0 -10px;
    }
    
    .topbanner_newssec .topthreenews .row > [class*="col-"] {
        padding: 0 10px;
    }
    
    .topthreenews .col-md-8,
    .topthreenews .col-md-4 {
        width: 100%;
    }
    
    /* Reset flex height on tablet */
    .topthreenews > .row > .col-sm-12.col-md-4.col-lg-4.col-xl-4 {
        height: auto;
        gap: 15px;
    }
    
    .topthreenews > .row > .col-sm-12.col-md-4.col-lg-4.col-xl-4 .newsbox.rowpost {
        flex: none;
        height: 180px;
    }
    
    .topthreenews .newsbox.bigpost {
        height: 280px;
    }
    
    .topthreenews .newsbox {
        margin-bottom: 15px;
        overflow: hidden;
    }
    
    .topthreenews .newsbox .contntbox .titlebox h2 {
        font-size: 18px;
        line-height: 1.4;
    }
    
    .topthreenews .newsbox.rowpost .contntbox .titlebox h2 {
        font-size: 14px;
    }
    
    /* Most Popular */
    .mostpopular_newsbox {
        margin-top: 20px;
        padding-left: 0;
    }
    
    .listnewsbox .newsbox .contntbox {
        width: calc(100% - 70px);
    }
    
    .mostpopular_newsbox .listnewsbox .newsbox .imgbox {
        width: 70px;
        height: 70px;
    }
    
    /* Section Titles */
    .maintitlebox {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    .maintitlebox h2 {
        font-size: 22px;
    }
    
    .viewall_btn a {
        font-size: 13px;
        padding: 6px 15px;
    }
    
    /* Recent News */
    .toprecentnews {
        padding: 30px 0;
    }
    
    .recentnews_slider .slick-slide {
        padding: 0 5px;
    }
    
    /* Most Viewed */
    .mostviewednews {
        padding: 30px 0;
    }
    
    .mostviewed_newsbox .mostviewed_box .imgbox {
        height: 150px;
    }
    
    .mostviewed_newsbox .mostviewed_box .titlebox h3 {
        font-size: 13px;
    }
    
    /* Media News Tabs */
    .medianews_mainbox {
        padding: 30px 0;
    }
    
    .medianews_mainbox .medianewsbox .maintitlebox {
        margin-bottom: 15px;
    }
    
    .medianews_mainbox .medianewsbox .news_tabs {
        margin-bottom: 20px;
    }
    
    .medianews_mainbox .medianewsbox .news_tabs .nav-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .medianews_mainbox .medianewsbox .news_tabs .nav-tabs .nav-link {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .medianews_mainbox .tabs_newsbox .newsbox.rowpost {
        height: 180px;
        margin-bottom: 15px;
    }
    
    /* Featured Stories */
    .featuredstories_news {
        padding: 30px 0;
    }
    
    .featuredstories_news .stories_newsbox .storiesbox {
        margin-bottom: 25px;
    }
    
    .featuredstories_news .stories_newsbox .storiesbox .imgbox img {
        height: 200px;
        object-fit: cover;
    }
    
    .featuredstories_news .stories_newsbox .storiesbox .contntbox .titlebox h3 {
        font-size: 16px;
    }
    
    /* Footer */
    .footer_mainsec {
        padding: 40px 0 20px;
    }
    
    .footer_mainsec .footer_widget {
        margin-bottom: 25px;
        text-align: center;
    }
    
    .footer_mainsec .social_sec ul {
        justify-content: left;
    }
    
    .copyright_sec {
        padding: 15px 0;
        text-align: center;
    }
    
    /* Single Post */
    .single-post .post-header {
        padding: 30px 0;
    }
    
    .single-post .post-title {
        font-size: 24px;
    }
    
    /* Archive */
    .archive-header {
        padding: 40px 0 !important;
    }
    
    .archive-header h1 {
        font-size: 28px !important;
    }
    
    /* Sidebar */
    .sidebar {
        margin-top: 40px;
    }
}

/* Extra Small Devices (Portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Header */
    .header_topbar .social_sec ul li {
        margin-left: 8px;
    }
    
    .header_topbar .social_sec ul li a {
        font-size: 12px;
    }
    
    .header_mainsec .menubox .navbar-brand {
        font-size: 18px;
    }
    
    /* Top Banner - Fix overlapping on mobile */
    .topbanner_newssec {
        padding: 20px 0;
    }
    
    .topbanner_newssec .topthreenews .row {
        margin: 0;
    }
    
    .topbanner_newssec .topthreenews .row > [class*="col-"] {
        padding: 0 10px;
        margin-bottom: 15px;
    }
    
    /* Reset flex height on mobile */
    .topthreenews > .row > .col-sm-12.col-md-4.col-lg-4.col-xl-4 {
        height: auto;
        gap: 15px;
    }
    
    .topthreenews > .row > .col-sm-12.col-md-4.col-lg-4.col-xl-4 .newsbox.rowpost {
        flex: none;
        height: 150px;
    }
    
    .topthreenews .newsbox.bigpost {
        height: 250px;
    }
    
    .topthreenews .newsbox {
        margin-bottom: 15px;
        position: relative;
        overflow: hidden;
    }
    
    .topthreenews .newsbox .contntbox .titlebox {
        padding: 15px;
    }
    
    .topthreenews .newsbox .contntbox .titlebox h2 {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .topthreenews .newsbox.rowpost .contntbox .titlebox h2 {
        font-size: 14px;
        line-height: 1.3;
    }
    
    /* Most Popular Sidebar on mobile */
    .mostpopular_newsbox {
        padding-left: 0;
        margin-top: 20px;
    }
    
    .listnewsbox .newsbox .contntbox {
        width: calc(100% - 60px);
    }
    
    /* Category Badges */
    .catgrybox span {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    /* Section Titles */
    .maintitlebox h2 {
        font-size: 20px;
    }
    
    /* Most Popular */
    .mostpopular_newsbox .listnewsbox .newsbox .imgbox {
        width: 100px;
		height: -webkit-fill-available;
        min-width: 100px;
    }
    
    .mostpopular_newsbox .listnewsbox .newsbox .contntbox .titlebox h3 {
        font-size: 13px;
        line-height: 1.3;
    }
    
    /* Recent News Slider */
    .recentnews_slider .recentnewsbox .newsbox .imgbox {
        width: 100%;
        min-width: 80px;
    }
    
    .recentnews_slider .recentnewsbox .newsbox .contntbox .titlebox h3 {
        font-size: 12px;
    }
    
    /* Most Viewed */
    .mostviewed_newsbox .mostviewed_box .imgbox {
        height: 120px;
    }
    
    .mostviewed_newsbox .mostviewed_box .contntbox {
        padding: 10px;
    }
    
    .mostviewed_newsbox .mostviewed_box .titlebox h3 {
        font-size: 12px;
    }
    
    /* Media News Tabs */
    .medianews_mainbox .medianewsbox .news_tabs .nav-tabs .nav-link {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .medianews_mainbox .tabs_newsbox .newsbox.rowpost {
        height: 150px;
    }
    
    .medianews_mainbox .tabs_newsbox .newsbox.rowpost .titlebox h2 {
        font-size: 12px;
    }
    
    /* Featured Stories */
    .featuredstories_news .stories_newsbox .storiesbox .imgbox img {
        height: 180px;
    }
    
    .featuredstories_news .stories_newsbox .storiesbox .contntbox {
        padding: 15px;
    }
    
    .featuredstories_news .stories_newsbox .storiesbox .contntbox .titlebox h3 {
        font-size: 15px;
    }
    
    .featuredstories_news .stories_newsbox .storiesbox .contntbox .titlebox p {
        font-size: 13px;
    }
    
    /* Footer */
    .footer_mainsec .navbar-brand {
        font-size: 22px;
    }
    
    .footer_mainsec .titlebox h3 {
        font-size: 18px;
    }
    
    .footer_mainsec .social_sec ul li a {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    /* Single Post */
    .single-post .post-title {
        font-size: 20px;
    }
    
    .single-post .post-meta {
        font-size: 12px;
    }
    
    .single-post .post-content {
        font-size: 15px;
    }
    
    /* Comments */
    .comment-list .comment {
        padding: 15px;
    }
    
    .comment-list .comment .comment-author img {
        width: 40px;
        height: 40px;
    }
    
    /* Pagination */
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Search Form */
    .search-form .search-field {
        font-size: 14px;
    }
    
    /* Widgets */
    .widget .widget-title,
    .widget .maintitlebox h2 {
        font-size: 18px;
    }
}

/* Slick Slider Responsive Fixes */
@media (max-width: 767.98px) {
    .slick-prev,
    .slick-next {
        width: 30px;
        height: 30px;
    }
    
    .slick-prev {
        left: -5px;
    }
    
    .slick-next {
        right: -5px;
    }
    
    .slick-prev:before,
    .slick-next:before {
        font-size: 16px;
    }
}

/* Back to Top Button Responsive */
@media (max-width: 767.98px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        right: 15px;
        bottom: 15px;
    }
}

/* Print Styles */
@media print {
    .header_topbar,
    .header_mainsec,
    .footer_mainsec,
    .copyright_sec,
    .sidebar,
    .back-to-top,
    .slick-arrow,
    .social_sec,
    .viewall_btn,
    .comment-form {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
        width: 100%;
    }
}

/* ============================================
   SLICK SLIDER ARROW FIXES
   ============================================ */

/* Global Slider Arrow Styles */
.slick-prev,
.slick-next {
    width: 40px !important;
    height: 40px !important;
    background-color: #012964 !important;
    border-radius: 50% !important;
    border: 2px solid #012964 !important;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.slick-prev:hover,
.slick-next:hover,
.slick-prev:focus,
.slick-next:focus {
    background-color: #1261d6 !important;
    border-color: #1261d6 !important;
}

/* Hide default :before pseudo-element - using Font Awesome icons in HTML */
.slick-prev:before,
.slick-next:before {
    display: none !important;
    content: '' !important;
}

/* Style Font Awesome icons inside arrows */
.slick-prev i,
.slick-next i {
    font-size: 14px;
    color: #fff;
    line-height: 1;
}

.slick-prev {
    left: 10px;
}

.slick-next {
    right: 10px;
}

/* Most Viewed Slider Arrows - Position at top right */
.mostviewednews .slick-prev,
.mostviewednews .slick-next {
    top: -45px;
    transform: none;
}

.mostviewednews .slick-prev {
    left: auto;
    right: 50px;
}

.mostviewednews .slick-next {
    right: 0;
}

/* Recent News Slider Arrows - Blue filled circles at top right */
.toprecentnews .slick-prev,
.toprecentnews .slick-next,
.recentnews_mainsec .slick-prev,
.recentnews_mainsec .slick-next {
    top: -55px;
    transform: none;
    background-color: #012964 !important;
    border: 2px solid #012964 !important;
}

.toprecentnews .slick-prev:hover,
.toprecentnews .slick-next:hover,
.recentnews_mainsec .slick-prev:hover,
.recentnews_mainsec .slick-next:hover {
    background-color: #1261d6 !important;
    border-color: #1261d6 !important;
}

.toprecentnews .slick-prev,
.recentnews_mainsec .slick-prev {
    left: auto;
    right: 50px;
}

.toprecentnews .slick-next,
.recentnews_mainsec .slick-next {
    right: 0;
}

/* ============================================
   EQUAL HEIGHT GRID FIXES
   ============================================ */

/* Featured Stories Equal Height */
.featuredstories_news .stories_newsbox .row {
    display: flex;
    flex-wrap: wrap;
}

.featuredstories_news .stories_newsbox .row > [class*="col-"] {
    display: flex;
    margin-bottom: 30px;
}

.featuredstories_news .stories_newsbox .storiesbox {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.featuredstories_news .stories_newsbox .storiesbox .imgbox {
    height: 200px;
    flex-shrink: 0;
}

.featuredstories_news .stories_newsbox .storiesbox .contntbox {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.featuredstories_news .stories_newsbox .storiesbox .contntbox .titlebox h3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.featuredstories_news .stories_newsbox .storiesbox .contntbox .titlebox p {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Media News Tab Grid Equal Height */
.medianews_mainbox .tabs_newsbox .row {
    display: flex;
    flex-wrap: wrap;
}

.medianews_mainbox .tabs_newsbox .row > [class*="col-"] {
    display: flex;
    margin-bottom: 20px;
}

.medianews_mainbox .tabs_newsbox .newsbox {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Most Popular Sidebar Equal Height */
.mostpopular_newsbox .listnewsbox .newsbox {
    min-height: 102px;
}

.mostpopular_newsbox .listnewsbox .newsbox .contntbox .titlebox h3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* Recent News Slider Equal Height */
.recentnews_slider .slick-track {
    display: flex !important;
}

.recentnews_slider .slick-slide {
    height: inherit !important;
}

.recentnews_slider .slick-slide > div {
    height: 100%;
}

.recentnews_slider .recentnewsbox {
    height: 100%;
}

.recentnews_slider .recentnewsbox .newsbox {
    height: 100%;
    display: flex;
    align-items: stretch;
}
