/* ---------------------------
   FONTS & BASE TYPOGRAPHY
---------------------------- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400&family=Lateef:wght@300;400&family=Noto+Sans+Arabic:wght@300;400&family=Rubik:ital,wght@0,300;1,300&display=swap');

body { 
    font-family: 'Noto Sans Arabic', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* ---------------------------
   ARTICLE GRID / LAYOUT - RESPONSIVE
---------------------------- */
article {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Content containers */
.article-header,
.author-header,
.article-detail {
    max-width: 100%;
    margin: 0 auto;
}

/* Images and figures */
article > figure {
    margin: 2rem 0;
    width: 100%;
}

article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Aside content */
article > .aside {
    font-family: 'Noto Sans Arabic', sans-serif;
    margin: 2rem 0;
    color: #666;
    font-size: 0.9rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Blockquote styling moved to pullquotes section below */

/* ---------------------------
   HEADINGS & TEXT - RESPONSIVE
---------------------------- */
article > h1 {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 2rem 0 1.5rem 0;
    color: rgba(0,0,0,.84);
}

article > h2 {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 2rem 0 1rem 0;
    color: rgba(0,0,0,.84);
}

article > h3 {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 1.5rem 0 0.75rem 0;
    color: rgba(0,0,0,.84);
}

article > p {    
    font-family: 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.1rem;
    line-height: 1.7;
    letter-spacing: -.003em;
    color: rgba(0,0,0,.84);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    margin: 0 0 1.5rem 0;
}

article > ul, article > ol {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(0,0,0,.84);
    margin: 0 0 1.5rem 0;
    padding-right: 1.5rem;
}

article > li {
    margin-bottom: 0.5rem;
}

/* ---------------------------
   IMAGES / FIGURES
---------------------------- */
article img { max-width: 100%; }

figure { margin: 0; }

figure figcaption {
    color: #666;
    font-style: italic;
    font-size: 0.8em;
}

/* ---------------------------
   CODE BLOCKS
---------------------------- */
.line-numbers a {
    text-decoration: none;
    color: #000;
    padding-right: 1em;
}

code {
    background: #eee;
    padding: 2px 5px;
}

pre {
    background: #eee;
    padding: 10px 15px;
    overflow: auto;
}

pre > code { padding: 0; }

/* ---------------------------
   PULLQUOTES (Medium-like)
---------------------------- */
article blockquote {
  margin: 2.5rem auto;
  max-width: 100%;
  padding: 0;
  border: none;
  position: relative;
  font-family: 'Noto Sans Arabic', sans-serif;
}

article blockquote p {
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(0,0,0,.84);
  margin: 0;
  padding-right: 1.5rem;
  text-align: right;
  position: relative;
}

/* Black vertical line - Medium style (RTL) */
article blockquote p::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #000;
  border-radius: 1px;
}

/* Citation styling */
article blockquote footer {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  font-style: normal;
  text-align: right;
  padding-right: 1.5rem;
  font-family: 'Noto Sans Arabic', sans-serif;
}

/* Responsive design */
@media (max-width: 900px) {
  article blockquote {
    max-width: 92%;
    margin: 2rem auto;
  }
  
  article blockquote p {
    font-size: 1rem;
    padding-right: 1.2rem;
  }
  
  article blockquote p::before {
    width: 2px;
  }
  
  article blockquote footer {
    padding-right: 1.2rem;
  }
}

/* RTL is now the default layout for Arabic content */

/* ---------------------------
   MEDIUM-STYLE AUTHOR HEADER - RESPONSIVE
---------------------------- */
.author-header {
  margin: 2rem 0 2rem 0;
  padding: 0 0 1.5rem 0;
  border-bottom: 1px solid #e5e5e5;
}

.author-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  direction: rtl;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-details {
  flex: 1;
  text-align: right;
}

.author-name {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(0,0,0,.84);
  margin-bottom: 0.25rem;
}

.author-bio {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 0.9rem;
  color: rgba(0,0,0,.54);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 0.85rem;
  color: rgba(0,0,0,.54);
  flex-direction: row-reverse;
}

.publish-date,
.reading-time {
  display: flex;
  align-items: center;
}

/* Responsive design for author header */
@media (max-width: 900px) {
  .author-header {
    margin: 1.5rem 0 1.5rem 0;
    padding: 0 0 1rem 0;
  }
  
  .author-info {
    gap: 0.75rem;
  }
  
  .author-avatar {
    width: 40px;
    height: 40px;
  }
  
  .author-name {
    font-size: 0.95rem;
  }
  
  .author-bio {
    font-size: 0.85rem;
  }
  
  .article-meta {
    font-size: 0.8rem;
    gap: 0.75rem;
  }
}

/* hide Hugo heading anchors */
article a.anchor { display: none !important; }

/* ---------------------------
   BACK BUTTON (optional) - RESPONSIVE
---------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Noto Sans Arabic', sans-serif;
    color: #000;
    background: #fff;
    border: 1px solid #000;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem 0;
}

.back-link:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.back-button:focus { outline: none; }

.back-button:hover {
    box-shadow: 10px 10px 0 #999;
}

.back-button .back-text { transform: skewX(15deg); }

.back-button .back-arrow {
    width: 20px;
    margin-right: 30px;
    position: relative;
    top: 12%;
    transition: 0.5s;
}

.back-button:hover .back-arrow { margin-left: 45px; }

.arrow-one,
.arrow-two,
.arrow-three {
    transition: 0.4s;
}

.back-button:hover .arrow-three {
    animation: arrow-color-anim 1s infinite 0.2s;
}

.back-button:hover .arrow-one {
    transform: translateX(0%);
    animation: arrow-color-anim 1s infinite 0.6s;
}

.back-button:hover .arrow-two {
    transform: translateX(0%);
    animation: arrow-color-anim 1s infinite 0.4s;
}

@keyframes arrow-color-anim {
    0%   { fill: #000; }
    50%  { fill: #666; }
    100% { fill: #000; }
}

/* ---------------------------
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
---------------------------- */

/* Mobile styles for screens smaller than 768px */
@media (max-width: 768px) {
  /* Article container */
  article {
    padding: 0 16px;
    max-width: 100%;
  }
  
  /* Typography adjustments */
  article > h1 {
    font-size: 2rem;
    margin: 1.5rem 0 1rem 0;
  }
  
  article > h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem 0;
  }
  
  article > h3 {
    font-size: 1.25rem;
    margin: 1.25rem 0 0.5rem 0;
  }
  
  article > p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
  }
  
  article > ul, article > ol {
    font-size: 1rem;
    line-height: 1.6;
    padding-right: 1rem;
  }
  
  /* Author header mobile */
  .author-header {
    margin: 1.5rem 0;
    padding: 0 0 1rem 0;
  }
  
  .author-info {
    gap: 0.75rem;
  }
  
  .author-avatar {
    width: 40px;
    height: 40px;
  }
  
  .author-name {
    font-size: 0.95rem;
  }
  
  .author-bio {
    font-size: 0.85rem;
  }
  
  .article-meta {
    font-size: 0.8rem;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  
  /* Blockquotes mobile */
  article blockquote {
    margin: 1.5rem 0;
    padding: 0;
  }
  
  article blockquote p {
    font-size: 1rem;
    padding-right: 1rem;
  }
  
  article blockquote p::before {
    width: 2px;
  }
  
  article blockquote footer {
    padding-right: 1rem;
    font-size: 0.85rem;
  }
  
  /* Images mobile */
  article > figure {
    margin: 1.5rem 0;
  }
  
  /* Code blocks mobile */
  pre {
    padding: 8px 12px;
    font-size: 0.9rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Back button mobile */
  .back-link {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}

/* Extra small mobile devices (320px and up) */
@media (max-width: 480px) {
  article {
    padding: 0 12px;
  }
  
  article > h1 {
    font-size: 1.75rem;
  }
  
  article > h2 {
    font-size: 1.35rem;
  }
  
  article > h3 {
    font-size: 1.15rem;
  }
  
  article > p {
    font-size: 0.95rem;
  }
  
  article > ul, article > ol {
    font-size: 0.95rem;
    padding-right: 0.75rem;
  }
  
  .author-info {
    gap: 0.5rem;
  }
  
  .author-avatar {
    width: 36px;
    height: 36px;
  }
  
  article blockquote p {
    font-size: 1rem;
  }
}

/* Tablet styles (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  article {
    max-width: 600px;
    padding: 0 24px;
  }
  
  article > h1 {
    font-size: 2.25rem;
  }
  
  article > h2 {
    font-size: 1.65rem;
  }
}

/* Large desktop styles (1024px and up) */
@media (min-width: 1024px) {
  article {
    max-width: 680px;
    padding: 0 20px;
  }
}
