/* 
  ---------------------------------------------------------------
  ------------------------ General Style ------------------------
  ---------------------------------------------------------------
*/
.blog-app {
    --bg-main: #f6f2ea;
    --surface-1: #ece5db;
    --surface-2: #e4ddd2;

    --accent: #8c5a72;
    --accent-2: #71465c;
    --accent-hover: #7a4c63;

    --text-main: #2a2927;
}

.blog-app {
    background:
        linear-gradient(
            to bottom,
            rgba(var(--surface-1-rgb), 0.25),
            transparent 20%
        ),
        var(--bg-main);
}

.blog-app .navbar {
    backdrop-filter: blur(18px);
}

.blog-app .card {
    border-radius: 20px;
    box-shadow:
        0 2px 8px rgba(0,0,0,.04),
        0 10px 24px rgba(0,0,0,.03);
}

.blog-app .page-title {
    font-weight: 500;
}

.blog-app .article-title,
.blog-app h1,
.blog-app h2 {
    font-family: "Manrope", sans-serif;
    letter-spacing: -0.03em;
}

.blog-app::after {
    background:
        radial-gradient(
            circle at top center,
            rgba(139,94,60,0.04),
            transparent 50%
        );
}

html[data-theme="dark"] .blog-app {
    --bg-main: #161412;

    --surface-1: #221e1a;
    --surface-2: #2a2520;
    --surface-3: #322c26;

    --text-main: #e9ecef;
    --text-secondary: #d7d9dd;
    --text-muted: #b0b9c2;
    --text-inverse: #ffffff;
    --text-nav: #e0e0e0;
    --nav-muted: #aaa;
}

/* 
  ---------------------------------------------------------------
  --------------------- Specific components ---------------------
  ---------------------------------------------------------------
*/

/* Blog profile form */
.blog-profile-input .input-group-text {
  background-color: var(--surface-2);  /* or a softer primary shade */
  color: var(--text-main);           /* pick a neutral text color for your palette */
  border: 1px solid var(--accent);
  border-right: none;
  border-radius: 0.375rem 0 0 0.375rem;
}

/* form-control inputs */
.blog-profile-input .form-control {
  border: 1px solid var(--accent);
  border-left: none;
  border-radius: 0 0.375rem 0.375rem 0;
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.blog-profile-input .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--accent-rgb), 0.25);
  border-color: var(--accent);
}

/* Articles */
/* Article tags choice */
/* Tag selector */
.tag-selector-scroll {
  max-height: 220px;
  overflow-y: auto;

  padding: 0.75rem;
  border-radius: 14px;

  background: var(--surface-1);
  border: 1px solid var(--border-color);
}

.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tag-pill {
  position: relative;
  cursor: pointer;
}

.tag-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tag-pill-label {
  display: inline-flex;
  align-items: center;

  padding: 0.45rem 0.85rem;
  border-radius: 999px;

  background: var(--surface-2);
  color: var(--text-secondary);

  border: 1px solid transparent;

  font-size: 0.92rem;
  font-weight: 500;

  transition:
    background-color .15s ease,
    color .15s ease,
    transform .15s ease,
    border-color .15s ease;
}

.tag-pill:hover .tag-pill-label {
  transform: translateY(-1px);
  background: var(--surface-3);
}

