/*
Theme Name: CreamyTales Health
Theme URI: https://blog.creamytales.com/
Author: Asif Motion / H3 AI Films
Author URI: https://asifmotion.com/
Description: A fast, lightweight, mobile-first WordPress theme built for health & beauty blogs (skin, dental, hair, eye, nail care and wellness). AdSense-ready with in-content and sidebar ad widget zones, a built-in cookie consent bar, footer policy menu, and color-coded categories. No jQuery, no heavy frameworks — system fonts and minimal CSS for top page-speed scores.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.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: creamytales-health
Tags: blog, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready, full-width-template
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root{
  --brand:#1f9d8f;
  --brand-dark:#167a6f;
  --brand-soft:#e7f4f1;
  --accent:#ef6b5a;
  --accent-soft:#fdeae6;
  --ink:#17272a;
  --muted:#5d6f71;
  --muted-2:#869596;
  --line:#e8edeb;
  --bg:#ffffff;
  --bg-soft:#f5f9f8;
  --radius:14px;
  --radius-sm:9px;
  --maxw:1180px;
  --read:730px;
  --shadow:0 1px 2px rgba(16,40,40,.04),0 8px 24px rgba(16,40,40,.06);
  --shadow-hover:0 4px 10px rgba(16,40,40,.07),0 18px 40px rgba(16,40,40,.1);
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji";
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Times New Roman",serif;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{
  margin:0;
  font-family:var(--sans);
  font-size:18px;
  line-height:1.7;
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--brand-dark);text-decoration:none;transition:color .15s ease}
a:hover{color:var(--accent)}
h1,h2,h3,h4{font-weight:800;line-height:1.22;letter-spacing:-.012em;color:var(--ink);margin:0 0 .5em}
h1{font-size:2.1rem}
h2{font-size:1.55rem}
h3{font-size:1.22rem}
p{margin:0 0 1.1em}
ul,ol{margin:0 0 1.1em;padding-left:1.3em}
li{margin:.35em 0}
blockquote{margin:1.4em 0;padding:.4em 0 .4em 1.2em;border-left:4px solid var(--brand);color:var(--muted);font-style:italic}
code{background:var(--bg-soft);padding:.12em .4em;border-radius:5px;font-size:.9em}
hr{border:0;border-top:1px solid var(--line);margin:2em 0}
:focus-visible{outline:3px solid var(--brand);outline-offset:2px;border-radius:3px}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
.skip-link{position:absolute;left:-999px;top:0;z-index:100;background:var(--ink);color:#fff;padding:.7em 1.1em;border-radius:0 0 8px 0}
.skip-link:focus{left:0;color:#fff}

.wrap{max-width:var(--maxw);margin:0 auto;padding:0 18px}
.btn{display:inline-block;background:var(--brand);color:#fff;padding:.7em 1.4em;border-radius:40px;font-weight:700;font-size:.95rem;transition:background .15s ease,transform .15s ease}
.btn:hover{background:var(--brand-dark);color:#fff;transform:translateY(-1px)}

/* ============================================================
   3. HEADER
   ============================================================ */
.site-header{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.92);backdrop-filter:saturate(160%) blur(8px);border-bottom:1px solid var(--line)}
.header-inner{display:flex;align-items:center;gap:18px;min-height:64px}
.brand{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.brand .logo-img{max-height:42px;width:auto}
.brand-name{font-size:1.32rem;font-weight:800;letter-spacing:-.02em;color:var(--ink);line-height:1}
.brand-name b{color:var(--brand)}
.brand-tag{display:block;font-size:.66rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-2);margin-top:3px}

.primary-nav{margin-left:auto}
.primary-nav ul{list-style:none;display:flex;align-items:center;gap:4px;margin:0;padding:0}
.primary-nav a{display:block;padding:.55em .8em;border-radius:8px;color:var(--ink);font-weight:600;font-size:.96rem}
.primary-nav a:hover,.primary-nav .current-menu-item>a{background:var(--brand-soft);color:var(--brand-dark)}
.primary-nav .menu-item-has-children{position:relative}
.primary-nav .sub-menu{position:absolute;top:100%;left:0;min-width:200px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:6px;display:none;z-index:50}
.primary-nav .menu-item-has-children:hover .sub-menu,.primary-nav .menu-item-has-children:focus-within .sub-menu{display:block}
.primary-nav .sub-menu a{padding:.5em .7em}

