/*
Theme Name: Talepod
Theme URI: https://talepod.com
Author: Talepod Team
Author URI: https://talepod.com
Description: A custom WordPress theme for Talepod - Blog platform for educational content about bedtime stories, language learning, and child development. Features a dark theme with modern design, blog cards, and beautiful 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: talepod
Tags: dark-theme, custom-menu, blogs, blog-list
*/

/* ============================================
   LexendDeca Font Face Declarations
   ============================================ */

@font-face {
  font-family: "LexendDeca";
  src: url("./fonts/LexendDeca/LexendDeca-Light.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LexendDeca-Bold";
  src: url("./fonts/LexendDeca/LexendDeca-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   CSS Variables - Color Scheme
   ============================================ */
:root {
  --tp-dark: #121212;
  --tp-primary-color: #ad932d;
  --tp-secondary-color: #00bfff;
  --tp-white-color: #f0f0f0;
  --tp-text-muted: #b0b0b0;
  --tp-border: #333333;
  --font-family-base: "LexendDeca", sans-serif;
  --font-family-bold: "LexendDeca-Bold", sans-serif;
}

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

body {
  min-height: 100vh;
  color: var(--tp-white-color);
  font-family: var(--font-family-base);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  position: relative;
}

/* Fixed gradient background using pseudo-element - works on mobile */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, #000000, #2e3b4e);
  z-index: -1;
  pointer-events: none; /* Allow clicks to pass through */
}

.bold {
  font-family: var(--font-family-bold);
}

.italics {
  font-style: italic;
}

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

hr {
  margin: 32px auto;
  border-color: transparent;
  border-width: 0px 0px thin;
  border-style: solid;
  box-shadow: -9px -2px 1px var(--tp-secondary-color),
    13px 2px 1px var(--tp-primary-color);
}

hr.vertical {
  margin: 0 0.5rem;
  border-color: transparent;
  border-width: 0px 0px thin;
  border-style: solid;
  box-shadow: var(--tp-secondary-color) -2px -5px 1px,
    var(--tp-primary-color) 2px 2px 1px;
  display: inline;
}

a {
  color: var(--tp-secondary-color);
  text-decoration: underline solid var(--tp-primary-color);
  transition: all 0.3s ease;
  font-family: "LexendDeca-Bold", sans-serif;
}
a:hover {
  color: var(--tp-primary-color);
  text-decoration: underline solid var(--tp-secondary-color);
}

button,
.button {
  color: var(--tp-white-color) !important;
  background-color: var(--tp-primary-color) !important;
  border: none;
  border-radius: 4px !important;
  padding: 6px 16px !important;
  font-size: 16px !important;
  text-decoration: none !important;
  font-family: var(--font-family-base);
  transition: all 0.3s ease;
}
button:hover,
.button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: var(--tp-white-color);
  text-decoration: none !important;
  background-color: var(--tp-primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Site Wrapper Container
   ============================================ */
.site-wrapper {
  width: 100%;
  margin: 0 auto;
  padding-top: 5.5rem !important;
}

/* ============================================
   Header Styles
   ============================================ */
.site-header {
  z-index: 1000;
  padding: 1rem 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;

  position: fixed;
  inset: 0.5rem 0 0 0;
  border-radius: 4px;
  min-height: 64px;
  max-height: 60px;
}

.header-container {
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: var(--tp-primary-color) 0px 0px 1px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: bold;
  margin-right: 1rem;
  color: var(--tp-white-color);
}

.site-logo svg {
  width: 32px;
  height: 32px;
}

.site-logo .logo-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
}

.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation a {
  display: flex;
  align-items: anchor-center;
  color: var(--tp-white-color);
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 4px;
  gap: 4px;
  text-decoration: none;
  font-family: var(--font-family-base);
  font-weight: 400;
}

.main-navigation a .material-icons {
  font-size: 24px;
  margin-right: 4px;
  color: var(--tp-primary-color);
  transition: color 0.3s ease;
}

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

.main-navigation a:hover .material-icons {
  color: var(--tp-secondary-color);
}

.filters-button {
  background: none;
  border: 1px solid var(--tp-primary-color);
  color: var(--tp-primary-color);
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.filters-button:hover {
  background-color: var(--tp-primary-color);
  color: var(--tp-dark);
}

/* Mobile Menu Button */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  background-color: transparent !important;
  color: var(--tp-primary-color) !important;
  cursor: pointer;
  padding: 8px;
  font-size: 24px;
  z-index: 1003;
  transition: transform 0.3s ease;
  position: relative;
}

/* Hide hamburger button when panel is open */
.mobile-menu-toggle.active {
  display: none;
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-menu-toggle .close-icon {
  display: none;
}

/* Keep hamburger icon visible even when panel is open - panel has its own close button */
.mobile-menu-toggle.active .menu-icon {
  display: block;
}

.mobile-menu-toggle.active .close-icon {
  display: none;
}

/* Mobile Menu Panel */
.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: -200%;
  height: 100vh;
  background-color: rgb(18, 18, 18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1002;
  transition: right 0.3s ease;
  padding: 16px 8px 8px;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  max-width: 60%;
}

.mobile-menu-panel.active {
  right: 0;
}

.mobile-menu-panel .main-navigation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.mobile-menu-panel .main-navigation a {
  display: flex;
  width: 100%;
  padding: 6px 16px;
  font-size: 1.25rem;
  color: var(--tp-white-color);
  transition: all 0.3s ease;
}

.mobile-menu-panel .main-navigation a .material-icons {
  font-size: 24px;
  margin-right: 6px;
  color: var(--tp-primary-color);
  transition: color 0.3s ease;
}

.mobile-menu-panel .main-navigation a:hover {
  color: var(--tp-secondary-color);
}

.mobile-menu-panel .main-navigation a:hover .material-icons {
  color: var(--tp-secondary-color);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================
   Main Content Area
   ============================================ */
.site-main {
  width: 100%;
  margin: 0 auto;
}

/* MUI Container responsive max-widths for main content */
@media (min-width: 600px) {
  .site-main {
    max-width: 600px;
  }
}

@media (min-width: 900px) {
  .site-main {
    max-width: 900px;
  }
}

@media (min-width: 1200px) {
  .site-main {
    max-width: 1200px;
  }
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-size: 36px;
  margin-bottom: 10px;
  color: var(--tp-white-color);
}

/* ============================================
   Blog Cards Grid
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-bottom: 60px;
}

.blog-card {
  box-shadow: var(--tp-secondary-color) 0px 2px 0px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid rgba(51, 51, 51, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 260px;
}

.blog-card:hover {
  box-shadow: var(--tp-primary-color) 2px 2px 3px;
}

.blog-card h3 {
  margin-bottom: 15px;
  font-size: 22px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.3em * 2);
  height: calc(1.3em * 2);
  flex-shrink: 0;
}

.blog-card h3 a {
  color: var(--tp-white-color);
  text-decoration: none;
}

.blog-card h3 a:hover {
  color: var(--tp-primary-color);
}

.blog-description {
  color: var(--tp-text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--tp-text-muted);
  padding-top: 15px;
  border-top: 1px solid var(--tp-border);
  margin-top: auto;
  flex-shrink: 0;
}

.blog-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.blog-meta-item svg {
  width: 16px;
  height: 16px;
}

.read-more-link {
  color: var(--tp-primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* ============================================
   Blog Pages (Archive & Detail)
   ============================================ */

/* Blog Archive/Listing Page */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.blog-post-card {
  box-shadow: var(--tp-secondary-color) 0px 2px 0px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid rgba(51, 51, 51, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 320px;
}

.blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--tp-primary-color) 2px 2px 3px;
}

.blog-post-card h2 {
  font-size: 20px;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.3em * 2);
  height: calc(1.3em * 2);
  flex-shrink: 0;
}

.blog-post-card h2 a {
  color: var(--tp-white-color);
}

.blog-post-excerpt {
  color: var(--tp-text-muted);
  margin-bottom: 15px;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.blog-post-meta {
  font-size: 14px;
  color: var(--tp-text-muted);
  margin-top: auto;
  flex-shrink: 0;
}

/* Blog Post Detail Page */
.blog-detail {
  margin: 0 auto;
  padding: 1rem 2rem;
}

.direction-rtl {
  direction: rtl;
  text-align: right;
}
.direction-ltr {
  direction: ltr;
  text-align: left;
}

.blog-detail-header {
  margin-bottom: 40px;
}

.blog-detail-title {
  margin-bottom: 20px;
  color: var(--tp-primary-color);
}

.blog-detail-meta {
  display: flex;
  gap: 20px;
  color: var(--tp-text-muted);
  font-size: 16px;
  margin-bottom: 30px;
}

.blog-detail-content-wrapper {
  margin-bottom: 2rem;
}

.blog-content {
  border-radius: 12px;
  line-height: 1.8;
  font-size: 18px;
  color: var(--tp-white-color);
}

.blog-content p {
  margin-bottom: 20px;
}

.blog-navigation {
  margin-top: 40px;
}

/* ============================================
   404 Page
   ============================================ */
.error-404 {
  text-align: center;
  padding: 80px 20px;
}

.error-404 h1 {
  font-size: 120px;
  color: var(--tp-primary-color);
  margin-bottom: 20px;
  font-weight: bold;
}

.error-404 h2 {
  font-size: 32px;
  margin-bottom: 20px;
  color: var(--tp-white-color);
}

.error-404 p {
  font-size: 18px;
  color: var(--tp-text-muted);
  margin-bottom: 40px;
}

.error-404 .search-form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.error-404 input[type="search"] {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--tp-border);
  border-radius: 8px;
  color: var(--tp-white-color);
  font-size: 16px;
}

.error-404 input[type="search"]:focus {
  outline: none;
  border-color: var(--tp-primary-color);
}

.error-404 button {
  padding: 12px 30px;
  background-color: var(--tp-primary-color);
  color: var(--tp-dark);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.error-404 button:hover {
  background-color: var(--tp-primary-color);
}

.error-404-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ============================================
   Footer Styles
   ============================================ */
.footer-container {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-text {
  flex: 2 1 300px;
  min-width: 0;
}

.footer-links {
  flex: 1 1 200px;
  min-width: 0;
}

.footer-text p {
  margin-bottom: 20px;
}

.footer-text strong {
  color: var(--tp-white-color);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links h4 {
  color: var(--tp-primary-color);
  margin-bottom: 15px;
  font-size: 18px;
}

.footer-bottom {
  text-align: center;
  font-size: 16px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 899px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 599px) {
  .header-container {
    padding: 0 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-menu-toggle {
    display: block;
  }

  /* Hide hamburger button when panel is open */
  .mobile-menu-toggle.active {
    display: none;
  }

  .main-navigation {
    display: none;
  }

  .site-main {
    padding: 16px 0;
  }

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

  .error-404 h1 {
    font-size: 80px;
  }

  .site-logo {
    font-size: 20px;
  }

  .site-logo svg {
    width: 28px;
    height: 28px;
  }
}

/* ============================================
   Utility Classes
   ============================================ */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

/* MUI Container responsive max-widths for utility container */
@media (min-width: 600px) {
  .container {
    max-width: 600px;
    padding: 0 24px;
  }
}

@media (min-width: 900px) {
  .container {
    max-width: 900px;
    padding: 0 24px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
    padding: 0 40px;
  }
}

.card {
  border-radius: 4px;
  background-color: transparent;
  background-image: linear-gradient(
    rgba(255, 255, 255, 0.051),
    rgba(255, 255, 255, 0.051)
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
}

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

.mt-40 {
  margin-top: 40px;
}

.mb-40 {
  margin-bottom: 40px;
}
