/* Rewritertools Blog — modern theme + CKEditor content isolation */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,650;9..144,700&display=swap');

:root {
  --rt-ink: #132029;
  --rt-muted: #5a6a75;
  --rt-line: #d5e0e8;
  --rt-surface: #ffffff;
  --rt-bg: #eef3f6;
  --rt-bg-deep: #e3ebf1;
  --rt-brand: #0a6f9c;
  --rt-brand-dark: #085578;
  --rt-accent: #0d8f7b;
  --rt-shadow: 0 10px 30px rgba(19, 32, 41, 0.06);
  --rt-radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Figtree", "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body.rt-blog {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--rt-ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(10, 111, 156, 0.12), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(13, 143, 123, 0.10), transparent 55%),
    linear-gradient(180deg, var(--rt-bg) 0%, var(--rt-bg-deep) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body.rt-blog a {
  text-decoration: none;
  color: inherit;
}

/* —— Header —— */
.rt-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(213, 224, 232, 0.8);
  transition: box-shadow 0.25s ease;
}

.rt-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(19, 32, 41, 0.08);
}

.rt-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.rt-logo img {
  width: 148px;
  height: auto;
  display: block;
}

.rt-nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rt-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--rt-muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.rt-nav-links a:hover {
  color: var(--rt-brand);
  background: rgba(10, 111, 156, 0.08);
}

.rt-nav-toggle {
  display: none;
  border: 1px solid var(--rt-line);
  background: #fff;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--rt-ink);
}

/* —— Hero —— */
.rt-hero {
  position: relative;
  overflow: hidden;
  padding: 2.6rem 0 2.2rem;
  border-bottom: 1px solid rgba(213, 224, 232, 0.7);
  background:
    linear-gradient(135deg, rgba(10, 111, 156, 0.92), rgba(8, 85, 120, 0.88)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.rt-hero-inner {
  max-width: 760px;
}

.rt-hero-kicker {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #e8f5fb;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rt-hero h1,
.rt-hero .rt-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.65rem, 3.2vw, 2.45rem);
  line-height: 1.2;
  color: #fff;
  letter-spacing: -0.02em;
}

.rt-hero p {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 40rem;
}

/* —— Layout —— */
.rt-main {
  padding: 2rem 0 3.5rem;
}

.rt-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 991px) {
  .rt-shell {
    grid-template-columns: 1fr;
  }

  .rt-nav-toggle {
    display: inline-flex;
  }

  .rt-nav-links {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.35rem);
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--rt-line);
    border-radius: 14px;
    padding: 0.55rem;
    box-shadow: var(--rt-shadow);
  }

  .rt-nav-links.is-open {
    display: flex;
  }

  .rt-header .container {
    position: relative;
  }
}

/* —— Post cards (listing) —— */
.rt-post-list {
  display: grid;
  gap: 1.25rem;
}

.rt-post-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.15rem;
  background: var(--rt-surface);
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  overflow: hidden;
  box-shadow: var(--rt-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rtFadeUp 0.45s ease both;
}

.rt-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(19, 32, 41, 0.1);
}

.rt-post-card__media {
  min-height: 170px;
  background: #dbe6ee;
  overflow: hidden;
}

.rt-post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.rt-post-card:hover .rt-post-card__media img {
  transform: scale(1.04);
}

