/* =========================================================================
   BLOG WRAPPER — Kotak/Card
   ========================================================================= */
.blog__wrapper {
   background: #ffffff;
   border: 1px solid #e5e5e5;
   border-radius: 12px;
   padding: 40px 45px;
   margin: 30px auto;
   max-width: 1100px;
   width: calc(100% - 30px);
   box-sizing: border-box;
   box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
   transition: all .25s ease;
   position: relative;
   overflow: hidden;
}

.blog__wrapper::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   height: 4px;
   background: #2b4eff;
}

.blog__wrapper:hover {
   box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
   border-color: #d0d0d0;
}

@media (max-width: 768px) {
   .blog__wrapper {
      padding: 25px 20px;
      margin: 20px auto;
      width: calc(100% - 30px);
      border-radius: 10px;
   }
}

@media (max-width: 480px) {
   .blog__wrapper {
      padding: 20px 15px;
      margin: 15px auto;
      width: calc(100% - 20px);
      border-radius: 8px;
   }
}

/* =========================================================================
   CK-CONTENT — Konten dari CKEditor
   Prinsip: dinamis, ikuti perintah editor. CSS hanya bantu responsif.
   ========================================================================= */

/* ---------- WRAPPER ---------- */
.ck-content {
   font-family: 'Poppins', Arial, sans-serif;
   font-size: 16px;
   line-height: 1.75;
   color: #333;
   word-wrap: break-word;
   overflow-wrap: break-word;
}

/* ---------- PARAGRAPH ---------- */
.ck-content p {
   margin: 0 0 15px 0;
   padding: 0;
}

/* ---------- HEADING ---------- */
.ck-content h1,
.ck-content h2,
.ck-content h3,
.ck-content h4,
.ck-content h5,
.ck-content h6 {
   margin: 25px 0 15px 0;
   padding: 0;
   font-weight: 700;
   line-height: 1.3;
   color: #222;
   font-family: inherit;
}

.ck-content h1 {
   font-size: 32px;
}

.ck-content h2 {
   font-size: 26px;
}

.ck-content h3 {
   font-size: 22px;
}

.ck-content h4 {
   font-size: 18px;
}

.ck-content h5 {
   font-size: 16px;
}

.ck-content h6 {
   font-size: 14px;
}

.ck-content>h1:first-child,
.ck-content>h2:first-child,
.ck-content>h3:first-child,
.ck-content>h4:first-child,
.ck-content>p:first-child {
   margin-top: 0;
}

/* ---------- LINK ---------- */
.ck-content a {
   color: #2b4eff;
   text-decoration: none;
   transition: color .2s;
}

.ck-content a:hover {
   text-decoration: underline;
}

/* ---------- ORDERED LIST ---------- */
.ck-content ol {
   list-style: decimal outside !important;
   list-style-type: decimal !important;
   padding-left: 28px !important;
   margin: 15px 0 !important;
}

.ck-content ol>li {
   display: list-item !important;
   list-style: decimal outside !important;
   margin: 6px 0 !important;
   padding-left: 4px !important;
   line-height: 1.75 !important;
}

.ck-content ol>li::marker {
   color: #333;
   font-weight: 500;
}

/* ---------- UNORDERED LIST ---------- */
.ck-content ul {
   list-style: disc outside !important;
   list-style-type: disc !important;
   padding-left: 28px !important;
   margin: 15px 0 !important;
}

.ck-content ul>li {
   display: list-item !important;
   list-style: disc outside !important;
   margin: 6px 0 !important;
   padding-left: 4px !important;
   line-height: 1.75 !important;
}

.ck-content ul>li::marker {
   color: #2b4eff;
   font-weight: 700;
}

/* ---------- NESTED LIST ---------- */
.ck-content ol ol {
   list-style-type: lower-alpha !important;
}

.ck-content ol ol ol {
   list-style-type: lower-roman !important;
}

.ck-content ol ol ol ol {
   list-style-type: decimal !important;
}

.ck-content ul ul {
   list-style-type: circle !important;
}

.ck-content ul ul ul {
   list-style-type: square !important;
}

/* =========================================================================
   ★ TEXT ALIGN — Ikuti CKEditor (inline style & class)
   ========================================================================= */
.ck-content [style*="text-align:left"],
.ck-content [style*="text-align: left"],
.ck-content .text-left,
.ck-content .has-text-align-left {
   text-align: left !important;
}

.ck-content [style*="text-align:center"],
.ck-content [style*="text-align: center"],
.ck-content .text-center,
.ck-content .has-text-align-center {
   text-align: center !important;
}

.ck-content [style*="text-align:right"],
.ck-content [style*="text-align: right"],
.ck-content .text-right,
.ck-content .has-text-align-right {
   text-align: right !important;
}

.ck-content [style*="text-align:justify"],
.ck-content [style*="text-align: justify"],
.ck-content .text-justify,
.ck-content .has-text-align-justify {
   text-align: justify !important;
}

/* =========================================================================
   ★ IMAGE — Dinamis mengikuti CKEditor
   ========================================================================= */

/* Dasar: responsif, tanpa paksa display */
.ck-content img {
   max-width: 100%;
   height: auto;
   border-radius: 8px;
}

/* --- CKEditor 5: figure.image + image-style-* --- */
.ck-content figure.image {
   margin: 20px 0;
   max-width: 100%;
   display: table;
}

.ck-content figure.image img {
   display: block;
   margin: 0;
}

