/*
Theme Name: Hana Tsuki Author Theme
Theme URI: https://yoursite.com
Author: Omnia Ahmed (Hana Tsuki)
Author URI: https://yoursite.com
Description: A custom WordPress theme for author Hana Tsuki featuring books showcase, blog, and mood-based reading experience with dark/light mode toggle
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hana-tsuki
Tags: author, blog, books, dark-mode, custom-colors, responsive-layout
*/

/* ============================================
   TABLE OF CONTENTS
   1. CSS Custom Properties (Variables)
   2. CSS Reset & Base Styles
   3. Typography System
   4. Layout & Container
   5. Components - Buttons
   6. Components - Logo
   7. Utility Classes
   8. Responsive Design
============================================ */


/* ============================================
   1. CSS CUSTOM PROPERTIES (VARIABLES)
============================================ */
:root {
  /* Brand Color Palette */
  --color-primary-black: #000000;
  --color-primary-beige: #f5eee5;
  --color-brown-dark: #714231;
  --color-brown-medium: #a2785b;
  --color-brown-light: #536564;
  
  /* Semantic Color Tokens - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: var(--color-primary-beige);
  --text-primary: var(--color-primary-black);
  --text-secondary: var(--color-brown-medium);
  --text-accent: var(--color-brown-dark);
  --border-color: var(--color-brown-light);
  
  /* Typography System */
  --font-heading: 'Cinzel Decorative', serif;
  --font-body: 'Alice', serif;
  --font-sans: 'DM Sans', sans-serif;
  --font-elegant: 'Cormorant Garamond', serif;
  
  /* Font Sizes - Fluid Typography */
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.5rem;    /* 24px */
  --font-size-2xl: 2rem;     /* 32px */
  --font-size-3xl: 2.5rem;   /* 40px */
  --font-size-4xl: 3rem;     /* 48px */
  
  /* Line Heights */
  --line-height-tight: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;
  
  /* Spacing Scale */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;     /* 16px */
  --spacing-md: 2rem;     /* 32px */
  --spacing-lg: 3rem;     /* 48px */
  --spacing-xl: 4rem;     /* 64px */
  --spacing-2xl: 6rem;    /* 96px */
  
  /* Layout */
  --container-max-width: 1200px;
  --content-max-width: 800px;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  
  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-tooltip: 1070;
}


/* Dark Mode Color Overrides */
body.night-mode {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: var(--color-primary-beige);
  --text-secondary: var(--color-brown-light);
  --text-accent: var(--color-brown-medium);
  --border-color: #444444;
}


/* ============================================
   2. CSS RESET & BASE STYLES
============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base), 
              color var(--transition-base);
  overflow-x: hidden;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Remove default link underline */
a {
  text-decoration: none;
  color: inherit;
}

/* Image responsiveness */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Button reset */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}


/* ============================================
   3. TYPOGRAPHY SYSTEM
============================================ */
h1, 
h2, 
h3, 
h4, 
h5, 
h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-sm);
  color: var(--text-accent);
}

h1 {
  font-size: clamp(2rem, 5vw, var(--font-size-4xl));
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: clamp(1.75rem, 4vw, var(--font-size-3xl));
  color: var(--color-brown-medium);
}

h3 {
  font-size: clamp(1.5rem, 3vw, var(--font-size-2xl));
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-md);
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

/* Link Styles */
a {
  color: var(--text-accent);
  transition: color var(--transition-fast);
  position: relative;
}

a:hover,
a:focus {
  color: var(--text-secondary);
  outline: none;
}

/* Optional: Underline animation on hover */
a:not(.btn):hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  animation: linkUnderline var(--transition-fast) ease;
}

@keyframes linkUnderline {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Text Selection */
::selection {
  background-color: var(--color-brown-medium);
  color: var(--color-primary-beige);
}


/* ============================================
   4. LAYOUT & CONTAINER
============================================ */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
}

.container--narrow {
  max-width: var(--content-max-width);
}

.section {
  padding: var(--spacing-xl) 0;
}

