/*
Theme Name: S. G. Homeopathy
Theme URI: https://sghomeo.in/
Author: S. G. Homeopathy Clinic
Author URI: https://sghomeo.in/
Description: Official blog theme for S. G. HOMEOPATHY CLINIC — matching the main site design with Cormorant Garamond + DM Sans, sage/cream palette, fixed nav, and full footer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sg-homeopathy
Tags: blog, medical, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  --sage: #7a9e7e;
  --deep-sage: #4a6b4e;
  --earth: #c4a882;
  --warm-cream: #faf6ef;
  --parchment: #f2ead8;
  --ink: #1e2820;
  --muted-ink: #4a5240;
  --accent-gold: #b8965a;
  --light-sage: #e8f0e9;
  --white: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: 'DM Sans', sans-serif; background: var(--warm-cream); color: var(--ink); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--deep-sage); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-gold); }

/* ── NAV ────────────────────────────────────────────────────────────────────── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 5vw;
  background: rgba(250,246,239,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(122,158,126,0.2);
  transition: box-shadow 0.3s;
  min-height: 64px;
}
#site-header.scrolled { box-shadow: 0 2px 20px rgba(30,40,32,0.08); }
.nav-logo { display: flex; flex-direction: column; gap: 1px; text-decoration: none; }
.nav-logo-main { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; color: var(--deep-sage); letter-spacing: 0.02em; line-height: 1; }
.nav-logo-sub { font-size: 0.6rem; font-weight: 300; color: var(--accent-gold); letter-spacing: 0.15em; text-transform: uppercase; }

/* WordPress nav menu */
#primary-menu-wrap { display: none; }
#primary-menu-wrap ul { list-style: none; display: flex; gap: 2rem; align-items: center; }
#primary-menu-wrap ul li a { text-decoration: none; color: var(--muted-ink); font-size: 0.9rem; letter-spacing: 0.04em; transition: color 0.2s; }
#primary-menu-wrap ul li a:hover,
#primary-menu-wrap ul li.current-menu-item > a { color: var(--deep-sage); }
#primary-menu-wrap ul li.menu-cta a {
  background: var(--deep-sage); color: var(--white) !important;
  padding: 0.5rem 1.2rem; border-radius: 2px;
  font-size: 0.76rem !important; letter-spacing: 0.08em !important; text-transform: uppercase;
}
#primary-menu-wrap ul li.menu-cta a:hover { background: var(--accent-gold); }

/* Hamburger */
.hamburger { display: flex; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 6px; }
.hamburger span { display: block; width: 22px; height: 1.5px; background: var(--ink); transition: 0.3s; }
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
#mobile-menu {
  display: none; flex-direction: column; gap: 0;
  position: fixed; top: 64px; left: 0; right: 0;
  background: rgba(250,246,239,0.98); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(122,158,126,0.2);
  padding: 1rem 0; z-index: 99; max-height: calc(100vh - 64px); overflow-y: auto;
}
#mobile-menu.open { display: flex; }
#mobile-menu ul { list-style: none; }
#mobile-menu ul li { border-bottom: 1px solid rgba(122,158,126,0.1); }
#mobile-menu ul li a { display: block; padding: 0.9rem 5vw; font-size: 0.9rem; color: var(--ink); text-decoration: none; }
#mobile-menu ul li.menu-cta a { margin: 1rem 5vw; display: block; text-align: center; border-radius: 2px; padding: 0.8rem; background: var(--deep-sage); color: var(--white); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.08em; }

/* ── PAGE WRAPPER ────────────────────────────────────────────────────────────── */
#page-wrap { padding-top: 64px; }

/* ── BLOG HERO BANNER ───────────────────────────────────────────────────────── */
.blog-banner {
  background: linear-gradient(135deg, var(--light-sage) 0%, var(--parchment) 100%);
  padding: 3rem 5vw 2.5rem;
  border-bottom: 1px solid rgba(122,158,126,0.15);
}
.blog-banner-inner { max-width: 1200px; margin: 0 auto; }
.blog-eyebrow { font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--deep-sage); margin-bottom: 0.6rem; }
.blog-banner h1 { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 300; color: var(--ink); line-height: 1.15; }
.blog-banner h1 em { font-style: italic; color: var(--deep-sage); }
.blog-banner p { margin-top: 0.7rem; color: var(--muted-ink); font-size: 0.92rem; font-weight: 300; max-width: 560px; line-height: 1.7; }

