/*
Theme Name: Karunakaran
Theme URI: https://skarunakaran.com/
Author: Sayanthan
Description: Minimal Tamil literary theme for Sivarasa Karunakaran. Designed to work with Karunakaran Core and Karunakaran Books.
Version: 1.1.0
Text Domain: karunakaran
Requires at least: 6.4
Requires PHP: 7.4
*/

:root{
  --kk-bg:#fff;
  --kk-text:#191919;
  --kk-muted:#77736e;
  --kk-border:#e7e3de;
  --kk-accent:#9b6b22;
  --kk-soft:#f7f5f1;
  --kk-radius:10px;
  --kk-site:1440px;
  --kk-reading:760px;
  --kk-body-size:18px;
  --kk-body-size-mobile:17px;
  --kk-title-size:50px;
  --kk-title-size-mobile:32px;
  --kk-card-title-size:24px;
  --kk-card-title-size-mobile:22px;
  --kk-section-size:28px;
  --kk-section-size-mobile:24px;
  --kk-menu-size:15px;
  --kk-menu-size-mobile:15px;
  --kk-excerpt-size:16px;
  --kk-excerpt-size-mobile:16px;
  --kk-body-lh:1.85;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--kk-bg);color:var(--kk-text);font-family:var(--kk-body-font,'Pavanam',sans-serif);font-size:var(--kk-body-size);line-height:var(--kk-body-lh);-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
a:hover{color:var(--kk-accent)}
img{max-width:100%;height:auto;display:block}
.kk-shell{width:min(calc(100% - 48px),var(--kk-site));margin-inline:auto}
.kk-site-header{border-bottom:1px solid var(--kk-border);background:rgba(255,255,255,.96);position:relative;z-index:20}
.kk-header-inner{min-height:76px;display:flex;align-items:center;gap:24px}
.kk-brand{font-family:var(--kk-heading-font,'Pavanam',sans-serif);font-weight:700;font-size:30px;letter-spacing:-.02em;margin-right:auto;white-space:nowrap}
.kk-nav{margin-left:auto}
.kk-nav ul{list-style:none;display:flex;align-items:center;gap:28px;margin:0;padding:0;font-size:var(--kk-menu-size)}
.kk-header-actions{display:flex;gap:6px;align-items:center;margin-left:2px}
.kk-icon-btn{width:42px;height:42px;border:0;background:transparent;border-radius:50%;display:grid;place-items:center;cursor:pointer;color:var(--kk-text)}
.kk-icon-btn:hover{background:var(--kk-soft)}
.kk-mobile-menu-btn{display:none}
.kk-mobile-menu{display:none}
.kk-search-panel{display:none;border-top:1px solid var(--kk-border);padding:16px 0}
.kk-search-panel.is-open{display:block}
.kk-search-form{display:flex;gap:10px}
.kk-search-form input{flex:1;border:1px solid var(--kk-border);border-radius:8px;padding:12px 14px;font:inherit}
.kk-search-form button{border:0;background:var(--kk-text);color:#fff;border-radius:8px;padding:0 18px;font:inherit;cursor:pointer}

.kk-hero{padding:0;border-bottom:1px solid var(--kk-border);background:#fff;overflow:hidden}
.kk-hero-picture{display:block;width:100%}
.kk-hero-picture img{display:block;width:100%;height:auto;max-height:470px;object-fit:cover;object-position:center}
.kk-hero-placeholder{min-height:340px;display:grid;place-items:center;background:var(--kk-soft);color:var(--kk-muted);font-size:14px}


.kk-section{padding:54px 0;border-top:1px solid var(--kk-border)}
.kk-section-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:26px}
.kk-section-title{font-family:var(--kk-heading-font);font-size:var(--kk-section-size);line-height:1.25;margin:0}
.kk-section-link{font-size:14px;color:var(--kk-muted)}
.kk-latest-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.kk-post-card{border:1px solid var(--kk-border);border-radius:var(--kk-radius);padding:22px;min-height:286px;display:flex;flex-direction:column;background:#fff}
.kk-meta{display:flex;gap:8px;flex-wrap:wrap;align-items:center;color:var(--kk-muted);font-size:13px;line-height:1.4}
.kk-meta-sep{opacity:.5}
.kk-post-card h3{font-family:var(--kk-heading-font);font-size:var(--kk-card-title-size);line-height:1.45;margin:18px 0 12px;letter-spacing:-.01em}
.kk-excerpt{font-size:var(--kk-excerpt-size);line-height:1.75;color:#56524f;margin:0 0 18px;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
.kk-read-more{margin-top:auto;font-size:14px;font-weight:600}

.kk-home-feature-row{padding-top:30px;padding-bottom:28px}
.kk-home-feature-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.95fr) minmax(0,1.97fr);gap:0;align-items:start}
.kk-home-selected,.kk-home-interview,.kk-home-books{min-width:0;padding:0 24px}
.kk-home-selected{padding-left:0}
.kk-home-books{padding-right:0}
.kk-home-interview,.kk-home-books{border-left:1px solid var(--kk-border)}
.kk-home-feature-grid .kk-section-head{margin-bottom:12px}
.kk-home-feature-grid .kk-section-title{font-size:20px}
.kk-selected-list{display:grid;border-top:0}
.kk-selected-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:start;padding:12px 0;border-bottom:1px solid var(--kk-border)}
.kk-selected-item:first-child{border-top:0}
.kk-selected-item h3{font-family:var(--kk-heading-font);font-size:15px;line-height:1.55;margin:0;font-weight:500}
.kk-selected-item time{font-size:11px;color:var(--kk-muted);white-space:nowrap;padding-top:2px}
.kk-mini-more{display:block;text-align:right;margin-top:13px;font-size:13px}

