/* -------------------------------------------------
 * Typecho Default Theme — Modernized (Blue, Auto L/D)
 * Compatible with original selectors & markup
 * ------------------------------------------------- */

/* ===== Theme tokens (edit these to rebrand) ===== */
:root {
  /*--font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               "PingFang SC","Hiragino Sans GB","Microsoft Yahei",
               "Noto Sans", Arial, sans-serif;
  --font-serif: "Noto Serif","Droid Serif", Georgia, "Times New Roman",
                "PingFang SC","Hiragino Sans GB","Microsoft Yahei", serif;*/
  --font-mono: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;


  --font-sans: -apple-system, BlinkMacSystemFont, "Source Sans 3", "Inter", "Segoe UI",
               Roboto, Oxygen, Ubuntu, Cantarell,
               "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", serif;



  /* Blue palette */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  /* Light mode surfaces */
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --card: #ffffff;
  --border: #e6e8eb;
  --text: #0f172a;         /* slate-900 */
  --text-muted: #64748b;   /* slate-500 */
  --link: var(--brand-700);
  --link-hover: var(--brand-600);
  --code-bg: #f6f8fa;
  --code: #0b3b8a;
  --blockquote-bar: var(--brand-400);
  --blockquote: #0b2a58;
  --focus: var(--brand-500);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 20px rgba(15, 23, 42, 0.06);
}

/* Dark mode (auto). Also supports [data-theme="dark"] override */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;          /* near slate-950 */
    --bg-soft: #0f172a;
    --card: #0f1b31;
    --border: #1e293b;
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    --link: var(--brand-300);
    --link-hover: var(--brand-200);
    --code-bg: #111827;
    --code: #9ec1ff;
    --blockquote-bar: var(--brand-500);
    --blockquote: #c7dbff;
    --shadow: none;
  }
}
:root[data-theme="dark"] { /* manual opt-in if you add a toggle */
  --bg: #0b1220;
  --bg-soft: #0f172a;
  --card: #0f1b31;
  --border: #1e293b;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --link: var(--brand-300);
  --link-hover: var(--brand-200);
  --code-bg: #111827;
  --code: #9ec1ff;
  --blockquote-bar: var(--brand-500);
  --blockquote: #c7dbff;
  --shadow: none;
}

/* ===== Global ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans), var(--font-serif);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Modern container width (keeps your original .container max override) */
.container { padding: 0 18px; margin: 0 auto; }
@media (min-width: 1200px) { .container { max-width: 960px; } }

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
a:hover, a:active { color: var(--link-hover); }

/* Better focus for accessibility */
a, button, input, textarea {
  outline: none;
}
a:focus, button:focus, input:focus, textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent);
  border-color: var(--focus);
}

/* Code */
pre, code { 
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: .94em;
}
code { padding: .25em .45em; color: var(--code); border-radius: .375rem; }
pre {
  padding: 12px 14px;
  overflow: auto;
  max-height: 60vh;
  border-radius: .5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
pre code { padding: 0; color: inherit; background: transparent; }

/* Blockquote */
blockquote {
  margin: 1.2em 0;
  padding: .1em 1.25em;
  border-left: 4px solid var(--blockquote-bar);
  color: var(--blockquote);
  background: color-mix(in srgb, var(--blockquote-bar) 8%, transparent);
  border-radius: 0 .5rem .5rem 0;
  font-family: var(--font-sans);
}

/* Tables */
table {
  border: 1px solid var(--border);
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: .5rem;
}
table th,
table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
}
table th {
  background: color-mix(in srgb, var(--bg) 70%, var(--brand-50));
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: 1.25;
  color: var(--text);
  margin-top: 1.5em;
  margin-bottom: .6em;
}
/*h1 { font-size: clamp(1.6rem, 1.2vw + 1.1rem, 1.9rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 1vw + 1rem, 1.55rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 0.9rem + 0.6vw, 1.35rem); font-weight: 500; }*/


h1 { font-size: clamp(1.35rem, 1vw + 1rem, 1.55rem); font-weight: 700; }
h2 { font-size: clamp(1.2rem, 0.9rem + 0.6vw, 1.35rem); font-weight: 600; }
h3 { font-weight: 500; color: var(--brand-500)}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  width: 100%;
  border-radius: .5rem;
  background: var(--card);
  color: var(--text);
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
textarea { resize: vertical; min-height: 120px; }
::placeholder { color: var(--text-muted); }

/* Special link underline within content areas */
.post-meta a,
.post-content a,
.widget a,
.comment-content a {
  border-bottom: 1px solid color-mix(in srgb, var(--link) 35%, transparent);
}
.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
  border-bottom-color: transparent;
}

