/*
Theme Name: Kerala Silver
Description: Clean, mobile-friendly theme for keralasilver.com. Silver-blue color scheme with sticky header, responsive navigation, widget areas and full Customizer control.
Version: 1.0.0
Author: keralasilver.com
Text Domain: kerala-silver
*/

/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #1a1a1a;
    background: #f4f7fa;
}
a { color: #4a6fa5; text-decoration: none; }
a:hover { color: #2d4f80; text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
p { margin-bottom: 1rem; }
h1,h2,h3,h4,h5,h6 {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.3;
    margin-bottom: .75rem;
    color: #1e3a5f;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* ══════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════ */
#ks-topbar {
    background: #1e3a5f;
    color: #a8c4e0;
    font-size: .82rem;
    padding: 6px 0;
}
.ks-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
#ks-topbar a { color: #a8c4e0; }
#ks-topbar a:hover { color: #fff; text-decoration: none; }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
#ks-header {
    background: #2c5f8a;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.ks-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 16px;
}

/* Logo */
.ks-logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    text-decoration: none;
}
.ks-logo-wrap img {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}
.ks-logo-text { display: flex; flex-direction: column; }
.ks-site-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: #ffffff;
    line-height: 1.2;
}
.ks-site-tagline {
    font-size: .72rem;
    color: rgba(255,255,255,.7);
}

/* ══════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════ */
#ks-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}
#ks-nav ul li { position: relative; }
#ks-nav ul li a {
    display: block;
    padding: 22px 16px;
    color: rgba(255,255,255,.9);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s;
}
#ks-nav ul li a:hover,
#ks-nav ul li.current-menu-item > a {
    background: rgba(255,255,255,.15);
    color: #fff;
    text-decoration: none;
}
/* Dropdown */
#ks-nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e3a5f;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    border-radius: 0 0 4px 4px;
    flex-direction: column;
    z-index: 200;
}
#ks-nav ul li:hover > ul { display: flex; flex-direction: column; }
#ks-nav ul li ul li a {
    padding: 10px 16px;
    font-size: .88rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
}

/* Hamburger button */
.ks-menu-btn {
    display: none;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
}

/* ══════════════════════════════════════════
   PAGE WRAPPER & MAIN LAYOUT
══════════════════════════════════════════ */
#ks-page { display: flex; flex-direction: column; min-height: 100vh; }
#ks-wrap {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px;
    width: 100%;
}
/* With sidebar */
.has-sidebar #ks-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}
/* Full width */
.no-sidebar #ks-wrap { max-width: 900px; }

/* ══════════════════════════════════════════
   CONTENT
══════════════════════════════════════════ */
#ks-content { min-width: 0; }

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
#ks-sidebar {}

