/* ============================================
   TALESBOOK — Component Styles
   ============================================ */

/* ---- NAVBAR ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--color-overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-base), border-color var(--transition-base);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.nav-logo {
  font-family: 'Rochester',cursive; font-size: clamp(1.64rem, 2.5vw, 1.4rem);
  font-weight: 800; color: var(--color-text); letter-spacing: 0.035em;
  display: flex; align-items: center; line-height: 1; margin-bottom: 2.8px;
}
.nav-logo span { color: var(--color-accent); }
.nav-links { display: flex; align-items: center; gap: var(--space-8); }
.nav-links a {
  font-size: var(--text-sm); font-weight: 500;
  color: var(--color-text-secondary); position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--color-accent);
  border-radius: var(--radius-full); transition: width var(--transition-base);
}
.nav-links a:hover, .nav-links a.active { color: var(--color-text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.mobile-only-link { display: none !important; }

/* ---- THEME TOGGLE (minimal ghost icon) ---- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  margin-left: 12px;
  margin-top: 3.2px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover {
  background: var(--color-surface);
  transform: translateY(-1px);
}
.theme-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  margin-top: -9.6px;
  margin-left: -13.1px;
  color: var(--color-text);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle .icon-theme {
  transform: rotate(0deg);
}
[data-theme="dark"] .theme-toggle .icon-theme {
  transform: rotate(180deg);
}

/* ---- HAMBURGER (creative tapered bars → mathematically perfect X) ---- */
.mobile-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  background: transparent;
  border: 1px solid transparent;
}
.mobile-toggle:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
}
.mobile-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--color-text);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s ease;
}
/* Tapered elegant look */
.mobile-toggle span:nth-child(1) { width: 22px; transform-origin: center; }
.mobile-toggle span:nth-child(2) { width: 14px; transform-origin: center; }
.mobile-toggle span:nth-child(3) { width: 22px; transform-origin: center; }

/* Active X state */
.mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 24px;
  background-color: var(--color-accent);
}
.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 24px;
  background-color: var(--color-accent);
}

/* ---- MOBILE NAV ACTIONS ---- */
.mobile-nav-actions {
  display: none; align-items: center; gap: var(--space-3);
  margin-left: auto; margin-right: var(--space-2);
}
.mobile-home-text {
  font-family: var(--font-accent); font-size: 16.px; font-weight: 600; margin-right: -4px;
  color: var(--color-text); transition: all var(--transition-fast); white-space: nowrap;
  letter-spacing: var(--tracking-accent);
}
.mobile-home-text:hover, .mobile-home-text:active { color: var(--color-accent); }

/* ---- HERO ---- */
.hero {
  padding-top: calc(var(--nav-height) + var(--space-10));
  padding-bottom: var(--space-16); position: relative; overflow: hidden;
}
.hero .container { display: grid; grid-template-columns: 1fr; gap: var(--space-10); align-items: center; }
.hero-content { max-width: 560px; }
.hero-label {
  display: inline-block; font-family: var(--font-accent);
  font-size: var(--text-sm); font-weight: 800; color: var(--color-accent);
  background: var(--color-accent-light); padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full); margin-bottom: var(--space-6); letter-spacing: var(--tracking-wide);
}
.hero h1 { margin-bottom: var(--space-6); line-height: var(--leading-snug);; }
.hero-text { font-size: var(--text-md); color: var(--color-text-secondary); margin-bottom: var(--space-8); max-width: 480px; }
.hero-buttons { display: flex; gap: var(--space-4); flex-wrap: wrap; }

.hero-visual { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); perspective: 800px; }
.hero-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6);
  box-shadow: var(--shadow-md); transition: all var(--transition-base);
  animation: floatCard 6s ease-in-out infinite;
}
.hero-card:nth-child(2) { animation-delay: -1.5s; }
.hero-card:nth-child(3) { animation-delay: -3s; }
.hero-card:nth-child(4) { animation-delay: -4.5s; }
.hero-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--color-accent); }
.hero-card-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366F1 0%, #A5B4FC 100%);
  border-radius: var(--radius-md); margin-bottom: var(--space-3); color: #FFFFFF;
}
.hero-card-icon svg { width: 20px; height: 20px; }
.hero-card h3 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1); }
.hero-card p { font-size: var(--text-xs); }
@keyframes floatCard { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---- SECTION HEADER ---- */
.section-header { text-align: center; margin-bottom: var(--space-12); }
.section-header h2 { margin-bottom: var(--space-3); }
.section-header p { font-size: var(--text-md); max-width: 520px; margin: 0 auto; }

/* ---- ARTICLE CARD ---- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
.article-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition-base); display: flex; flex-direction: column;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--color-accent); }
.article-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--color-border); }
.article-card-body { padding: var(--space-6); flex: 1; display: flex; flex-direction: column; }
.article-card-tag {
  font-family: var(--font-accent); font-size: var(--text-xs); font-weight: 800;
  color: var(--color-accent); text-transform: uppercase; letter-spacing: var(--tracking-wide); margin-bottom: var(--space-2);
}
.article-card-title {
  font-size: var(--text-md); font-weight: 700; line-height: var(--leading-snug);
  margin-bottom: var(--space-2); color: var(--color-text);
}
.article-card:hover .article-card-title { color: var(--color-accent); }
.article-card-desc { font-size: var(--text-sm); margin-bottom: var(--space-4); flex: 1; }
.article-card-meta { display: flex; align-items: center; gap: var(--space-4); font-size: var(--text-xs); color: var(--color-text-secondary); }
.article-card-meta svg { width: 14px; height: 14px; margin-right: var(--space-1); }
.article-card-meta span { display: flex; align-items: center; }

/* ---- VIEW ALL ACTION ---- */
.view-all-action { display: flex; justify-content: center; margin-top: var(--space-10); }
.view-all-link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-accent); font-size: var(--text-sm); font-weight: 800;
  color: #FFFFFF; padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full); background: var(--color-accent);
  border: 2.2px solid var(--color-accent);
  transition: all var(--transition-base);
  letter-spacing: var(--tracking-accent);
}
.view-all-link svg { width: 16px; height: 16px; transition: transform var(--transition-base); }
.view-all-link:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #FFFFFF; }
.view-all-link:hover svg { transform: translateX(4px); }

