/* ====================================================================
   Pragmatic Gita design system for WordPress / Divi pages.
   Same tokens, fonts and mood as pg-pages/home.php, applied to
   everything WordPress renders: posts, pages, archives, search,
   category pages, comments, 404.

   Scoping philosophy:
   - Chrome (header, footer) uses pg- prefixed classes and is fully ours.
   - Content typography is set with gentle specificity on Divi's own
     wrappers (#main-content, #left-area, .entry-content) so that any
     styling you set inside the Divi Builder on a specific module still
     wins. The Builder stays in charge of layout; we supply the voice.
   ==================================================================== */

:root{
  --ink:#221A12;
  --muted:#6A5E4E;
  --cream:#FBF6EC;
  --surface:#FFFFFF;
  --hairline:#E8DEC9;
  --indigo:#201C3A;
  --indigo-soft:#2C2752;
  --indigo-line:#473F75;
  --indigo-text:#F3ECDB;
  --indigo-muted:#B9AFCD;
  --saffron:#C9741A;
  --saffron-deep:#A85F0E;
  --saffron-soft:#F6E7C9;
  --saffron-soft-text:#7A4A0C;
  --maroon:#7C2D2D;
  --font-serif:'Spectral', Georgia, 'Times New Roman', serif;
  --font-deva:'Tiro Devanagari Sanskrit','Noto Serif Devanagari', Georgia, serif;
  --font-sans:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --maxw:1080px;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;}
html,body.pg-theme{max-width:100%;overflow-x:clip;}
body.pg-theme{
  background:var(--cream);
  color:var(--ink);
  font-family:var(--font-sans);
  font-size:17px;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body.pg-theme :focus-visible{outline:2.5px solid var(--saffron);outline-offset:3px;border-radius:4px;}

.pg-wrap{max-width:var(--maxw);margin:0 auto;
  padding-left:max(24px, env(safe-area-inset-left));
  padding-right:max(24px, env(safe-area-inset-right));}

.pg-skip{position:absolute;left:-9999px;top:0;background:var(--ink);color:#fff;padding:10px 16px;z-index:200;}
.pg-skip:focus{left:8px;top:8px;border-radius:6px;}

/* Divi's own top/main header remnants must never show. */
body.pg-theme #top-header,
body.pg-theme #main-header{display:none !important;}

/* ------------------------------------------------------------------ */
/* Divi Theme Builder chrome                                           */
/* ------------------------------------------------------------------ */
/* functions.php already tells Divi not to inject Theme Builder header
   and footer layouts. This is the CSS backstop in case a future Divi
   version changes that mechanism; the old header (podcast badges) and
   the old dark footer must never appear alongside the new chrome. */
body.pg-theme .et-l--header,
body.pg-theme .et-l--footer{display:none !important;}

/* Theme Builder BODY layouts keep working, but they are held to the
   same reading column as everything else. This is what restores the
   left and right margins on posts rendered through a Theme Builder
   template whose row was set to full width. */
body.pg-theme .et-l--body .et_pb_row{
  width:90% !important;
  max-width:var(--maxw) !important;
  margin-left:auto !important;
  margin-right:auto !important;}
body.pg-theme .et-l--body .et_pb_section{
  padding-left:max(24px, env(safe-area-inset-left));
  padding-right:max(24px, env(safe-area-inset-right));
  background-color:transparent;}
body.pg-theme .et-l--body{background:var(--cream);}

/* Divi sometimes pads the page top to make room for its fixed header. */
body.pg-theme #page-container{padding-top:0 !important;background:var(--cream);}

/* ------------------------------------------------------------------ */
/* Header (identical look to home.php)                                 */
/* ------------------------------------------------------------------ */
.pg-nav{position:sticky;top:0;z-index:100;background:rgba(251,246,236,.9);
  backdrop-filter:saturate(140%) blur(8px);border-bottom:1px solid var(--hairline);}
body.admin-bar .pg-nav{top:32px;}
@media (max-width:782px){ body.admin-bar .pg-nav{top:46px;} }

.pg-nav-in{display:flex;align-items:center;justify-content:space-between;height:66px;}
.pg-brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--ink);}
.pg-brand:hover{color:var(--ink);}
.pg-mark{width:44px;height:44px;object-fit:contain;flex:none;display:block;
  background:none;border:0;border-radius:0;}
