@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

body {
  font-family: 'Inter', sans-serif;
  /* Stellody-esque dark theme */
  background: radial-gradient(circle at top left, #2a2640, #171827 60%, #121321);
  color: #e9e7ff;
  font-size: 20px;
  line-height: 1.8;
  padding: 4rem 2rem;
  margin: 0;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
  text-rendering: optimizeLegibility;
}

/* Simple site header (title + RSS icon) */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.site-title {
  margin: 0;
  text-align: center;
}

.header-spacer {
  min-width: 1px;
}

.site-title-link {
  justify-self: center;
  color: inherit;
}

.site-title-link:hover {
  color: inherit;
  text-shadow: none;
}

.site-header .back-link {
  justify-self: start;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.icon-btn,
.rss-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  /* Pale yellow background, red icon (foreground) */
  color: #ff4d4d;
  background: rgba(255, 242, 168, 0.92);
  border: 1px solid rgba(255, 242, 168, 0.55);
}

.icon-btn {
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  line-height: 1;
}

.icon-btn:hover,
.rss-link:hover {
  color: #ff2f2f;
  background: rgba(255, 242, 168, 1);
  text-shadow: none;
}

.icon-btn:focus-visible,
.rss-link:focus-visible {
  outline: 3px solid rgba(203, 182, 255, 0.65);
  outline-offset: 3px;
}

.rss-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.search-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: -1rem 0 2rem;
}

/* Ensure the `hidden` attribute always wins (overrides `.search-panel { display: flex; }`). */
.search-panel[hidden] {
  display: none !important;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 520px;
}

.search-input {
  flex: 1;
  width: 100%;
  padding: 0.65rem 0.85rem;
  padding-right: 2.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e9e7ff;
}

/* Hide the browser-provided clear (×) button so we only show our custom close icon. */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-close {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(233, 231, 255, 0.75);
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.search-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.search-close:focus-visible {
  outline: 3px solid rgba(203, 182, 255, 0.65);
  outline-offset: 3px;
}

.search-input::placeholder {
  color: rgba(233, 231, 255, 0.55);
}

.search-input:focus-visible {
  outline: 3px solid rgba(203, 182, 255, 0.65);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3 {
  color: #cbb6ff;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 2.4rem;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.4rem;
}

p {
  margin-bottom: 2rem;
}

a {
  color: #8bb3ff;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

a:hover {
  color: #ffffff;
  text-decoration: none;
  text-shadow: 0 0 10px rgba(139, 179, 255, 0.35);
}

ul {
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

small {
  display: block;
  margin: 0.5rem 0 1rem;
  color: rgba(233, 231, 255, 0.7);
}

code {
  background: rgba(255, 255, 255, 0.08);
  color: #f7f6ff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}

pre {
  background: rgba(255, 255, 255, 0.06);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

img {
  max-width: 100%;
  height: auto;
}

.post-cover-link {
  display: block;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.post-cover {
  display: block;
  width: 100%;
  max-width: 640px;
  border-radius: 14px;
  border: 0;
  box-shadow: none;
  margin: 0.5rem auto 1.25rem;
}

.tag {
  display: inline-block;
  background: rgba(139, 179, 255, 0.12);
  color: #8bb3ff;
  padding: 0.4rem 0.8rem;
  margin: 0.3rem 0.5rem 0.3rem 0;
  border-radius: 999px;
  font-size: 0.85rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(139, 179, 255, 0.25);
  transition: background 0.3s ease;
}

.tag:hover {
  background: rgba(139, 179, 255, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

a[href=\"/\"] {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: rgba(233, 231, 255, 0.72);
}

/* Back link inside header should not create extra spacing */
.site-header .back-link {
  display: inline-block;
  margin-bottom: 0;
  font-size: 0.9rem;
  color: rgba(233, 231, 255, 0.72);
}

/* Center the post title button + tags/meta, but keep body/content left-aligned */
.post-heading {
  text-align: center;
}

.post-heading > h1,
.post-heading > p,
.post-heading > small {
  margin-left: auto;
  margin-right: auto;
}

/* Homepage-only: center the post summary text under the title/tags */
.post-summary {
  text-align: center;
}

/* One-off: center content for the Hello Crank post only */
.post-content--centered {
  text-align: center;
}

.post-content--centered p,
.post-content--centered ul,
.post-content--centered ol {
  margin-left: auto;
  margin-right: auto;
}

a[href=\"/\"]:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(203, 182, 255, 0.35);
}

.site-header .back-link:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(203, 182, 255, 0.35);
}

/* Button-styled links */
.btn-link {
  display: inline-block;
  background: #8bb3ff;
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 12px 26px rgba(139, 179, 255, 0.18);
}

.btn-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  background: #a6c4ff;
  color: #ffffff;
}

.btn-link:focus-visible {
  outline: 3px solid rgba(203, 182, 255, 0.65);
  outline-offset: 3px;
}