.section--large {
  padding: var(--spacing-2xl) 0;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid--2-cols {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3-cols {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  justify-content: space-between;
  align-items: center;
}


/* ============================================
   5. COMPONENTS - BUTTONS
============================================ */
.btn {
  display: inline-block;
  padding: 12px 30px;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid var(--text-accent);
  background-color: transparent;
  color: var(--text-accent);
  cursor: pointer;
  transition: all var(--transition-base);
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.btn:hover,
.btn:focus {
  background-color: var(--text-accent);
  color: var(--color-primary-beige);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  outline: none;
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background-color: var(--text-accent);
  color: var(--color-primary-beige);
  border-color: var(--text-accent);
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: var(--text-secondary);
  border-color: var(--text-secondary);
}

.btn--large {
  padding: 16px 40px;
  font-size: var(--font-size-md);
}

.btn--small {
  padding: 8px 20px;
  font-size: 12px;
}

/* Button disabled state */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* ============================================
   6. COMPONENTS - LOGO
============================================ */
.custom-logo-link {
  display: inline-block;
  transition: opacity var(--transition-fast);
}

.custom-logo-link:hover {
  opacity: 0.8;
}

.custom-logo {
  display: block;
  max-height: 80px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
}


/* ============================================
   7. UTILITY CLASSES
============================================ */
/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Margin Utilities */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

/* Padding Utilities */
.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

/* Display Utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================
   8. RESPONSIVE DESIGN
============================================ */
/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
  :root {
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
}

/* Tablets */
@media (max-width: 768px) {
  :root {
    --font-size-base: 15px;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
  }
  
  .custom-logo {
    max-height: 60px;
    max-width: 180px;
  }
  
  .btn {
    padding: 10px 24px;
    font-size: 13px;
  }
  
  .section {
    padding: var(--spacing-lg) 0;
  }
}

/* Mobile Devices */
@media (max-width: 480px) {
  :root {
    --font-size-base: 14px;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
  }
  
  .custom-logo {
    max-height: 50px;
    max-width: 150px;
  }
  
  .btn {
    padding: 10px 20px;
    width: 100%;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
}

/* Print Styles */

@media print {
  body {
    background-color: white;
    color: black;
  }
  
  .btn,
  .no-print {
    display: none;
  }
}
/* --- Comments Section Styles --- */

.comments-area {
    margin-top: 60px;
    border-top: 1px solid #eee;
    padding-top: 40px;
}

.comments-title {
    font-size: 1.8rem;
    margin-bottom: 40px;
    text-align: center;
}

/* قائمة التعليقات */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 60px 0;
}

.comment-list li.comment {
    margin-bottom: 40px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 40px;
}

.comment-body {
    position: relative;
    padding-left: 80px; /* مساحة للصورة */
}

/* صورة المعلق (Avatar) */
.comment-list .avatar {
    position: absolute;
    left: 0;
    top: 5px;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.comment-meta {
    margin-bottom: 10px;
}

.fn {
    font-style: normal;
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    margin-right: 10px;
}

.comment-metadata {
    display: inline-block;
    font-size: 0.85rem;
    color: #999;
}
.comment-metadata a {
    color: inherit;
    text-decoration: none;
}

.comment-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

/* زر الرد */
.reply {
    text-align: right;
}
.comment-reply-link {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
    transition: all 0.3s ease;
}
.comment-reply-link:hover {
    color: #777;
    border-color: #777;
}

/* الردود المتداخلة (Replies) */
.comment-list .children {
    list-style: none;
    padding-left: 40px;
    margin-top: 40px;
    border-left: 2px solid #f5f5f5;
}

/* --- Comment Form --- */
.comment-respond {
    background: #fafafa; /* خلفية خفيفة للنموذج */
    padding: 40px;
    border-radius: 8px;
}
.comment-reply-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    display: block;
}

.comment-form .form-group {
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.3s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #333;
}

.form-submit {
    margin-top: 20px;
    text-align: center;
}

/* --- Night Mode Support --- */
.night-mode .comments-area {
    border-color: #333;
}
.night-mode .comment-list li.comment {
    border-color: #333;
}
.night-mode .fn, 
.night-mode .comment-reply-link {
    color: #fff;
    border-color: #fff;
}
.night-mode .comment-content p {
    color: #ccc;
}
.night-mode .comment-respond {
    background: #1a1a1a;
}
.night-mode .comment-form input,
.night-mode .comment-form textarea {
    background: #222;
    border-color: #444;
    color: #fff;
}
.night-mode .comment-form input:focus,
.night-mode .comment-form textarea:focus {
    border-color: #fff;
}
.night-mode .comment-list .children {
    border-color: #333;
}
/* =========================================
   HANA CINEMATIC BLOG SECTION (NEW DESIGN)
   ========================================= */

/* 1. Section Container Reset */
.hana-blog-section {
    background-color: #ffffff;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 100px 0 120px 0;
    position: relative;
    box-sizing: border-box;
}

.hana-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* 2. Header Styles */
.hana-section-header {
    text-align: center;
    margin-bottom: 60px;
}

.hana-title {
    font-family: 'Cinzel Decorative', serif; /* أو خطك المفضل */
    font-size: 3rem;
    color: #222;
    margin-bottom: 10px;
    font-weight: 400;
}

.hana-subtitle {
    font-family: 'Alice', serif;
    font-size: 1.1rem;
    color: #888;
    font-style: italic;
}

/* 3. The Grid System */
.hana-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
}

/* 4. The Card Component */
.hana-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    /* الظل الفخم */
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    aspect-ratio: 2/3.2; /* نسبة طولية ثابتة للكروت */
    background: #f0f0f0; /* لون خلفية احتياطي */
}

.hana-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.hana-card-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

/* 5. Image Handling (The Fix) */
.hana-image-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.hana-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* يملأ الكارت بالكامل */
    display: block;
    transition: transform 0.8s ease;
}

