:root{
  --bg: #ffffff;                 /* white */
  --muted: #f6f6f6;
  --text: #0b0b0b;               /* black */
  --muted-text: #5b5b5b;
  --brand: #c89a1a;              /* warm gold */
  --brand-dark: #a28014;
  --page-bg: #0f1720;
  --accent: #111111;
  --drawer-width: 320px;        /* width on large screen */
  --accent1: #d4af37;           /* gold */
  --shadow: 0 8px 24px rgba(2,6,23,0.45);
  --radius: 10px;
  --card-radius: 12px;
  --max-width: 1100px;
  --container-padding: 1rem;
  --shadow-sm: 0 6px 18px rgba(11,11,11,0.06);
  --shadow-md: 0 12px 30px rgba(11,11,11,0.09);
  --glass: rgba(255,255,255,0.6);
  --transition: 220ms cubic-bezier(.2,.9,.3,1);
}

* {
  box-sizing: border-box;
}

html,body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar-track {
  background: #d1e5ff;
}

button {
  border-color: #c89a1a;
}

.link-gold {
  color: #c89a1a;
  text-decoration: none;
  transition: color 220ms cubic-bezier(.2,.9,.3,1);
}
  
.link-gold:hover {
  color: #a28014;
  text-decoration: underline;
}

/* Advertisement */
.pull-tab {
    transition: transform 0.3s;
}

.pull-tab.expanded {
    transform: rotate(180deg);
}

.ad-inner img {
    width: 100%;
    height: auto;
    max-height: 192px; /* adjust as needed */
}

.exit-popup {
  display: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.exit-popup-content {
  padding: 30px;
  width: 350px;
  text-align: center;
  border-radius: 8px;
}

.exit-popup-content input {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
}

.exit-popup-content button {
  margin-top: 10px;
  padding: 10px;
  width: 100%;
  background: #007bff;
  color: white;
  border: none;
}

#close-exit-popup {
  float: right;
  cursor: pointer;
  font-size: 22px;
}

.sticky-ad.bottom {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 50;
    transition: transform 0.3s ease-in-out;
}

/* Header Setting */
header{
  height: 56px;
  color: var(--muted);
  letter-spacing: 1px;
}

.menu-btn{
  appearance: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  color: var(--brand);
}
  
.menu-btn:focus{
  outline: 2px solid rgba(212,175,55,.18);
}

/* Dashboard navbar */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Avoid sticky for Firefox */
header.navbar * {
  transform: none !important;
  filter: none !important;
  contain: none !important;
}

/* Editor Setting */
.editor-content h1,
.post-content h1 {
  font-size: 2rem;
  font-weight: bold;
}

.editor-content h2,
.post-content h2 {
  font-size: 1.5rem;
  font-weight: bold;
}

.editor-content img {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 12px;
}

.ticker {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  animation: scroll 30s linear infinite;
}

.media_slot {
    min-height: 120px;
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

textarea:not(.comment-textarea) {
  width: 100%;
  max-height: none;

  padding: 12px;
  font-size: 15px;
  line-height: 1.6;

  resize: vertical; /* user can resize safely */
  overflow-y: auto; /* prevents overflow */
  overflow-x: hidden;

  border-radius: 8px;

  box-sizing: border-box;

  outline: none;
  -webkit-appearance: none; 
}

form > div {
  min-height: 0;
}

/* Breaking news banner */
.breaking-banner {
  background-color: #dc2626; /* Tailwind red-600 */
  color: white;
  font-weight: bold;
  width: 100%;
  overflow: hidden;
  position: relative; /* instead of fixed */
  z-index: 10;
  transition: transform 0.3s ease, max-height 0.3s ease;
}

/* Hide/show effect */
.breaking-banner.hidden {
  max-height: 0;
  padding: 0;
  transform: scaleY(0);
}
.breaking-banner.visible {
  max-height: 80px; /* enough for your text */
  transform: scaleY(1);
}

/* Add spacing for nav automatically handled by flow */

/* Caption generator */
.captions-container {
  transition: max-height 0.3s ease;
  overflow: hidden;
}

.captions-container.show {
  max-height: 1000px; /* arbitrary large value */
}

.tool-header {
  margin-bottom: 24px;
}

.card {
  background: #171a21;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.input-card textarea {
  width: 100%;
  min-height: 140px;
  background: #0f1115;
  color: 
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 12px;
}

.primary-btn {
  background: #4f46e5;
  border: none;
  color: white;
  padding: 12px;
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Post page img */
.prose img {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 12px;
}

/* Editor Scrollbar */
.ticker-track:hover {
  animation-play-state: paused;
}

.format-btn.active {
  background: rgba(59, 130, 246, 0.2); /* Tailwind blue-500/20 */
  border-radius: 0.375rem;
}

@keyframes scroll {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

@media (max-width: 640px) {
  .ticker-track {
    animation-duration: 20s;
  }
}

/* Comment form */
#fixed-comment-form {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Policy Editor */
.policy-toolbar {
  display: flex;
  gap: 1.5rem;       /* spacing between buttons */
  overflow-x: auto;   /* enable horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  white-space: nowrap; /* prevent wrapping to new line */
  padding: 0.25rem 0; /* optional: top/bottom spacing */
  position: relative;
  padding-bottom: 6px;
}

.policy-toolbar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  pointer-events: none;
}

.policy-toolbar button {
  flex: 0 0 auto;
}

.policy-toolbar::-webkit-scrollbar {
  display: none;
}

/* Editor-toolbar */
#toolbar {
  display: flex;
  gap: 1.5rem;       /* spacing between buttons */
  overflow-x: auto;   /* enable horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  white-space: nowrap; /* prevent wrapping to new line */
  padding: 0.25rem 0; /* optional: top/bottom spacing */
  position: relative;
  padding-bottom: 6px;
}

#toolbar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  pointer-events: none;
}