/* ── MAIN CONTENT LAYOUT ─────────────────────────────────────────────────────── */
.site-main { max-width: 1200px; margin: 0 auto; padding: 3rem 5vw; display: grid; grid-template-columns: 1fr; gap: 3rem; }

/* ── POST CARD (archive/index) ──────────────────────────────────────────────── */
.post-card { background: var(--white); border: 1px solid rgba(122,158,126,0.12); border-radius: 4px; overflow: hidden; transition: box-shadow 0.25s, transform 0.25s; }
.post-card:hover { box-shadow: 0 8px 32px rgba(74,107,78,0.12); transform: translateY(-2px); }
.post-card-thumb { aspect-ratio: 16/9; overflow: hidden; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.post-card:hover .post-card-thumb img { transform: scale(1.03); }
.post-card-body { padding: 1.5rem; }
.post-card-category { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage); margin-bottom: 0.5rem; }
.post-card-title { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 400; color: var(--ink); line-height: 1.25; margin-bottom: 0.6rem; }
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--deep-sage); }
.post-card-excerpt { font-size: 0.88rem; color: var(--muted-ink); line-height: 1.7; font-weight: 300; margin-bottom: 1rem; }
.post-card-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.75rem; color: var(--muted-ink); border-top: 1px solid var(--light-sage); padding-top: 0.9rem; }
.post-card-meta time { color: var(--accent-gold); }
.read-more { display: inline-block; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--deep-sage); border-bottom: 1px solid var(--sage); padding-bottom: 1px; transition: color 0.2s, border-color 0.2s; }
.read-more:hover { color: var(--accent-gold); border-color: var(--accent-gold); }

/* Posts grid */
.posts-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }

/* ── SINGLE POST ─────────────────────────────────────────────────────────────── */
.single-post-hero { background: linear-gradient(135deg, var(--light-sage) 0%, var(--parchment) 100%); padding: 3rem 5vw 2rem; }
.single-post-hero-inner { max-width: 780px; margin: 0 auto; }
.single-post-category { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--deep-sage); margin-bottom: 0.7rem; display: block; }
.single-post-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 300; color: var(--ink); line-height: 1.15; margin-bottom: 1rem; }
.single-post-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted-ink); }
.single-post-meta time { color: var(--accent-gold); }

.single-post-featured { max-width: 1200px; margin: 0 auto; padding: 0 5vw; }
.single-post-featured img { width: 100%; max-height: 480px; object-fit: cover; border-radius: 4px; margin-top: -1.5rem; box-shadow: 0 8px 40px rgba(30,40,32,0.12); }

.single-post-content { max-width: 780px; margin: 2.5rem auto; padding: 0 5vw; }
.single-post-content .entry-content { font-size: 1rem; line-height: 1.85; color: var(--muted-ink); font-weight: 300; }
.single-post-content .entry-content h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; font-weight: 400; color: var(--ink); margin: 2rem 0 0.7rem; }
.single-post-content .entry-content h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 400; color: var(--ink); margin: 1.5rem 0 0.5rem; }
.single-post-content .entry-content p { margin-bottom: 1.2rem; }
.single-post-content .entry-content ul, .single-post-content .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.2rem; }
.single-post-content .entry-content li { margin-bottom: 0.4rem; }
.single-post-content .entry-content blockquote { border-left: 3px solid var(--sage); padding: 1rem 1.5rem; margin: 1.5rem 0; background: var(--light-sage); border-radius: 0 4px 4px 0; font-style: italic; }
.single-post-content .entry-content img { border-radius: 4px; margin: 1.5rem 0; }
.single-post-content .entry-content a { color: var(--deep-sage); border-bottom: 1px solid rgba(122,158,126,0.4); }
.single-post-content .entry-content a:hover { color: var(--accent-gold); border-color: var(--accent-gold); }

