/* ============================================
   Arvind Nagarajan — Personal Site
   Teal-accent design matching Squarespace original
   ============================================ */

:root {
  --teal: #2b4c5e;
  --teal-light: #3a6478;
  --teal-dark: #1e3a4a;
  --text: #1a1a1a;
  --text-light: #555;
  --text-muted: #999;
  --bg: #fff;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --max-width: 1700px;
  --content-width: 900px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(26, 26, 26, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: var(--text);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr, .section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem auto;
  max-width: var(--content-width);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.2rem; margin-bottom: 0.5em; }
h2 { font-size: 1.35rem; margin-bottom: 0.5em; }
h3 { font-size: 1.5rem; margin-bottom: 0.5em; }
h4 { font-size: 1.2rem; margin-bottom: 0.5em; }

p { margin-bottom: 1.2em; }

blockquote {
  border-left: 3px solid var(--teal);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #444;
}

/* ============================================
   SITE HEADER — Dark Teal
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--teal);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}

.site-title:hover {
  text-decoration: none;
  color: rgba(255,255,255,0.85);
}

/* --- Navigation (white on teal) --- */
.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #fff;
  text-decoration: none;
}

/* Dropdown */
.dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--teal-dark);
  min-width: 240px;
  padding: 0.5rem 0;
  list-style: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 200;
}

.has-dropdown:hover .dropdown,
.has-dropdown.active .dropdown {
  display: block;
}

.dropdown-link {
  display: block;
  padding: 0.55rem 1.4rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255,255,255,0.8);
  transition: background 0.15s, color 0.15s;
}

.dropdown-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

/* Social links in nav */
.nav-social {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.3rem;
}

.social-link {
  display: flex;
  align-items: center;
  padding: 0.4rem;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}

.social-link:hover {
  color: #fff;
  text-decoration: none;
}

.social-link svg {
  fill: currentColor;
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================
   HERO SECTION (Homepage)
   ============================================ */
.hero {
  padding: 4rem 6vw;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-image img {
  width: 100%;
  max-width: 500px;
}

.hero-text h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-text h2 a {
  color: var(--teal);
  text-decoration: underline;
}

/* ============================================
   SECTION BANNER (Blog listing pages)
   ============================================ */
.section-banner {
  position: relative;
  width: 100%;
  height: 45vh;
  min-height: 320px;
  max-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-banner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
}

.section-banner-text {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 2rem;
}

.section-banner-text h1 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 3rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 0.3em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.section-banner-text p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.9);
  font-style: italic;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Section without banner */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 1rem;
}

.section-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 400;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ============================================
   FEATURED SECTIONS (Homepage)
   ============================================ */
.featured-section {
  padding: 2rem 6vw;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-container {
  max-width: var(--content-width);
  margin: 0 auto;
}

.featured-heading {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--teal);
}

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

.podcast-embed iframe {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
}

.podcast-description {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  text-align: center;
}

/* Featured Posts (list with thumbnails) */
.featured-posts {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.featured-post {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.featured-post:last-child {
  border-bottom: none;
}

.featured-post-image-link {
  flex-shrink: 0;
  width: 200px;
  overflow: hidden;
}

.featured-post-image {
  width: 200px;
  height: 133px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-post-image-link:hover .featured-post-image {
  transform: scale(1.05);
}

.featured-post-content h4 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.featured-post-content h4 a {
  text-decoration: none;
  color: var(--text);
}

.featured-post-content h4 a:hover {
  color: var(--teal);
}

.featured-post-content p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.read-more {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--teal);
}

.read-more:hover {
  text-decoration: underline;
  color: var(--teal);
}

/* Newsletter */
.newsletter-section {
  padding: 3rem 6vw;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.newsletter-section p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--teal);
  border: 2px solid var(--teal);
  transition: background 0.2s, color 0.2s;
}

.btn:hover {
  background: transparent;
  color: var(--teal);
  text-decoration: none;
}

/* ============================================
   SECTION PAGES (Blog Listings)
   ============================================ */
.section-page {
  padding: 3rem 6vw;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Post Grid — Cards with prominent images */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.post-card {
  background: var(--bg);
  overflow: hidden;
}

.post-card-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 3/2;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card-image-link:hover .post-card-image {
  transform: scale(1.05);
}

.post-card-content {
  padding: 1rem 0;
}

.post-card-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.post-card-title a {
  text-decoration: none;
  color: var(--text);
}

.post-card-title a:hover {
  color: var(--teal);
}

.post-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.post-card-excerpt {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.post-card .read-more {
  display: inline-block;
  margin-top: 0.3rem;
}

/* ============================================
   SINGLE POST
   ============================================ */
.post {
  padding: 3rem 6vw;
}

.post-container {
  max-width: 740px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2rem;
  text-align: center;
}

.post-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.post-categories {
  margin-top: 0.5rem;
}

.post-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--teal);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--teal);
}