.tag-pill input:checked + .tag-pill-label {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.tag-pill.hidden {
  display: none;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-tag {
  display: inline-flex;
  align-items: center;

  padding: 0.38rem 0.9rem;

  border-radius: 999px;
  border: 1px solid rgba(var(--border-color-rgb), 0.75);

  background: rgba(var(--surface-1-rgb), 0.65);
  color: var(--text-secondary);

  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;

  transition:
    background-color .15s ease,
    border-color .15s ease,
    transform .12s ease,
    color .15s ease;
}

.article-tag::before {
  content: "#";
  opacity: 0.6;
  margin-right: 0.1rem;
}

.article-tag:hover {
  background: rgba(var(--surface-1-rgb), 0.95);

  border-color: var(--accent);
  color: var(--accent);

  transform: translateY(-1px);
}

.article-tag:active {
  transform: translateY(0);
}

/* Article detail */
.article-detail {
  max-width: 760px;
  padding-inline: 1rem;
}

.article-detail .article-title {
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.article-detail {
  word-break: break-word;
}

.article-meta-top {
    font-size: 0.95rem;
}

.article-divider {
    opacity: 0.12;
}

.article-content {
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--text-main);
}

.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

.article-content h2,
.article-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.25rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content pre {
    border-radius: 12px;
    overflow-x: auto;
    padding: 1rem;
    background: var(--surface-2);
}

.article-content img {
    max-width: 100%;
    border-radius: 14px;
    margin: 2rem auto;
    display: block;
}

.article-footer {
    border-top: none;
}

.article-list-item {
  padding: 0.5rem 0 1.5rem;
}

.article-list-item .article-card-title {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.article-list-item .article-excerpt {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-divider {
  margin: 2rem 0;
  opacity: 0.12;
}

.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;

  padding: 1.5rem;
  border-radius: 18px;

  background: var(--bg-card);
  border: 1px solid rgba(var(--border-color-rgb), 0.7);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.article-card:hover {
  transform: translateY(-2px);

  border-color: rgba(var(--border-color-rgb), 0.95);

  box-shadow:
    0 8px 22px rgba(0,0,0,0.06);
}

.article-excerpt {
  color: var(--text-secondary);
  line-height: 1.7;
}

.article-card h2 a {
  text-decoration: none;
}

.article-content {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* hyphens: auto; */
  line-height: 1.3;
}

.article-card-title {
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

.article-card-title a {
  color: var(--text-main);
  text-decoration: none;
  background-image: linear-gradient(
    transparent 90%,
    rgba(var(--primary-rgb), 0.2) 0
  );
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease;
}

.article-card-title a:hover {
  background-size: 100% 100%;
}

/* Author pages */
.author-page h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.author-card {
  position: sticky;
  top: 96px;
}

.author-links a {
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.author-links a:hover {
  color: var(--primary);
}

.article-nav.active {
  color: var(--accent) !important;
}

/* About page */

.about-page {
  max-width: 1100px;
}

.about-card {
  background: var(--surface-1);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: var(--bs-body-bg);
}

.about-avatar img {
  width: 120px;
  height: 120px;
  object-fit: cover;
}

.about-name {
  margin-bottom: 0.25rem;
}

.about-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.about-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-links li {
  margin-bottom: 0.5rem;
}

.about-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
}

.about-links a:hover {
  text-decoration: underline;
}

.about-content {
  max-width: 720px;
}

.about-title {
  margin-bottom: 1.5rem;
}

.about-content p {
  line-height: 1.7;
  margin-bottom: 1.25rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens:auto;
}

/* Article editor */
.markdown-editor {
  background: var(--bg-hover);
  border-radius: 1rem;
  padding: 1rem;
}

.editor-toolbar {
  display: flex;
  border-bottom: rgba(var(--border-color-rgb), 0.6);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.editor-toolbar button {
  border: none;
  background: var(--surface-1);
  padding: 0.4rem 0.6rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.editor-textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: vertical;
  font-family: ui-monospace, monospace;
}

.article-meta {
  margin-bottom: 2rem;
}

.meta-title input {
  font-size: 1.6rem;
  font-weight: 600;
  border: none;
  padding: 0.75rem 0.5rem;
}

.meta-title input:focus {
  outline: none;
}

.meta-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.meta-field {
  flex: 1;
}

.meta-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: block;
}

.pre-article-editor {
  background: var(--bs-light);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1rem;
}

/* Article footnotes & spans */
.article-content span.muted {
  color: var(--text-muted);
    
}

.article-content small {
  font-size: 0.92rem;
}

.article-content .smallcaps {
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

.article-content hr {
  border: none;
  height: 1px;

  width: 80%;
  margin: 2rem auto;

  background:
      linear-gradient(
          to right,
          transparent,
          rgba(0, 0, 0, 0.45),
          transparent
      );
}

.article-content .footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
}

.article-content .footnote-ref a {
  text-decoration: none;
}

.article-content .footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;

  border-top: 1px solid var(--border-color);

  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-content .footnotes ol {
  padding-left: 1.3rem;
}

.article-content .footnotes li {
  margin-bottom: 0.75rem;
}

.article-content .footnotes p {
  margin-bottom: 0;
}

.article-pre-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  opacity: 0.9;

  border-left: 3px solid var(--border-color);
  padding-left: 1rem;

  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

.article-pre-content p:last-child {
  margin-bottom: 0;
}

.article-content {
  font-size: 1rem;
}

@keyframes splashFloat {
    0% { transform: rotate(-2deg) scale(1); }
    50% { transform: rotate(-1deg) scale(1.02); }
    100% { transform: rotate(-2deg) scale(1); }
}

.blog-splash {
    animation: splashFloat 5s ease-in-out infinite;
}
.blog-splash:hover {
    transform: rotate(0deg) scale(1.02);
}