/*
Theme Name: Ahmed El-Gazar Blog
Theme URI: https://ahmedelgazar.com
Author: Ahmed El-Gazar
Author URI: https://ahmedelgazar.com
Description: A clean, dark SEO blog theme matching the Ahmed El-Gazar portfolio. Built for digital marketing and SEO content.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: ahmed-blog
*/

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #c8a96e;
  --gold-light: #d4ba85;
  --dark: #111111;
  --dark-2: #1a1a1a;
  --dark-3: #222222;
  --dark-4: #2a2a2a;
  --border: rgba(255,255,255,0.08);
  --text: #cccccc;
  --text-light: #999999;
  --white: #ffffff;
  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --max-width: 1140px;
  --sidebar-width: 300px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--white);
  line-height: 1.25;
  font-weight: 700;
}

p { margin-bottom: 1.2em; color: var(--text); }
ul, ol { padding-left: 1.5em; margin-bottom: 1.2em; }
li { margin-bottom: 0.4em; }

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 50px;
  padding: 60px 0 80px;
  align-items: start;
}

/* ═══════════════════════════════════════
   HEADER / NAVBAR
═══════════════════════════════════════ */
.site-header {
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-name {
  font-family: var(--font-head);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
}

.logo-name span { color: var(--gold); }

.logo-badge {
  font-size: 0.65rem;
  background: var(--gold);
  color: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 4px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.header-nav a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover { color: var(--gold); }

.header-nav .btn-portfolio {
  background: var(--gold);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 2px;
  font-size: 0.78rem;
}

.header-nav .btn-portfolio:hover { background: var(--gold-light); color: #fff; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s;
}

/* ═══════════════════════════════════════
   HERO / PAGE BANNER
═══════════════════════════════════════ */
.page-banner {
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
  padding: 50px 0 40px;
  text-align: center;
}

.page-banner h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 10px;
}

.page-banner h1 span { color: var(--gold); }

.page-banner p {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--text-light);
  max-width: 540px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════
   BLOG POST CARDS (Archive)
═══════════════════════════════════════ */
.posts-grid { display: flex; flex-direction: column; gap: 36px; }

.post-card {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: rgba(200,169,110,0.35);
  transform: translateY(-2px);
}

.post-card-thumb {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--dark-3);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card:hover .post-card-thumb img { transform: scale(1.03); }

.post-card-body { padding: 28px 30px 30px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.post-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: rgba(200,169,110,0.1);
  padding: 3px 10px;
  border-radius: 2px;
}

.post-date {
  font-size: 0.78rem;
  color: var(--text-light);
}

.post-read-time {
  font-size: 0.78rem;
  color: var(--text-light);
}

.post-card-title {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  margin-bottom: 12px;
  line-height: 1.35;
}

.post-card-title a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.2s;
}

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

.post-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.75;
  margin-bottom: 20px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  transition: gap 0.2s;
}

.read-more:hover { gap: 10px; color: var(--gold-light); }
.read-more::after { content: "→"; }

/* ═══════════════════════════════════════
   SINGLE POST
═══════════════════════════════════════ */
.single-post-hero {
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
  padding: 50px 0 40px;
}

.single-post-hero .post-meta { margin-bottom: 18px; }

.single-post-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  line-height: 1.2;
  max-width: 820px;
  margin-bottom: 16px;
}

.single-post-hero .post-excerpt {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--text-light);
  max-width: 640px;
  line-height: 1.7;
}

.post-featured-image {
  width: 100%;
  max-height: 440px;
  overflow: hidden;
  border-radius: 4px;
  margin: 36px 0;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Post content typography */
.post-content {
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.85;
  color: var(--text);
}

.post-content h2 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin: 2.2em 0 0.8em;
  color: var(--white);
  border-left: 4px solid var(--gold);
  padding-left: 16px;
}

.post-content h3 {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin: 1.8em 0 0.7em;
  color: var(--white);
}

.post-content h4 {
  font-size: 1rem;
  margin: 1.5em 0 0.6em;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-content p { margin-bottom: 1.4em; }

.post-content a { color: var(--gold); border-bottom: 1px solid rgba(200,169,110,0.3); }
.post-content a:hover { color: var(--gold-light); border-color: var(--gold-light); }

.post-content ul, .post-content ol {
  margin: 1em 0 1.4em 1.4em;
}

.post-content li { margin-bottom: 0.5em; }

.post-content blockquote {
  border-left: 4px solid var(--gold);
  background: var(--dark-2);
  padding: 20px 24px;
  margin: 2em 0;
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--text-light);
}

