.content-page {
  min-height: calc(100vh - var(--header-height, 0px));
}

.content-page-shell {
  display: grid;
  gap: var(--space-5);
  max-width: 940px;
  margin-inline: auto;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface);
}

.content-page-title {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.5;
}

.content-page-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.content-page-body {
  color: var(--text);
  line-height: 2.1;
  overflow-wrap: anywhere;
}

.content-page-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: var(--space-5);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  color: var(--text-muted);
  text-align: center;
}

.content-page-body .cms-align-right,
.cms-align-right {
  text-align: right;
}

.content-page-body .cms-align-center,
.cms-align-center {
  text-align: center;
}

.content-page-body .cms-align-left,
.cms-align-left {
  text-align: left;
}

.content-page-body .cms-align-justify,
.cms-align-justify {
  text-align: justify;
}

.content-page-body .cms-text-small,
.cms-text-small {
  font-size: 0.875rem;
}

.content-page-body .cms-text-normal,
.cms-text-normal {
  font-size: 1rem;
}

.content-page-body .cms-text-large,
.cms-text-large {
  font-size: 1.2rem;
}

.content-page-body .cms-media img,
.content-page-body .cms-media video {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-xl);
}

.content-page-body .cms-media-link,
.cms-media-link {
  color: var(--primary);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.content-list-page {
  min-height: calc(100vh - var(--header-height, 0px));
  background:
    radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.08), transparent 34rem),
    var(--bg);
}

.content-list-shell {
  display: grid;
  gap: var(--space-5);
}

.content-list-header {
  display: grid;
  gap: var(--space-2);
  max-width: 760px;
}

.content-list-header h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.5;
}

.content-list-header p,
.content-list-count {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.9;
}

.content-list-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.content-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.content-list-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.content-list-card-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.content-list-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.content-list-card-body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

.content-list-card-body h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.1rem;
  line-height: 1.7;
}

.content-list-card-body h2 a {
  color: inherit;
}

.content-list-card-body p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.9;
}

.content-list-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.content-list-card-meta a {
  color: var(--primary);
  font-weight: 950;
}

.content-list-empty {
  display: grid;
  gap: var(--space-2);
  min-height: 220px;
  place-items: center;
  padding: var(--space-5);
  border: 1px dashed var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
}

.content-list-empty strong {
  color: var(--text-strong);
  font-weight: 950;
}

.content-list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding-block: var(--space-4);
}

.content-list-pagination a,
.content-list-pagination span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 900;
}

.content-list-pagination a {
  border: 1px solid var(--border);
  background: var(--surface-2);
}

@media (max-width: 760px) {
  .content-list-search {
    grid-template-columns: 1fr;
  }

  .content-list-search .btn {
    width: 100%;
  }

  .content-list-card-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =========================================================
   Part 38.1 Public resized content images
   ========================================================= */

.content-page-body .cms-media img[width],
.content-page-body img[width] {
  height: auto;
  max-width: 100%;
}

.content-page-body .cms-media {
  max-width: 100%;
}

@media (max-width: 760px) {
  .content-page-body .cms-media img[width],
  .content-page-body img[width] {
    width: 100%;
    height: auto;
  }
}

/* =========================================================
   Part 38.2 Word-like inline media flow
   ========================================================= */

.content-page-body .cms-media {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  vertical-align: top;
  gap: var(--space-2);
  margin: 0.45rem 0.55rem;
}

.content-page-body .cms-media img,
.content-page-body .cms-media video {
  width: auto;
  max-width: min(100%, 36rem);
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-xl);
}

.content-page-body .cms-media img[width],
.content-page-body img[width] {
  max-width: 100%;
  height: auto;
}

.content-page-body .cms-media figcaption {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.9;
}

@media (max-width: 760px) {
  .content-page-body .cms-media {
    max-width: 100%;
  }

  .content-page-body .cms-media img,
  .content-page-body .cms-media video {
    max-width: 100%;
  }
}

/* =========================================================
   Part 38.2.1 Corrected public inline resizable media
   ========================================================= */

.content-page-body .cms-media {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  vertical-align: top;
  gap: var(--space-2);
  margin: 0.45rem 0.55rem;
}

.content-page-body .cms-media img,
.content-page-body .cms-media video {
  max-width: min(100%, 36rem);
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-xl);
}

.content-page-body .cms-media img[width],
.content-page-body img[width] {
  max-width: 100%;
  height: auto;
}

.content-page-body .cms-media figcaption {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.9;
}


/* ANAYEK FIX START: tinymce-editor */

