/*
Theme Name: Kasaragod Channel
Theme URI: https://kasaragodchannel.com/
Author: Deneb Studios
Author URI: https://denebstudios.in/
Description: Super-lightweight, high-performance news theme crafted for Kasaragod Channel. 100% pure PHP and CSS, zero Elementor or bloated framework dependencies. Features identical card sliders, category sections, responsive layouts, and Malayalam typography.
Version: 1.0.0
Tested up to: 6.7
Requires at least: 5.8
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: kasaragod-channel
Tags: news, blog, custom-header, custom-menu, featured-images, full-width-template, grid-layout, rtl-language-support, translation-ready
*/

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
:root {
  --kcn-red: #c60202;
  --kcn-red-hover: #a50202;
  --kcn-blue: #001c75;
  --kcn-blue-light: #0693e3;
  --kcn-gray: #666666;
  --kcn-light-gray: #f5f5f7;
  --kcn-border: #eeeeee;
  --kcn-text: #1a1a1a;
  --kcn-bg: #ffffff;
  --kcn-container-max: 1220px;
  --kcn-font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", "Manjari", "Gayathri", "Noto Sans Malayalam", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--kcn-font-main);
  background-color: var(--kcn-bg);
  color: var(--kcn-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--kcn-red);
}

ul, ol {
  list-style: none;
}

.kcn-container {
  width: 100%;
  max-width: var(--kcn-container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

.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;
}

/* ==========================================================================
   2. Header & Navigation
   ========================================================================== */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--kcn-border);
  position: relative;
  z-index: 1000;
}

.header-main-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.site-branding {
  display: flex;
  align-items: center;
}

.site-branding .custom-logo-link img {
  width: auto;
  max-height: 62px;
  height: auto;
  object-fit: contain;
}

.site-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--kcn-blue);
  letter-spacing: -0.5px;
}

/* Desktop Navigation */
.main-navigation {
  display: flex;
  align-items: center;
}

.main-menu {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
}

.main-menu > li {
  position: relative;
}

.main-menu > li > a {
  font-size: 15px;
  font-weight: 600;
  color: #111111;
  padding: 8px 0;
  display: inline-block;
  transition: color 0.2s ease;
}

.main-menu > li > a:hover,
.main-menu > li.current-menu-item > a,
.main-menu > li.current-menu-ancestor > a {
  color: var(--kcn-red);
}

/* Submenu / Dropdown */
.main-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  min-width: 190px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 99;
}

.main-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-menu .sub-menu li a {
  display: block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #333333;
}

.main-menu .sub-menu li a:hover {
  background: var(--kcn-light-gray);
  color: var(--kcn-red);
}

/* Mobile Toggle Button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #222222;
}

.mobile-menu-toggle svg {
  width: 26px;
  height: 26px;
  display: block;
}

.mobile-menu-toggle .icon-close {
  display: none;
}

.mobile-menu-toggle.is-active .icon-menu {
  display: none;
}

.mobile-menu-toggle.is-active .icon-close {
  display: block;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  display: none;
  background: #ffffff;
  border-top: 1px solid var(--kcn-border);
  padding: 15px 0 20px;
}

.mobile-nav-drawer.is-open {
  display: block;
}

.mobile-menu {
  display: flex;
  flex-direction: column;
}

.mobile-menu li {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-menu li:last-child {
  border-bottom: none;
}

.mobile-menu li a {
  display: block;
  padding: 12px 15px;
  font-size: 15px;
  font-weight: 600;
  color: #222222;
}

.mobile-menu li.current-menu-item a,
.mobile-menu li a:hover {
  color: var(--kcn-red);
  background: #fafafa;
}

/* ==========================================================================
   3. Below-Header Ad Banner
   ========================================================================== */
.below-header-ad {
  padding: 16px 0 20px;
  text-align: center;
}

.below-header-ad .ad-banner-link {
  display: inline-block;
  max-width: 100%;
}

