/* =========================================================
   KeralamLiveNews — main design CSS
   Author: Tahseen Ashrafi
   ========================================================= */

/* ---------- Global Link Hover Override ---------- */
a, a:hover, a:focus, a:visited {
  text-decoration: none !important;
}
a:hover {
  color: inherit;
}

/* ---------- Image Border Radius ---------- */
img, .klm-lead__top-img, .klm-lead__extra-img, .klm-lead__card-img, .klm-list__img,
.klm-magazine__side-img, .klm-magazine__row-img, .klm-fourcol__img, .klm-strip__img,
.klm-sidebar-cards__big-img, .klm-custom-grid__big-img, .klm-custom-grid__col3-img,
.klm-custom-grid__card-img, .klm-5col-row__img, .klm-archive__card-img, .klm-noimg {
  border-radius: var(--klm-radius, 4px);
  max-width: 100%;
  height: auto;
}

/* ---------- Typography overflow prevention ---------- */
h1, h2, h3, h4, h5, h6,
.klm-lead__top-title, .klm-lead__card-title, .klm-lead__extra-title,
.klm-custom-grid__col1-title, .klm-custom-grid__big-title, .klm-custom-grid__col3-title, .klm-custom-grid__card-title,
.klm-5col-row__title, .klm-list__title, .klm-sidebar-cards__title, .klm-story__title, .klm-archive__title, .klm-archive__card-title {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ---------- Header ---------- */
.klm-header{border-bottom:1px solid var(--klm-border);background:var(--klm-bg);width:100%;overflow-x:hidden;}
.klm-header__top{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;gap:12px;width:100%;box-sizing:border-box;}
.klm-header__left,.klm-header__right{flex:1 1 0;display:flex;align-items:center;gap:12px;font-size:14px;color:var(--klm-muted);min-width:0;}
.klm-header__right{justify-content:flex-end;}
.klm-header__weather{display:inline-flex;align-items:center;gap:6px;font-weight:600;white-space:nowrap;}
.klm-weather-icon{color:#f2a900;}
.klm-header__center{flex:0 0 auto;text-align:center;min-width:0;}
.klm-header__logo img{max-height:64px;width:auto;max-width:100%;margin:0 auto;}
.klm-header__sitename{font-family:var(--klm-font-head);font-weight:800;font-size:28px;color:var(--klm-text);display:block;word-break:break-word;}
.klm-header__date{font-size:12px;color:var(--klm-muted);margin-top:4px;}
.klm-header__right-text{font-size:13px;}
.klm-header__search-toggle{background:none;border:1px solid var(--klm-border);border-radius:50%;width:36px;height:36px;font-size:15px;line-height:1;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.klm-header__search-panel{display:none;padding:12px 0;background:var(--klm-bg-alt);border-top:1px solid var(--klm-border);border-bottom:1px solid var(--klm-border);}
.klm-header__search-panel.is-open{display:block;}

/* Language Select Box */
.klm-lang-select-wrap{display:inline-block;position:relative;max-width:100%;}
.klm-lang-select{
  padding:5px 10px;
  border:1px solid var(--klm-border);
  border-radius:4px;
  background:#fff;
  font-size:12px;
  font-weight:700;
  color:var(--klm-text);
  cursor:pointer;
  outline:none;
}
.klm-lang-select:focus{border-color:var(--klm-primary);}

.klm-nav{background:var(--klm-primary);width:100%;}
.klm-nav__inner{display:flex;align-items:center;justify-content:space-between;width:100%;box-sizing:border-box;}
.klm-nav__menu{display:flex;flex-wrap:wrap;}
.klm-nav__menu li a{display:block;padding:12px 16px;color:#fff;font-weight:600;font-size:14px;text-transform:uppercase;letter-spacing:.02em;}
.klm-nav__menu li a:hover,.klm-nav__menu li.current-menu-item a{background:rgba(255,255,255,.15);text-decoration:none;}
.klm-nav__toggle{display:none;background:none;border:0;padding:12px;width:44px;flex-direction:column;gap:4px;cursor:pointer;}
.klm-nav__toggle span{display:block;height:2px;background:#fff;}

/* ---------- Layout shell ---------- */
.klm-site-content{width:100%;}
.klm-home,.klm-single,.klm-archive{padding:20px 16px;width:100%;box-sizing:border-box;}
.klm-home--with-sidebar,.klm-single--with-sidebar,.klm-archive--with-sidebar{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start;}
.klm-home--full .klm-home__main,.klm-single--full .klm-single__main,.klm-archive--full .klm-archive__main{width:100%;margin:0 auto;}
.klm-home__row{margin-bottom:28px;width:100%;}
.klm-home__row--lead{display:grid;grid-template-columns:2fr 1fr;gap:24px;}
.klm-empty-state{padding:40px;text-align:center;color:var(--klm-muted);border:1px dashed var(--klm-border);border-radius:6px;}

/* ---------- Shared block chrome ---------- */
.klm-block{margin-bottom:28px;width:100%;}
.klm-block__title{font-size:20px;font-weight:800;text-transform:uppercase;color:var(--klm-primary);padding-bottom:8px;border-bottom:3px solid var(--klm-primary);margin-bottom:16px;position:relative;overflow-wrap:break-word;}
.klm-block__viewall{float:right;font-size:13px;font-weight:600;color:var(--klm-link);text-transform:none;}
.klm-noimg{display:flex;align-items:center;justify-content:center;background:var(--klm-bg-alt);color:#999;font-size:12px;aspect-ratio:4/3;width:100%;}
.klm-badge{display:inline-block;color:var(--klm-link);font-size:12px;font-weight:700;text-transform:uppercase;margin-bottom:4px;}

/* ---------- Lead layout ---------- */
.klm-lead{display:flex;flex-direction:column;gap:20px;width:100%;}
.klm-lead__top-img,.klm-lead__extra-img{width:100%;height:auto;max-height:420px;object-fit:cover;}
.klm-lead__top-title{font-size:24px;font-weight:800;margin-top:10px;line-height:1.3;color:var(--klm-text);}
.klm-lead__top-title:hover,.klm-lead__card-title:hover,.klm-lead__extra-title:hover{color:inherit;text-decoration:none!important;}
.klm-lead__excerpt{color:var(--klm-muted);font-size:14px;margin-top:6px;}
.klm-lead__row{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:4px;}
.klm-lead__card a{display:flex;flex-direction:column;gap:8px;color:var(--klm-text);}
.klm-lead__card-img{aspect-ratio:16/10;object-fit:cover;width:100%;}
.klm-lead__card-title{font-size:14px;font-weight:700;margin:0;line-height:1.35;}
.klm-lead__extra-title{font-size:20px;font-weight:800;margin-top:10px;}

/* ---------- Custom Grid Layout ---------- */
.klm-custom-grid{display:flex;flex-direction:column;gap:24px;width:100%;}
.klm-custom-grid__top{display:grid;grid-template-columns:1fr 1.5fr 1fr;gap:20px;align-items:start;}
.klm-custom-grid__col1-title{font-size:18px;font-weight:800;line-height:1.35;margin-top:4px;}
.klm-custom-grid__col1-title a{color:var(--klm-text);}
.klm-custom-grid__col1-title a:hover{color:inherit;text-decoration:none!important;}
.klm-custom-grid__big-img{width:100%;aspect-ratio:4/3;object-fit:cover;}
.klm-custom-grid__big-title{font-size:22px;font-weight:800;margin-top:10px;line-height:1.3;color:var(--klm-text);}
.klm-custom-grid__col3-img{width:100%;aspect-ratio:16/10;object-fit:cover;}
.klm-custom-grid__col3-title{font-size:15px;font-weight:700;margin-top:6px;line-height:1.35;}
.klm-custom-grid__col3-title a{color:var(--klm-text);}

.klm-custom-grid__bottom{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;border-top:1px solid var(--klm-border);padding-top:20px;}
.klm-custom-grid__card-img{width:100%;aspect-ratio:16/10;object-fit:cover;}
.klm-custom-grid__card-title{font-size:14px;font-weight:700;margin-top:6px;line-height:1.35;}
.klm-custom-grid__card-title a{color:var(--klm-text);}
.klm-custom-grid__excerpt{font-size:13px;color:var(--klm-muted);margin-top:4px;}

/* ---------- Full-Width 5-Column Grid ---------- */
.klm-5col-row{display:grid;grid-template-columns:repeat(5,1fr);gap:18px;width:100%;}
.klm-5col-row__item a{display:flex;flex-direction:column;gap:8px;color:var(--klm-text);}
.klm-5col-row__img{width:100%;aspect-ratio:16/10;object-fit:cover;}
.klm-5col-row__title{font-size:14px;font-weight:700;margin:0;line-height:1.35;}
.klm-5col-row__excerpt{font-size:12px;color:var(--klm-muted);margin-top:4px;}

/* ---------- Simple list ---------- */
.klm-list__item{display:flex;flex-direction:column;padding:10px 0;border-bottom:1px solid var(--klm-border);}
.klm-list__link{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;color:var(--klm-text);}
.klm-list__link:hover .klm-list__title{color:inherit;text-decoration:none!important;}
.klm-list__title{flex:1;font-weight:600;font-size:14px;line-height:1.35;overflow-wrap:break-word;word-break:break-word;}
.klm-list__img{width:100px;height:70px;object-fit:cover;flex:none;}

/* ---------- Magazine layout ---------- */
.klm-magazine{display:grid;grid-template-columns:1.6fr 1fr;gap:20px;width:100%;}
.klm-magazine__main h3{font-size:20px;}
.klm-magazine__excerpt{color:var(--klm-muted);font-size:14px;}
.klm-magazine__side a{display:flex;flex-direction:column;gap:8px;color:var(--klm-text);}
.klm-magazine__side-img{aspect-ratio:1/1;object-fit:cover;width:100%;}
.klm-magazine__side span{font-weight:600;font-size:14px;}
.klm-magazine__row{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:6px;}
.klm-magazine__row-item a{display:flex;flex-direction:column;gap:6px;color:var(--klm-text);}
.klm-magazine__row-img{aspect-ratio:1/1;object-fit:cover;width:100%;}
.klm-magazine__row-item span{font-size:13px;font-weight:600;}

/* ---------- Four column ---------- */
.klm-fourcol{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;width:100%;}
.klm-fourcol__item a{display:flex;flex-direction:column;gap:6px;color:var(--klm-text);}
.klm-fourcol__img{aspect-ratio:1/1;object-fit:cover;width:100%;}
.klm-fourcol__cat{color:var(--klm-primary);font-size:12px;font-weight:700;text-transform:uppercase;}
.klm-fourcol__item h4{font-size:14px;margin:0;}

/* ---------- Strip (video / gallery) ---------- */
.klm-strip{position:relative;display:flex;align-items:center;gap:8px;width:100%;overflow:hidden;}
.klm-strip__track{display:flex;gap:14px;overflow-x:auto;scroll-behavior:smooth;padding-bottom:4px;flex:1;-webkit-overflow-scrolling:touch;}
.klm-strip__item{flex:0 0 220px;max-width:100%;}
.klm-strip__item a{position:relative;display:block;color:#fff;}
.klm-strip__img{width:100%;aspect-ratio:16/10;object-fit:cover;}
.klm-strip__play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:40px;height:40px;background:rgba(0,0,0,.55);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;}
.klm-strip__gicon{position:absolute;top:8px;right:8px;background:rgba(0,0,0,.55);width:26px;height:26px;border-radius:3px;display:flex;align-items:center;justify-content:center;font-size:12px;}
.klm-strip__tag{position:absolute;top:8px;left:8px;background:var(--klm-primary);color:#fff;font-size:10px;font-weight:700;padding:2px 6px;border-radius:2px;}
.klm-strip__caption{position:absolute;left:0;right:0;bottom:0;padding:20px 8px 8px;background:linear-gradient(transparent,rgba(0,0,0,.8));font-size:13px;font-weight:600;}
.klm-strip__arrow{flex:none;width:32px;height:32px;border-radius:50%;border:1px solid var(--klm-border);background:#fff;}

/* ---------- Sidebar Cards layout ---------- */
.klm-sidebar-cards{display:flex;flex-direction:column;gap:14px;width:100%;}
.klm-sidebar-cards__big-img{width:100%;aspect-ratio:16/10;object-fit:cover;}
.klm-sidebar-cards__title{font-size:16px;font-weight:700;margin-top:8px;line-height:1.3;color:var(--klm-text);}
.klm-sidebar-cards__title:hover{color:inherit;text-decoration:none!important;}
.klm-sidebar-cards__excerpt{font-size:13px;color:var(--klm-muted);margin-top:4px;}
.klm-sidebar-cards__list{margin:6px 0;}

/* ---------- Social Links Widget ---------- */
.klm-social-links{display:flex;flex-wrap:wrap;gap:10px;}
.klm-social-btn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:#fff!important;font-weight:800;font-size:14px;}
.klm-social-btn--fb{background:#1877f2;}
.klm-social-btn--ig{background:linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);}
.klm-social-btn--tw{background:#000;}
.klm-social-btn--yt{background:#ff0000;}

/* ---------- Sidebar ---------- */
.klm-sidebar{display:flex;flex-direction:column;gap:20px;position:sticky;top:16px;align-self:start;width:100%;}
.klm-sidebar-widget__title{font-size:15px;font-weight:800;text-transform:uppercase;color:var(--klm-primary);border-bottom:2px solid var(--klm-primary);padding-bottom:6px;margin-bottom:10px;}
.klm-ad{background:var(--klm-bg-alt);border:1px dashed var(--klm-border);color:var(--klm-muted);text-align:center;padding:40px 10px;font-size:13px;text-transform:uppercase;letter-spacing:.05em;max-width:100%;overflow:hidden;}

/* ---------- Meta line ---------- */
.klm-meta{font-size:12px;color:var(--klm-muted);margin-top:6px;}
.klm-meta__sep{margin:0 4px;}

/* ---------- Breadcrumb ---------- */
.klm-breadcrumb{font-size:13px;color:var(--klm-muted);margin-bottom:14px;}
.klm-breadcrumb a{color:var(--klm-muted);}
.klm-breadcrumb__current{color:var(--klm-text);font-weight:600;}

/* ---------- Single "Open Story" ---------- */
.klm-story{width:100%;}
.klm-story__eyebrow{display:inline-block;color:var(--klm-primary);font-weight:800;text-transform:uppercase;font-size:13px;margin-bottom:8px;}
.klm-story__title{font-size:30px;line-height:1.25;}
.klm-story__meta{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;border-bottom:1px solid var(--klm-border);padding-bottom:14px;margin-bottom:16px;}
.klm-story__share{display:flex;gap:8px;}
.klm-story__share a,.klm-story__print{width:32px;height:32px;border-radius:50%;background:var(--klm-bg-alt);display:flex;align-items:center;justify-content:center;color:var(--klm-text);border:none;}
.klm-story__figure{margin:0 0 16px;width:100%;}
.klm-story__content{font-size:17px;line-height:1.8;overflow-wrap:break-word;word-break:break-word;}
.klm-story__content p{margin:0 0 1.2em;}
.klm-story__content img{max-width:100%;height:auto;}

/* ---------- Archive / Category Grid Page ---------- */
.klm-archive__title{font-size:26px;font-weight:800;text-transform:uppercase;margin-bottom:16px;}
.klm-archive__grid{display:grid;gap:22px;margin-bottom:28px;width:100%;}
.klm-archive__grid--cols-3{grid-template-columns:repeat(3,1fr);}
.klm-archive__grid--cols-4{grid-template-columns:repeat(4,1fr);}
.klm-archive__grid--cols-5{grid-template-columns:repeat(5,1fr);}

.klm-archive__card{display:flex;flex-direction:column;gap:6px;}
.klm-archive__card-link{display:flex;flex-direction:column;gap:8px;color:var(--klm-text);}
.klm-archive__card-img{width:100%;aspect-ratio:16/10;object-fit:cover;}
.klm-archive__card-title{font-size:15px;font-weight:700;line-height:1.35;margin:0;}
.klm-archive__card-title:hover{color:inherit;text-decoration:none!important;}
.klm-archive__card-excerpt{font-size:13px;color:var(--klm-muted);margin:0;}

.klm-infinite-scroll{text-align:center;padding:20px 0;}
.klm-loader{font-weight:700;color:var(--klm-primary);padding:12px;background:var(--klm-bg-alt);border-radius:4px;display:inline-block;}
.klm-end-msg{font-size:14px;color:var(--klm-muted);padding:12px;background:var(--klm-bg-alt);border-radius:4px;display:inline-block;}

/* ---------- Search form ---------- */
.klm-search-form{display:flex;width:100%;max-width:600px;margin:0 auto;box-sizing:border-box;}
.klm-search-form__field{flex:1;min-width:0;padding:12px 16px;border:1px solid var(--klm-border);border-right:none;border-radius:4px 0 0 4px;font-size:15px;}
.klm-search-form__submit{padding:12px 24px;background:var(--klm-primary);color:#fff;border:none;border-radius:0 4px 4px 0;font-weight:700;white-space:nowrap;}

/* ---------- Footer Redesign ---------- */
.klm-footer{background:#0a0a0a;color:#ddd;margin-top:40px;width:100%;overflow-x:hidden;border-top:3px solid var(--klm-primary);}
.klm-footer__inner{padding:48px 16px;width:100%;box-sizing:border-box;}
.klm-footer__grid{display:grid;grid-template-columns:1.3fr 1fr 1fr 1.2fr;gap:36px;width:100%;align-items:start;}

.klm-footer__logo-card{
	background:#ffffff;
	padding:12px 16px;
	border-radius:6px;
	display:inline-block;
	margin-bottom:16px;
	box-shadow:0 2px 8px rgba(0,0,0,0.3);
}
.klm-footer__logo-card img{display:block;max-width:100%;height:auto;}
.klm-footer__brand-title{font-size:20px;font-weight:800;color:var(--klm-text);}

.klm-footer__col .klm-footer__widget-title,
.klm-footer__col .klm-sidebar-widget__title,
.klm-footer__widget-title,
.klm-footer-widget__title{
	color:#ffffff;
	font-size:15px;
	font-weight:800;
	text-transform:uppercase;
	letter-spacing:.03em;
	margin-bottom:14px;
	border-bottom:2px solid var(--klm-primary);
	padding-bottom:6px;
	display:inline-block;
}

.klm-footer__desc{font-size:13px;color:#aaa;line-height:1.6;margin-top:8px;}

.klm-footer__menu{list-style:none;padding:0;margin:0;}
.klm-footer__menu li{margin-bottom:10px;}
.klm-footer__menu a{color:#bbb;font-size:14px;transition:color .2s;}
.klm-footer__menu a:hover{color:#fff!important;}

/* Footer Social Stack */
.klm-footer__social-stack{display:flex;flex-direction:column;gap:10px;margin-top:4px;}
.klm-social-pill{
	display:flex;
	align-items:center;
	gap:10px;
	padding:10px 16px;
	border-radius:6px;
	color:#ffffff!important;
	font-weight:700;
	font-size:14px;
	text-decoration:none!important;
	transition:opacity .2s, transform .2s;
}
.klm-social-pill:hover{opacity:.9;transform:translateY(-1px);}
.klm-social-pill--fb{background:#1877f2;}
.klm-social-pill--ig{background:linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);}
.klm-social-pill--yt{background:#ff0000;}
.klm-social-pill--x{background:#111111;border:1px solid #333;}

/* Footer Bottom Bar */
.klm-footer__bottom{border-top:1px solid #222222;background:#05050a;width:100%;}
.klm-footer__bottom-inner{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;padding:16px;font-size:13px;color:#888;position:relative;width:100%;box-sizing:border-box;}
.klm-footer__credit{font-weight:600;color:#ccc;}

/* Scroll to top button */
.klm-backtotop{
	width:36px;
	height:36px;
	border-radius:50%;
	background:var(--klm-primary);
	color:#fff;
	border:none;
	display:flex;
	align-items:center;
	justify-content:center;
	font-size:18px;
	font-weight:800;
	cursor:pointer;
	transition:background .2s;
}
.klm-backtotop:hover{background:var(--klm-primary-dark);}

/* ---------- Responsive ---------- */
@media (max-width: 1024px){
  .klm-custom-grid__top{grid-template-columns:1fr 1fr;}
  .klm-custom-grid__col3{grid-column:1/-1;}
  .klm-5col-row,.klm-archive__grid--cols-5,.klm-archive__grid--cols-4{grid-template-columns:repeat(3,1fr);}
}

@media (max-width: 900px){
  .klm-home--with-sidebar,.klm-single--with-sidebar,.klm-archive--with-sidebar{grid-template-columns:1fr;}
  .klm-home__row--lead{grid-template-columns:1fr;}
  .klm-lead__row,.klm-magazine__row,.klm-fourcol,.klm-custom-grid__bottom{grid-template-columns:repeat(2,1fr);}
  .klm-custom-grid__top{grid-template-columns:1fr;}
  .klm-magazine{grid-template-columns:1fr;}
  .klm-footer__grid{grid-template-columns:repeat(2,1fr);gap:28px;}
  .klm-sidebar{position:static;}
}

@media (max-width: 768px){
  .klm-header__top{flex-direction:column;text-align:center;gap:10px;padding:12px 16px;}
  .klm-header__left,.klm-header__center,.klm-header__right{flex:0 0 auto;width:100%;justify-content:center;text-align:center;}
  .klm-header__right{flex-wrap:wrap;gap:10px;}
  .klm-nav__toggle{display:flex;}
  .klm-nav__menu{display:none;flex-direction:column;width:100%;background:var(--klm-primary-dark);}
  .klm-nav__menu.is-open{display:flex;}
  .klm-nav__menu li a{padding:10px 16px;border-bottom:1px solid rgba(255,255,255,0.1);}
  .klm-5col-row,.klm-archive__grid--cols-3,.klm-archive__grid--cols-4,.klm-archive__grid--cols-5{grid-template-columns:repeat(2,1fr);}
  .klm-story__title{font-size:22px;}
}

@media (max-width: 576px){
  .klm-header__sitename{font-size:22px;}
  .klm-custom-grid__top,.klm-custom-grid__bottom,.klm-lead__row,.klm-magazine__row,.klm-fourcol,.klm-5col-row,.klm-archive__grid--cols-3,.klm-archive__grid--cols-4,.klm-archive__grid--cols-5{grid-template-columns:1fr;}
  .klm-footer__grid{grid-template-columns:1fr;gap:24px;}
  .klm-footer__bottom-inner{flex-direction:column;text-align:center;gap:10px;}
  .klm-strip__item{flex:0 0 75%;max-width:280px;}
  .klm-list__img{width:80px;height:60px;}
  .klm-story__title{font-size:20px;}
  .klm-story__content{font-size:15px;}
  .klm-block__title{font-size:18px;}
}