/* Post tags */
.post-tags { max-width: 780px; margin: 0 auto 2rem; padding: 0 5vw; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.post-tags a { font-size: 0.72rem; padding: 0.3rem 0.8rem; background: var(--light-sage); color: var(--deep-sage); border-radius: 100px; border: 1px solid rgba(122,158,126,0.3); transition: background 0.2s; }
.post-tags a:hover { background: var(--sage); color: var(--white); }

/* Medical disclaimer box */
.medical-disclaimer-box { max-width: 780px; margin: 0 auto 3rem; padding: 0 5vw; }
.medical-disclaimer-box-inner { background: var(--light-sage); border: 1px solid rgba(122,158,126,0.3); border-radius: 4px; padding: 1.2rem 1.5rem; font-size: 0.8rem; color: var(--muted-ink); line-height: 1.6; }
.medical-disclaimer-box-inner strong { color: var(--deep-sage); }

/* Author box */
.author-box { max-width: 780px; margin: 0 auto 3rem; padding: 0 5vw; }
.author-box-inner { background: var(--white); border: 1px solid rgba(122,158,126,0.15); border-radius: 4px; padding: 1.5rem; display: flex; gap: 1.2rem; align-items: flex-start; }
.author-box-avatar img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.author-box-info .author-name { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-bottom: 0.2rem; }
.author-box-info .author-bio { font-size: 0.82rem; color: var(--muted-ink); line-height: 1.6; font-weight: 300; }

/* Related posts */
.related-posts { max-width: 1200px; margin: 0 auto 3rem; padding: 0 5vw; }
.related-posts h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 300; color: var(--ink); margin-bottom: 1.5rem; }
.related-posts .posts-grid { grid-template-columns: 1fr; }

/* Comments */
.comments-section { max-width: 780px; margin: 0 auto 3rem; padding: 0 5vw; }
.comments-section h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 300; color: var(--ink); margin-bottom: 1.5rem; border-bottom: 1px solid var(--light-sage); padding-bottom: 0.8rem; }
.comment-list { list-style: none; }
.comment { padding: 1.2rem 0; border-bottom: 1px solid var(--light-sage); }
.comment-author-name { font-weight: 500; font-size: 0.9rem; color: var(--ink); }
.comment-date { font-size: 0.75rem; color: var(--accent-gold); margin-bottom: 0.5rem; }
.comment-body p { font-size: 0.88rem; color: var(--muted-ink); line-height: 1.7; }

/* Comment form */
.comment-respond { margin-top: 2rem; }
.comment-respond h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 300; color: var(--ink); margin-bottom: 1.2rem; }
.comment-form label { display: block; font-size: 0.78rem; color: var(--muted-ink); margin-bottom: 0.3rem; letter-spacing: 0.05em; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea { width: 100%; padding: 0.7rem 1rem; border: 1px solid rgba(122,158,126,0.3); border-radius: 2px; background: var(--white); font-family: 'DM Sans', sans-serif; font-size: 0.9rem; color: var(--ink); transition: border-color 0.2s; margin-bottom: 1rem; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--sage); }
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .submit { background: var(--deep-sage); color: var(--white); border: none; padding: 0.7rem 2rem; font-family: 'DM Sans', sans-serif; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; border-radius: 2px; transition: background 0.2s; }
.comment-form .submit:hover { background: var(--accent-gold); }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 2rem; }
.widget { background: var(--white); border: 1px solid rgba(122,158,126,0.12); border-radius: 4px; padding: 1.5rem; }
.widget-title { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 400; color: var(--ink); margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--light-sage); }
.widget ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.widget ul li a { font-size: 0.85rem; color: var(--muted-ink); transition: color 0.2s; }
.widget ul li a:hover { color: var(--deep-sage); }
.widget-search input[type="search"] { width: 100%; padding: 0.6rem 1rem; border: 1px solid rgba(122,158,126,0.3); border-radius: 2px; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; color: var(--ink); background: var(--warm-cream); }
.widget-search input:focus { outline: none; border-color: var(--sage); }
.widget-cta { background: linear-gradient(135deg, var(--deep-sage), var(--sage)); border: none; text-align: center; }
.widget-cta .widget-title { color: var(--white); border-color: rgba(255,255,255,0.2); }
.widget-cta p { font-size: 0.82rem; color: rgba(255,255,255,0.8); margin-bottom: 1rem; line-height: 1.6; }
.widget-cta a.btn { display: block; background: var(--white); color: var(--deep-sage); padding: 0.7rem 1.2rem; border-radius: 2px; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; transition: background 0.2s; }
.widget-cta a.btn:hover { background: var(--accent-gold); color: var(--white); }