.post-hero {
  margin-bottom: 2rem;
}

.post-hero img {
  width: 100%;
}

/* Post Content */
.post-content {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #333;
}

.post-content h2 { font-size: 1.6rem; margin-top: 2.5rem; margin-bottom: 0.8rem; }
.post-content h3 { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.6rem; }
.post-content h4 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.post-content img { margin: 1.5rem 0; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1.2em; }
.post-content li { margin-bottom: 0.4em; }
.post-content iframe { width: 100%; margin: 1.5rem 0; }

.post-content a {
  color: var(--teal);
}

/* YouTube shortcode */
.post-content .youtube,
.page-body .youtube {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
}

.post-content .youtube iframe,
.page-body .youtube iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ============================================
   STATIC PAGES (recommendations, published)
   ============================================ */
.page-content {
  padding: 3rem 6vw;
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-content h1 {
  font-family: 'Libre Baskerville', Georgia, serif;
  text-align: center;
  margin-bottom: 2rem;
}

.page-content h2 { margin-top: 2.5rem; }
.page-content h3 { margin-top: 2rem; color: var(--teal); }
.page-content img { margin: 1rem 0; }
.page-content a { color: var(--teal); }

/* Page layout */
.page {
  padding: 3rem 6vw;
}

.page-container {
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.page-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 400;
}

.page-body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #333;
}

.page-body h2 { margin-top: 2.5rem; }
.page-body h3 { margin-top: 2rem; color: var(--teal); }
.page-body img { margin: 1rem 0; }
.page-body a { color: var(--teal); }
.page-body hr { margin: 2rem 0; }

/* Book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.book-item {
  text-align: center;
}

.book-item img {
  width: 100%;
  max-width: 140px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.3s;
}

.book-item img:hover {
  transform: translateY(-3px);
}

.book-item p {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--text-light);
}

/* Article list */
.article-list { list-style: none; }
.article-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--border-light); }
.article-list a { font-weight: 600; color: var(--teal); }
.article-list .article-source { font-size: 0.85rem; color: #888; margin-left: 0.5rem; }

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.video-item iframe { width: 100%; aspect-ratio: 16/9; }
.video-item p { font-size: 0.9rem; color: var(--text-light); margin-top: 0.5rem; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 2.5rem 6vw;
  text-align: center;
  background: var(--teal-dark);
  color: rgba(255,255,255,0.7);
  margin-top: 3rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.footer-social a {
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
  text-decoration: none;
}

.footer-social a:hover {
  color: #fff;
}

.footer-social a svg {
  fill: currentColor;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  list-style: none;
}

.page-item a,
.page-item span {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
}

.page-item.active span {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-image img {
    max-width: 350px;
    margin: 0 auto;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .featured-post {
    flex-direction: column;
  }

  .featured-post-image-link { width: 100%; }
  .featured-post-image { width: 100%; height: 200px; }
  .post-title { font-size: 1.8rem; }
  .section-banner-text h1 { font-size: 2rem; }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--teal-dark);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }

  .site-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    padding: 1rem 0;
    gap: 0;
  }

  .nav-item { width: 100%; }

  .nav-link {
    display: block;
    padding: 0.7rem 2rem;
  }

  .dropdown {
    position: static;
    box-shadow: none;
    padding-left: 1.5rem;
    background: transparent;
  }

  .has-dropdown .dropdown { display: none; }
  .has-dropdown.active .dropdown { display: block; }

  .nav-social {
    margin-left: 0;
    padding: 0.7rem 2rem;
    justify-content: flex-start;
  }

  .hero { padding: 2rem 5vw; }
  .header-inner { padding: 0.8rem 5vw; }

  .featured-section,
  .section-page,
  .post,
  .newsletter-section { padding-left: 5vw; padding-right: 5vw; }

  .video-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .section-banner { height: 35vh; min-height: 250px; }
}

/* Menu toggle active */
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
