/*
Theme Name: Ajmal
Theme URI: https://ajmaltv.com
Author: Ajmal
Description: A minimal personal website theme for Ajmal — SEO Expert in Dubai.
Version: 2.0
License: GNU General Public License v2 or later
Text Domain: ajmal
*/

:root {
  --bg: #f7f6f3; --text: #1a1a1a; --muted: #888;
  --border: #e0ddd8; --link: #1a1a1a; --max-w: 680px;
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
[data-theme="dark"] { --bg: #141414; --text: #e8e6e1; --muted: #666; --border: #2a2a2a; --link: #e8e6e1; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--text); font-family: var(--font-sans); line-height: 1.6; transition: background 0.25s, color 0.25s; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { opacity: 0.6; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; width: 100%; }
main { flex: 1; }

/* ── Header ─────────────────────────────────────────── */
header { padding: 20px 0 0; }
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}
.site-logo { text-decoration: none; display: flex; align-items: center; justify-self: start; }
.site-name { font-size: 0.95rem; font-weight: 500; text-decoration: none; color: var(--text); }

/* Center nav wrapper */
.header-nav-wrap { justify-self: center; }

/* Nav */
.header-nav { display: flex; align-items: center; gap: 6px; list-style: none; }
.header-nav li a {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  display: block;
}
.header-nav li a:hover { color: var(--text); opacity: 1; background: transparent; }
.header-nav .current-menu-item a {
  color: var(--text);
  font-weight: 500;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border), 0 2px 6px rgba(0,0,0,0.07);
}

/* Right side */
.header-right { display: flex; align-items: center; gap: 10px; justify-self: end; }

/* CTA Button */
.cta-btn { font-family: var(--font-sans); font-size: 0.82rem; font-weight: 500; color: var(--bg); background: var(--text); text-decoration: none; padding: 7px 14px; border-radius: 7px; transition: opacity 0.2s; white-space: nowrap; letter-spacing: 0.01em; }
.cta-btn:hover { opacity: 0.75; }

/* Toggle */
.theme-toggle { display: flex; align-items: center; background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; }
.toggle-track { width: 48px; height: 26px; border-radius: 999px; background: var(--border); border: 1.5px solid var(--border); position: relative; transition: border-color 0.25s, background 0.25s; display: flex; align-items: center; justify-content: space-between; padding: 0 5px; }
.theme-toggle:hover .toggle-track { border-color: var(--muted); }
.toggle-icon-sun, .toggle-icon-moon { width: 12px; height: 12px; flex-shrink: 0; pointer-events: none; z-index: 0; color: var(--text); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,0.15); transition: transform 0.25s cubic-bezier(.4,0,.2,1); z-index: 1; }
[data-theme="dark"] .toggle-thumb { transform: translateX(22px); }
[data-theme="dark"] .toggle-track { background: #3a3a3a; border-color: #3a3a3a; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Hero ────────────────────────────────────────────── */
.hero { padding: 40px 0 28px; }
.hero h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 14px; }
.hero-intro { font-size: 1.05rem; color: var(--muted); line-height: 1.6; }
.profile-photo { width: 100%; max-width: 480px; height: auto; border-radius: 6px; object-fit: cover; object-position: top center; margin: 28px 0 0; }

/* ── Bio ─────────────────────────────────────────────── */
.bio { font-size: 1rem; line-height: 1.7; }
.bio p + p { margin-top: 16px; }
details.bio-more { margin-top: 16px; }
details.bio-more summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; font-size: 1.1rem; color: var(--muted); transition: color 0.2s; user-select: none; }
details.bio-more summary::-webkit-details-marker { display: none; }
details.bio-more summary::before { content: '→'; display: inline-block; transition: transform 0.2s; }
details.bio-more summary:hover { color: var(--text); }
details.bio-more[open] summary::before { transform: rotate(90deg); }
details.bio-more .more-content { margin-top: 16px; font-size: 1rem; line-height: 1.7; }
details.bio-more .more-content p + p { margin-top: 16px; }
#liveAge { font-family: 'Courier New', Courier, monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; font-size: 1.05em; font-weight: 700; }

