/*
Theme Name: Dr BKG
Description: Personal website of Dr. B. K. Gairola — Technology, Governance and India's Future
Template: twentytwentyfive
Version: 1.0.9
Text Domain: drbkg-theme
*/

/* ===== TOKENS ===== */
:root {
  --navy: #17324C;
  --gold: #B99A66;
  --ivory: #F5F3ED;
  --white: #FFFFFF;
  --charcoal: #26313A;
  --slate: #65727D;
  --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --reading-width: 680px;
}

/* ===== GLOBAL ===== */
body {
  background: var(--ivory) !important;
  color: var(--charcoal);
  font-family: var(--font-sans) !important;
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* ===== MASTHEAD / HEADER ===== */
/* Signature element: navy masthead with a 2px gold base rule */
header.wp-block-template-part {
  background: var(--navy) !important;
  border-bottom: 2px solid var(--gold);
}

.wp-block-site-title {
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  font-size: 1.125rem !important;
  letter-spacing: 0.04em;
  margin: 0 !important;
}
.wp-block-site-title a {
  color: var(--white) !important;
  text-decoration: none !important;
}
.wp-block-site-title a:hover {
  color: var(--gold) !important;
}

.wp-block-navigation a,
.wp-block-navigation .wp-block-navigation-item__content {
  color: var(--white) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none !important;
  opacity: 0.9;
}
.wp-block-navigation a:hover,
.wp-block-navigation .wp-block-navigation-item:hover > .wp-block-navigation-item__content {
  color: var(--gold) !important;
  opacity: 1;
}
.wp-block-navigation__responsive-container-open {
  color: var(--white) !important;
}
.wp-block-navigation__responsive-container-open svg path {
  fill: var(--white) !important;
}
/* Mobile nav overlay */
.wp-block-navigation__responsive-container {
  background: var(--navy) !important;
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6,
.wp-block-heading {
  font-family: var(--font-serif) !important;
  color: var(--navy);
  line-height: 1.25;
}
h1 { font-size: clamp(1.875rem, 4vw, 3rem); }
h2 { font-size: clamp(1.375rem, 2.5vw, 1.875rem); }
h3 { font-size: 1.25rem; }

/* ===== LINKS ===== */
a { color: var(--navy); text-decoration-color: rgba(23,50,76,0.3); }
a:hover { color: var(--gold); text-decoration-color: var(--gold); }

/* ===== BUTTONS ===== */
.wp-block-button__link,
.wp-element-button {
  font-family: var(--font-sans) !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0 !important;
  padding: 10px 24px !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: var(--navy) !important;
  color: var(--white) !important;
  border: 1px solid var(--navy);
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent !important;
  border: 1px solid var(--navy) !important;
  color: var(--navy) !important;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}

/* ===== GOLD SEPARATORS ===== */
.wp-block-separator {
  border-color: var(--gold) !important;
  opacity: 0.45 !important;
}

/* ===== FOOTER ===== */
footer.wp-block-template-part {
  background: var(--navy) !important;
  border-top: 2px solid rgba(185, 154, 102, 0.4);
}
footer.wp-block-template-part h1,
footer.wp-block-template-part h2,
footer.wp-block-template-part h3,
footer.wp-block-template-part h4 {
  color: var(--white) !important;
}
footer.wp-block-template-part p,
footer.wp-block-template-part li,
footer.wp-block-template-part .wp-block-site-title {
  color: rgba(255,255,255,0.72) !important;
}
footer.wp-block-template-part a {
  color: rgba(255,255,255,0.72) !important;
}
footer.wp-block-template-part a:hover {
  color: var(--gold) !important;
}
footer.wp-block-template-part .wp-block-site-title a {
  color: rgba(255,255,255,0.72) !important;
}

/* ===== HIDE REDUNDANT PAGE TITLES ===== */
/* Front page: title is in the hero block */
.home .wp-block-post-title:is(h1) {
  display: none !important;
}
/* About Me page: content opens with the person's name heading, page title is redundant */
.page-id-6 .wp-block-post-title {
  display: none !important;
}

/* ===== POST ARCHIVE / BLOG LIST ===== */
.wp-block-post-title a {
  font-family: var(--font-serif) !important;
  color: var(--navy) !important;
  text-decoration: none !important;
  font-weight: 700;
}
.wp-block-post-title a:hover {
  color: var(--gold) !important;
}
/* Clean title on single/page (no border) — comes BEFORE the query rule so query rule overrides */
.single .wp-block-post-title,
.page .wp-block-post-title {
  border-left: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}
/* Signature: vertical gold left-border on article titles in archive lists and query loops.
   Placed AFTER the page cleanup rule so this takes precedence on pages with query loops. */
.blog .wp-block-post-title,
.archive .wp-block-post-title,
.drbkg-writings .wp-block-post-title,
.wp-block-query .wp-block-post-title {
  border-left: 3px solid var(--gold) !important;
  padding-left: 0.875rem !important;
  margin-left: -0.875rem !important;
}
.wp-block-post-date,
.wp-block-post-date time {
  color: var(--gold) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wp-block-post-excerpt__excerpt {
  color: var(--slate);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.wp-block-post-excerpt__more-link {
  color: var(--navy) !important;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* ===== SINGLE POST / PAGE ===== */
.single .wp-block-post-title.wp-block-heading {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}
/* Center the reading column on non-home pages.
   The content area has alignfull class which FSE gives margin: -50px.
   Override with !important so it centers properly. */
.single .entry-content.wp-block-post-content,
.page:not(.home) .entry-content.wp-block-post-content {
  max-width: 760px !important;
  width: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
  position: static !important;
  transform: none !important;
  left: auto !important;
}
.wp-block-post-content h2 {
  margin-top: 2.5em;
  padding-top: 0.875em;
  border-top: 1px solid rgba(185, 154, 102, 0.3);
  font-size: 1.375rem;
}
.wp-block-post-content h3 {
  margin-top: 2em;
  font-size: 1.125rem;
}
.wp-block-post-content blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 1.5rem;
  color: var(--slate);
  font-style: italic;
}

/* ===== HOME PAGE HERO ===== */
.drbkg-hero {
  padding-top: 5rem !important;
  padding-bottom: 4.5rem !important;
}
.drbkg-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem) !important;
  line-height: 1.1 !important;
  margin-bottom: 0.5em !important;
  letter-spacing: -0.01em;
}
.drbkg-subtitle {
  font-family: var(--font-serif) !important;
  font-style: italic;
  color: var(--gold) !important;
  font-size: 1.25rem !important;
  margin-bottom: 2em !important;
  line-height: 1.4;
}
.drbkg-credentials {
  color: var(--slate) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.875rem !important;
  font-style: normal;
  line-height: 1.5;
  margin-top: 0.75em !important;
  margin-bottom: 1.75em !important;
  max-width: 600px;
  letter-spacing: 0.01em;
}
.drbkg-intro {
  color: var(--slate) !important;
  font-size: 1.0625rem;
  max-width: 600px;
  margin-bottom: 2.5em !important;
  line-height: 1.75;
}

/* ===== FULL-WIDTH SECTION BREAKOUT ===== */
/* Make the homepage content area itself full-width so alignfull sections can expand naturally.
   On other pages, constrained layout stays at reading width. */
.home .entry-content.wp-block-post-content {
  max-width: 100vw !important;
  width: 100vw !important;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Full-width for the navy/white homepage sections.
   Width is 100% + 15px to cover the 15px scrollbar that shifts the containing block's 50% calc.
   overflow-x: hidden on html clips the 7.5px left overflow. */
.alignfull.drbkg-interests,
.alignfull.drbkg-writings {
  width: calc(100% + 15px) !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: -15px !important;
  box-sizing: border-box;
}

/* Clip the small left-side overflow caused by the content area offset */
html { overflow-x: hidden; }

/* ===== HOME — AREAS OF INTEREST (navy section) ===== */
.drbkg-interests {
  background: var(--navy) !important;
  padding-top: 4.5rem !important;
  padding-bottom: 4.5rem !important;
}
.drbkg-interests .drbkg-section-label {
  font-family: var(--font-sans) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold) !important;
  margin-bottom: 2.5em !important;
}
/* Signature: gold top-border on each interest heading */
.drbkg-interests h2,
.drbkg-interests .wp-block-heading {
  color: var(--white) !important;
  font-size: 1.1875rem !important;
  border-top: 2px solid var(--gold);
  padding-top: 1em;
  margin-top: 0 !important;
  margin-bottom: 0.75em !important;
}
.drbkg-interests p {
  color: rgba(255,255,255,0.78) !important;
  font-size: 0.9375rem;
  line-height: 1.7;
}
/* Vertical gold divider between columns on desktop */
@media (min-width: 782px) {
  .drbkg-interests .wp-block-columns {
    gap: 0 !important;
  }
  .drbkg-interests .wp-block-column:first-child {
    padding-right: 3rem;
    border-right: 1px solid rgba(185, 154, 102, 0.35);
  }
  .drbkg-interests .wp-block-column:last-child {
    padding-left: 3rem;
  }
}

/* ===== HOME — RECENT WRITINGS ===== */
.drbkg-writings {
  background: var(--white) !important;
  padding-top: 4.5rem !important;
  padding-bottom: 4.5rem !important;
}
.drbkg-writings .drbkg-section-label {
  font-family: var(--font-sans) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--slate) !important;
  margin-bottom: 2.5em !important;
  padding-bottom: 1em;
  border-bottom: 1px solid rgba(185, 154, 102, 0.4);
}

/* ===== ABOUT PAGE ===== */
.drbkg-about-header {
  padding-top: 4rem !important;
  padding-bottom: 3rem !important;
  border-bottom: 1px solid rgba(185, 154, 102, 0.4) !important;
  margin-bottom: 3rem !important;
}
.drbkg-about-header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem) !important;
  margin-bottom: 0.4em !important;
}
.drbkg-about-role {
  font-family: var(--font-serif) !important;
  font-style: italic;
  color: var(--gold) !important;
  font-size: 1.125rem !important;
  margin: 0 !important;
}
.drbkg-interest-block {
  border-left: 3px solid var(--gold) !important;
  padding-left: 1.25rem !important;
  margin-top: 2rem !important;
  margin-bottom: 2rem !important;
}
.drbkg-interest-block h3 {
  font-size: 1.0625rem !important;
  margin-bottom: 0.5em !important;
  color: var(--navy) !important;
}
.drbkg-interest-block p {
  font-size: 0.9375rem;
  color: var(--slate);
  margin: 0 !important;
}

/* ===== PORTRAIT ===== */
.drbkg-hero-portrait {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
}
.drbkg-about-portrait {
  display: flex !important;
  align-items: flex-start;
  justify-content: flex-end;
}
.drbkg-hero-portrait .wp-block-image,
.drbkg-about-portrait .wp-block-image {
  width: 100%;
  margin: 0;
}
.drbkg-hero-portrait .wp-block-image img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 15%;
  max-height: 400px;
  display: block;
}
.drbkg-about-portrait .wp-block-image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  max-height: 260px;
  display: block;
}
@media (max-width: 781px) {
  .drbkg-hero-portrait,
  .drbkg-about-portrait {
    justify-content: center;
    max-width: 220px;
    margin: 0 auto 1.5rem;
    order: -1;
  }
}

/* ===== ACCESSIBILITY ===== */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== MOBILE ===== */
@media (max-width: 781px) {
  body { font-size: 1rem; }
  .drbkg-hero { padding-top: 3rem !important; padding-bottom: 2.5rem !important; }
  .drbkg-interests,
  .drbkg-writings { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  .wp-block-post-title { margin-left: 0; }
}