.hana-card:hover .hana-img {
    transform: scale(1.1); /* زووم بطيء */
}

/* Gradient Overlay */
.hana-overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom, 
        transparent 0%, 
        rgba(0,0,0,0.2) 50%, 
        rgba(0,0,0,0.9) 100%
    );
    z-index: 1;
}

/* 6. Content Styles */
.hana-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 2;
    color: #fff;
    text-align: center;
    transform: translateY(20px); /* النص ينزل قليلاً للأسفل */
    transition: transform 0.4s ease;
}

.hana-card:hover .hana-card-content {
    transform: translateY(0); /* يرتفع عند الماوس */
}

.hana-date {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.hana-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* الزر الشفاف */
.hana-read-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 30px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}

.hana-card:hover .hana-read-btn {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* 7. Bottom Button */
.hana-footer-action {
    text-align: center;
    margin-top: 60px;
}

.hana-view-all-btn {
    display: inline-block;
    padding: 15px 40px;
    border: 2px solid #222;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.hana-view-all-btn:hover {
    background: #222;
    color: #fff;
}

/* Night Mode */
body.night-mode .hana-blog-section { background-color: #111; }
body.night-mode .hana-title { color: #fff; }
body.night-mode .hana-view-all-btn { border-color: #fff; color: #fff; }
body.night-mode .hana-view-all-btn:hover { background: #fff; color: #000; }

/* Responsive */
@media (max-width: 900px) {
    .hana-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hana-cards-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}


/* ============================================
   Z-INDEX FIX - Mobile Menu & Page Content
============================================ */

/* Fix z-index hierarchy */
.site-header {
    z-index: 1000 !important;
}

.mobile-menu {
    z-index: 999 !important;
}

.menu-backdrop {
    z-index: 998 !important;
}

.search-overlay {
    z-index: 997 !important;
}

/* Ensure page content is below header */
.site-content,
.books-archive-page,
main {
    position: relative;
    z-index: 1 !important;
}

/* When menu is open, prevent scrolling */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Fix mobile menu positioning */
@media (max-width: 992px) {
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: var(--bg-color, #f5eee5);
        z-index: 999;
        padding: 80px 20px 30px;
        overflow-y: auto;
        transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    body.night-mode .mobile-menu {
        background: var(--bg-color, #050508);
    }
    
    body.menu-open .mobile-menu {
        right: 0;
    }
    
    /* Menu backdrop */
    .menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    body.menu-open .menu-backdrop {
        opacity: 1;
        visibility: visible;
    }
}