.rt-post-card__body {
  padding: 1.15rem 1.15rem 1.15rem 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin-bottom: 0.55rem;
  color: var(--rt-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.rt-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.rt-meta i {
  color: var(--rt-brand);
  font-size: 0.78rem;
}

.rt-post-card__title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.rt-post-card__title a {
  color: var(--rt-ink);
}

.rt-post-card__title a:hover {
  color: var(--rt-brand);
}

.rt-post-card__excerpt {
  margin: 0;
  color: var(--rt-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rt-readmore {
  margin-top: auto;
  padding-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  color: var(--rt-brand);
  font-weight: 700;
  font-size: 0.9rem;
}

.rt-readmore:hover {
  color: var(--rt-brand-dark);
}

@media (max-width: 767px) {
  .rt-post-card {
    grid-template-columns: 1fr;
  }

  .rt-post-card__media {
    height: 190px;
  }

  .rt-post-card__body {
    padding: 0 1rem 1.1rem;
  }
}

/* —— Single article —— */
.rt-article {
  background: var(--rt-surface);
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  box-shadow: var(--rt-shadow);
  overflow: hidden;
  animation: rtFadeUp 0.4s ease both;
}

.rt-article__cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
  background: #dbe6ee;
}

.rt-article__inner {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.rt-article__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--rt-ink);
}

.rt-share {
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--rt-line);
}

.rt-share h4 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.rt-share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.rt-share-btns a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #f2f7fa;
  border: 1px solid var(--rt-line);
  color: var(--rt-ink);
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.rt-share-btns a:hover {
  background: var(--rt-brand);
  border-color: var(--rt-brand);
  color: #fff;
}

.rt-share-btns img {
  width: 16px;
  height: 16px;
}

/* —— CKEditor / article prose isolation —— */
.rt-prose {
  font-family: var(--font-ui) !important;
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--rt-ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}

.rt-prose,
.rt-prose *:not(script):not(style) {
  font-family: var(--font-ui) !important;
}

.rt-prose * {
  max-width: 100% !important;
  box-sizing: border-box;
}

.rt-prose font,
.rt-prose [face],
.rt-prose [style*="font-family"],
.rt-prose [style*="font-size"],
.rt-prose [style*="Font-Family"],
.rt-prose [style*="Font-Size"] {
  font-family: var(--font-ui) !important;
  font-size: inherit !important;
}

.rt-prose p,
.rt-prose div,
.rt-prose span,
.rt-prose li,
.rt-prose td,
.rt-prose th {
  line-height: 1.78 !important;
  color: inherit;
}

.rt-prose p {
  margin: 0 0 1.05rem !important;
}

.rt-prose h1,
.rt-prose h2,
.rt-prose h3,
.rt-prose h4,
.rt-prose h5,
.rt-prose h6 {
  font-family: var(--font-display) !important;
  color: var(--rt-ink) !important;
  line-height: 1.3 !important;
  margin: 1.5rem 0 0.7rem !important;
  letter-spacing: -0.015em;
  font-weight: 650 !important;
}

.rt-prose h1 { font-size: 1.7rem !important; }
.rt-prose h2 { font-size: 1.4rem !important; }
.rt-prose h3 { font-size: 1.22rem !important; }
.rt-prose h4 { font-size: 1.08rem !important; }

.rt-prose ul,
.rt-prose ol {
  margin: 0 0 1.1rem !important;
  padding-left: 1.4rem !important;
}

.rt-prose ul { list-style: disc !important; }
.rt-prose ol { list-style: decimal !important; }

.rt-prose li {
  list-style: inherit !important;
  margin: 0.35rem 0 !important;
  padding-left: 0.15rem;
}

.rt-prose a {
  color: var(--rt-brand) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rt-prose img,
.rt-prose video,
.rt-prose iframe,
.rt-prose embed,
.rt-prose object {
  display: block !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  margin: 1.15rem auto !important;
  border-radius: 10px;
}

.rt-prose figure {
  margin: 1.15rem 0 !important;
  max-width: 100%;
}

.rt-prose table {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.15rem 0 !important;
  border: 1px solid var(--rt-line);
  border-radius: 10px;
}

.rt-prose th,
.rt-prose td {
  border: 1px solid var(--rt-line) !important;
  padding: 0.55rem 0.7rem !important;
  vertical-align: top;
  word-break: break-word;
  background: #fff;
}

.rt-prose th {
  background: #f3f8fb !important;
  font-weight: 700;
}

.rt-prose blockquote {
  margin: 1.2rem 0 !important;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--rt-brand);
  background: #f4f9fb;
  color: var(--rt-muted);
  border-radius: 0 10px 10px 0;
}

.rt-prose pre,
.rt-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 0.9em !important;
}

.rt-prose pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  background: #122028;
  color: #e8eef2;
  border-radius: 10px;
  margin: 1rem 0 !important;
}

.rt-prose hr {
  border: 0;
  border-top: 1px solid var(--rt-line);
  margin: 1.5rem 0;
}

/* —— Sidebar —— */
.rt-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 88px;
}

.rt-side-card {
  background: var(--rt-surface);
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  padding: 1.05rem 1.1rem;
  box-shadow: var(--rt-shadow);
}

.rt-side-card h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
}

.rt-search {
  display: flex;
  gap: 0.45rem;
}

.rt-search input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rt-line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font: inherit;
  background: #f7fafc;
}

.rt-search input:focus {
  outline: 2px solid rgba(10, 111, 156, 0.25);
  border-color: var(--rt-brand);
  background: #fff;
}

.rt-search button {
  border: 0;
  border-radius: 10px;
  background: var(--rt-brand);
  color: #fff;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rt-search button:hover {
  background: var(--rt-brand-dark);
}

.rt-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.rt-side-list a {
  display: block;
  color: var(--rt-ink);
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #e8eef3;
}

.rt-side-list a:hover {
  color: var(--rt-brand);
}

.rt-side-list li:last-child a {
  border-bottom: 0;
  padding-bottom: 0;
}

.rt-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rt-tag-cloud a {
  display: inline-flex;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #f1f7fa;
  border: 1px solid var(--rt-line);
  color: var(--rt-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.rt-tag-cloud a:hover {
  background: rgba(10, 111, 156, 0.1);
  color: var(--rt-brand);
  border-color: rgba(10, 111, 156, 0.25);
}

/* —— Pagination —— */
.rt-blog .pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1.5rem 0 0 !important;
  padding: 0 !important;
  list-style: none;
}

.rt-blog .page-link {
  border-radius: 10px !important;
  border: 1px solid var(--rt-line) !important;
  color: var(--rt-ink) !important;
  padding: 0.45rem 0.75rem !important;
  background: #fff !important;
}

.rt-blog .page-item.active .page-link {
  background: var(--rt-brand) !important;
  border-color: var(--rt-brand) !important;
  color: #fff !important;
}

/* —— Footer —— */
.rt-footer {
  border-top: 1px solid var(--rt-line);
  background: rgba(255, 255, 255, 0.7);
  padding: 1.25rem 0;
  color: var(--rt-muted);
  font-size: 0.9rem;
  text-align: center;
}

#myBtn {
  display: none;
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--rt-brand);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(10, 111, 156, 0.3);
}

#myBtn:hover {
  background: var(--rt-brand-dark);
}

@keyframes rtFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
