/*
Theme Name: Expert Theme
Theme URI: http://example.com/
Author: Generated by ChatGPT
Author URI: http://example.com/
Description: Lightweight responsive WordPress theme with in-content ad widgets, overlay ads, dark mode, related posts, updated-on display and SEO meta handling.
Version: 1.0
License: GNU GPL v2 or later
Text Domain: expert-theme
*/

:root{
  --bg:#ffffff; --text:#111827; --muted:#6b7280; --accent:#2563eb; --card:#f8fafc;
}
[data-theme="dark"]{
  --bg:#0b1220; --text:#e6eef8; --muted:#9aa7b6; --accent:#3b82f6; --card:#071025;
}

*{box-sizing:border-box; margin:0; padding:0;}
html, body {overflow-x:hidden;}   /* FIX right-side scrolling */

body{
  font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
}

a{color:var(--accent);text-decoration:none}

.container{
  max-width:1100px;
  margin:0 auto;
  padding:16px;
}

/* HEADER */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  flex-wrap:wrap;                 /* FIX for mobile */
}
.brand{
  font-weight:700;
  font-size:20px;
  border-radius:14px;
}
.top-controls{
  display:flex;
  gap:8px;
  align-items:center;
}
.search-small input{
  padding:6px 8px;
  border-radius:8px;
  border:1px solid #ddd;
  width:160px;
}
.toggle-dark{
  cursor:pointer;
  padding:6px;
  border-radius:8px;
  border:1px solid #ddd;
}

/* MAIN LAYOUT */
.layout{
  display:grid;
  grid-template-columns:3fr 1fr;   /* 75 / 25 desktop */
  gap:20px;
  margin-top:16px;
}

.content{
  background:var(--card);
  padding:14px;
  border-radius:12px;
}

.sidebar{
  background:transparent;
  padding:8px;
}

/* POST */
.post-meta{
  color:var(--muted);
  font-size:14px;
  margin-bottom:8px;
}
.post-title{
  font-size:26px;
  margin:6px 0;
}

/* FEATURED IMAGE */
.featured{
  max-width:160px;
  height:auto;
  float:left;
  margin-right:12px;
  border-radius:6px;
}

/* RELATED POSTS */
.related{
  margin-top:22px;
  padding-top:12px;
  border-top:1px dashed #ccc;
}

/* OVERLAY AD */
.overlay-ad{
  position:fixed;
  left:0; right:0; bottom:0;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:12px;
  background:rgba(0,0,0,0.6);
  z-index:9999;
}
.overlay-ad .box{
  background:var(--card);
  padding:12px;
  border-radius:8px;
  max-width:980px;
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.overlay-ad .close{margin-left:12px;cursor:pointer}

.ad-right{
  position:sticky;
  top:16px;
}

/* MOBILE FIXES */
@media(max-width:900px){
  .layout{
    grid-template-columns:1fr;
    padding-bottom:80px;
  }

  .header{justify-content:center;}

  .search-small input{width:120px}

  .featured{
    float:none;
    display:block;
    margin:0 auto 10px;
    max-width:120px;
  }

  .overlay-ad .box{
    border-radius:6px;
    padding:8px;
  }
}