/* ── PAGINATION ──────────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid rgba(122,158,126,0.3); border-radius: 2px; font-size: 0.82rem; color: var(--muted-ink); transition: all 0.2s; }
.pagination a:hover, .pagination .current { background: var(--deep-sage); color: var(--white); border-color: var(--deep-sage); }

/* ── FOOTER ──────────────────────────────────────────────────────────────────── */
footer { background: var(--ink); color: var(--white); padding: 3rem 5vw 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 600; color: var(--white); margin-bottom: 0.5rem; }
.footer-tagline { font-size: 0.78rem; color: rgba(255,255,255,0.4); line-height: 1.6; margin-bottom: 0.6rem; }
.ayush-badge { background: rgba(122,158,126,0.2); border: 1px solid rgba(122,158,126,0.3); color: var(--sage); padding: 0.3rem 0.8rem; border-radius: 2px; font-size: 0.63rem; letter-spacing: 0.12em; text-transform: uppercase; display: inline-block; }
.footer-col-title { font-size: 0.63rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sage); margin-bottom: 0.8rem; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { text-decoration: none; color: rgba(255,255,255,0.5); font-size: 0.82rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-copy { font-size: 0.7rem; color: rgba(255,255,255,0.3); }
.footer-copy a { color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-copy a:hover { color: var(--white); }

/* ── FLOATING CTA ────────────────────────────────────────────────────────────── */
.floating-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
  background: var(--deep-sage); color: var(--white);
  text-align: center; padding: 0.9rem 1rem;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.05em;
  text-decoration: none; display: block;
  transition: background 0.2s;
}
.floating-cta:hover { background: var(--accent-gold); color: var(--white); }

/* ── NO POSTS / ERROR ────────────────────────────────────────────────────────── */
.no-results { text-align: center; padding: 4rem 1rem; color: var(--muted-ink); }
.no-results h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; margin-bottom: 0.5rem; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-posts .posts-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  #site-header { padding: 1.2rem 5vw; }
  #primary-menu-wrap { display: flex; align-items: center; gap: 2rem; }
  .hamburger { display: none; }
  .site-main { grid-template-columns: 1fr 300px; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .related-posts .posts-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
  .footer-col-title { font-size: 0.7rem; }
  .footer-links a { font-size: 0.95rem; }
  .footer-copy { font-size: 0.82rem; }
}

@media (min-width: 1200px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── WORDPRESS ADMIN BAR FIX ─────────────────────────────────────────────────
   When logged in, WP adds a 32px admin bar at the top.
   We offset the fixed header and mobile menu accordingly.
   ──────────────────────────────────────────────────────────────────────────── */

/* Desktop admin bar = 32px */
.admin-bar #site-header {
  top: 32px;
}
.admin-bar #mobile-menu {
  top: calc(64px + 32px);
}
.admin-bar #page-wrap {
  padding-top: calc(64px + 32px);
}

/* Mobile admin bar collapses to 46px at <600px */
@media screen and (max-width: 600px) {
  .admin-bar #site-header {
    top: 46px;
  }
  .admin-bar #mobile-menu {
    top: calc(64px + 46px);
  }
  .admin-bar #page-wrap {
    padding-top: calc(64px + 46px);
  }
}

/* ── NAV LAYOUT FIX ──────────────────────────────────────────────────────────
   Ensure logo and menu items align properly and nav-cta button shows inline.
   ──────────────────────────────────────────────────────────────────────────── */
#site-header {
  gap: 2rem;
}

/* Make WordPress-generated menu ul flex properly */
#primary-menu-wrap #primary-menu {
  display: flex;
  list-style: none;
  gap: 1.8rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* Inline Book Appointment CTA next to menu */
.nav-cta-inline {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Fix: WordPress wraps menu in a div by default — unwrap it visually */
#primary-menu-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: flex-end;
}

/* Hide hamburger on desktop */
@media (min-width: 900px) {
  .hamburger { display: none !important; }
  #mobile-menu { display: none !important; }
}

/* Show hamburger only on mobile */
@media (max-width: 899px) {
  #primary-menu-wrap { display: none !important; }
  .hamburger { display: flex !important; }
}