.below-header-ad img {
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* In-Between Content Ads */
.kcn-content-ad {
  margin: 25px 0 35px;
  text-align: center;
}

.kcn-content-ad img {
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.kcn-ad-placeholder {
  display: inline-block;
  background: #f7f7f7;
  border: 1px dashed #ccc;
  padding: 20px 40px;
  color: #777;
  font-size: 14px;
  border-radius: 4px;
}

/* ==========================================================================
   4. Section Divider & Homepage Category Rows
   ========================================================================== */
.kcn-category-section {
  margin-bottom: 40px;
}

.kcn-top-divider {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 25px;
}

.kcn-divider-line {
  width: 4px;
  height: 30px;
  background: var(--kcn-red);
  border-radius: 2px;
  flex-shrink: 0;
}

.kcn-divider-title {
  color: var(--kcn-blue);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0;
}

.kcn-divider-title a {
  color: inherit;
}

.kcn-divider-title a:hover {
  color: var(--kcn-red);
}

.kcn-updates {
  color: var(--kcn-red);
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  margin-left: 4px;
}

/* ==========================================================================
   5. Swiper Slider & KCN Cards (Ditto Replica)
   ========================================================================== */
.kcn-slider {
  position: relative;
  width: 100%;
  padding-bottom: 10px;
}

.kcn-slider .swiper-slide {
  height: auto;
  display: flex;
}

.kcn-slider .kcn-card {
  width: 100%;
  height: 100%;
}

.swiper-button-next,
.swiper-button-prev,
.swiper-pagination {
  display: none !important;
}

.kcn-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  width: 100%;
}

.kcn-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Category Top Pill */
.kcn-category-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--kcn-blue);
  padding: 12px 15px 5px;
  width: auto;
  text-transform: uppercase;
}

.kcn-cat {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kcn-news {
  color: var(--kcn-red);
}

.kcn-sep {
  color: #aaa;
  user-select: none;
}

/* Thumbnail */
.kcn-thumb {
  position: relative;
  overflow: hidden;
  background-color: #f2f2f2;
  aspect-ratio: 1080 / 1320;
}

.kcn-thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.kcn-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  transition: transform 0.4s ease;
}

.kcn-card:hover .kcn-thumb img {
  transform: scale(1.03);
}

/* Content */
.kcn-content {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.kcn-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  line-height: 1.4;
  margin: 4px 0 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.kcn-title a {
  color: inherit;
  text-decoration: none !important;
}

.kcn-title a:hover {
  color: var(--kcn-red);
}

/* Card Footer */
.kcn-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #eee;
  padding-top: 8px;
  margin-top: auto;
  color: var(--kcn-gray);
  font-size: 13px;
}

.kcn-footer img.kcn-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  flex-shrink: 0;
}

.kcn-brand {
  color: var(--kcn-blue);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
  white-space: nowrap;
}

.kcn-date-block {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}

.kcn-date-line {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.kcn-month,
.kcn-year {
  color: var(--kcn-blue);
  font-size: 13px;
  font-weight: 600;
}

.kcn-day {
  color: var(--kcn-red);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

/* ==========================================================================
   6. Archive & Category Grid Layout
   ========================================================================== */
.ast-archive-description {
  margin: 20px 0 30px;
  border-bottom: 2px solid var(--kcn-red);
  padding-bottom: 10px;
}

.page-title.ast-archive-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--kcn-blue);
  margin: 0;
}

.kcn-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.kcn-archive-item {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kcn-archive-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1080 / 1320;
  background: #f0f0f0;
  border-radius: 8px;
  margin-bottom: 14px;
}

.kcn-archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.kcn-archive-item:hover .kcn-archive-thumb img {
  transform: scale(1.03);
}

.kcn-archive-cats {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--kcn-red);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.kcn-archive-title {
  font-size: 18px;
  font-weight: 700;
  color: #111111;
  line-height: 1.4;
  margin-bottom: 8px;
}

.kcn-archive-title a:hover {
  color: var(--kcn-red);
}

.kcn-archive-meta {
  font-size: 13px;
  color: #777777;
  margin-bottom: 12px;
}

.kcn-archive-meta a {
  color: #555555;
}

.kcn-archive-excerpt {
  font-size: 14px;
  color: #555555;
  line-height: 1.6;
}

/* Pagination */
.kcn-pagination {
  margin: 40px 0;
  text-align: center;
}