.header-tools{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.icon-btn{display:inline-grid;place-items:center;width:40px;height:40px;border:0;background:transparent;color:var(--ink);cursor:pointer;border-radius:9px}
.icon-btn:hover{background:var(--bg-soft)}
.icon-btn svg{width:21px;height:21px}
.menu-toggle{display:none}

/* search dropdown */
.header-search{display:none;border-top:1px solid var(--line);background:var(--bg-soft)}
.header-search.open{display:block}
.header-search form{display:flex;gap:8px;padding:14px 0;max-width:var(--maxw);margin:0 auto}
.header-search input[type=search]{flex:1;padding:.7em 1em;border:1px solid var(--line);border-radius:10px;font-size:1rem;background:#fff}
.header-search input[type=search]:focus{outline:none;border-color:var(--brand)}

/* mobile drawer */
.mobile-nav{position:fixed;inset:0 0 0 auto;width:min(82vw,320px);background:#fff;transform:translateX(100%);transition:transform .25s ease;z-index:80;box-shadow:-12px 0 40px rgba(0,0,0,.12);padding:18px;overflow-y:auto}
.mobile-nav.open{transform:translateX(0)}
.mobile-nav .close-row{display:flex;justify-content:flex-end;margin-bottom:6px}
.mobile-nav ul{list-style:none;margin:0;padding:0}
.mobile-nav a{display:block;padding:.8em .4em;border-bottom:1px solid var(--line);font-weight:600;color:var(--ink)}
.mobile-nav .sub-menu{padding-left:14px}
.nav-overlay{position:fixed;inset:0;background:rgba(15,30,30,.45);opacity:0;visibility:hidden;transition:.25s;z-index:70}
.nav-overlay.open{opacity:1;visibility:visible}

/* ============================================================
   4. LAYOUT SHELL
   ============================================================ */
.site-main{padding:28px 0 48px}
.content-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:40px;align-items:start}
.layout-full .content-grid{grid-template-columns:minmax(0,1fr)}

/* ============================================================
   5. HERO / FRONT PAGE
   ============================================================ */
.home-hero{background:linear-gradient(135deg,var(--brand-soft),#fff 60%);border-bottom:1px solid var(--line)}
.home-hero .wrap{padding-top:40px;padding-bottom:36px}
.home-hero h1{font-size:clamp(1.9rem,4.5vw,2.9rem);max-width:18ch;margin-bottom:.35em}
.home-hero h1 span{color:var(--brand)}
.home-hero p{font-size:1.12rem;color:var(--muted);max-width:54ch;margin-bottom:1.3em}
.hero-cats{display:flex;flex-wrap:wrap;gap:10px}
.hero-cats a{display:inline-flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);padding:.5em 1em;border-radius:40px;font-weight:700;font-size:.9rem;color:var(--ink);box-shadow:var(--shadow)}
.hero-cats a:hover{transform:translateY(-2px);color:var(--ink)}
.dot{width:9px;height:9px;border-radius:50%;background:var(--brand);flex:0 0 auto}

.section-head{display:flex;align-items:baseline;justify-content:space-between;margin:34px 0 18px;gap:14px}
.section-head h2{font-size:1.4rem;margin:0;position:relative;padding-left:14px}
.section-head h2::before{content:"";position:absolute;left:0;top:.18em;bottom:.18em;width:5px;border-radius:4px;background:var(--brand)}
.section-head .more{font-size:.86rem;font-weight:700;color:var(--muted)}
.section-head .more:hover{color:var(--accent)}

/* ============================================================
   6. POST CARDS / GRID
   ============================================================ */
.post-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:24px}
.layout-full .post-grid{grid-template-columns:repeat(3,1fr)}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:transform .18s ease,box-shadow .18s ease;display:flex;flex-direction:column}
.card:hover{transform:translateY(-4px);box-shadow:var(--shadow-hover)}
.card-thumb{display:block;position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--bg-soft)}
.card-thumb img{width:100%;height:100%;object-fit:cover;transition:transform .4s ease}
.card:hover .card-thumb img{transform:scale(1.04)}
/* Branded placeholder (shown when a post has no featured image) */
.ct-ph{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:flex-end;gap:.4rem;padding:18px 20px;box-sizing:border-box;color:#fff;background-color:var(--phc,#1f9d8f);background-image:radial-gradient(135% 130% at 100% 0%,rgba(255,255,255,.22),rgba(255,255,255,0) 55%),linear-gradient(165deg,rgba(0,0,0,0) 30%,rgba(15,33,36,.5) 100%)}
.ct-ph__cat{font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;font-weight:700;opacity:.95}
.ct-ph__title{font-size:1.1rem;line-height:1.28;font-weight:800;text-shadow:0 1px 2px rgba(0,0,0,.22);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.card:hover .ct-ph{filter:brightness(1.04)}
.card-body{padding:16px 18px 18px;display:flex;flex-direction:column;flex:1}
.cat-pill{display:inline-flex;align-items:center;gap:7px;font-size:.7rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--brand-dark);margin-bottom:9px}
.cat-pill .dot{width:8px;height:8px}
.card h3{font-size:1.12rem;margin:0 0 .4em;line-height:1.3}
.card h3 a{color:var(--ink)}
.card h3 a:hover{color:var(--brand)}
.card .excerpt{font-size:.94rem;color:var(--muted);margin:0 0 14px;line-height:1.6}
.card .meta{margin-top:auto;font-size:.78rem;color:var(--muted-2);display:flex;gap:10px;align-items:center}

/* featured / first card on home */
.feature-card{grid-column:1/-1;display:grid;grid-template-columns:1.15fr 1fr;align-items:stretch}
.feature-card .card-thumb{aspect-ratio:auto;height:100%;min-height:280px}
.feature-card .ct-ph__title{font-size:1.55rem;-webkit-line-clamp:4}
.feature-card .card-body{justify-content:center;padding:30px}
.feature-card h3{font-size:1.7rem}
.feature-card .excerpt{font-size:1rem}

/* ============================================================
   7. SIDEBAR
   ============================================================ */
.sidebar{position:sticky;top:84px}
.widget{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px;margin-bottom:24px}
.widget-title{font-size:.82rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 14px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.widget ul{list-style:none;margin:0;padding:0}
.widget li{margin:0;padding:9px 0;border-bottom:1px solid var(--line);font-size:.95rem}
.widget li:last-child{border-bottom:0}
.widget a{color:var(--ink);font-weight:600}
.widget a:hover{color:var(--brand)}
.widget select{width:100%;padding:.6em;border:1px solid var(--line);border-radius:8px}

/* popular posts widget look */
.pop-item{display:flex;gap:12px;align-items:center}
.pop-item .pop-thumb{flex:0 0 64px;width:64px;height:64px;border-radius:10px;overflow:hidden;background:var(--bg-soft)}
.pop-item .pop-thumb img{width:100%;height:100%;object-fit:cover}
.pop-item .pop-title{font-size:.9rem;font-weight:700;line-height:1.35;color:var(--ink)}
.pop-item .pop-meta{font-size:.74rem;color:var(--muted-2);margin-top:3px}

/* ad zone */
.ad-zone{margin:26px 0;text-align:center;min-height:1px}
.ad-zone--label{position:relative}
.ad-zone--label::before{content:"Advertisement";display:block;font-size:.62rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted-2);margin-bottom:6px}
.widget-ad{background:var(--bg-soft);border-style:dashed}

/* ============================================================
   8. SINGLE POST
   ============================================================ */
.single-article{background:#fff}
.article-head{max-width:var(--read);margin:0 auto;padding:8px 0 4px}
.breadcrumbs{font-size:.8rem;color:var(--muted-2);margin-bottom:16px}
.breadcrumbs a{color:var(--muted)}
.breadcrumbs span{margin:0 6px;color:var(--line)}
.article-head h1{font-size:clamp(1.7rem,3.8vw,2.6rem);margin-bottom:.45em}
.article-meta{display:flex;align-items:center;gap:14px;flex-wrap:wrap;font-size:.86rem;color:var(--muted);margin-bottom:8px}
.article-meta .author{display:flex;align-items:center;gap:8px;font-weight:600;color:var(--ink)}
.article-meta .avatar{width:34px;height:34px;border-radius:50%;object-fit:cover}
.featured-wrap{max-width:980px;margin:22px auto 0;border-radius:var(--radius);overflow:hidden}
.featured-wrap img{width:100%}
.featured-wrap .ct-ph{position:relative;min-height:300px}
.featured-wrap .ct-ph__title{font-size:1.7rem;-webkit-line-clamp:4}

.article-body{max-width:var(--read);margin:30px auto 0;font-size:1.09rem}
.article-body h2{font-size:1.6rem;margin:1.6em 0 .55em}
.article-body h3{font-size:1.28rem;margin:1.4em 0 .5em}
.article-body p{margin:0 0 1.25em}
.article-body img{border-radius:12px;margin:1.4em 0}
.article-body ul,.article-body ol{margin:0 0 1.3em;padding-left:1.4em}
.article-body li{margin:.5em 0}
.article-body a{text-decoration:underline;text-underline-offset:2px}
.article-body .tip-box{background:var(--bg-soft);border:1px solid var(--line);border-left:4px solid var(--brand);border-radius:10px;padding:14px 18px;margin:1.6em 0;font-size:1rem;color:var(--ink)}
.article-body .tip-box strong{color:var(--brand-dark,var(--brand))}
.article-body .tip-box p{margin:0}

/* health disclaimer box */
.med-disclaimer{max-width:var(--read);margin:30px auto;background:var(--accent-soft);border:1px solid #f6c9c2;border-left:4px solid var(--accent);border-radius:10px;padding:16px 18px;font-size:.9rem;color:#7a3b32}
.med-disclaimer strong{color:#a8362a}

.tip-box{background:var(--brand-soft);border:1px solid #cfe9e4;border-left:4px solid var(--brand);border-radius:10px;padding:16px 18px;margin:1.6em 0;font-size:.97rem}
.tip-box strong{color:var(--brand-dark)}

.article-footer{max-width:var(--read);margin:30px auto 0}
.tag-row{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}
.tag-row a{font-size:.8rem;background:var(--bg-soft);border:1px solid var(--line);padding:.4em .9em;border-radius:30px;color:var(--muted);font-weight:600}
.tag-row a:hover{color:var(--brand);border-color:var(--brand)}

.author-box{max-width:var(--read);margin:34px auto 0;display:flex;gap:18px;background:var(--bg-soft);border:1px solid var(--line);border-radius:var(--radius);padding:22px}
.author-box .avatar{width:64px;height:64px;border-radius:50%;flex:0 0 auto}
.author-box h4{margin:0 0 .3em}
.author-box p{margin:0;font-size:.92rem;color:var(--muted)}

.related{max-width:var(--maxw);margin:46px auto 0}
.related h2{font-size:1.35rem;margin-bottom:18px;padding-left:14px;position:relative}
.related h2::before{content:"";position:absolute;left:0;top:.15em;bottom:.15em;width:5px;border-radius:4px;background:var(--accent)}

/* ============================================================
   9. ARCHIVE / PAGE HEADERS
   ============================================================ */
.page-banner{background:var(--bg-soft);border-bottom:1px solid var(--line)}
.page-banner .wrap{padding:34px 18px 30px}
.page-banner h1{font-size:clamp(1.7rem,4vw,2.4rem);margin-bottom:.3em}
.page-banner p{color:var(--muted);margin:0;max-width:60ch}
.archive-accent{height:5px;border-radius:4px;width:60px;background:var(--brand);margin-bottom:16px}

.page-content{max-width:var(--read);margin:0 auto;font-size:1.06rem}
.page-content h2{margin:1.5em 0 .5em}
.page-content ul{margin-bottom:1.2em}

/* pagination */
.pagination{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin:40px 0 0}
.pagination .page-numbers{display:inline-grid;place-items:center;min-width:42px;height:42px;padding:0 12px;border:1px solid var(--line);border-radius:10px;font-weight:700;color:var(--ink);background:#fff}
.pagination .page-numbers.current{background:var(--brand);border-color:var(--brand);color:#fff}
.pagination a.page-numbers:hover{border-color:var(--brand);color:var(--brand)}

/* ============================================================
   10. COMMENTS
   ============================================================ */
.comments-area{max-width:var(--read);margin:44px auto 0}
.comments-area h2{font-size:1.3rem;margin-bottom:18px}
.comment-list{list-style:none;margin:0;padding:0}
.comment-list li{margin:0 0 18px;background:var(--bg-soft);border:1px solid var(--line);border-radius:12px;padding:16px}
.comment-author{font-weight:700;font-size:.95rem}
.comment-meta{font-size:.78rem;color:var(--muted-2);margin-bottom:8px}
.comment-form input,.comment-form textarea{width:100%;padding:.7em 1em;border:1px solid var(--line);border-radius:9px;font:inherit;font-size:1rem;margin-bottom:12px;background:#fff}
.comment-form textarea:focus,.comment-form input:focus{outline:none;border-color:var(--brand)}

/* ============================================================
   11. FOOTER
   ============================================================ */
.site-footer{background:var(--ink);color:#c9d6d6;margin-top:50px}
.footer-top{padding:46px 0 30px}
.footer-cols{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:40px}
.site-footer h4{color:#fff;font-size:.82rem;letter-spacing:.1em;text-transform:uppercase;margin:0 0 16px}
.site-footer .footer-about p{font-size:.92rem;color:#9fb2b2;line-height:1.7;margin:14px 0 0}
.site-footer .brand-name{color:#fff}
.site-footer .brand-name b{color:var(--brand)}
.footer-menu ul,.footer-cats ul{list-style:none;margin:0;padding:0}
.footer-menu li,.footer-cats li{margin:0 0 10px}
.footer-menu a,.footer-cats a{color:#b9c8c8;font-size:.93rem}
.footer-menu a:hover,.footer-cats a:hover{color:#fff}
.footer-bottom{border-top:1px solid rgba(255,255,255,.1);padding:18px 0;font-size:.84rem;color:#8ba0a0}
.footer-bottom .wrap{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;align-items:center}
.footer-bottom nav a{color:#9fb2b2;margin-left:16px}
.footer-bottom nav a:hover{color:#fff}

/* ============================================================
   12. COOKIE CONSENT BAR (AdSense friendly, no dependencies)
   ============================================================ */
.cookie-bar{position:fixed;left:14px;right:14px;bottom:14px;z-index:90;max-width:760px;margin:0 auto;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 50px rgba(0,0,0,.18);padding:16px 18px;display:none;align-items:center;gap:16px;flex-wrap:wrap}
.cookie-bar.show{display:flex}
.cookie-bar p{margin:0;font-size:.88rem;color:var(--muted);flex:1;min-width:220px;line-height:1.55}
.cookie-bar a{color:var(--brand-dark);text-decoration:underline;font-weight:600}
.cookie-actions{display:flex;gap:8px;flex:0 0 auto}
.cookie-actions button{cursor:pointer;border:0;font-weight:700;font-size:.86rem;padding:.6em 1.2em;border-radius:30px}
.cookie-accept{background:var(--brand);color:#fff}
.cookie-accept:hover{background:var(--brand-dark)}
.cookie-decline{background:var(--bg-soft);color:var(--ink);border:1px solid var(--line)!important}

/* ============================================================
   13. 404 + SEARCH
   ============================================================ */
.notfound{text-align:center;max-width:560px;margin:40px auto;padding:30px 0}
.notfound .code{font-size:5rem;font-weight:800;color:var(--brand);line-height:1}
.notfound p{color:var(--muted)}

/* WP core alignment helpers */
.aligncenter{margin-left:auto;margin-right:auto;display:block}
.alignleft{float:left;margin:.4em 1.4em 1em 0}
.alignright{float:right;margin:.4em 0 1em 1.4em}
.wp-caption{max-width:100%}
.wp-caption-text{font-size:.82rem;color:var(--muted-2);text-align:center;margin-top:6px}
.sticky,.bypostauthor{display:block}

/* ============================================================
   14. RESPONSIVE
   ============================================================ */
@media (max-width:980px){
  .content-grid{grid-template-columns:1fr;gap:34px}
  .sidebar{position:static}
  .layout-full .post-grid{grid-template-columns:repeat(2,1fr)}
  .footer-cols{grid-template-columns:1fr 1fr}
  .footer-about{grid-column:1/-1}
  .feature-card{grid-template-columns:1fr}
  .feature-card .card-thumb{min-height:200px}
}
@media (max-width:760px){
  body{font-size:17px}
  .primary-nav{display:none}
  .menu-toggle{display:inline-grid}
  .post-grid,.layout-full .post-grid{grid-template-columns:1fr;gap:20px}
  .footer-cols{grid-template-columns:1fr;gap:30px}
  .footer-bottom .wrap{flex-direction:column;text-align:center}
  .footer-bottom nav a{margin:0 8px}
  .author-box{flex-direction:column}
  h1{font-size:1.7rem}
  .article-body{font-size:1.05rem}
}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
