/*
Theme Name: Byalk
Theme URI: https://github.com/alok/byalk-theme
Author: Antigravity
Author URI: https://gemini.google.com
Description: A warm, minimalist theme designed for personal blogs and poetry, with full support for Malayalam typography.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: byalk
*/

/* ==========================================================================
   CSS Custom Properties & Design Tokens
   ========================================================================== */
:root {
  --bg-color: #faf6f0;          /* Warm organic cream */
  --text-color: #24292f;        /* Elegant dark slate */
  --text-muted: #57606a;        /* Muted charcoal */
  --accent-color: #b2533e;      /* Handcrafted terracotta */
  --accent-hover: #913f2e;      /* Deeper terracotta */
  --border-color: #e2dacf;      /* Subtle warm gray line */
  --card-bg: #ffffff;           /* Pure white card backgrounds */
  --site-width: 960px;          /* Clean line length */
  --content-width: 680px;       /* Optimal reading measure */
  
  /* Typography scales */
  --font-serif: "Noto Serif Malayalam", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Manjari", "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  /* Elegant print-paper dot pattern to make the theme feel tactile & less flat */
  background-image: 
    radial-gradient(rgba(178, 83, 62, 0.04) 1px, transparent 0),
    radial-gradient(rgba(178, 83, 62, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 1.125rem; /* 18px */
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
}

/* Malayalam specific spacing */
body:lang(ml) p, .post-content p {
  letter-spacing: 0.01em;
  word-spacing: 0.02em;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  display: block;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-container {
  max-width: var(--site-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Sticky Header Section (Glassmorphic)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(250, 246, 240, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 0;
  transition: var(--transition-smooth);
}

.site-header .site-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.site-branding {
  text-align: left;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0;
}

.site-title a {
  color: var(--text-color);
}

.site-title a:hover {
  color: var(--accent-color);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

.main-navigation a {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  position: relative;
  padding-bottom: 0.25rem;
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: var(--transition-smooth);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
  width: 100%;
}

.main-navigation a:hover {
  color: var(--accent-color);
}

/* ==========================================================================
   Parallax Hero Section
   ========================================================================== */
.hero-parallax {
  position: relative;
  height: 380px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3.5rem;
}

.hero-parallax-bg {
  position: absolute;
  top: -80px;
  left: 0;
  width: 100%;
  height: calc(100% + 160px);
  background-size: cover;
  background-position: center;
  z-index: 1;
  transform: translateY(0);
  will-change: transform;
}

.hero-parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(250, 246, 240, 0.45) 0%,
    rgba(250, 246, 240, 0.85) 100%
  );
  z-index: 2;
}

.hero-parallax-content {
  position: relative;
  z-index: 3;
  padding: 0 1.5rem;
  max-width: 700px;
}

.hero-parallax-content h1 {
  font-size: 3.25rem;
  font-family: var(--font-serif);
  color: var(--text-color);
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 4px rgba(250, 246, 240, 0.6);
}

.hero-parallax-content p {
  font-size: 1.15rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-bottom: 0;
  text-shadow: 0 1px 2px rgba(250, 246, 240, 0.6);
}

/* ==========================================================================
   Home Page Layout
   ========================================================================== */
/* Highlight Post */
.highlight-post {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3rem;
  margin-bottom: 4rem;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.02),
    0 10px 15px -3px rgba(178, 83, 62, 0.03);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.highlight-post:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 10px 20px -2px rgba(0, 0, 0, 0.03),
    0 15px 25px -4px rgba(178, 83, 62, 0.07);
  border-color: rgba(178, 83, 62, 0.25);
}

.highlight-tag {
  color: var(--accent-color);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.highlight-tag::after {
  content: '';
  height: 1px;
  width: 35px;
  background-color: var(--accent-color);
  display: inline-block;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.post-meta a {
  color: var(--text-muted);
}

.post-meta a:hover {
  color: var(--accent-color);
}

.highlight-post .entry-title {
  font-size: 2.25rem;
  margin-bottom: 1.25rem;
}

.highlight-post .entry-title a {
  color: var(--text-color);
}

.highlight-post .entry-title a:hover {
  color: var(--accent-color);
}

.highlight-post .entry-content {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* Other Posts Grid */
.section-title {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 2.5rem;
  font-weight: 700;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
  transition: var(--transition-smooth);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.03);
  border-color: rgba(178, 83, 62, 0.15);
}

.post-card .entry-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

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

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

.post-card .entry-excerpt {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.btn-readmore {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-color);
  transition: var(--transition-smooth);
}

.btn-readmore svg {
  margin-left: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-readmore:hover {
  color: var(--accent-hover);
}

.btn-readmore:hover svg {
  transform: translateX(5px);
}

/* ==========================================================================
   Single Post & Page View
   ========================================================================== */
.post-detail {
  max-width: var(--content-width);
  margin: 3.5rem auto 5rem auto;
}

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

.post-detail-header .entry-title {
  font-size: 2.75rem;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

.post-detail-header .post-meta {
  justify-content: center;
}

.post-content {
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--text-color);
}

.post-content p {
  margin-bottom: 1.8rem;
}

/* Blockquotes with warm literary feel */
blockquote {
  border-left: 4px solid var(--accent-color);
  padding: 1rem 0 1rem 1.5rem;
  margin: 2.5rem 0;
  font-style: italic;
  color: var(--text-muted);
  background-color: rgba(178, 83, 62, 0.03);
  font-size: 1.25rem;
  font-family: var(--font-serif);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Poem styling - center-aligned, with human touch spacing */
.category-poem .post-content,
.category-%e0%b4%95%e0%b4%b5%e0%b4%bf%e0%b4%a4%e0%b4%95%e0%b5%be .post-content,
.post-in-poem-category .post-content {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 2.1;
  white-space: pre-line; /* preserves poem line breaks if formatted in text */
}

/* ==========================================================================
   Category Archives
   ========================================================================== */
.archive-header {
  padding-top: 3.5rem;
}

/* ==========================================================================
   Comments Section
   ========================================================================== */
.comments-area {
  max-width: var(--content-width);
  margin: 4rem auto 0 auto;
  border-top: 1px solid var(--border-color);
  padding-top: 3rem;
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.comment-list {
  list-style: none;
  margin-bottom: 3rem;
}

.comment-list li {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.comment-body {
  display: flex;
  flex-direction: column;
}

.comment-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
}

.comment-author {
  font-weight: 700;
  color: var(--text-color);
}

.comment-content {
  font-size: 1.05rem;
  color: var(--text-color);
}

.comment-respond {
  margin-top: 3rem;
}

.comment-reply-title {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-form label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--card-bg);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(178, 83, 62, 0.1);
}

.submit {
  align-self: flex-start;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
}

.submit:hover {
  background-color: var(--accent-hover);
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0;
  margin-top: 5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin-bottom: 0.5rem;
}

.site-footer .human-touch {
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--accent-color);
  margin-top: 1rem;
}

/* ==========================================================================
   Navigation & Pagination
   ========================================================================== */
.navigation.pagination {
  margin: 3rem 0;
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-links .page-numbers {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--card-bg);
  color: var(--text-color);
}

.nav-links .page-numbers.current {
  background-color: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.nav-links a.page-numbers:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@media (max-width: 768px) {
  .site-header .site-container {
    flex-direction: column;
    padding: 0.5rem 0;
  }
  
  .main-navigation ul {
    gap: 1.25rem;
    margin-top: 0.5rem;
  }
  
  .hero-parallax {
    height: 280px;
  }
  
  .hero-parallax-content h1 {
    font-size: 2.25rem;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .highlight-post {
    padding: 2rem;
  }
  
  .highlight-post .entry-title {
    font-size: 1.75rem;
  }
  
  .post-detail-header .entry-title {
    font-size: 2rem;
  }
}