.admin-tinymce-lazy-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-block-start: 0.65rem;
  padding: 0.48rem 0.9rem;
  border: 1px solid rgba(115, 201, 244, 0.26);
  border-radius: var(--radius-pill, 999px);
  background: rgba(115, 201, 244, 0.10);
  color: var(--primary, #2563eb);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.admin-tinymce-lazy-button:hover,
.admin-tinymce-lazy-button.is-active {
  background: rgba(115, 201, 244, 0.18);
}

.tox.tox-tinymce {
  width: 100% !important;
  border-color: rgba(115, 201, 244, 0.22) !important;
  border-radius: var(--radius-xl, 1rem) !important;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18) !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__overflow,
.tox .tox-toolbar__primary,
.tox .tox-statusbar {
  background: #071626 !important;
}

.tox .tox-statusbar {
  border-top-color: rgba(115, 201, 244, 0.16) !important;
}

.tox .tox-edit-area__iframe {
  background: #071626;
}

.product-cms-content img,
.product-list-hero__description img,
.content-detail__body img,
.content-body img,
.cms-content img {
  max-width: 100%;
  height: auto;
}

.product-cms-content p:has(> img:only-child),
.product-list-hero__description p:has(> img:only-child),
.content-detail__body p:has(> img:only-child),
.content-body p:has(> img:only-child),
.cms-content p:has(> img:only-child),
.product-cms-content figure.image,
.product-list-hero__description figure.image,
.content-detail__body figure.image,
.content-body figure.image,
.cms-content figure.image {
  display: inline-block;
  max-width: 100%;
  margin: 0.7rem 0.55rem;
  vertical-align: top;
}

.product-cms-content p:has(> img:only-child) img,
.product-list-hero__description p:has(> img:only-child) img,
.content-detail__body p:has(> img:only-child) img,
.content-body p:has(> img:only-child) img,
.cms-content p:has(> img:only-child) img,
.product-cms-content figure.image img,
.product-list-hero__description figure.image img,
.content-detail__body figure.image img,
.content-body figure.image img,
.cms-content figure.image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.product-cms-content p:has(> img:only-child) + p:not(:has(> img:only-child)),
.product-list-hero__description p:has(> img:only-child) + p:not(:has(> img:only-child)),
.content-detail__body p:has(> img:only-child) + p:not(:has(> img:only-child)),
.content-body p:has(> img:only-child) + p:not(:has(> img:only-child)),
.cms-content p:has(> img:only-child) + p:not(:has(> img:only-child)) {
  display: block;
  clear: both;
}

@media (max-width: 760px) {
  .product-cms-content p:has(> img:only-child),
  .product-list-hero__description p:has(> img:only-child),
  .content-detail__body p:has(> img:only-child),
  .content-body p:has(> img:only-child),
  .cms-content p:has(> img:only-child),
  .product-cms-content figure.image,
  .product-list-hero__description figure.image,
  .content-detail__body figure.image,
  .content-body figure.image,
  .cms-content figure.image {
    display: block;
    width: 100%;
    margin: 0.85rem 0;
  }
}

/* ANAYEK FIX END: tinymce-editor */


/* ANAYEK FIX START: cms-editor-public-parity */

.content-detail__body,
.content-body,
.cms-content,
.product-cms-content,
.product-list-hero__description.product-cms-content {
  direction: rtl;
  text-align: right;
  line-height: 2.05;
  overflow-wrap: anywhere;
}

.content-detail__body *,
.content-body *,
.cms-content *,
.product-cms-content *,
.product-list-hero__description.product-cms-content * {
  box-sizing: border-box;
}

.content-detail__body p,
.content-body p,
.cms-content p,
.product-cms-content p,
.product-list-hero__description.product-cms-content p {
  margin: 0 0 1rem;
  line-height: 2.05;
  text-align: right;
}

.content-detail__body h1,
.content-detail__body h2,
.content-detail__body h3,
.content-detail__body h4,
.content-detail__body h5,
.content-detail__body h6,
.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6,
.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4,
.cms-content h5,
.cms-content h6,
.product-cms-content h1,
.product-cms-content h2,
.product-cms-content h3,
.product-cms-content h4,
.product-cms-content h5,
.product-cms-content h6 {
  margin: 1.25rem 0 0.75rem;
  line-height: 1.7;
  text-align: right;
}

.content-detail__body img,
.content-detail__body video,
.content-body img,
.content-body video,
.cms-content img,
.cms-content video,
.product-cms-content img,
.product-cms-content video,
.product-list-hero__description.product-cms-content img,
.product-list-hero__description.product-cms-content video {
  max-width: 100%;
  height: auto;
}

.content-detail__body p:has(> img:only-child),
.content-detail__body p:has(> video:only-child),
.content-detail__body figure,
.content-detail__body figure.image,
.content-body p:has(> img:only-child),
.content-body p:has(> video:only-child),
.content-body figure,
.content-body figure.image,
.cms-content p:has(> img:only-child),
.cms-content p:has(> video:only-child),
.cms-content figure,
.cms-content figure.image,
.product-cms-content p:has(> img:only-child),
.product-cms-content p:has(> video:only-child),
.product-cms-content figure,
.product-cms-content figure.image,
.product-list-hero__description.product-cms-content p:has(> img:only-child),
.product-list-hero__description.product-cms-content p:has(> video:only-child),
.product-list-hero__description.product-cms-content figure,
.product-list-hero__description.product-cms-content figure.image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 1rem 0 !important;
  text-align: right !important;
  clear: both !important;
}