#toolbar button {
  flex: 0 0 auto; /* keep buttons at natural width */
}

.editor-toolbar::-webkit-scrollbar {
  display: none;
}

/* Error handling */
.btn-primary {
  @apply relative inline-flex items-center justify-center gap-2
           h-11 px-6 rounded-lg font-medium
           bg-blue-600
           hover:bg-blue-700
           transition
           disabled:opacity-60
           disabled:pointer-events-none;
}

.btn-danger {
  @apply bg-red-600 hover:bg-red-700;
}

/* Policy Editor buttons */
.policy-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.15);
}

.policy-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* Editor buttons */
.format-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.15);
}

.format-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
}

strong{
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* -- Tailwind animation -- */

@keyframes pulseSlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.animate-pulse-slow {
  animation: pulseSlow 2.5s ease-in-out infinite;
}

/* ---SEO FALLBACK--- */

.seo-intro {
  color: #d1d5db;
  text-align: center;
}

.seo-intro p {
  max-width: 1100px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.7;
}

@media (min-width: 640px) {
  .seo-intro p {
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .seo-intro p {
    font-size: 18px;
  }
}

/* Pull-Out Dashboard */
 
  .overlay{
    position: fixed;
    inset: 0;
    opacity: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: rgba(2,6,23,0.55);
    transition: opacity var(--transition);
    visibility: hidden;
    z-index: 999;
  }
  
  .overlay[data-hidden="false"]{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  
  .drawer{
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    max-width: 100%;
    width: calc(280px);
    transform: translateX(110%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    will-change: transform;
  }

  .drawer[aria-hidden="false"]{
    transform: translateX(0);
  }
  
.drawer__header{
  position: sticky;
  top: 0;
  padding: 1rem;
  background-color: #0f172a;
  border-bottom: 1px solid #374151;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
}
  
  .avatar{
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), #dde9);
    overflow: hidden;
    flex-shrink: 0;
  }
  
  .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .drawer__title{
    letter-spacing: 0.2px;
    font-weight: 600;
    font-size: 18px;
  }

.drawer__subtitle {
  color: #9ca3af;
  font-size: 16px;
  margin-top: 0.25rem;
}

.drawer__body{
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  overflow-x: hidden;

  -webkit-overflow-scrolling: touch; /* iOS + Chrome mobile */
  overscroll-behavior: contain;      /* stops body scroll */
  scrollbar-width: thin;
  padding-bottom: 2rem;
  margin-left: 1rem;
}

.drawer__body::-webkit-scrollbar {
  width: 6px;
}

.drawer__body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
}

.section-title{
  font-size: 13px;
  color: #8b95a1;
}

.nav-list{
  list-style: none;
  display: flex;
  gap: 6px;
  flex-direction: column;
  border-radius: 0;
  background: none;
  width: 200px;
  height: 280px;
  margin: 0;
  padding: 0;
}

.nav-list a{
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  padding: 0.5rem 0;
  text-decoration: none;
  transition: background 0.2s;
  gap: 12px
  transition: background var(--transition), transform var(--transition);
}
  
.nav-list a:active{
  transform: translateY(1px);
}
  
.nav-list a:focus{
  outline: 2px solid rgba(2,6,23,0.06);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.07);
}
  
.icon{
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #374151;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1f7aed;
  display: grid;
  place-items: center;
  font-size: 13px;
}

.editor-content,
.post-content {
    font-size: 16px;      /* Base size */
    line-height: 1.7;
}

@media (min-width: 768px) {
    .editor-content,
    .post-content {
        font-size: 18px;  /* Match Tailwind md:text-lg */
    }
}

.editor-toolbar {
  border: none !important;
  background: transparent !important;
}

.CodeMirror {
  background: transparent !important;
  font-size: 16px;
  line-height: 1.7;
}

.CodeMirror-scroll {
  min-height: 350px;
}
 
.section-title{
  margin: 8px 0;
  font-size: 22px;
  color: #8b95a1;
  padding: 12px 4px 6px;
}

#tag-suggestions {
  pointer-events: auto;
}

.homepage_down_nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fade-message {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-message.hide {
  opacity: 0;
  transform: translateY(-20px); /* Optional: slide up a bit */
}

.prose {
    word-wrap: break-word; /* old-school fallback */
    overflow-wrap: break-word;
}

.post-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.prose img {
    max-width: 100%;  /* Images scale to container */
    height: auto;
}

.prose pre {
    white-space: pre-wrap; /* Wrap long code lines */
    word-break: break-word;
}

.prose table {
    width: 100%;  /* Tables fit inside container */
    table-layout: fixed; /* Prevent overflow */
}

/* Apply custom white text for dark mode */
.dark .post-content {
    color: white;
}

.dark .prose,
.dark .prose p,
.dark .prose li,
.dark .prose a,
.dark .prose h1, 
.dark .prose h2, 
.dark .prose h3, 
.dark .prose h4, 
.dark .prose h5, 
.dark .prose h6 {
    color: #ffffff !important;
}

.dark .post-content h1,
.dark .post-content h2,
.dark .post-content h3,
.dark .post-content h4,
.dark .post-content h5,
.dark .post-content h6,
.dark .post-content li,
.dark .post-content p,
.dark .post-content a {
    color: white;
}

@media (max-width: 599px) {
  .drawer__header{
    padding: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid #efefef;
    background: linear-gradient(180deg, ,rgba(0,0,0,0.03), transparent);
  }
  
  .homepage_down_nav {
    flex-direction: column;
    text-align: left;
    border: none;
  }
}