/* ==========================================================================
   CENTERED IMAGE LAYOUT
   ========================================================================== */

.centered-image-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* Horizontal centering */
  justify-content: center;
  width: 100%; /* Span full article width */
  margin: 1rem 0; /* Vertical spacing between paragraphs */
  clear: both;
}

.lightbox-link {
  cursor: zoom-in;
  display: inline-block;
  line-height: 0; /* Removes ghost space below images */
}

.centered-image-container img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Style the optional caption */
.image-caption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
  opacity: 0.8;
}

/* ==========================================================================
   LIGHTBOX DIALOG (MODAL)
   ========================================================================== */

#image-dialog {
  display: none; /* Hidden by default */
  position: fixed;
  inset: 0; /* Top, Left, Right, Bottom: 0 */
  background: rgba(40, 40, 40, 0.9);
  z-index: 99999; /* Above everything */
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 20px;
}

#image-dialog img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  /* Prevent the image itself from being draggable to avoid click confusion */
  user-select: none;
  -webkit-user-drag: none;
}

/* ==========================================================================
   EXTERNAL LINK MARKING
   ========================================================================== */
.external-link {
  display: inline-flex;
  gap: 4px;
}

/* Using a simple Unicode arrow or an SVG background */
.external-icon::after {
  content: "\2197"; /* North East Arrow: ↗ */
  font-size: 0.7em;
  vertical-align: super;
  font-weight: bold;
  margin-left: -2px;
}

/* ==========================================================================
   THEME OVERRIDES
   ========================================================================== */

:root {
  --font-family-main: "Montserrat", sans-serif !important;
  --font-family-content: "Montserrat", sans-serif !important;
  --font-family-summary: "Montserrat", sans-serif !important;

  --font-weight-main: 450 !important;
  --font-weigth-main: 450 !important; /* Intentional typo (theme has it) */
  --font-weight-content: 450 !important;
  --font-weight-summary: 450 !important;

  --primary-color: #d37c6d !important;
  font-size: 15px;
}

:root[color-scheme^="light"] {
  --primary-color: #871616 !important;
}

code {
  font-size: 14px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
}

#main-header {
  margin-bottom: 3rem !important;
}

#main-header .nav-left {
  line-height: 1.2;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

#nav-menu a {
  font-weight: 600;
}

/* Fix for dark mode shadows */
html.dark .centered-image-container img {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Ensure figure doesn't have weird theme margins */
figure {
  margin-inline-start: 0;
  margin-inline-end: 0;
}

/* Original styling looks bad for inline images */
main#main-content img {
  margin: 0.5rem !important;
  border-radius: 0 !important;
}

a {
  text-decoration: none !important;
}

.list-group-heading time {
  font-family: monospace;
  /*font-size: 0.9rem;*/
  opacity: 1 !important;
  border-bottom: 4px solid purple;
  padding-bottom: 2px;
  font-weight: 400;
  height: 1.2rem;
  /* Without max-content the element has 100% width of container in mobile view */
  width: max-content;
}

:root[color-scheme^="light"] .list-group-heading time {
  border-color: #7c337c;
}

.single-header > time,
.latestEnPost {
  display: inline-block;
  font-family: monospace;
  opacity: 1 !important;
  background: purple;
  color: white;
  padding: 0.3rem 0.6rem;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
  border-radius: 0.3rem;
}

:root[color-scheme^="light"] .single-header > time,
:root[color-scheme^="light"] .latestEnPost {
  background: #7c337c;
}

.latestEnPost {
  margin-left: 0.3rem;
  padding: 0.2rem 0.5rem;
}

.enPosts {
  padding-inline: 1rem;
  margin-bottom: 4rem;
}

.side-details {
  border-bottom: none !important;
}

.side-details-taxonomy {
  margin-top: 0.5rem !important;
}

/* ==========================================================================
   MISC
   ========================================================================== */

#hello {
  color: white;
  padding: 0.9rem 1.1rem;
  background: #1e313e;
  border: 1px solid #49799b;
  border-radius: 5px;
  margin-bottom: 3rem;
}

#hello b {
  font-weight: 600;
}

:root[color-scheme^="light"] #hello {
  color: black;
  background: #fdeec1;
  border: 1px solid #f9d061;
}

#hello p:first-child {
  margin-top: 0;
}

#hello .other-sites {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#hello .other-sites > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

#hello .other-sites a {
  padding: 0.3rem 0.6rem;
  color: black;
  background: #ededed;
  border-radius: 5px;
  font-size: 0.9rem;
  width: min-content;
  white-space: nowrap;
}

:root[color-scheme^="light"] #hello .other-sites a {
  color: white;
  background: #6a6a6a;
}

#hello .other-sites a:hover {
  background: #939393;
}

:root[color-scheme^="light"] #hello .other-sites a:hover {
  background: #444;
}

#blog-subtitle {
  padding-bottom: 0.5rem;
}