.ck-content figure.image figcaption {
   display: table-caption;
   caption-side: bottom;
   text-align: center;
   font-size: 13px;
   color: #888;
   font-style: italic;
   margin-top: 8px;
}

/* Align center (block) */
.ck-content figure.image-style-align-center,
.ck-content figure.image-style-block-align-center,
.ck-content .image-style-align-center {
   margin-left: auto !important;
   margin-right: auto !important;
}

/* Align right (block) */
.ck-content figure.image-style-align-right,
.ck-content figure.image-style-block-align-right,
.ck-content .image-style-align-right {
   margin-left: auto !important;
   margin-right: 0 !important;
}

/* Align left (block) */
.ck-content figure.image-style-align-left,
.ck-content figure.image-style-block-align-left,
.ck-content .image-style-align-left {
   margin-left: 0 !important;
   margin-right: auto !important;
}

/* --- Inline float dari editor --- */
.ck-content img[style*="float:left"],
.ck-content img[style*="float: left"] {
   float: left !important;
   margin: 5px 20px 15px 0 !important;
}

.ck-content img[style*="float:right"],
.ck-content img[style*="float: right"] {
   float: right !important;
   margin: 5px 20px 15px 20px !important;
}

/* Gambar di dalam <p style="text-align:center"> — otomatis center karena inline */
.ck-content p[style*="text-align:center"] img,
.ck-content p[style*="text-align: center"] img,
.ck-content p[style*="text-align:right"] img,
.ck-content p[style*="text-align: right"] img {
   display: inline-block;
   margin: 15px 0;
}

/* Clear float setelah gambar */
.ck-content p::after,
.ck-content div::after,
.ck-content figure::after {
   content: '';
   display: table;
   clear: both;
}

/* ---------- BLOCKQUOTE ---------- */
.ck-content blockquote {
   margin: 20px 0;
   padding: 15px 20px;
   border-left: 4px solid #2b4eff;
   background: #f5f7ff;
   font-style: italic;
   color: #555;
   border-radius: 4px;
   position: relative;
}

.ck-content blockquote::before {
   content: '"';
   font-size: 60px;
   color: #2b4eff;
   opacity: .15;
   position: absolute;
   top: 0;
   left: 10px;
   line-height: 1;
   font-family: Georgia, serif;
}

.ck-content blockquote p {
   margin: 0;
}

/* ---------- CODE / PRE ---------- */
.ck-content code {
   background: #f5f5f5;
   color: #c7254e;
   padding: 2px 6px;
   border-radius: 4px;
   font-family: 'Courier New', monospace;
   font-size: 14px;
}

.ck-content pre {
   background: #2d2d2d;
   color: #f8f8f2;
   padding: 15px 20px;
   border-radius: 6px;
   overflow-x: auto;
   font-size: 14px;
   line-height: 1.6;
   margin: 15px 0;
}

.ck-content pre code {
   background: transparent;
   color: inherit;
   padding: 0;
}

/* ---------- TABLE ---------- */
.ck-content table {
   width: 100%;
   max-width: 100%;
   border-collapse: collapse;
   margin: 15px 0;
   font-size: 14px;
}

.ck-content table th,
.ck-content table td {
   border: 1px solid #e0e0e0;
   padding: 10px 14px;
   text-align: left;
   vertical-align: top;
}

.ck-content table th {
   background: #f5f6fa;
   font-weight: 700;
   color: #333;
}

.ck-content table tr:nth-child(even) {
   background: #fcfcfc;
}

.ck-content table tr:hover {
   background: #f9fdf6;
}

/* ---------- HORIZONTAL RULE ---------- */
.ck-content hr {
   border: none;
   border-top: 1px solid #e0e0e0;
   margin: 25px 0;
}

/* ---------- STRONG / BOLD ---------- */
.ck-content strong,
.ck-content b {
   font-weight: 700;
   color: #222;
}

/* ---------- ITALIC ---------- */
.ck-content em,
.ck-content i {
   font-style: italic;
}

/* ---------- SPAN — biarkan style inline dari editor ---------- */
.ck-content span {
   line-height: inherit;
}

/* ---------- RESET MARGIN PERTAMA & TERAKHIR ---------- */
.ck-content>*:first-child {
   margin-top: 0 !important;
}

.ck-content>*:last-child {
   margin-bottom: 0 !important;
}

/* =========================================================================
   RESPONSIVE MOBILE
   ========================================================================= */
@media (max-width: 575px) {
   .ck-content {
      font-size: 15px;
   }

   .ck-content h1 {
      font-size: 24px;
   }

   .ck-content h2 {
      font-size: 20px;
   }

   .ck-content h3 {
      font-size: 18px;
   }

   .ck-content h4 {
      font-size: 16px;
   }

   .ck-content ol,
   .ck-content ul {
      padding-left: 22px !important;
   }

   .ck-content img {
      border-radius: 6px;
   }

   /* Di mobile, gambar float jadi full-width biar gak rusak */
   .ck-content img[style*="float"],
   .ck-content img[style*="float: left"],
   .ck-content img[style*="float: right"] {
      float: none !important;
      display: block;
      margin: 15px auto !important;
   }
}

/* =========================================================================
   PRINT
   ========================================================================= */
@media print {
   .ck-content {
      font-size: 12pt;
      color: #000;
   }

   .ck-content a {
      color: #000;
      text-decoration: underline;
   }

   .blog__wrapper {
      box-shadow: none;
      border: none;
      padding: 0;
   }
}