.kcn-pagination .nav-links {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.kcn-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid var(--kcn-border);
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  background: #ffffff;
}

.kcn-pagination .page-numbers.current,
.kcn-pagination .page-numbers:hover {
  background: var(--kcn-blue);
  color: #ffffff;
  border-color: var(--kcn-blue);
}

/* ==========================================================================
   7. Single Post Layout
   ========================================================================== */
.kcn-single-post {
  max-width: 900px;
  margin: 25px auto 50px;
}

.kcn-single-header {
  margin-bottom: 25px;
}

.kcn-single-title {
  font-size: 32px;
  font-weight: 800;
  color: #111111;
  line-height: 1.35;
  margin-bottom: 15px;
}

.kcn-single-meta {
  font-size: 14px;
  color: #777777;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eeeeee;
  margin-bottom: 25px;
}

.kcn-single-meta a {
  color: var(--kcn-blue);
  font-weight: 600;
}

.kcn-single-featured-img {
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.kcn-single-featured-img img {
  width: 100%;
  height: auto;
  display: block;
}

.kcn-single-content {
  font-size: 18px;
  line-height: 1.8;
  color: #222222;
}

.kcn-single-content p {
  margin-bottom: 22px;
}

.kcn-single-content h2,
.kcn-single-content h3 {
  color: var(--kcn-blue);
  margin: 30px 0 15px;
}

.kcn-single-content blockquote {
  border-left: 4px solid var(--kcn-red);
  padding: 12px 20px;
  margin: 25px 0;
  font-style: italic;
  background: #fdf2f2;
}

/* Single Post Navigation */
.kcn-post-navigation {
  margin: 40px 0;
  padding: 20px 0;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.kcn-post-navigation .nav-item {
  flex: 1;
}

.kcn-post-navigation .nav-item.nav-next {
  text-align: right;
}

.kcn-post-navigation .nav-label {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--kcn-red);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.kcn-post-navigation .nav-next .nav-label {
  justify-content: flex-end;
}

.kcn-post-navigation .nav-title {
  font-size: 15px;
  font-weight: 600;
  color: #111111;
  line-height: 1.4;
}

/* Related Posts */
.kcn-related-posts-section {
  margin-top: 50px;
}

.kcn-related-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--kcn-blue);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--kcn-red);
  padding-bottom: 8px;
  display: inline-block;
}

.kcn-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

/* ==========================================================================
   8. Standard Page & Fallback Styles
   ========================================================================== */
.kcn-page-container {
  max-width: 900px;
  margin: 30px auto 60px;
  background: #ffffff;
}

.kcn-page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--kcn-blue);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--kcn-red);
  padding-bottom: 10px;
}

/* ==========================================================================
   9. Footer & Scroll To Top
   ========================================================================== */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--kcn-border);
  padding: 25px 0;
  margin-top: 50px;
}

.footer-copyright {
  text-align: center;
  font-size: 14px;
  color: #666666;
}

.footer-copyright a {
  color: var(--kcn-blue);
  font-weight: 600;
}

.footer-copyright a:hover {
  color: var(--kcn-red);
}

/* Scroll To Top */
.kcn-scroll-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 42px;
  height: 42px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  border: none;
}

.kcn-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.kcn-scroll-top:hover {
  background: var(--kcn-red);
}

.kcn-scroll-top svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==========================================================================
   10. Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
  .kcn-archive-grid,
  .kcn-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .kcn-title {
    font-size: 16px;
    margin: 3px 0 5px;
  }
  
  .kcn-category-top {
    font-size: 13px;
    width: auto;
  }
  
  .kcn-day {
    font-size: 18px;
  }
  
  .kcn-divider-title,
  .kcn-updates {
    font-size: 16px;
  }

  .kcn-archive-grid,
  .kcn-related-grid {
    grid-template-columns: 1fr;
  }
  
  .kcn-single-title {
    font-size: 24px;
  }

  .kcn-post-navigation {
    flex-direction: column;
  }
  
  .kcn-post-navigation .nav-item.nav-next {
    text-align: left;
  }
  
  .kcn-post-navigation .nav-next .nav-label {
    justify-content: flex-start;
  }
}