/* ── Section ─────────────────────────────────────────── */
.section-heading { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px; }
.section-intro { font-size: 0.97rem; color: var(--muted); line-height: 1.75; margin-bottom: 28px; }
.seo-section { padding: 40px 0; }

/* ── Clients ─────────────────────────────────────────── */
.clients-section { padding: 32px 0; }
.clients-grid { border: 1px solid var(--border); border-radius: 10px; padding: 24px 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; }
.client-box { font-size: 0.93rem; color: var(--text); line-height: 1.8; }

/* ── Posts homepage ──────────────────────────────────── */
.posts-section { padding: 32px 0 40px; }
.posts-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.posts-header a { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.posts-header a:hover { color: var(--text); opacity: 1; }
.posts-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.post-featured, .post-item { border: 1px solid var(--border); border-radius: 10px; padding: 24px 28px; transition: border-color 0.2s; }
.post-featured:hover, .post-item:hover { border-color: var(--muted); }
.post-featured h3, .post-item h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; margin-bottom: 10px; }
.post-featured h3 a, .post-item h3 a { text-decoration: none; }
.post-excerpt { font-size: 0.92rem; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.post-meta { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 14px; }
.post-read-time { font-size: 0.8rem; color: var(--muted); }
.post-date { font-size: 0.8rem; color: var(--muted); font-family: monospace; }

/* ── Blog archive ────────────────────────────────────── */
.page-intro { padding: 48px 0 28px; }
.page-intro h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 10px; }
.page-intro p { font-size: 0.97rem; color: var(--muted); line-height: 1.6; }
.category-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.cat-btn { font-family: var(--font-sans); font-size: 0.8rem; color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.cat-btn:hover { color: var(--text); border-color: var(--muted); }
.cat-btn.active { color: var(--bg); background: var(--text); border-color: var(--text); }
.post-card { border: 1px solid var(--border); border-radius: 10px; padding: 24px 28px; transition: border-color 0.2s; margin-bottom: 12px; }
.post-card:hover { border-color: var(--muted); }
.post-card h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; margin-bottom: 10px; }
.post-card h2 a { text-decoration: none; }
.post-card h2 a:hover { text-decoration: underline; }
.post-meta-left { display: flex; align-items: center; gap: 10px; }
.post-cat { font-size: 0.75rem; background: var(--border); color: var(--muted); padding: 2px 8px; border-radius: 4px; }
.post-card.hidden { display: none; }

/* ── Single Post ─────────────────────────────────────── */
.post-back { display: inline-block; font-size: 0.85rem; color: var(--muted); text-decoration: none; margin: 36px 0 28px; transition: color 0.2s; }
.post-back:hover { color: var(--text); opacity: 1; }
.post-single { padding: 0 0 24px; }
.post-single h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 16px; }
.post-single-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.post-single-content { font-size: 1.02rem; line-height: 1.8; }
.post-single-content h2 { font-size: 1.4rem; font-weight: 700; margin: 36px 0 12px; letter-spacing: -0.02em; }
.post-single-content h3 { font-size: 1.15rem; font-weight: 600; margin: 28px 0 10px; }
.post-single-content p { margin-bottom: 20px; }
.post-single-content ul, .post-single-content ol { margin: 0 0 20px 24px; }
.post-single-content li { margin-bottom: 8px; line-height: 1.7; }
.post-single-content blockquote { border-left: 3px solid var(--border); padding: 4px 0 4px 20px; color: var(--muted); margin: 28px 0; font-style: italic; }
.post-single-content img { border-radius: 8px; margin: 24px 0; width: 100%; }
.post-single-content code { font-family: 'Courier New', monospace; font-size: 0.88em; background: var(--border); padding: 2px 6px; border-radius: 4px; }
.post-single-content pre { background: var(--border); padding: 20px; border-radius: 10px; overflow-x: auto; margin: 24px 0; }
.post-single-content a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-nav a { font-size: 0.88rem; text-decoration: none; color: var(--muted); max-width: 45%; line-height: 1.4; }
.post-nav a:hover { color: var(--text); opacity: 1; }

