/* ============================================
   LOGO & AVATAR
   ============================================ */

html.dark .logo, .logo {
  margin-bottom: 2px;
  height: 30px;
}

.menu {
  position: relative;
  padding-right: calc(30px + 37.2px + 15px);
}

.avatar-link {
  display: block;
  height: calc(30px + 37.2px);
  width: calc(30px + 37.2px);
  background-image: url('/images/avatar.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 10;
  text-decoration: none;
  cursor: pointer;
  border: 0px solid #99a1af !important;
  transition: all 0.2s ease;
  box-shadow: 3px 3px #000 !important;
  transform: none !important;
}

.avatar-link:hover {
  border-color: #000 !important;
  box-shadow: 5px 5px #000 !important;
  transform: translateY(-3px) scale(1.05) !important;
}

html.dark .avatar-link {
  border-color: #fff !important;
  box-shadow: 3px 3px #fff !important;
}

html.dark .avatar-link:hover {
  border-color: #fff !important;
  box-shadow: 5px 5px #fff !important;
  transform: translateY(-3px) scale(1.05) !important;
}

/* ============================================
   MENU SPACING & LAYOUT
   ============================================ */

.menu .trigger-container {
  gap: 0.25rem;
}

.menu .trigger-container li {
  margin: 0;
}



.menu .trigger {
  margin-top: 0px;
}

.menu input[type=checkbox]:checked~.trigger {
  right: 0;
}

/* ============================================
   MOBILE ADJUSTMENTS
   ============================================ */

@media screen and (max-width: 768px) {
  body {
    font-size: 18px !important;
  }
  
  .navbar {
    padding: 1rem 1.25rem;
    border-radius: 12px;
  }
  
  .menu {
    padding-right: 0;
    padding-top: 0;
  }
  
  .menu .logo {
    margin: 36px calc(35px + 25px) 0 0 !important;
  }
  
  .avatar-link {
    position: absolute;
    top: 26px;
    right: 0px;
    height: 50px;
    width: 50px;
    z-index: 1;
  }
  
  .menu:has(input[type="checkbox"]:checked) .avatar-link {
    display: none;
  }
  
  .menu .trigger-container li {
    margin-bottom: 0.5rem !important;
  }
  
}

/* ============================================
   UTILITY STYLES
   ============================================ */

.listmonk-form-container {
  margin: 0 auto;
}

.footer {
  margin-top: 1rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* ============================================
   GLOBAL IMPROVEMENTS
   ============================================ */

html {
  scroll-behavior: smooth;
}

*:focus-visible {
  outline: 2px solid var(--link-color, #003fff);
  outline-offset: 2px;
  border-radius: 4px;
}

html.dark *:focus-visible {
  outline-color: var(--link-color-dark, #003fff);
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background-color: var(--selection-bg, #e0f7fa);
  color: var(--selection-text, #0d122b);
}

html.dark ::selection {
  background-color: var(--selection-bg-dark, #fffba0);
  color: var(--selection-text-dark, #0d122b);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bodybg, #FCFCF9);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

html.dark ::-webkit-scrollbar-track {
  background: var(--bodybg-dark, #131418);
}

html.dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   BUTTON & FORM INPUT STYLING
   ============================================ */

button,
input[type="submit"],
input[type="button"] {
  transition: all 0.2s ease;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================
   LINK COLOR VARIABLES
   ============================================ */

:root {
  --link-color: #003fff;
  --link-color-hover: #3399FF;
}

html.dark {
  --link-color-dark: #5b9aff;
  --link-color-dark-hover: #7db3ff;
}

/* ============================================
   PAGE CONTENT STYLING
   ============================================ */

.page-content {
  word-spacing: 0.05em;
}

.page-content p {
  margin-bottom: 1.25em;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
  font-weight: 700;
}

.page-content code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

html.dark .page-content code {
  background-color: rgba(255, 255, 255, 0.1);
}

.page-content pre {
  border-radius: 8px;
  overflow-x: auto;
  padding: 1.25em;
  line-height: 1.6;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  border-radius: 8px;
  overflow: hidden;
}

.page-content table th,
.page-content table td {
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--border-color, #ddd);
}

.page-content table th {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

html.dark .page-content table th {
  background-color: rgba(255, 255, 255, 0.05);
}

html.dark .page-content table th,
html.dark .page-content table td {
  border-bottom-color: var(--border-color-dark, #3C3F4A);
}

/* ============================================
   POST ITEM LAYOUT
   ============================================ */

.post-item {
  display: flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
  flex-direction: row !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-item:hover {
  transform: translateY(-2px);
}

.post-item-postlisting {
  display: inline-block;
  font-size: 0.85em;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
  flex-shrink: 0;
  background: #fff !important;
  border: 1px solid #99a1af !important;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 3px 3px #000 !important;
  transform: none !important;
  border-radius: 8px;
  padding: 0.25rem 0.75rem;
  opacity: 0.8 !important;
}

.post-item-postlisting:hover {
  background: #fff !important;
  border-color: #000 !important;
  box-shadow: 5px 5px #000 !important;
  transform: translateY(-2px) !important;
  scale: 1 !important;
  opacity: 1 !important;
}

.post-item-postlisting a,
.post-item-postlisting a:hover,
.post-item-postlisting a:focus,
.post-item-postlisting a:active,
.post-item-postlisting:hover a,
.post-item-postlisting:hover a:hover {
  color: inherit !important;
  text-decoration: none !important;
  border-bottom: none !important;
  text-decoration-line: none !important;
  text-underline-offset: 0 !important;
  font-weight: normal !important;
}

.post-item-postlisting:hover {
  text-decoration: none !important;
}

html.dark .post-item-postlisting {
  background: #1a1a1a !important;
  border-color: #fff !important;
  opacity: 0.8 !important;
  box-shadow: 3px 3px #fff !important;
}

html.dark .post-item-postlisting:hover {
  background: #1a1a1a !important;
  border-color: #fff !important;
  box-shadow: 5px 5px #fff !important;
  transform: translateY(-2px) !important;
  opacity: 1 !important;
}

html.dark .post-item-postlisting a,
html.dark .post-item-postlisting a:hover,
html.dark .post-item-postlisting a:focus,
html.dark .post-item-postlisting a:active,
html.dark .post-item-postlisting:hover a,
html.dark .post-item-postlisting:hover a:hover {
  color: var(--bodytext-dark, #babdc4) !important;
  text-decoration: none !important;
  border-bottom: none !important;
  text-decoration-line: none !important;
  text-underline-offset: 0 !important;
  font-weight: normal !important;
}

html.dark .post-item-postlisting:hover {
  text-decoration: none !important;
}

.post-item-title {
  display: inline-block;
  margin: 0;
  flex: 1;
  min-width: 0;
}

@media screen and (min-width: 641px) {
  .post-item {
    flex-direction: row !important;
    align-items: center;
    gap: 1rem !important;
  }
}

@media screen and (min-width: 641px) and (max-width: 768px) {
  .post-item {
    flex-direction: row !important;
    align-items: center;
    gap: 1rem !important;
  }
}

@media screen and (max-width: 640px) {
  .post-item {
    flex-direction: column !important;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .post-item-postlisting {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .post-item-title {
    width: 100%;
  }
}

/* ============================================
   BUTTON STYLES - Common base properties
   ============================================ */

.menu .menu-link,
.menu .menu-link.active {
  background: #fff !important;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 3px 3px #000 !important;
  transform: none !important;
  text-decoration: none !important;
  border-radius: 8px;
  padding: 0.25rem 0.75rem;
  display: inline-block;
  margin: 0 0.25rem;
  line-height: 1.4;
}

.menu .menu-link {
  border: 1px solid #99a1af !important;
  color: var(--menulink, #0d122b) !important;
  opacity: 0.8 !important;
}

.menu .menu-link:hover {
  background: #fff !important;
  border-color: #000 !important;
  box-shadow: 5px 5px #000 !important;
  transform: translateY(-2px) !important;
  scale: 1 !important;
  color: var(--menulink, #0d122b) !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

.menu .menu-link.active {
  border-color: #99a1af !important;
  color: var(--menulink, #0d122b) !important;
}

.menu .menu-link::before {
  display: none !important;
}

html.dark .menu .menu-link,
html.dark .menu .menu-link.active {
  background: #1a1a1a !important;
  border-color: #fff !important;
  color: var(--menulink-dark, #eaeaea) !important;
  opacity: 0.8 !important;
  box-shadow: 3px 3px #fff !important;
}

html.dark .menu .menu-link:hover {
  background: #1a1a1a !important;
  border-color: #fff !important;
  box-shadow: 5px 5px #fff !important;
  transform: translateY(-2px) !important;
  opacity: 1 !important;
}

html.dark .menu .menu-link::before {
  display: none !important;
}

/* ============================================
   FOOTER LINKS
   ============================================ */

.footerlinks a.footerlinks {
  background: #fff !important;
  border: 1px solid #99a1af !important;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 3px 3px #000 !important;
  transform: none !important;
  text-decoration: none !important;
  border-radius: 8px;
  padding: 0.25rem 0.75rem;
  display: inline-block;
  margin: 0 0.25rem;
  line-height: 1.4;
  opacity: 0.8 !important;
}

.footerlinks a.footerlinks:hover {
  background: #fff !important;
  border-color: #000 !important;
  box-shadow: 5px 5px #000 !important;
  transform: translateY(-2px) !important;
  scale: 1 !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

html.dark .footerlinks a.footerlinks {
  background: #1a1a1a !important;
  border-color: #fff !important;
  opacity: 0.8 !important;
  box-shadow: 3px 3px #fff !important;
}

html.dark .footerlinks a.footerlinks:hover {
  background: #1a1a1a !important;
  border-color: #fff !important;
  box-shadow: 5px 5px #fff !important;
  transform: translateY(-2px) !important;
  opacity: 1 !important;
}

/* ============================================
   HOMEPAGE MENU LINK
   ============================================ */

.homepage-all-posts-link {
  background: #fff !important;
  border: 1px solid #99a1af !important;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 3px 3px #000 !important;
  transform: none !important;
  text-decoration: none !important;
  border-radius: 8px;
  padding: 1rem;
  display: block;
  max-width: 100%;
  text-align: center;
  line-height: 1.4;
  opacity: 0.8 !important;
  font-weight: bold;
}

.homepage-all-posts-link:hover {
  background: #fff !important;
  border-color: #000 !important;
  box-shadow: 5px 5px #000 !important;
  transform: translateY(-2px) !important;
  scale: 1 !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

html.dark .homepage-all-posts-link {
  background: #1a1a1a !important;
  border: 1px solid #fff !important;
  opacity: 0.8 !important;
  box-shadow: 3px 3px #fff !important;
}

html.dark .homepage-all-posts-link:hover {
  background: #1a1a1a !important;
  border: 1px solid #fff !important;
  box-shadow: 5px 5px #fff !important;
  transform: translateY(-2px) !important;
  opacity: 1 !important;
}

/* ============================================
   MICRO NAVIGATION (أقدم and أحدث)
   ============================================ */

.microNavigation .previous-post,
.microNavigation .next-post {
  background: #fff !important;
  border: 1px solid #000 !important;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 3px 3px #000 !important;
  transform: none !important;
  text-decoration: none !important;
  border-radius: 8px;
  padding: 0.25rem 0.75rem !important;
  display: inline-block;
  font-size: 0.875rem !important;
  color: var(--bodytext, #000) !important;
}

.microNavigation .previous-post a,
.microNavigation .next-post a {
  color: var(--bodytext, #000) !important;
  text-decoration: none !important;
  border-bottom: none !important;
}

.microNavigation .previous-post:hover,
.microNavigation .next-post:hover {
  background: #fff !important;
  border-color: #000 !important;
  box-shadow: 5px 5px #000 !important;
  transform: translateY(-2px) !important;
  scale: 1 !important;
  text-decoration: none !important;
  color: var(--bodytext, #000) !important;
}

.microNavigation .previous-post:hover a,
.microNavigation .next-post:hover a {
  color: var(--bodytext, #000) !important;
  text-decoration: none !important;
  border-bottom: none !important;
}

html.dark .microNavigation .previous-post,
html.dark .microNavigation .next-post {
  background: #1a1a1a !important;
  border: 1px solid #fff !important;
  box-shadow: 3px 3px #fff !important;
  color: var(--bodytext-dark, #babdc4) !important;
}

html.dark .microNavigation .previous-post a,
html.dark .microNavigation .next-post a {
  color: var(--bodytext-dark, #babdc4) !important;
  text-decoration: none !important;
  border-bottom: none !important;
}

html.dark .microNavigation .previous-post:hover,
html.dark .microNavigation .next-post:hover {
  background: #1a1a1a !important;
  border: 1px solid #fff !important;
  box-shadow: 5px 5px #fff !important;
  transform: translateY(-2px) !important;
  color: var(--bodytext-dark, #babdc4) !important;
}

html.dark .microNavigation .previous-post:hover a,
html.dark .microNavigation .next-post:hover a {
  color: var(--bodytext-dark, #babdc4) !important;
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ============================================
   IMAGES
   ============================================ */

.page-content img,
.microArticle img,
article img {
  border: 1px solid #000 !important;
  box-shadow: 3px 3px #000 !important;
  border-radius: 8px;
}

html.dark .page-content img,
html.dark .microArticle img,
html.dark article img {
  border-color: #fff !important;
  box-shadow: 3px 3px #fff !important;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

.page-content blockquote,
.microArticle blockquote {
  background: #fff !important;
  border: 1px solid #000 !important;
  border-right: 1px solid #000 !important;
  position: relative;
  box-shadow: 3px 3px #000 !important;
  border-radius: 8px;
  padding: 1.5em;
  margin: 1.5em 0;
  transform: none !important;
  color: var(--bodytext, #000) !important;
}

.page-content blockquote:hover,
.microArticle blockquote:hover {
  background: #fff !important;
  border-color: #000 !important;
  border-right-color: #000 !important;
  box-shadow: 3px 3px #000 !important;
  transform: none !important;
}

.page-content blockquote::before,
.microArticle blockquote::before {
  display: none !important;
}

html.dark .page-content blockquote,
html.dark .microArticle blockquote {
  background: #1a1a1a !important;
  border-color: #fff !important;
  border-right-color: #fff !important;
  box-shadow: 3px 3px #fff !important;
  color: var(--bodytext-dark, #babdc4) !important;
}

html.dark .page-content blockquote:hover,
html.dark .microArticle blockquote:hover {
  background: #1a1a1a !important;
  border-color: #fff !important;
  border-right-color: #fff !important;
  box-shadow: 3px 3px #fff !important;
}

/* ============================================
   CONTENT LINKS (with double underline)
   ============================================ */

.page-content a,
.microArticle a,
article a,
main a {
  color: var(--bodytext, #000) !important;
  text-decoration: none !important;
  border-bottom: 3px double currentColor;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
  opacity: 1;
  position: relative;
  font-weight: 600 !important;
}

.page-content a:hover,
.microArticle a:hover,
article a:hover,
main a:hover {
  color: var(--link-color-hover) !important;
  text-decoration: none !important;
  border-bottom-color: var(--link-color-hover) !important;
  border-bottom-style: double;
  border-bottom-width: 3px;
  text-underline-offset: 3px;
  opacity: 1;
}

html.dark .page-content a,
html.dark .microArticle a,
html.dark article a,
html.dark main a {
  color: var(--bodytext-dark, #babdc4) !important;
  border-bottom: 3px double currentColor;
  opacity: 1;
  font-weight: 600 !important;
}

html.dark .page-content a:hover,
html.dark .microArticle a:hover,
html.dark article a:hover,
html.dark main a:hover {
  color: var(--link-color-dark-hover) !important;
  border-bottom-color: var(--link-color-dark-hover) !important;
  border-bottom-style: double;
  border-bottom-width: 3px;
  opacity: 1;
}

/* Time button link font-weight override */
.page-content .post-item-postlisting a,
article .post-item-postlisting a,
main .post-item-postlisting a {
  font-weight: normal !important;
}

html.dark .page-content .post-item-postlisting a,
html.dark article .post-item-postlisting a,
html.dark main .post-item-postlisting a {
  font-weight: normal !important;
}

/* ============================================
   EXCLUDE STYLED BUTTONS FROM LINK UNDERLINE
   ============================================ */

   .menu a,
   .footerlinks a,
   .post-item-postlisting a,
   .post-item-title a,
   .post-item-title-micro a,
   .home-title a,
   .microNavigation a {
     border-bottom: none !important;
     color: inherit !important;
   }
   
   .post-item-title a:hover,
   .post-item-title-micro a:hover,
   .home-title a:hover {
     border-bottom: none !important;
   }
   
   html.dark .post-item-title a,
   html.dark .post-item-title-micro a,
   html.dark .home-title a {
     border-bottom: none !important;
   }
   
   html.dark .post-item-title a:hover,
   html.dark .post-item-title-micro a:hover,
   html.dark .home-title a:hover {
     border-bottom: none !important;
}
.footer_social-icons {opacity: 0.5 !important;}

blockquote p {
  margin-bottom: 0px !important;
  margin-top: 0px !important;
}