.post-content code {
  background: var(--dark-3);
  color: var(--gold);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: monospace;
}

.post-content pre {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.post-content img {
  border-radius: 4px;
  margin: 1.5em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.post-content th {
  background: var(--dark-3);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  border: 1px solid var(--border);
}

.post-content td {
  padding: 11px 16px;
  border: 1px solid var(--border);
  color: var(--text);
}

.post-content tr:nth-child(even) td { background: var(--dark-2); }

/* ═══════════════════════════════════════
   AUTHOR BOX (bottom of post)
═══════════════════════════════════════ */
.author-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  margin-top: 50px;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--gold);
  background: var(--dark-3);
}

.author-info h4 {
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 4px;
}

.author-info .author-title {
  font-size: 0.78rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: block;
}

.author-info p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar { display: flex; flex-direction: column; gap: 36px; }

.widget {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
}

.widget-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* About widget */
.widget-about-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.widget-about-role {
  font-size: 0.78rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: block;
}

.widget-about p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 16px;
}

.widget-cta {
  display: block;
  text-align: center;
  background: var(--gold);
  color: #fff !important;
  padding: 11px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s;
}

.widget-cta:hover { background: var(--gold-light); }

/* Recent posts widget */
.recent-post-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.recent-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-post-item:first-child { padding-top: 0; }

.recent-post-thumb {
  width: 58px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--dark-3);
}

.recent-post-info a {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.35;
  display: block;
  margin-bottom: 4px;
  text-decoration: none;
}

.recent-post-info a:hover { color: var(--gold); }

.recent-post-date { font-size: 0.72rem; color: var(--text-light); }

/* Categories widget */
.category-list { list-style: none; padding: 0; margin: 0; }

.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.category-list li:last-child { border-bottom: none; }

.category-list a {
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.category-list a:hover { color: var(--gold); }

.cat-count {
  font-size: 0.72rem;
  background: var(--dark-3);
  color: var(--text-light);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Tags widget */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-cloud a {
  font-size: 0.72rem;
  background: var(--dark-3);
  color: var(--text-light);
  padding: 5px 12px;
  border-radius: 2px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-cloud a:hover {
  background: rgba(200,169,110,0.1);
  border-color: var(--gold);
  color: var(--gold);
}

/* Search widget */
.search-form { display: flex; gap: 0; }

.search-form input {
  flex: 1;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--white);
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: 2px 0 0 2px;
  outline: none;
  font-family: var(--font-body);
}

.search-form input::placeholder { color: var(--text-light); }
.search-form input:focus { border-color: var(--gold); }

.search-form button {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 0 2px 2px 0;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.search-form button:hover { background: var(--gold-light); }

/* ═══════════════════════════════════════
   PAGINATION
═══════════════════════════════════════ */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 50px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  font-family: var(--font-head);
  font-weight: 600;
}

.pagination a:hover, .pagination .current {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
.site-footer {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 60px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 16px;
}

.footer-col p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
}

.footer-links { list-style: none; padding: 0; margin: 0; }

.footer-links li { margin-bottom: 8px; }

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-light);
}

.footer-copy a { color: var(--gold); }

.footer-social { display: flex; gap: 14px; }

.footer-social a {
  font-size: 0.78rem;
  color: var(--text-light);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.footer-social a:hover { color: var(--gold); }

/* ═══════════════════════════════════════
   UTILITY
═══════════════════════════════════════ */
.text-gold { color: var(--gold); }
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.no-results h2 { margin-bottom: 10px; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .site-layout {
    grid-template-columns: 1fr;
    padding: 40px 0 60px;
    gap: 40px;
  }

  .sidebar { order: 2; }
  .main-content { order: 1; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--dark-2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 16px;
  }

  .header-nav.is-open { display: flex; }
  .menu-toggle { display: flex; }
  .site-header { position: relative; }

  .author-box { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .post-card-body { padding: 20px; }
  .container { padding: 0 16px; }
  .single-post-hero { padding: 36px 0 28px; }
}
