/* ==========================================================================
   Pradeep Hingorani — home page design (scoped under .ph)
   Ported 1:1 from the original static design; every class is prefixed "ph-"
   so it can never collide with Astra or other themes/plugins.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* ============ TOKENS ============ */
:root{
  --ph-ivory:#F6F2EA;
  --ph-ivory-deep:#EFE9DC;
  --ph-charcoal:#1B1A17;
  --ph-charcoal-soft:#33322D;
  --ph-terracotta:#B15E3B;
  --ph-green:#33483B;
  --ph-warm-gray:#847A6B;
  --ph-hairline:rgba(27,26,23,0.14);
  --ph-display:'Fraunces', Georgia, serif;
  --ph-body:'IBM Plex Sans', -apple-system, sans-serif;
  --ph-max:1180px;
}

/* Only the static front page carries this design. */
body.home{
  background:var(--ph-ivory);
  color:var(--ph-charcoal);
  font-family:var(--ph-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

html{ scroll-behavior:smooth; }

.ph, .ph *, .ph *::before, .ph *::after{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

.ph{
  width:100%;
  max-width:none;
  /* Astra's dynamic CSS pads direct .entry-content block children by 48px. */
  padding:0 !important;
}

/* Astra's .entry-content p { margin-bottom:1.6em } (0,1,1) beats the bare
   component rules below, so zero paragraph margins here (equal specificity,
   loaded after Astra) and give margin-bearing components a .ph prefix. */
.ph p{ margin-bottom:0; }

/* Headings inherit the design's charcoal (Astra otherwise colours them). */
.ph-hero-title,
.ph-featured-title,
.ph-identity-title,
.ph-observation .ph-quote{
  color:var(--ph-charcoal);
}

.ph a{ color:inherit; text-decoration:none; }
.ph img{ max-width:100%; display:block; }

.ph-wrap{
  max-width:var(--ph-max);
  margin:0 auto;
  padding:0 32px;
}

@media (max-width:640px){
  .ph-wrap{ padding:0 20px; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .ph *{ animation:none !important; transition:none !important; }
  html{ scroll-behavior:auto !important; }
}

/* ============ REVEAL ON SCROLL ============ */
/* Hidden only when JS is present (html.ph-js) so content is never lost. */
html.ph-js .ph-reveal{
  opacity:0;
  transform:translateY(14px);
  transition:opacity .7s ease, transform .7s ease;
}
html.ph-js .ph-reveal.in{
  opacity:1;
  transform:translateY(0);
}

@media (prefers-reduced-motion: reduce){
  html.ph-js .ph-reveal{
    opacity:1;
    transform:none;
    transition:none;
  }
}

/* ============ MARGINALIA (signature element) ============ */
.ph-marginalia{
  font-family:var(--ph-display);
  font-style:italic;
  font-weight:400;
  font-size:14px;
  color:var(--ph-terracotta);
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:10px;
  transform:rotate(-1.2deg);
}
.ph-marginalia::before{
  content:"";
  width:26px;
  height:1px;
  background:currentColor;
  opacity:.55;
  display:inline-block;
}

/* ============ HEADER ============ */
/* Sticky lives on the wrapper, not .ph-header: the .ph wrapper only wraps the
   header, so its containing block is the body — a sticky .ph-header would be
   trapped in a parent just as tall as itself and could never stick. */
.ph-header-wrap{
  position:sticky;
  top:0;
  z-index:1000;
  background:var(--ph-ivory);
}
.ph-header{
  position:relative;
  padding:26px 0;
  border-bottom:1px solid var(--ph-hairline);
}
.ph-header .ph-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
.ph-logo{
  font-family:var(--ph-display);
  font-weight:600;
  font-size:18px;
  letter-spacing:0.04em;
}
.ph-nav{
  display:flex;
  gap:36px;
  font-size:13px;
  letter-spacing:0.12em;
  font-weight:500;
}
.ph-nav a{
  opacity:.75;
  transition:opacity .25s ease;
  position:relative;
}
.ph-nav a:hover, .ph-nav a:focus-visible{ opacity:1; }
.ph-nav a.current{ opacity:1; }
.ph-nav a::before{
  content:"";
  position:absolute;
  left:0; bottom:-6px;
  width:0%;
  height:1px;
  background:var(--ph-terracotta);
  transition:width .3s ease;
}
.ph-nav a:hover::before, .ph-nav a:focus-visible::before{ width:100%; }

/* Native menu markup: wp_nav_menu emits ul/li. Turn the lists into inline rows
   inside the flex chrome (the <nav class="ph-nav"> / <div class="ph-footer-links">). */
.ph-nav ul,
.ph-nav li,
.ph-footer-links ul,
.ph-footer-links li{
  margin:0;
  padding:0;
  list-style:none;
}
/* Dropdown caret: a small ▾ after any top-level item that has children
   (e.g. Guide) — signals the item opens a dropdown. */
.ph-nav > ul > .menu-item-has-children > a::after{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  margin-left:9px;
  border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  vertical-align:middle;
}
/* Nested (level-3) toggle caret: e.g. "South India" inside the Guide
   dropdown. Matches the top-level ▾ style and flips to point up when its own
   list of guides (Kerala, Karnataka, Tamil Nadu…) is expanded. */
.ph-nav .sub-menu .menu-item-has-children > a::after{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  margin-left:9px;
  border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .25s ease;
  vertical-align:middle;
}
.ph-nav .sub-menu .menu-item-has-children.ph-sub-open > a::after{
  transform:rotate(225deg) translateY(2px);
}

/* Desktop dropdown menus */
.ph-nav .menu-item-has-children{
  position:relative;
}

.ph-nav .sub-menu{
  position:absolute;
  top:100%;
  left:0;
  display:none;
  flex-direction:column;
  gap:0;
  min-width:200px;
  margin:0;
  padding:10px 0;
  background:var(--ph-ivory);
  border:1px solid var(--ph-hairline);
  z-index:100;
}

.ph-nav .menu-item-has-children:hover > .sub-menu,
.ph-nav .menu-item-has-children:focus-within > .sub-menu{
  display:flex;
}

.ph-nav .sub-menu li{
  display:block;
  width:100%;
}

.ph-nav .sub-menu a{
  display:block;
  padding:8px 16px;
  white-space:nowrap;
}
/* No underline sweep inside the dropdown (that's a top-bar affordance). */
.ph-nav .sub-menu a::before{ display:none; }

/* Level-3 accordion (e.g. South India's Kerala/Karnataka/Tamil Nadu list):
   never a hover flyout, never absolutely positioned — it expands in the
   normal document flow so it pushes Eastern India / North East etc. down
   instead of covering them. Open/closed state is toggled by ph-nav.js via
   the .ph-sub-open class; max-height is set inline to the measured content
   height so the roll-down/roll-up animates smoothly. */
.ph-nav .sub-menu .sub-menu{
  position:static;
  display:block;
  flex-direction:column;
  min-width:0;
  margin:0;
  padding:0;
  background:transparent;
  border:0;
  max-height:0;
  overflow:hidden;
  transition:max-height .3s ease;
}
.ph-nav .sub-menu .menu-item-has-children:hover > .sub-menu,
.ph-nav .sub-menu .menu-item-has-children:focus-within > .sub-menu{
  display:block; /* override the flex/flyout hover rule above; visibility is
                     governed by max-height + .ph-sub-open, not by :hover */
}
.ph-nav .sub-menu .sub-menu li{
  width:100%;
}
.ph-nav .sub-menu .sub-menu a{
  padding:8px 16px 8px 30px;
  font-size:13px;
  opacity:.85;
}
/* The empty Astra dropdown-toggle span inside the Guide link — hide it so no
   stray glyph or padding sits next to the caret. */
.ph-nav .dropdown-menu-toggle{ display:none; }
.ph-nav > ul{
  display:flex;
  gap:36px;
  align-items:center;
}
.ph-footer-links ul{
  display:flex;
  gap:22px;
  flex-wrap:wrap;
  align-items:center;
}

.ph-lang{
  font-size:13px;
  letter-spacing:0.06em;
  display:flex;
  gap:6px;
  font-weight:500;
  white-space:nowrap;
}
.ph-lang a{ opacity:.55; transition:opacity .25s ease; }
.ph-lang a.active{ opacity:1; color:var(--ph-terracotta); }
.ph-lang a:hover{ opacity:1; }
.ph-lang .sep{ opacity:.4; }

/* Hamburger toggle — hidden on desktop, drives the mobile dropdown. */
.ph-nav-toggle{
  display:none;
  position:relative;
  width:34px;
  height:34px;
  border:1px solid var(--ph-hairline);
  border-radius:2px;
  background:transparent;
  cursor:pointer;
  padding:0;
  flex:none;
}
.ph-nav-toggle span{
  display:block;
  position:absolute;
  left:9px;
  width:14px;
  height:2px;
  background:var(--ph-charcoal);
  transition:top .25s ease, transform .25s ease, opacity .2s ease;
}
.ph-nav-toggle span:nth-child(1){ top:11px; }
.ph-nav-toggle span:nth-child(2){ top:16px; }
.ph-nav-toggle span:nth-child(3){ top:21px; }

/* Mobile: the primary nav becomes a dropdown panel under the header. */
@media (max-width:640px){
  .ph-header .ph-wrap{ gap:12px; }
  .ph-nav-toggle{ display:block; }
  .ph-nav{
    display:none;
    position:absolute;
    top:100%;
    left:0;
    right:0;
    background:var(--ph-ivory);
    border-bottom:1px solid var(--ph-hairline);
    padding:4px 20px 16px;
    z-index:50;
  }
  .ph-header.ph-nav-open .ph-nav{ display:block; }
  .ph-nav > ul{
    flex-direction:column;
    align-items:stretch;
    gap:0;
  }
  .ph-nav li{ width:100%; }
  .ph-nav a{
    display:block;
    padding:12px 0;
    font-size:14px;
    border-bottom:1px solid var(--ph-hairline);
  }
  .ph-nav a::before{ display:none; }
  /* Mobile submenu: keep children in the navigation panel */
  .ph-nav .menu-item-has-children{
    position:static;
  }

  .ph-nav .sub-menu{
    position:static;
    display:flex;
    flex-direction:column;
    min-width:0;
    padding:0 0 0 16px;
    background:transparent;
    border:0;
  }

  .ph-nav .sub-menu li{
    width:100%;
  }

  .ph-nav .sub-menu a{
    padding:10px 0;
    white-space:normal;
  }
  .ph-header.ph-nav-open .ph-nav-toggle span:nth-child(1){ top:16px; transform:rotate(45deg); }
  .ph-header.ph-nav-open .ph-nav-toggle span:nth-child(2){ opacity:0; }
  .ph-header.ph-nav-open .ph-nav-toggle span:nth-child(3){ top:16px; transform:rotate(-45deg); }
}

/* ============ HERO ============ */
.ph-hero{
  padding:110px 0 90px;
}
.ph-hero .ph-wrap{
  display:grid;
  grid-template-columns:1.3fr 0.9fr;
  gap:64px;
  align-items:end;
}
.ph-hero-title{
  font-family:var(--ph-display);
  font-weight:500;
  font-size:clamp(42px, 6vw, 78px);
  line-height:1.04;
  letter-spacing:-0.01em;
}
.ph-hero-title em{
  font-style:italic;
  font-weight:400;
  color:var(--ph-terracotta);
}
.ph-hero-side{
  padding-bottom:8px;
}
.ph .ph-hero-sub{
  font-size:17px;
  color:var(--ph-charcoal-soft);
  max-width:34ch;
  margin-bottom:28px;
}
.ph-cta{
  margin:0;
}
.ph-cta a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  font-weight:600;
  letter-spacing:0.04em;
  padding-bottom:3px;
  border-bottom:1px solid var(--ph-charcoal);
  transition:gap .25s ease, border-color .25s ease, color .25s ease;
}
.ph-cta a:hover, .ph-cta a:focus-visible{
  gap:14px;
  border-color:var(--ph-terracotta);
  color:var(--ph-terracotta);
}

@media (max-width:820px){
  .ph-hero .ph-wrap{ grid-template-columns:1fr; gap:28px; }
  .ph-hero{ padding:70px 0 60px; }
}

/* ============ FEATURED ESSAY ============ */
.ph-featured{
  padding:70px 0 110px;
  border-top:1px solid var(--ph-hairline);
}
.ph-featured-grid{
  display:grid !important;
  grid-template-columns:0.95fr 1.05fr;
  gap:56px;
  align-items:center;
}
.ph-featured-grid > .wp-block-column,
.ph-identity-grid > .wp-block-column{ min-width:0; }
.ph-featured-photo{
  aspect-ratio:4/5;
  background:
    repeating-linear-gradient(135deg, var(--ph-ivory-deep), var(--ph-ivory-deep) 2px, transparent 2px, transparent 14px),
    linear-gradient(160deg, #E4DCC9, #D8CEB6);
  border:1px solid var(--ph-hairline);
  display:flex;
  align-items:flex-end;
  padding:18px;
  font-family:var(--ph-body);
  font-size:12px;
  letter-spacing:0.08em;
  color:var(--ph-warm-gray);
  position:relative;
  overflow:hidden;
}
.ph-caption{
  background:var(--ph-ivory);
  padding:6px 10px;
  border:1px solid var(--ph-hairline);
  font-size:12px;
  letter-spacing:0.08em;
  color:var(--ph-warm-gray);
}
.ph .ph-featured-eyebrow{
  margin-bottom:18px;
}
.ph-featured-title{
  font-family:var(--ph-display);
  font-weight:500;
  font-size:clamp(32px, 4vw, 50px);
  line-height:1.06;
  margin-bottom:22px;
}
.ph .ph-excerpt{
  font-family:var(--ph-display);
  font-style:italic;
  font-size:19px;
  line-height:1.55;
  color:var(--ph-charcoal-soft);
  max-width:46ch;
  margin-bottom:26px;
}
.ph .ph-meta{
  display:flex;
  align-items:center;
  gap:18px;
  font-size:12px;
  letter-spacing:0.1em;
  color:var(--ph-warm-gray);
  margin-bottom:30px;
  text-transform:uppercase;
}
.ph-meta .dot{
  width:3px; height:3px;
  border-radius:50%;
  background:var(--ph-warm-gray);
}

@media (max-width:820px){
  .ph-featured-grid{ grid-template-columns:1fr; gap:32px; }
  .ph-featured{ padding:50px 0 70px; }
}

/* ============ IDENTITY (About + India-from-within) ============ */
.ph-identity{
  background:var(--ph-ivory-deep);
  padding:100px 0;
}
.ph-identity-grid{
  display:grid !important;
  grid-template-columns:0.85fr 1.15fr;
  gap:64px;
  align-items:center;
}
.ph-identity-photo{
  aspect-ratio:1/1;
  background:
    repeating-linear-gradient(45deg, #DCD3BE, #DCD3BE 2px, transparent 2px, transparent 14px),
    linear-gradient(200deg, #CFC4A9, #E4DCC9);
  border:1px solid var(--ph-hairline);
  display:flex;
  align-items:flex-end;
  padding:16px;
}

/* A photo set via the editor's "Background image" on these frames fills them
   edge-to-edge (cover) instead of tiling or letterboxing. Placed after the
   shorthand rules above so it wins the cascade. */
.ph-featured-photo,
.ph-identity-photo{
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}
.ph .ph-identity-eyebrow{
  margin-bottom:20px;
}
.ph-identity-title{
  font-family:var(--ph-display);
  font-weight:500;
  font-size:clamp(28px, 3.4vw, 38px);
  margin-bottom:22px;
  line-height:1.15;
}
.ph .ph-body{
  font-size:16px;
  color:var(--ph-charcoal-soft);
  max-width:54ch;
  margin-bottom:16px;
}
.ph-identity .ph-cta{ margin-top:14px; }

@media (max-width:820px){
  .ph-identity-grid{ grid-template-columns:1fr; gap:32px; }
  .ph-identity{ padding:70px 0; }
  .ph-identity .ph-photo-col{ max-width:280px; }
}

/* ============ EDITORIAL OBSERVATION ============ */
.ph-observation{
  padding:110px 0;
  text-align:center;
}
.ph-observation .ph-wrap{
  max-width:800px;
}
.ph .ph-obs-label{
  display:block;
  margin-bottom:34px;
  justify-content:center;
}
/* 0,3,1 beats WP's inline .wp-block-quote:not(...):not(...) (0,3,0) so the
   design's borderless quote wins over Gutenberg's default left border. */
.ph-observation .ph-wrap blockquote.ph-quote{
  margin:0;
  padding:0;
  border:none;
  font-family:var(--ph-display);
  font-weight:500;
  font-size:clamp(26px, 3.6vw, 40px);
  line-height:1.35;
  letter-spacing:-0.005em;
}
.ph-observation .ph-quote p{
  margin:0;
}

@media (max-width:640px){
  .ph-observation{ padding:70px 0; }
}

/* ============ FOOTER ============ */
.ph-footer{
  border-top:1px solid var(--ph-hairline);
  padding:40px 0;
}
.ph-footer .ph-wrap{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  font-size:13px;
  color:var(--ph-warm-gray);
}
.ph-footer-logo{
  font-family:var(--ph-display);
  font-style:italic;
  color:var(--ph-charcoal);
}
.ph-footer-links{
  display:flex;
  gap:22px;
  flex-wrap:wrap;
}
.ph-footer-links a{ opacity:.8; transition:opacity .2s ease; }
.ph-footer-links a:hover{ opacity:1; color:var(--ph-terracotta); }

/* ============ ASTRA WRAPPER NEUTRALISATION ============
   The home page is fully self-contained (own header/footer), so strip any
   padding/margins Astra puts around the page content. */
body.home #content,
body.home #content .ast-container,
body.home #primary,
body.home #main,
body.home article,
body.home .ast-article-single,
body.home .entry-content{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  border:none;
  box-shadow:none;
  background:transparent;
}

body.home .entry-header{ display:none !important; }

/* ============ GERMAN TYPOGRAPHY ============
   The DE copy runs longer, so the design's display sizes are a step
   smaller (as in index-de.html). html[lang^="de"] matches "de-DE". */
html[lang^="de"] .ph-hero-title{
  font-size:clamp(40px, 5.6vw, 74px);
  line-height:1.08;
}
html[lang^="de"] .ph .ph-hero-sub{ max-width:36ch; }
html[lang^="de"] .ph-featured-title{
  font-size:clamp(30px, 3.8vw, 48px);
  line-height:1.1;
}
html[lang^="de"] .ph .ph-excerpt{ max-width:48ch; }
html[lang^="de"] .ph-identity-title{
  font-size:clamp(26px, 3.1vw, 36px);
  line-height:1.22;
}
html[lang^="de"] .ph .ph-body{ max-width:56ch; }
html[lang^="de"] .ph-observation .ph-wrap{ max-width:820px; }
html[lang^="de"] .ph-observation .ph-wrap blockquote.ph-quote{
  font-size:clamp(24px, 3.3vw, 38px);
  line-height:1.4;
}