/* ---- CATEGORY ---- */
.category-section { padding: var(--space-12) 0; }
.category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-8); }
.category-header h2 { font-size: var(--text-xl); }
.category-header a { font-size: var(--text-sm); font-weight: 600; color: var(--color-accent); display: flex; align-items: center; gap: var(--space-1); }
.category-header a svg { width: 16px; height: 16px; transition: transform var(--transition-fast); }
.category-header a:hover svg { transform: translateX(4px); }

/* ---- VALUE ---- */
.value-section { background: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.value-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); }
.value-item { text-align: center; padding: var(--space-8) var(--space-4); }
.value-icon {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: var(--color-accent-light); color: var(--color-accent);
  border-radius: var(--radius-lg); margin: 0 auto var(--space-4);
}
.value-icon svg { width: 24px; height: 24px; }
.value-item h3 { margin-bottom: var(--space-2); }
.value-item p { font-size: var(--text-sm); max-width: 280px; margin: 0 auto; }

/* ---- CTA ---- */
.cta-section { padding: var(--space-16) 0; }
.cta-block {
  background: linear-gradient(135deg, #6366F1 0%, #A5B4FC 100%);
  border-radius: var(--radius-xl); padding: var(--space-12) var(--space-8);
  text-align: center; position: relative; overflow: hidden;
}
.cta-block::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 400px; height: 400px; background: rgba(255,255,255,0.08); border-radius: 50%;
}
.cta-block h2 { color: #FFFFFF; margin-bottom: var(--space-4); position: relative; }
.cta-block p { color: rgba(255,255,255,0.85); margin-bottom: var(--space-8); font-size: var(--text-md); position: relative; }
.cta-block .btn { background: #FFFFFF; color: var(--color-accent); font-weight: 700; position: relative; }
.cta-block .btn:hover { background: #F0F0FF; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* ---- FOOTER ---- */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-12) 0 var(--space-8); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); margin-bottom: var(--space-10); }
.footer-brand { max-width: 300px; }
.footer-brand .nav-logo { font-size: var(--text-xl); margin-bottom: var(--space-3); display: block; }
.footer-brand p { font-size: var(--text-sm); margin-bottom: var(--space-4); }
.footer-socials { display: flex; gap: var(--space-3); }
.footer-socials a {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  color: var(--color-text-secondary); transition: all var(--transition-fast);
}
.footer-socials a:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-light); }
.footer-socials svg { width: 16px; height: 16px; }
.footer-col h4 {
  font-family: var(--font-accent); font-size: var(--text-sm); font-weight: 900;
  margin-bottom: var(--space-4); color: var(--color-text); text-transform: uppercase; letter-spacing: var(--tracking-wide);
}
.footer-col a { display: block; font-size: var(--text-sm); color: var(--color-text-secondary); padding: var(--space-1) 0; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
  padding-top: var(--space-6); border-top: 1px solid var(--color-border);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  font-size: var(--text-xs); color: var(--color-text-secondary);
}
.footer-bottom-links { display: flex; gap: var(--space-4); }
.footer-bottom-links a { font-size: var(--text-xs); color: var(--color-text-secondary); }


/* ---- RESPONSIVE ---- */
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .hero .container { grid-template-columns: 1fr 1fr; }
  .hero-content { max-width: none; }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
  .theme-toggle{margin-left: -6px;border: 1.6px;}
  

  
}
@media (max-width: 767px) {
  .nav-links {
    position: absolute; top: var(--nav-height); left: 0; right: 0; 
    height: calc(100vh - var(--nav-height));
    background: var(--color-surface); flex-direction: column; justify-content: flex-start;
    padding-top: var(--space-10); gap: var(--space-6);
    z-index: 1000;
    transform: translateX(100%); transition: transform var(--transition-base);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: var(--text-lg); }
  .nav-links .mobile-only-link { display: block !important; }
  #nav-links .theme-toggle { display: none !important; }
  .mobile-toggle { display: flex; }
  .mobile-nav-actions { display: flex; }
}

/* ---- UTILITIES ---- */
.text-accent { color: var(--color-accent); }
.accent-dot {
  color:#5b73e8;
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 2px;
  line-height: 0;
  vertical-align: middle;
  position: relative;
  top: -1.45px;
}