.content-detail__body p:has(> img:only-child) img,
.content-detail__body p:has(> video:only-child) video,
.content-detail__body figure img,
.content-detail__body figure video,
.content-body p:has(> img:only-child) img,
.content-body p:has(> video:only-child) video,
.content-body figure img,
.content-body figure video,
.cms-content p:has(> img:only-child) img,
.cms-content p:has(> video:only-child) video,
.cms-content figure img,
.cms-content figure video,
.product-cms-content p:has(> img:only-child) img,
.product-cms-content p:has(> video:only-child) video,
.product-cms-content figure img,
.product-cms-content figure video,
.product-list-hero__description.product-cms-content p:has(> img:only-child) img,
.product-list-hero__description.product-cms-content p:has(> video:only-child) video,
.product-list-hero__description.product-cms-content figure img,
.product-list-hero__description.product-cms-content figure video {
  display: inline-block !important;
  max-width: 100% !important;
  height: auto !important;
  vertical-align: top !important;
}

.content-detail__body figcaption,
.content-body figcaption,
.cms-content figcaption,
.product-cms-content figcaption {
  margin-top: 0.4rem;
  color: rgba(234, 247, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.8;
}

.content-detail__body table,
.content-body table,
.cms-content table,
.product-cms-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.content-detail__body td,
.content-detail__body th,
.content-body td,
.content-body th,
.cms-content td,
.cms-content th,
.product-cms-content td,
.product-cms-content th {
  border: 1px solid rgba(115, 201, 244, 0.24);
  padding: 0.5rem;
  vertical-align: top;
}

.content-detail__body blockquote,
.content-body blockquote,
.cms-content blockquote,
.product-cms-content blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-right: 3px solid #73c9f4;
  background: rgba(115, 201, 244, 0.08);
  border-radius: 0.75rem;
}

/* ANAYEK FIX END: cms-editor-public-parity */


/* ANAYEK FIX START: cms-image-text-wrap-parity */

.content-detail__body img.cms-image-float-right,
.content-body img.cms-image-float-right,
.cms-content img.cms-image-float-right,
.product-cms-content img.cms-image-float-right {
  float: right !important;
  width: auto !important;
  max-width: min(48%, 360px) !important;
  height: auto !important;
  margin: 0.25rem 0 1rem 1.25rem !important;
  display: block !important;
  clear: none !important;
}

.content-detail__body img.cms-image-float-left,
.content-body img.cms-image-float-left,
.cms-content img.cms-image-float-left,
.product-cms-content img.cms-image-float-left {
  float: left !important;
  width: auto !important;
  max-width: min(48%, 360px) !important;
  height: auto !important;
  margin: 0.25rem 1.25rem 1rem 0 !important;
  display: block !important;
  clear: none !important;
}

.content-detail__body img.cms-image-block,
.content-body img.cms-image-block,
.cms-content img.cms-image-block,
.product-cms-content img.cms-image-block {
  float: none !important;
  display: block !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 1rem auto !important;
  clear: both !important;
}

.content-detail__body p:has(> img.cms-image-float-right:only-child),
.content-detail__body p:has(> img.cms-image-float-left:only-child),
.content-body p:has(> img.cms-image-float-right:only-child),
.content-body p:has(> img.cms-image-float-left:only-child),
.cms-content p:has(> img.cms-image-float-right:only-child),
.cms-content p:has(> img.cms-image-float-left:only-child),
.product-cms-content p:has(> img.cms-image-float-right:only-child),
.product-cms-content p:has(> img.cms-image-float-left:only-child) {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  clear: none !important;
  text-align: inherit !important;
}

.content-detail__body p:has(> img.cms-image-block:only-child),
.content-body p:has(> img.cms-image-block:only-child),
.cms-content p:has(> img.cms-image-block:only-child),
.product-cms-content p:has(> img.cms-image-block:only-child) {
  display: block !important;
  width: 100% !important;
  margin: 1rem 0 !important;
  clear: both !important;
  text-align: center !important;
}

.content-detail__body::after,
.content-body::after,
.cms-content::after,
.product-cms-content::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 760px) {
  .content-detail__body img.cms-image-float-right,
  .content-detail__body img.cms-image-float-left,
  .content-body img.cms-image-float-right,
  .content-body img.cms-image-float-left,
  .cms-content img.cms-image-float-right,
  .cms-content img.cms-image-float-left,
  .product-cms-content img.cms-image-float-right,
  .product-cms-content img.cms-image-float-left {
    float: none !important;
    display: block !important;
    max-width: 100% !important;
    margin: 1rem auto !important;
    clear: both !important;
  }
}

/* ANAYEK FIX END: cms-image-text-wrap-parity */