/* ===== Header ===== */
#header {
  padding: 36px 0 4px;
  border-bottom: 1px solid var(--border);
/*  
background: linear-gradient(180deg, color-mix(in srgb, var(--brand-50) 35%, transparent), transparent);
*/
  background: 
    linear-gradient(to bottom, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.8) 70%),
    url('https://upload.wikimedia.org/wikipedia/commons/3/35/Dramatic_Views_of_Hurricane_Florence_from_the_International_Space_Station_From_9_12_%2842828603210%29_%28cropped%29.jpg') center/cover no-repeat;
  color: #fff;
}
.header-credit {
  display: block;
  font-size: 0.5rem;       /* small */
  color: var(--text-muted); /* softer */
  text-align: right;        /* tuck in corner */
  margin: 4px 12px 0 0;     /* little breathing room */
}
.header-credit a {
  color: inherit;           /* same muted tone */
  text-decoration: underline dotted;
}
.header-credit a:hover {
  color: var(--link);       /* pop on hover */
}
#logo {
  color: var(--text);
  font-size: clamp(2rem, 3vw + 1rem, 2.5rem);
  font-weight: 300;
  letter-spacing: .2px;
}
#logo img { max-height: 64px; vertical-align: middle; }
.description {
  margin: .5em 0 0;
  color: var(--text-muted);
  font-style: normal;
}

#logo.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  max-width: 100%;
}
.site-name,
#logo.brand { min-width: 0; }
#logo .logo-img {
  height: 64px; /* adjust to taste */
  width: auto;
  display: block;
  flex: 0 0 auto;
}
#logo .logo-text {
  font-weight: 300;
  letter-spacing: .2px;
  white-space: nowrap;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  #logo.brand {
    display: inline-flex;
    flex-direction: column;    /* stack image over text */
    align-items: center;   
    gap: 4px;
    padding: 8 8px; /* left & right padding */

  }
  #logo .logo-img {
    height: 100px;   
  }
  #logo .logo-text {
    margin-left: 8px;
    margin-right: 8px;
    font-size: clamp(1.1rem, 4vw, 1.6rem);;
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap; /* allow wrapping if title is long */
  }
}


/* Navigation menu -> pill tabs */
#nav-menu {
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#nav-menu a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  height: auto;
  line-height: 1.2;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
}
#nav-menu a:hover,
#nav-menu .current {
  background: color-mix(in srgb, var(--brand-50) 45%, var(--card));
  border-color: color-mix(in srgb, var(--brand-400) 35%, var(--border));
  color: var(--link);
}

/* Search (kept structure, modern hit area) */
#search { position: relative; margin-top: 14px; }
#search input { padding-right: 38px; }
#search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent url(img/icon-search.png) no-repeat center center;
  background-size: 20px 20px;
  text-indent: -9999em;
  cursor: pointer;
  transition: background-color .15s ease;
}
#search button:hover { background-color: color-mix(in srgb, var(--brand-50) 60%, transparent); }

/* ===== Main ===== */
.post {
  padding: 20px 0 28px;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
}
.post-title {
  margin: .7em 0 .4em;
  font-size: clamp(1.4rem, 1.2vw + 1rem, 1.8rem);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: .2px;
  text-decoration: none;              
  position: relative;
}
.post-title a { color: inherit; }
.post-title::after {                 /* modern accent underline */
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: .35rem;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
  border-radius: 3px;
}

.post-meta {
  margin-top: .2em;
  padding: 0;
  color: var(--text-muted);
  font-size: .93em;
}
.post-meta li {
  display: inline-block;
  margin: 0 10px 0 0;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}
.post-meta li:first-child { margin-left: 0; padding-left: 0; border: none; }

.post-content { line-height: 1.85; }
.post .tags { clear: both; }

/* Prev/Next links */
.post-near {
  list-style: none;
  margin: 28px 0;
  padding: 0;
  color: var(--text-muted);
}
.post-near li { margin: 8px 0; }

/* Archive title */
.archive-title {
  margin: 1em 0 -.6em;
  padding-top: 16px;
  color: var(--text-muted);
  font-size: 1em;
}

/* "Read more" button look */
.more { text-align: center; }
.more a {
  border: none;
  display: inline-block;
  padding: 10px 16px;
  border-radius: .6rem;
  background: var(--brand-600);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform .08s ease, background-color .2s ease;
}
.more a:hover { background: var(--brand-700); transform: translateY(-1px); }

.protected .text { width: 50%; }