.pg-brand b{font-family:var(--font-serif);font-weight:600;font-size:20px;letter-spacing:.01em;}

.pg-menu{display:flex;align-items:center;gap:26px;}
.pg-menu a{font-size:15px;color:var(--ink);text-decoration:none;}
.pg-menu a:hover{color:var(--saffron-deep);}
.pg-pods{display:flex;gap:14px;align-items:center;padding-left:8px;border-left:1px solid var(--hairline);}
.pg-pods a{color:var(--muted);display:inline-flex;}
.pg-pods a:hover{color:var(--saffron-deep);}
.pg-pods svg{width:19px;height:19px;}

.pg-burger{display:none;background:none;border:1px solid var(--hairline);border-radius:8px;
  width:42px;height:42px;align-items:center;justify-content:center;cursor:pointer;color:var(--ink);padding:0;}
.pg-burger svg{width:22px;height:22px;}

/* Anchor jumps must clear the sticky header. */
body.pg-theme [id]{scroll-margin-top:88px;}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */
.pg-foot{background:#19162C;color:#B9AFCD;padding:46px 0;}
.pg-foot-in{display:flex;justify-content:space-between;align-items:center;gap:24px;flex-wrap:wrap;}
.pg-foot-nav{display:flex;gap:22px;flex-wrap:wrap;font-size:14.5px;}
.pg-foot-nav a{color:inherit;text-decoration:none;}
.pg-foot-nav a:hover{color:#E0B05A;}
.pg-social{display:flex;gap:16px;}
.pg-social a{color:#9A8FB5;}
.pg-social a:hover{color:#E0B05A;}
.pg-social svg{width:20px;height:20px;}
.pg-copy{font-size:13.5px;color:#7E7499;width:100%;margin:0;}

/* Divi's own footer, if a template ever prints it, stays hidden. */
body.pg-theme #main-footer{display:none !important;}

/* ------------------------------------------------------------------ */
/* Content area                                                        */
/* ------------------------------------------------------------------ */
body.pg-theme #main-content{background:var(--cream);}
body.pg-theme #main-content .container{
  width:90% !important;max-width:var(--maxw) !important;margin:0 auto !important;
  padding-top:48px;padding-bottom:64px;
  padding-left:max(0px, env(safe-area-inset-left));
  padding-right:max(0px, env(safe-area-inset-right));}

/* Theme Builder Post Title module, when a body template supplies the
   title instead of the classic entry-title. */
body.pg-theme .et_pb_post_title .entry-title{
  font-family:var(--font-serif) !important;font-weight:500 !important;
  color:var(--ink) !important;font-size:clamp(30px,4.4vw,44px);line-height:1.22;}
body.pg-theme .et_pb_post_title .et_pb_title_meta_container,
body.pg-theme .et_pb_post_title .et_pb_title_meta_container a{
  font-size:12.5px;letter-spacing:.1em;text-transform:uppercase;
  color:var(--saffron-deep) !important;}

/* Reading typography inside posts and classic pages. The same voice is
   applied to Divi's classic content column (#left-area) and to the
   Theme Builder Post Content module (.et_pb_post_content), so posts
   read identically whichever way Divi renders them. */
body.pg-theme #left-area,
body.pg-theme .et_pb_post_content{font-size:17px;line-height:1.7;color:var(--ink);}
body.pg-theme #left-area p,
body.pg-theme .et_pb_post_content p{font-size:17px;line-height:1.7;color:var(--ink);}
body.pg-theme #left-area h1,
body.pg-theme #left-area h2,
body.pg-theme #left-area h3,
body.pg-theme #left-area h4,
body.pg-theme .et_pb_post_content h1,
body.pg-theme .et_pb_post_content h2,
body.pg-theme .et_pb_post_content h3,
body.pg-theme .et_pb_post_content h4{
  font-family:var(--font-serif);font-weight:500;line-height:1.25;color:var(--ink);
  padding-bottom:0;}
body.pg-theme #left-area h1,
body.pg-theme .et_pb_post_content h1{font-size:clamp(28px,4vw,40px);letter-spacing:-.01em;}
body.pg-theme #left-area h2,
body.pg-theme .et_pb_post_content h2{font-size:clamp(24px,3vw,32px);margin-top:1.6em;}
body.pg-theme #left-area h3,
body.pg-theme .et_pb_post_content h3{font-size:clamp(20px,2.4vw,24px);margin-top:1.4em;}
body.pg-theme #left-area h4,
body.pg-theme .et_pb_post_content h4{font-size:18px;margin-top:1.2em;}
body.pg-theme #left-area a,
body.pg-theme .et_pb_post_content a{color:var(--saffron-deep);text-decoration:none;
  border-bottom:1px solid rgba(200,116,26,.35);}
body.pg-theme #left-area a:hover,
body.pg-theme .et_pb_post_content a:hover{color:var(--saffron);border-bottom-color:var(--saffron);}
body.pg-theme #left-area img,
body.pg-theme .et_pb_post_content img{border-radius:14px;height:auto;}
body.pg-theme #left-area blockquote,
body.pg-theme .et_pb_post_content blockquote{
  border-left:3px solid var(--saffron);background:var(--surface);
  border-radius:0 12px 12px 0;padding:18px 22px;margin:1.4em 0;
  font-family:var(--font-serif);color:var(--ink);}
body.pg-theme #left-area strong,
body.pg-theme .et_pb_post_content strong{color:var(--ink);}
body.pg-theme #left-area hr,
body.pg-theme .et_pb_post_content hr{border:0;border-top:1px solid var(--hairline);margin:2em 0;}
body.pg-theme #left-area table,
body.pg-theme .et_pb_post_content table{border-collapse:collapse;width:100%;}
body.pg-theme #left-area table td,
body.pg-theme #left-area table th,
body.pg-theme .et_pb_post_content table td,
body.pg-theme .et_pb_post_content table th{border:1px solid var(--hairline);padding:10px 12px;}

/* Post title + meta on single posts and archives. */
body.pg-theme .entry-title,
body.pg-theme .entry-title a{
  font-family:var(--font-serif) !important;font-weight:500 !important;
  color:var(--ink) !important;line-height:1.22;text-decoration:none;}
body.pg-theme .et_pb_post .entry-title{font-size:clamp(24px,3vw,34px);}
body.pg-theme .single .entry-title{font-size:clamp(30px,4.4vw,44px);}
body.pg-theme .post-meta,
body.pg-theme .post-meta a{
  font-size:12.5px !important;letter-spacing:.1em;text-transform:uppercase;
  color:var(--saffron-deep) !important;text-decoration:none;border-bottom:0;}
body.pg-theme .post-meta a:hover{color:var(--saffron) !important;}

/* Archive, category, search and blog listings become cards. */
body.pg-theme.archive .et_pb_post,
body.pg-theme.search .et_pb_post,
body.pg-theme.blog .et_pb_post{
  background:var(--surface);border:1px solid var(--hairline);border-radius:14px;
  padding:26px 28px;margin-bottom:22px;
  transition:border-color .15s ease, transform .15s ease;}
body.pg-theme.archive .et_pb_post:hover,
body.pg-theme.search .et_pb_post:hover,
body.pg-theme.blog .et_pb_post:hover{border-color:var(--saffron);transform:translateY(-2px);}
body.pg-theme .et_pb_post .entry-featured-image-url img,
body.pg-theme .et_pb_post img.wp-post-image{border-radius:12px;}
body.pg-theme .et_pb_post .more-link{
  display:inline-flex;margin-top:10px;font-size:14.5px;color:var(--saffron-deep);border-bottom:0;}

/* Pagination */
body.pg-theme .pagination a,
body.pg-theme .wp-pagenavi a,
body.pg-theme .wp-pagenavi span{
  color:var(--saffron-deep);border:1px solid var(--hairline);border-radius:999px;
  padding:7px 14px;background:var(--surface);text-decoration:none;}
body.pg-theme .pagination a:hover,
body.pg-theme .wp-pagenavi a:hover{border-color:var(--saffron);background:var(--saffron-soft);}

/* Previous / next links on single posts. */
body.pg-theme .nav-single a,
body.pg-theme .et_post_nav a{
  color:var(--saffron-deep);font-size:15px;border-bottom:0;}
body.pg-theme .nav-single a:hover,
body.pg-theme .et_post_nav a:hover{color:var(--saffron);}

/* ------------------------------------------------------------------ */
/* Sidebar and widget areas                                            */
/* ------------------------------------------------------------------ */
/* Covers Divi's classic sidebar (#sidebar), Theme Builder sidebar
   modules (.et_pb_widget_area) and any stray widget wrapper. */
body.pg-theme #sidebar,
body.pg-theme .et_pb_widget_area{color:var(--ink);}

body.pg-theme #sidebar .et_pb_widget,
body.pg-theme .et_pb_widget_area .et_pb_widget{
  background:var(--surface);border:1px solid var(--hairline);border-radius:14px;
  padding:22px 24px;margin-bottom:20px;float:none;width:100%;max-width:100%;}

/* Widget titles in Spectral, whatever class or tag Divi gives them.
   The bare h4/h5 selectors matter; they outrank the Poppins-style
   heading font the old Divi customizer settings still broadcast. */
body.pg-theme #sidebar .widgettitle,
body.pg-theme #sidebar .widget-title,
body.pg-theme #sidebar h4,
body.pg-theme #sidebar h5,
body.pg-theme .et_pb_widget_area .widgettitle,
body.pg-theme .et_pb_widget_area .widget-title,
body.pg-theme .et_pb_widget_area h4,
body.pg-theme .et_pb_widget_area h5{
  font-family:var(--font-serif) !important;font-weight:500 !important;
  font-size:19px !important;line-height:1.3 !important;
  color:var(--ink) !important;margin:0 0 12px !important;padding:0 !important;
  text-transform:none !important;letter-spacing:0 !important;}

/* Widget links in the site's saffron, matching the reading column. */
body.pg-theme #sidebar a,
body.pg-theme .et_pb_widget_area a{
  color:var(--saffron-deep);text-decoration:none;border-bottom:0;
  font-size:15px;line-height:1.5;}
body.pg-theme #sidebar a:hover,
body.pg-theme .et_pb_widget_area a:hover{color:var(--saffron);}

body.pg-theme #sidebar li,
body.pg-theme .et_pb_widget_area li{
  border-bottom:1px solid var(--hairline);padding:9px 0;margin:0;line-height:1.45;}
body.pg-theme #sidebar li:last-child,
body.pg-theme .et_pb_widget_area li:last-child{border-bottom:0;padding-bottom:0;}
body.pg-theme .et_pb_widget ul{list-style:none;padding:0;margin:0;}

/* Search widget. Divi renders a plain input plus a submit button that
   float apart; joining them into one pill keeps it tidy. */
body.pg-theme .widget_search form,
body.pg-theme #sidebar .searchform,
body.pg-theme .et_pb_widget_area .searchform,
body.pg-theme .et_pb_searchform{
  display:flex !important;align-items:stretch;gap:0;position:relative;}
body.pg-theme .widget_search input[type="text"],
body.pg-theme .widget_search input[type="search"],
body.pg-theme #sidebar .searchform input[type="text"],
body.pg-theme #sidebar .searchform input[type="search"],
body.pg-theme .et_pb_searchform input.et_pb_s{
  flex:1;min-width:0;margin:0 !important;
  background:var(--cream);border:1px solid var(--hairline);border-right:0;
  border-radius:10px 0 0 10px;padding:11px 14px;font-size:15px;color:var(--ink);
  height:auto;position:static;}
body.pg-theme .widget_search input[type="submit"],
body.pg-theme #sidebar .searchform input[type="submit"],
body.pg-theme .et_pb_searchform input.et_pb_searchsubmit{
  flex:none;margin:0 !important;position:static;width:auto;height:auto;
  background:var(--saffron);color:#FFF6E8;border:1px solid var(--saffron);
  border-radius:0 10px 10px 0;padding:11px 18px;font-size:14.5px;font-weight:500;
  font-family:var(--font-sans);cursor:pointer;}
body.pg-theme .widget_search input[type="submit"]:hover,
body.pg-theme #sidebar .searchform input[type="submit"]:hover{background:#DB8326;}

body.pg-theme #sidebar input[type="text"],
body.pg-theme #sidebar input[type="search"]{width:100%;}

/* Divi draws a vertical divider between content and sidebar; soften it. */
body.pg-theme #main-content .container:before{background:transparent;}
body.pg-theme #sidebar .et_pb_widget:last-child{margin-bottom:0;}

/* ------------------------------------------------------------------ */
/* Buttons, forms, comments                                            */
/* ------------------------------------------------------------------ */
body.pg-theme .et_pb_button,
body.pg-theme button[type="submit"],
body.pg-theme input[type="submit"],
body.pg-theme #commentform .form-submit input{
  background:var(--saffron);color:#FFF6E8;border:1px solid transparent;
  border-radius:10px;padding:13px 22px;font-size:15.5px;font-weight:500;
  font-family:var(--font-sans);cursor:pointer;transition:background .18s ease;}
body.pg-theme .et_pb_button:hover,
body.pg-theme button[type="submit"]:hover,
body.pg-theme input[type="submit"]:hover,
body.pg-theme #commentform .form-submit input:hover{background:#DB8326;padding:13px 22px;}
body.pg-theme .et_pb_button:after{display:none;}

body.pg-theme #commentform input[type="text"],
body.pg-theme #commentform input[type="email"],
body.pg-theme #commentform input[type="url"],
body.pg-theme #commentform textarea{
  background:var(--surface);border:1px solid var(--hairline);border-radius:10px;
  padding:12px 14px;font-size:15px;color:var(--ink);width:100%;}
body.pg-theme #comment-wrap{padding-top:36px;}
body.pg-theme .comment-body{
  background:var(--surface);border:1px solid var(--hairline);border-radius:14px;
  padding:18px 20px;}
body.pg-theme h1#comment-section,
body.pg-theme #reply-title{
  font-family:var(--font-serif);font-weight:500;color:var(--ink);}

/* ------------------------------------------------------------------ */
/* Table of contents plugin box, if present                            */
/* ------------------------------------------------------------------ */
body.pg-theme #ez-toc-container,
body.pg-theme .ez-toc-v2_0_74,
body.pg-theme .lwptoc{
  background:var(--surface) !important;border:1px solid var(--hairline) !important;
  border-radius:14px !important;padding:18px 22px !important;box-shadow:none !important;}
body.pg-theme #ez-toc-container a{border-bottom:0;}

/* ------------------------------------------------------------------ */
/* Devanagari inside posts                                             */
/* ------------------------------------------------------------------ */
body.pg-theme #left-area [lang="sa"],
body.pg-theme .et_pb_post_content [lang="sa"],
body.pg-theme #left-area .pg-deva,
body.pg-theme .et_pb_post_content .pg-deva{
  font-family:var(--font-deva);line-height:2.0;color:var(--maroon);
  overflow-wrap:break-word;word-break:normal;}

/* ------------------------------------------------------------------ */
/* Mobile                                                               */
/* ------------------------------------------------------------------ */
@media (max-width:900px){
  .pg-menu,.pg-pods{display:none;}
  .pg-burger{display:flex;}
  .pg-menu.open{display:flex;position:absolute;top:67px;left:0;right:0;
    flex-direction:column;gap:0;background:var(--cream);
    border-bottom:1px solid var(--hairline);padding:8px 24px 16px;align-items:stretch;}
  .pg-menu.open a{padding:12px 0;border-bottom:1px solid var(--hairline);}
  .pg-menu.open .pg-pods{display:flex;border-left:0;padding:14px 0 0;}
}
@media (max-width:600px){
  body.pg-theme{font-size:16px;}
  body.pg-theme #main-content .container{padding-top:32px;padding-bottom:44px;}
}
@media (prefers-reduced-motion:reduce){
  body.pg-theme *{transition:none !important;}
}