/* ── Projects ────────────────────────────────────────── */
.group-heading { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; margin-top: 40px; }
.projects-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.project-card { border: 1px solid var(--border); border-radius: 10px; padding: 24px 28px; transition: border-color 0.2s; text-decoration: none; color: inherit; display: block; }
.project-card:hover { border-color: var(--muted); opacity: 1; }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.project-name { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.project-badge { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge-active { border-color: #4caf50; color: #4caf50; }
.badge-beta { border-color: #ff9800; color: #ff9800; }
.project-desc { font-size: 0.93rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.project-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 14px; }
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project-tag { font-size: 0.75rem; color: var(--muted); background: var(--border); padding: 2px 8px; border-radius: 4px; }
.project-link { font-size: 0.82rem; color: var(--muted); text-decoration: none; }
.project-card.dropped { opacity: 0.7; }

/* ── Contact ─────────────────────────────────────────── */
.contact-hero { padding: 48px 0 40px; }
.distance-headline { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; margin-bottom: 24px; }
.distance-num { font-style: italic; color: var(--muted); transition: color 0.3s; }
.distance-num.loaded { color: var(--text); }
.contact-email-link { display: inline-block; font-size: 1rem; font-weight: 500; color: var(--text); text-decoration: none; border-bottom: 1.5px solid var(--text); padding-bottom: 2px; transition: opacity 0.2s; margin-bottom: 28px; }
.contact-email-link:hover { opacity: 0.5; }
.location-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 10px 18px; font-family: var(--font-sans); font-size: 0.85rem; color: var(--muted); cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.location-btn:hover { border-color: var(--muted); color: var(--text); }
.location-btn svg { width: 14px; height: 14px; }
.location-status { margin-top: 14px; font-size: 0.85rem; color: var(--muted); }

/* ── Newsletter ──────────────────────────────────────── */
.newsletter-wrap { margin-top: 24px; padding: 0 24px; }
.newsletter-box { max-width: var(--max-w); margin: 0 auto; border: 1px solid var(--border); border-radius: 12px; padding: 32px 36px; }
.newsletter-title { font-size: 1rem; font-weight: 500; margin-bottom: 16px; }
.newsletter-form { display: flex; gap: 10px; }
.newsletter-input { flex: 1; font-family: var(--font-sans); font-size: 0.92rem; padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); outline: none; transition: border-color 0.2s; min-width: 0; }
.newsletter-input::placeholder { color: var(--muted); }
.newsletter-input:focus { border-color: var(--muted); }
.newsletter-btn { font-family: var(--font-sans); font-size: 0.92rem; font-weight: 500; padding: 10px 22px; background: var(--text); color: var(--bg); border: none; border-radius: 8px; cursor: pointer; transition: opacity 0.2s; white-space: nowrap; }
.newsletter-btn:hover { opacity: 0.75; }

/* ── Services ────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service-card { border: 1px solid var(--border); border-radius: 10px; padding: 24px; transition: border-color 0.2s; }
.service-card:hover { border-color: var(--muted); }
.service-icon { font-size: 1.2rem; display: block; margin-bottom: 12px; }
.service-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.service-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* ── Stats ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.stat-card { border: 1px solid var(--border); border-radius: 10px; padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-num { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.stat-label { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }

/* ── Testimonials ────────────────────────────────────── */
.testimonials-list { display: flex; flex-direction: column; gap: 12px; }
.testimonial-card { border: 1px solid var(--border); border-radius: 10px; padding: 28px; transition: border-color 0.2s; }
.testimonial-card:hover { border-color: var(--muted); }
.testimonial-text { font-size: 0.97rem; line-height: 1.75; font-style: italic; margin-bottom: 20px; }
.testimonial-author { display: flex; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.testimonial-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.testimonial-name { font-size: 0.88rem; font-weight: 600; }
.testimonial-role { font-size: 0.82rem; color: var(--muted); }

/* ── CTA Section ─────────────────────────────────────── */
.cta-section { padding: 48px 36px 56px; text-align: center; border: 1px solid var(--border); border-radius: 16px; margin: 40px 0 60px; }
.cta-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 14px; }
.cta-sub { font-size: 0.97rem; color: var(--muted); line-height: 1.7; max-width: 440px; margin: 0 auto 32px; }
.cta-actions { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.cta-primary { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; color: var(--bg); background: var(--text); text-decoration: none; padding: 14px 28px; border-radius: 10px; transition: opacity 0.2s; }
.cta-primary:hover { opacity: 0.75; }
.cta-secondary { font-size: 0.9rem; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 2px; transition: color 0.2s; }
.cta-secondary:hover { color: var(--text); border-color: var(--text); opacity: 1; }

/* ── Footer ──────────────────────────────────────────── */
footer { padding: 28px 0 32px; border-top: 1px solid var(--border); margin-top: 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 0.83rem; color: var(--muted); }
.footer-links { display: flex; gap: 20px; list-style: none; flex-wrap: wrap; }
.footer-links a { font-size: 0.83rem; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); opacity: 1; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .header-nav { gap: 16px; }
  .header-nav a { font-size: 0.82rem; }
  .services-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  .hero h1 { font-size: 1.9rem; }
  .hero { padding: 32px 0 20px; }
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .clients-grid { grid-template-columns: repeat(2, 1fr); }
  .newsletter-form { flex-direction: column; }
  .newsletter-wrap { padding: 0 24px; }
  .newsletter-box { padding: 24px; }
  .distance-headline { font-size: 1.4rem; }
  .cta-section { padding: 32px 20px 40px; text-align: left; }
  .cta-actions { justify-content: flex-start; }
  .cta-title { font-size: 1.5rem; }
  .cta-sub { margin: 0 0 28px; }
  .post-featured, .post-item { padding: 18px 20px; }
  .post-card { padding: 18px 20px; }
  .project-card { padding: 18px 20px; }
  .testimonial-card { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cta-btn { display: none; }
  .group-heading { margin-top: 28px; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.65rem; }
  .clients-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Mobile Menu ─────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  align-items: center;
  gap: 6px;
}
.mobile-menu-btn:hover { color: var(--text); border-color: var(--muted); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 12px 0 0;
  overflow: hidden;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { background: var(--border); opacity: 1; }

@media (max-width: 600px) {
  .mobile-menu-btn { display: flex; }
}

/* ── Logo ────────────────────────────────────────────── */
.site-logo { text-decoration: none; display: flex; align-items: center; flex-shrink: 0; }
.logo-img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s;
}
.site-logo:hover .logo-img { opacity: 0.7; }

/* Dark mode — invert logo since it's black on white */
[data-theme="dark"] .logo-img { filter: invert(1); }

/* Header right group */
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Mobile hamburger lines */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  width: 38px;
  height: 36px;
}
.mobile-menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}
.mobile-menu-btn:hover { border-color: var(--muted); }

@media (max-width: 600px) {
  .mobile-menu-btn { display: flex; }
  .logo-img { height: 34px; width: 34px; }
}

/* ── Logo updated ────────────────────────────────────── */
.logo-img {
  height: 38px;
  width: 38px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s;
}
.site-logo:hover .logo-img { opacity: 0.7; }
[data-theme="dark"] .logo-img { filter: invert(1); }

/* Mobile hamburger */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  cursor: pointer;
  width: 36px;
  height: 34px;
}
.mobile-menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
}
.mobile-menu-btn:hover { border-color: var(--muted); }

@media (max-width: 680px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .header-nav-wrap { display: none; }
  .mobile-menu-btn { display: flex; }
  .cta-btn { display: none; }
  .logo-img { height: 32px; width: 32px; }
}