/* ===== Pagination ===== */
.page-navigator {
  list-style: none;
  margin: 26px 0;
  padding: 0;
  text-align: center;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.page-navigator li { display: inline-block; }
.page-navigator a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: .5rem;
  border: 1px solid var(--border);
  background: var(--card);
  line-height: 1.2;
}
.page-navigator a:hover { background: color-mix(in srgb, var(--brand-50) 45%, var(--card)); text-decoration: none; }
.page-navigator .current a {
  color: #fff;
  border-color: var(--brand-600);
  background: var(--brand-600);
}

/* ===== Comments ===== */
#comments { padding-top: 18px; }
.comment-list, .comment-list ol { list-style: none; margin: 0; padding: 0; }
.comment-list li {
  padding: 14px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: var(--card);
  box-shadow: var(--shadow);
}
.comment-list li.comment-level-odd  { background: color-mix(in srgb, var(--card) 90%, var(--bg-soft)); }
.comment-list li.comment-level-even { background: var(--card); }
.comment-list li.comment-by-author  { background: color-mix(in srgb, var(--brand-50) 60%, var(--card)); }
.comment-list li .comment-reply { text-align: right; font-size: .92em; }
.comment-meta a { color: var(--text-muted); font-size: .92em; }
.comment-author {
  display: block; margin-bottom: 6px; color: var(--text); font-weight: 600;
}
.comment-author .avatar { float: left; margin-right: 10px; border-radius: 999px; }
.comment-author cite { font-style: normal; }

/* Comment reply */
.comment-list .respond {
  margin-top: 16px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.respond .cancel-comment-reply {
  float: right; margin-top: 10px; font-size: .92em; color: var(--text-muted);
}
#comment-form label { display: block; margin-bottom: .5em; font-weight: 700; }
#comment-form .required:after { content: " *"; color: #ef4444; }

/* ===== Sidebar / Secondary ===== */
#secondary { padding-top: 16px; word-wrap: break-word; }
.widget { margin-bottom: 28px; background: var(--card); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--shadow); padding: 14px; }
.widget-list { list-style: none; padding: 0; }
.widget-list li {
  margin: 6px 0;
  line-height: 1.6;
}
.widget-list li ul { margin-left: 14px; }

/* ===== Footer ===== */
#footer {
  padding: 3em 0;
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, color-mix(in srgb, var(--brand-50) 35%, transparent), transparent);
}

/* ===== Error page ===== */
.error-page { margin: 100px 0; }

/* ===== Content formatting ===== */
.post-content, .comment-content {
  line-height: 1.85;
  word-wrap: break-word;
}
.post-content h1::before,
.post-content h2::before,
.post-content h3::before {
  content: "#";
  font-size: 0.65em;   /* superscript look */
  vertical-align: super;
  margin-right: 0.4em;
  font-weight: 700;
}

/* Strongest for H1 */
.post-content h1::before {
  color: var(--brand-700);   /* deep blue */
}

/* Medium for H2 */
.post-content h2::before {
  color: var(--brand-500);   /* medium blue */
  font-size: 0.6em;          /* a touch smaller */
}

/* Lightest for H3 */
.post-content h3::before {
  color: var(--brand-400);   /* lighter blue */
  font-size: 0.55em;
}
/*.post-content h2, .comment-content h2 { font-size: 1.25rem; }*/
.post-content img, .comment-content img,
.post-content video, .comment-content video { max-width: 100%; border-radius: .5rem; }
.post-content a img,
.comment-content a img {
  background: var(--bg);
  position: relative;
  bottom: -4px; /* hide parent link underline */
}
.post-content hr, .comment-content hr {
  margin: 2em auto;
  width: 120px;
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-400), transparent);
  opacity: .6;
  border-radius: 2px;
}

/* ===== Utilities ===== */
.aligncenter, div.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; }
.alignright { float: right; }
img.alignleft { margin: 0 15px 10px 0; }
img.alignright { margin: 0 0 10px 15px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body { font-size: 95%; }
  #header, .post-title, .post-meta { text-align: center; }
  #nav-menu { justify-content: center; }
  .protected .text { width: 100%; }
  .post-title::after { margin-left: auto; margin-right: auto; }
}

/* ===== Accessibility helpers (kept) ===== */
.hidden { display: none !important; visibility: hidden; }
.sr-only {
  border: 0; height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;
}
.sr-only.focusable:active, .sr-only.focusable:focus {
  clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto;
}
.invisible { visibility: hidden; }

/* ===== Legacy bits kept for compatibility ===== */
#nav-menu a { height: auto; line-height: 1.2; } /* override old fixed heights */
.page-navigator a { height: auto; }
