/* Base styles for content inside the #markdown-content div */
#markdown-content {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #222;
    text-align: left;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 200px;
}

#markdown-content h1 {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #111;
    text-align: center;
}

#markdown-content h2 {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    text-transform: capitalize;
}

#markdown-content h3 {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 16px;
    color: #444;
}

#markdown-content p {
    margin-bottom: 16px;
    font-size: 1.2em;
    font-weight: lighter;
    color: #333;
    white-space: normal;
}

#markdown-content ul,
#markdown-content ol {
    margin: 20px 40px;
    padding: 0;
}

#markdown-content ul li {
    list-style-type: disc;
    margin-bottom: 10px;
    padding-left: 10px;
}

#markdown-content ol li {
    list-style-type: decimal;
    margin-bottom: 10px;
    padding-left: 10px;
}

#markdown-content blockquote {
    font-style: italic;
    margin: 20px 40px;
    color: #666;
    border-left: 4px solid #ccc;
    padding-left: 16px;
}

/* Table styles for #markdown-content */
#markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#markdown-content table th,
#markdown-content table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

#markdown-content table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

/* References */
.references {
    margin: 2em 0;
    padding: 1em;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    line-height: 1.4;
    text-align: left;
    /* Aligns text to the left */
    word-spacing: normal;
    /* Ensures consistent word spacing */
    white-space: normal;
    /* Prevents unnecessary large spaces */
}

.references h2 {
    margin-bottom: 0.5em;
}

.references p {
    margin: 0.5em 0;
    text-align: left;
}

.references a {
    color: #007acc;
}

.references a:hover {
    text-decoration: underline;
}

/* Base styles for desktop */
.container {
    display: flex;
    align-items: flex-start;
    flex-direction: row;
  }

  .text-content {
    flex: 1;
    padding-right: 20px;
  }

  .profile-picture {
    flex: 0 0 200px;
  }

.profile-picture img {
    width: 100%;
    border-radius: 10px;
    /* Shadow effect */
    box-shadow: 0 7px 8px rgba(0, 0, 0, 0.5); /* Adjust blur and color as needed */
    margin-top: 15px
}

/* Container for all videos */
.video-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 20px;
gap: 30px;
}

/* Individual video box styling */
.video-box {
flex: 1 1 560px;
max-width: 560px;
text-align: center;
}

/* Styling for video titles */
.video-title {
font-family: Arial, sans-serif;
color: #333;
}
/* Styling for video frame container */
.video-frame {
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
border-radius: 10px;
overflow: hidden;
}
.video-tutorial-title {
font-size: 2em;
color: #4a90e2; /* Use a color that complements your theme */
text-align: center;
margin-bottom: 20px;
font-family: Arial, sans-serif;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.video-tutorial-title i {
color: #f39c12; /* Color for the icon */
font-size: 1.2em;
}
/* Styling for the download button */
.download-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #008CBA;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}
.download-button:hover {
    background-color: #005f73;
}

.main_content {
    position: relative;
    top: 80px;
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;

    padding-left: 40px;
    padding-right: 40px;
}

.author-info span{
  font-size: 14px;
  color: rgba(31, 29, 29, 0.65) ;
}
.author-info {
  font-size: 14px;
  color: rgba(31, 29, 29, 0.65)
}
/* Inline citation */
.ref-anchor {
  cursor: pointer;
  color: #7bb5ff;
  font-family: 'Fira Code', monospace;
  font-size: 0.95em;
  user-select: none;
}

.ref-anchor:hover {
  text-decoration: underline;
}

/* Reference highlight on click */
.reference-list li {
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.reference-list li.ref-highlight {
  background: rgba(123, 181, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(123, 181, 255, 0.25);
  border-radius: 6px;
  padding: 6px 8px;
}
/* =========================================================
   MOBILE — AUTHOR BLOCK FIX
========================================================= */
@media (max-width: 768px) {

  /* Ensure markdown container stays readable */
  #markdown-content {
    padding: 20px;
    text-align: left;
  }

  /* Author wrapper (ID or class, both covered safely) */
  #author,
  .author-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;   /* 🔑 LEFT ALIGN */
    text-align: left;          /* 🔑 TEXT LEFT */
    width: 100%;
    margin-top: 16px;
  }

  /* Author text */
  .author-info span,
  .author-info {
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
  }

  /* If author image exists */
  .profile-picture {
    align-self: flex-start;    /* 🔑 */
    margin-bottom: 12px;
  }

  .profile-picture img {
    max-width: 120px;
  }
}
/* =========================================================
   MOBILE — DOCUMENT WIDTH & READABILITY FIX
========================================================= */
@media (max-width: 768px) {

  /* Main content wrapper */
  .main_content {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Markdown container */
  #markdown-content {
    max-width: 100%;
    padding: 18px 16px;
    margin-left: auto;
    margin-right: auto;

    border-radius: 10px;
    box-sizing: border-box;
  }

  /* Prevent wide elements from breaking layout */
  #markdown-content img,
  #markdown-content video,
  #markdown-content iframe {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Tables: allow horizontal scroll instead of overflow */
  #markdown-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Code blocks / pre */
  #markdown-content pre,
  #markdown-content code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* Lists: reduce indentation */
  #markdown-content ul,
  #markdown-content ol {
    margin-left: 20px;
    margin-right: 0;
  }

  /* Blockquotes */
  #markdown-content blockquote {
    margin: 16px 8px;
    padding-left: 14px;
  }
}
/* =========================================================
   FIX LONG REFERENCE LINKS (NO OVERFLOW)
========================================================= */

/* All links inside markdown */
#markdown-content a {
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Extra safety for references section */
.references,
.references p,
.references a {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Ordered reference lists */
.references ol,
.references ul,
.reference-list {
  padding-left: 1.2em;
}

/* Mobile-specific tightening */
@media (max-width: 768px) {
  .references {
    padding-left: 0;
    padding-right: 0;
  }

  .references a {
    font-size: 0.9em; /* slightly smaller for long URLs */
  }
}
/* =========================================================
   MOBILE FIX — PROFILE PICTURE IN MARKDOWN
========================================================= */
@media (max-width: 768px) {

  /* Stack content cleanly */
  .container {
    flex-direction: column;
    align-items: stretch;
  }

  /* Profile picture wrapper */
  .profile-picture {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 24px 0 16px 0;
  }

  /* Image itself */
  .profile-picture img {
    max-width: 85%;
    height: auto;
    border-radius: 14px;

    /* Remove desktop behavior */
    margin-top: 0;
    float: none;

    /* Premium centering */
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  }

  /* Text block spacing */
  .text-content {
    padding-right: 0;
  }
}
/* =========================================================
   MOBILE FIX — AUTHOR BLOCK OVERFLOW
========================================================= */
@media (max-width: 768px) {

  /* Author wrapper */
  #author {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    display: flex;
    justify-content: flex-start;
    align-items: flex-start;

    padding: 0;
    margin: 0 0 20px 0;
  }

  /* Author card itself */
  .author-info {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    padding: 16px 18px;
    margin: 0;

    border-radius: 14px;

    /* Prevent sideways overflow */
    overflow-wrap: break-word;
    word-break: normal;

    /* Kill any centering leftovers */
    align-self: stretch;
  }
}