.widget {
    background: #fff;
    border: 1px solid #d0dae8;
    border-radius: 6px;
    padding: 0 0 16px;
    margin-bottom: 24px;
    overflow: hidden;
}
.widget-title {
    font-size: .95rem;
    font-weight: bold;
    color: #fff;
    background: #2c5f8a;
    padding: 10px 16px;
    margin: 0 0 14px;
}
.widget ul { list-style: none; padding: 0 16px; margin: 0; }
.widget ul li {
    padding: 7px 0;
    border-bottom: 1px solid #edf0f5;
    font-size: .9rem;
    color: #444;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: #2c5f8a; }
.widget ul li a:hover { color: #1e3a5f; }
.widget p { padding: 0 16px; font-size: .9rem; color: #555; margin: 0; }

/* ══════════════════════════════════════════
   POST CARDS (archive/index)
══════════════════════════════════════════ */
.ks-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.ks-card {
    background: #fff;
    border: 1px solid #d0dae8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
}
.ks-card:hover { box-shadow: 0 4px 16px rgba(44,95,138,.15); transform: translateY(-2px); }
.ks-card-img img { width: 100%; height: 180px; object-fit: cover; }
.ks-card-body { padding: 16px; }
.ks-card-meta { font-size: .75rem; color: #888; margin-bottom: 6px; }
.ks-card-title { font-size: 1.05rem; font-weight: bold; color: #1e3a5f; margin-bottom: 8px; }
.ks-card-title a { color: inherit; }
.ks-card-title a:hover { color: #2c5f8a; text-decoration: none; }
.ks-card-excerpt { font-size: .88rem; color: #666; margin-bottom: 12px; }
.ks-read-more {
    display: inline-block;
    background: #2c5f8a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 600;
    transition: background .15s;
}
.ks-read-more:hover { background: #1e3a5f; text-decoration: none; color: #fff; }

/* ══════════════════════════════════════════
   SINGLE POST / PAGE
══════════════════════════════════════════ */
.ks-entry {
    background: #fff;
    border: 1px solid #d0dae8;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ks-entry-header { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid #e8eef5; }
.ks-entry-title { font-size: 1.75rem; color: #1e3a5f; margin-bottom: 8px; }
.ks-entry-meta { font-size: .8rem; color: #888; }
.ks-entry-meta a { color: #888; }
.ks-entry-thumb { margin-bottom: 20px; border-radius: 6px; overflow: hidden; }
.ks-entry-thumb img { width: 100%; max-height: 400px; object-fit: cover; }

/* Entry content typography */
.entry-content h2 { font-size: 1.35rem; color: #1e3a5f; margin: 1.5rem 0 .7rem; }
.entry-content h3 { font-size: 1.1rem; margin: 1.2rem 0 .6rem; }
.entry-content blockquote {
    border-left: 4px solid #2c5f8a;
    background: #eef3f9;
    padding: 12px 16px;
    margin: 1rem 0;
    font-style: italic;
    color: #555;
    border-radius: 0 4px 4px 0;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9rem; }
.entry-content table th { background: #2c5f8a; color: #fff; padding: 8px 12px; text-align: left; }
.entry-content table td { padding: 8px 12px; border: 1px solid #d0dae8; }
.entry-content table tr:nth-child(even) td { background: #f4f7fa; }
.entry-content img { border-radius: 4px; margin: 1rem 0; }
.entry-content code { font-family: monospace; font-size: .88em; background: #eef3f9; padding: 1px 5px; border-radius: 3px; }
.entry-content pre { background: #1e2a3a; color: #d4d4d4; padding: 16px; border-radius: 6px; overflow-x: auto; font-size: .85rem; }
.entry-content pre code { background: none; padding: 0; }

/* Post navigation */
.ks-post-nav {
    display: flex;
    gap: 14px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e8eef5;
}
.ks-post-nav a {
    flex: 1;
    background: #f4f7fa;
    border: 1px solid #d0dae8;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: .88rem;
    color: #333;
    transition: border-color .15s, color .15s;
}
.ks-post-nav a:hover { border-color: #2c5f8a; color: #2c5f8a; text-decoration: none; }
.ks-post-nav .nav-next { text-align: right; }
.ks-post-nav span { display: block; font-size: .72rem; color: #aaa; margin-bottom: 3px; }

/* Breadcrumbs */
.ks-breadcrumbs {
    font-size: .82rem;
    color: #888;
    margin-bottom: 16px;
}
.ks-breadcrumbs a { color: #888; }
.ks-breadcrumbs a:hover { color: #2c5f8a; }
.ks-breadcrumbs span { margin: 0 5px; }

/* Pagination */
.ks-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.ks-pagination a,
.ks-pagination span {
    display: inline-block;
    padding: 7px 13px;
    border: 1px solid #d0dae8;
    border-radius: 4px;
    font-size: .9rem;
    color: #444;
    background: #fff;
    text-decoration: none;
}
.ks-pagination a:hover { border-color: #2c5f8a; color: #2c5f8a; }
.ks-pagination .current { background: #2c5f8a; color: #fff; border-color: #2c5f8a; }

/* 404 */
.ks-404 { text-align: center; padding: 60px 20px; }
.ks-404 h1 { font-size: 5rem; color: #a8c4e0; }
.ks-404 h2 { font-size: 1.4rem; margin: 0 0 12px; }

/* Search form */
.ks-search { display: flex; }
.ks-search input[type="search"] {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #bbb;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: .95rem;
    font-family: Arial, sans-serif;
    outline: none;
}
.ks-search input[type="search"]:focus { border-color: #2c5f8a; }
.ks-search button {
    background: #2c5f8a;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: .95rem;
}
.ks-search button:hover { background: #1e3a5f; }

/* Page header banner */
.ks-page-header {
    background: linear-gradient(135deg, #2c5f8a, #1e3a5f);
    color: #fff;
    padding: 32px 20px;
    text-align: center;
    margin-bottom: 24px;
    border-radius: 8px;
}
.ks-page-header h1 { color: #fff; margin: 0; font-size: 1.8rem; }
.ks-page-header p { color: rgba(255,255,255,.8); margin: 8px 0 0; font-size: .9rem; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
#ks-footer { background: #1e3a5f; color: #a8c4e0; margin-top: 48px; }
.ks-footer-widgets {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px;
}
.ks-footer-widgets .widget {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}
.ks-footer-widgets .widget-title {
    background: transparent;
    color: #fff;
    font-size: .88rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 0 0 8px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 12px;
}
.ks-footer-widgets .widget ul { padding: 0; }
.ks-footer-widgets .widget ul li {
    border-bottom: 1px solid rgba(255,255,255,.05);
    padding: 5px 0;
    color: #a8c4e0;
}
.ks-footer-widgets .widget ul li a { color: #a8c4e0; }
.ks-footer-widgets .widget ul li a:hover { color: #fff; text-decoration: none; }
.ks-footer-widgets .widget p { padding: 0; color: rgba(255,255,255,.6); font-size: .88rem; }

.ks-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 14px 20px;
}
.ks-footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .8rem;
    color: rgba(255,255,255,.4);
}
.ks-footer-bottom-inner a { color: rgba(255,255,255,.4); }
.ks-footer-bottom-inner a:hover { color: #a8c4e0; }
.ks-footer-nav { display: flex; gap: 16px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.ks-footer-nav li a { color: rgba(255,255,255,.4); font-size: .8rem; }
.ks-footer-nav li a:hover { color: #a8c4e0; text-decoration: none; }

/* ══════════════════════════════════════════
   MISC
══════════════════════════════════════════ */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.alignleft  { float: left;  margin: 0 20px 10px 0; }
.alignright { float: right; margin: 0 0 10px 20px; }
.aligncenter { display: block; margin: 0 auto 1rem; }
.wp-caption-text { font-size: .8rem; color: #888; text-align: center; margin: 4px 0 0; }
hr { border: none; border-top: 1px solid #d0dae8; margin: 1.5rem 0; }

/* Comments */
.comment-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.comment-body { background: #f4f7fa; border: 1px solid #d0dae8; border-radius: 6px; padding: 14px; margin-bottom: 14px; }
.comment-author .fn { font-weight: bold; font-size: .9rem; }
.comment-metadata { font-size: .75rem; color: #aaa; }
.comment-form label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; color: #444; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #bbb; border-radius: 4px;
    font-size: .95rem; font-family: Arial, sans-serif; margin-bottom: 12px;
}
.comment-form input[type="submit"] {
    background: #2c5f8a; color: #fff; border: none; padding: 9px 22px;
    border-radius: 4px; font-size: .95rem; font-weight: 600; cursor: pointer;
}
.comment-form input[type="submit"]:hover { background: #1e3a5f; }

/* Back to top */
#ks-btt {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2c5f8a;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
    cursor: pointer;
    display: none;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    line-height: 42px;
    text-align: center;
    padding: 0;
}
#ks-btt:hover { background: #1e3a5f; }

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
    .has-sidebar #ks-wrap { grid-template-columns: 1fr; }
    #ks-sidebar { order: 2; }
}

@media (max-width: 680px) {
    /* Header */
    .ks-menu-btn { display: block; }
    #ks-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1e3a5f;
        box-shadow: 0 4px 12px rgba(0,0,0,.3);
        z-index: 999;
    }
    #ks-nav.open { display: block; }
    #ks-nav ul { flex-direction: column; }
    #ks-nav ul li a { padding: 13px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
    #ks-nav ul li ul { position: static; display: block; box-shadow: none; background: rgba(0,0,0,.15); }
    #ks-nav ul li ul li a { padding-left: 36px; }
    #ks-header { position: relative; }

    /* Layout */
    #ks-wrap { padding: 16px 14px; }
    .ks-entry { padding: 16px; }
    .ks-entry-title { font-size: 1.35rem; }
    .ks-posts-grid { grid-template-columns: 1fr; }
    .ks-post-nav { flex-direction: column; }
    .ks-topbar-inner { justify-content: center; font-size: .78rem; }

    /* Footer */
    .ks-footer-widgets { padding: 24px 14px 16px; gap: 20px; }
    .ks-footer-bottom-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 400px) {
    .ks-footer-widgets { grid-template-columns: 1fr; }
}