.kk-interview{display:grid;grid-template-columns:132px minmax(0,1fr);gap:18px;align-items:center;background:transparent;padding:0;border-radius:0}
.kk-interview img{width:132px;height:132px;aspect-ratio:1/1;object-fit:cover;border-radius:4px}
.kk-interview h3{font-family:var(--kk-heading-font);font-size:20px;line-height:1.5;margin:7px 0 8px}
.kk-interview-by{font-size:12px;color:var(--kk-muted);margin-bottom:8px}
.kk-interview .kk-read-more{font-size:13px}

.kk-books-wrap{overflow:hidden}
.kk-home-books .kk-section-head{align-items:center}
.kk-home-books .kk-section-link{font-size:12px}
.kk-books{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.kk-book{width:88px;flex:0 0 88px;text-align:center}
.kk-book-cover{aspect-ratio:2/3;background:var(--kk-soft);overflow:hidden;border-radius:4px;margin-bottom:8px}
.kk-book-cover img{width:100%;height:100%;object-fit:cover}
.kk-book h3{font-family:var(--kk-heading-font);font-size:12px;line-height:1.4;margin:0;white-space:normal}
.kk-book-meta{font-size:11px;color:var(--kk-muted);margin-top:3px}
.kk-book-dots{display:none}

.kk-site-footer{border-top:1px solid var(--kk-border);padding:34px 0 90px;color:var(--kk-muted);font-size:13px}
.kk-footer-inner{display:flex;justify-content:space-between;gap:24px;align-items:center}
.kk-socials{display:flex;gap:10px}
.kk-socials a{width:38px;height:38px;border:1px solid var(--kk-border);border-radius:50%;display:grid;place-items:center;color:var(--kk-text)}

/* Single */
.kk-single{padding:54px 0 90px}
.kk-reading{width:min(calc(100% - 48px),var(--kk-reading));margin-inline:auto}
.kk-single-head{text-align:left;margin-bottom:28px}
.kk-single-title{font-family:var(--kk-heading-font);font-size:var(--kk-title-size);line-height:1.3;letter-spacing:-.025em;margin:14px 0 14px}
.kk-featured{width:min(calc(100% - 48px),980px);margin:0 auto 42px;aspect-ratio:3/2;overflow:hidden;border-radius:var(--kk-radius);background:var(--kk-soft)}
.kk-featured img{width:100%;height:100%;object-fit:cover;}
.kk-content{font-size:var(--kk-body-size);line-height:var(--kk-body-lh)}
.kk-content p{margin:0 0 1.55em}
.kk-content h2,.kk-content h3,.kk-content h4{font-family:var(--kk-heading-font);line-height:1.4;margin:1.7em 0 .75em}
.kk-content blockquote{margin:2em 0;padding:5px 0 5px 24px;border-left:3px solid var(--kk-text);font-family:var(--kk-heading-font);font-size:1.15em}
.kk-content img{border-radius:var(--kk-radius);margin-block:30px}
.kk-share{margin-top:48px;padding-top:26px;border-top:1px solid var(--kk-border);display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.kk-share-label{font-size:13px;color:var(--kk-muted);margin-right:6px}
.kk-share-btn{height:42px;min-width:42px;padding:0 13px;border:1px solid var(--kk-border);border-radius:999px;background:#fff;display:inline-flex;align-items:center;justify-content:center;gap:8px;font:inherit;font-size:13px;cursor:pointer}
.kk-share-btn svg{width:18px;height:18px}
.kk-copy-status{font-size:12px;color:var(--kk-muted)}
.kk-reading-progress{position:fixed;top:0;left:0;height:2px;width:0;background:var(--kk-accent);z-index:9999;display:none}
body.kk-progress-on .kk-reading-progress{display:block}

/* Archives */
.kk-page-head{padding:48px 0 24px}
.kk-page-title{font-family:var(--kk-heading-font);font-size:42px;margin:0}
.kk-archive-list{border-top:1px solid var(--kk-border);margin-bottom:70px}
.kk-archive-item{display:grid;grid-template-columns:150px 1fr;gap:24px;padding:26px 0;border-bottom:1px solid var(--kk-border)}
.kk-archive-item h2{font-family:var(--kk-heading-font);font-size:26px;line-height:1.4;margin:0 0 8px}
.kk-archive-item p{margin:0;color:#56524f;font-size:15px}
.kk-empty{padding:60px 0 100px;color:var(--kk-muted)}

.kk-mobile-bottom{display:none}

@media(max-width:900px){
  body{font-size:var(--kk-body-size-mobile)}
  .kk-shell,.kk-reading{width:min(calc(100% - 32px),var(--kk-site))}
  .kk-header-inner{min-height:62px;display:grid;grid-template-columns:44px 1fr 44px;gap:6px}
  .kk-brand{justify-self:center;font-size:22px;white-space:nowrap}
  .kk-nav{display:none}
  .kk-mobile-menu-btn{display:grid;justify-self:start}
  .kk-header-actions{justify-self:end}
  .kk-hero{padding:0;border-bottom:1px solid var(--kk-border)}
  .kk-hero-picture img{width:100%;height:auto;max-height:none;object-fit:contain}
  .kk-section{padding:38px 0}
  .kk-section-title{font-size:var(--kk-section-size-mobile)}
  .kk-latest-grid{grid-template-columns:1fr;gap:14px}
  .kk-post-card{min-height:0;padding:20px}
  .kk-post-card h3{font-size:var(--kk-card-title-size-mobile);margin:13px 0 9px}
  .kk-excerpt{font-size:var(--kk-excerpt-size-mobile);-webkit-line-clamp:4}
  .kk-home-feature-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0}
  .kk-home-selected,.kk-home-interview{padding:0 16px}
  .kk-home-selected{padding-left:0}
  .kk-home-interview{padding-right:0;border-left:1px solid var(--kk-border)}
  .kk-home-books{grid-column:1 / -1;border-left:0;border-top:1px solid var(--kk-border);padding:28px 0 0;margin-top:28px}
  .kk-home-feature-grid .kk-section-title{font-size:20px}
  .kk-selected-item{gap:8px;padding:12px 0}
  .kk-selected-item h3{font-size:14px;line-height:1.5}
  .kk-interview{grid-template-columns:78px 1fr;gap:12px}
  .kk-interview img{width:78px;height:78px}
  .kk-interview h3{font-size:16px;margin:4px 0 6px}
  .kk-books{justify-content:flex-start;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:12px;scrollbar-width:none;gap:18px}
  .kk-books::-webkit-scrollbar{display:none}
  .kk-book{width:31vw;flex:0 0 31vw;max-width:150px;scroll-snap-align:start}
  .kk-book-dots{display:flex;justify-content:center;gap:7px;margin-top:14px}
  .kk-book-dot{width:6px;height:6px;border-radius:50%;background:#d3cec8}
  .kk-book-dot.is-active{background:var(--kk-text)}
  .kk-footer-inner{display:block;text-align:center}
  .kk-socials{justify-content:center;margin-top:18px}
  .kk-site-footer{padding-bottom:94px}
  .kk-single{padding:38px 0 90px}
  .kk-single-title{font-size:var(--kk-title-size-mobile)}
  .kk-featured{width:calc(100% - 32px);margin-bottom:30px;border-radius:var(--kk-radius)}
  .kk-content{font-size:var(--kk-body-size-mobile)}
  .kk-share-btn span{display:none}
  .kk-share-btn{padding:0;width:44px}
  .kk-page-title{font-size:32px}
  .kk-archive-item{grid-template-columns:1fr;gap:7px}
  .kk-mobile-bottom{position:fixed;left:0;right:0;bottom:0;z-index:50;display:grid;grid-template-columns:repeat(4,1fr);background:rgba(255,255,255,.97);border-top:1px solid var(--kk-border);padding-bottom:env(safe-area-inset-bottom)}
  .kk-mobile-bottom a{min-height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:10px;color:var(--kk-muted)}
  .kk-mobile-bottom svg{width:20px;height:20px}
  .kk-mobile-bottom a.is-active,.kk-mobile-bottom a:hover{color:var(--kk-text)}
  .kk-mobile-menu{display:none;position:absolute;top:62px;left:0;right:0;background:#fff;border-bottom:1px solid var(--kk-border);padding:8px 16px 18px}
  .kk-mobile-menu.is-open{display:block}
  .kk-mobile-menu ul{list-style:none;margin:0;padding:0}
  .kk-mobile-menu a{display:block;padding:12px 4px;border-bottom:1px solid var(--kk-border);font-size:var(--kk-menu-size-mobile)}
}

@media(max-width:430px){
  .kk-home-feature-grid{grid-template-columns:1fr 1fr}
  .kk-home-selected,.kk-home-interview{padding-inline:10px}
  .kk-home-selected{padding-left:0}
  .kk-home-interview{padding-right:0}
  .kk-home-feature-grid .kk-section-title{font-size:17px}
  .kk-selected-item h3{font-size:13px}
  .kk-interview{grid-template-columns:62px 1fr;gap:8px}
  .kk-interview img{width:62px;height:62px}
  .kk-interview h3{font-size:13px;line-height:1.45}
  .kk-interview .kk-meta,.kk-interview-by{font-size:9px}
  .kk-interview .kk-read-more{font-size:11px}
}
