/* shamanblog.com – redesign */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Sans+Pro:wght@300;400;600;700;900&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-deep: #1e252d;
  --bg-card: #faf6f1;
  --text: #2c2420;
  --text-muted: #6b5e56;
  --text-light: #9a8e85;
  --accent: #b86a3a;
  --accent-hover: #9a4f28;
  --rule: #e6ddd4;
  --font-body: 'Lora', Georgia, serif;
  --font-heading: 'Source Sans Pro', Helvetica, sans-serif;
  --measure: 64rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --radius: 3px;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}



/* ─── Intro fade-in (first tab per browser session) ─── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  pointer-events: none;
}

html.no-intro body::before {
  display: none;
}

html.intro body::before {
  animation: overlay-fade 1s ease-in-out 0.75s forwards;
}

@keyframes overlay-fade {
  to { opacity: 0; }
}

@keyframes float-up {
  from { opacity: 0; transform: translateY(2rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Hero / Header ─── */
.site-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 16rem;
  padding: 0 2rem;
  text-align: center;
  color: #fff;
  z-index: 1;
}

html.intro body .site-header {
  animation: float-up 1s ease-out 0.75s both;
}

.site-header::before {
  content: none;
}

site-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 0;
  transform: translateY(1.1rem);
  text-shadow: 0 0 8px rgba(0,0,0,0.3), 0 0 18px rgba(0,0,0,0.22), 0 0 38px rgba(0,0,0,0.15);
}

site-title a {
  color: inherit;
  text-decoration: none;
}

site-title a:hover {
  color: inherit;
  text-decoration: none;
}

tag-line {
  position: absolute;
  left: 50%;
  top: 83%;
  transform: translate(-50%, -50%);
  display: block;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  max-width: 32rem;
  width: max-content;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45), 0 0 12px rgba(0,0,0,0.38), 0 0 26px rgba(0,0,0,0.26), 0 0 45px rgba(0,0,0,0.15);
}

/* ─── Navigation ─── */
nav:not(.pagination) {
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: var(--measure);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.175);
  box-shadow: 0 0 20px rgba(255,255,255,0.15), 0 0 50px rgba(255,255,255,0.08);
  border-bottom: none;
  padding: 0;
  display: flex;
  align-items: center;
}

nav:not(.pagination) > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  flex: 1;
}

nav:not(.pagination) > ul > li {
  display: flex;
}

nav:not(.pagination) a {
  display: flex;
  align-items: center;
  padding: 0.9rem 0.8rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  transition: color 0.2s, background 0.2s;
}

nav:not(.pagination) a::before,
nav:not(.pagination) a::after {
  content: none;
}

nav:not(.pagination) a:hover {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.1);
}

nav:not(.pagination) a.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
  box-shadow: inset 0 -2px 0 rgba(255,255,255,0.5);
}

/* ─── Search form ─── */
.search-form {
  position: relative;
  margin-left: auto;
  flex: 0 0 clamp(8rem, calc(100% - 44.5rem), 15rem);
  padding: 0.3rem 0.8rem;
  display: flex;
  align-items: center;
}

.search-form input[type="search"] {
  width: 100%;
  min-width: 5rem;
  padding: 0.45em 1.6em 0.45em 1.85em;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  font-size: 0.88rem;
  font-family: var(--font-heading);
  letter-spacing: 0.04rem;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.45em center;
  background-size: 0.85em;
}

.search-form input[type="search"]:focus {
  border-color: rgba(255,255,255,0.5);
  background-color: rgba(255,255,255,0.15);
}

.search-form input[type="search"]::placeholder {
  color: rgba(255,255,255,0.45);
}

/* Hide native browser clear button */
.search-form input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}

/* Custom clear button */
.search-clear {
  position: absolute;
  right: 0.8rem;
  top: 0;
  bottom: 0;
  width: 1.6em;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.search-clear:hover {
  color: rgba(255,255,255,0.9);
}

.search-form input:not(:placeholder-shown) ~ .search-clear {
  display: flex;
}

body:has(.search-page) .search-form input[type="search"] {
  width: 20rem;
  font-size: 1rem;
  padding: 0.35em 2em 0.35em 2em;
}

body:has(.search-page) .search-clear {
  font-size: 1.2rem;
  width: 2em;
}

.search-message {
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Main content ─── */
main {
  background: var(--bg-card);
  max-width: var(--measure);
  margin: 0 auto 4rem;
  padding: 3.5rem 4rem 3rem;
  box-shadow:
    0 2px 12px rgba(0,0,0,0.25),
    0 8px 40px rgba(0,0,0,0.2),
    0 0 80px rgba(0,0,0,0.3);
}

/* ─── Links ─── */
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(184, 106, 58, 0.35);
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

/* External links */
a.external::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.2em;
  background: currentColor;
  vertical-align: middle;
  opacity: 0.5;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* ─── Headings ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.3;
  margin-block: 0;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.02rem;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

/* ─── Post list ─── */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list > li {
  padding-block: var(--space-md) var(--space-sm);
  border-bottom: none;
}

.post-list > li:first-child {
  padding-top: 0;
}

.post-list > li:last-child {
  border-bottom: none;
}

.post-list article {
  display: grid;
  gap: var(--space-sm);
}

.post-list h2 {
  margin: 0;
  font-size: 1.15rem;
}



/* ─── Time/date ─── */
time {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.04rem;
  text-transform: uppercase;
  margin: 1.5rem 0 0.25rem;
}

time::before,
time::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ─── Tags ─── */
.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin: 0;
}

.post-list .tags {
  order: 1;
}

.post-list time {
  order: 0;
  margin-bottom: 0.15rem;
}

.post-list .preview {
  order: 2;
}



.tags a {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  text-decoration: underline dotted;
  text-decoration-color: rgba(107, 94, 86, 0.4);
  text-underline-offset: 0.2em;
  border: none;
  padding: 0;
  transition: color 0.2s;
}

.tags a + a::before {
  content: " · ";
  color: var(--text-light);
}

.tags a:hover {
  color: var(--accent);
  background: none;
}

/* ─── Preview ─── */
.preview {
  color: var(--text);
  width: 100%;
}

.preview h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.01rem;
  margin-bottom: var(--space-sm);
  line-height: 1.35;
}

.preview h1 {
  color: var(--text);
  transition: color 0.2s;
}

.post-link:hover .preview h1 {
  color: inherit;
}

.preview blockquote {
  font-style: italic;
  border-left: none;
  padding-left: 0;
  color: var(--text-muted);
  margin: 0 0 var(--space-md);
  font-size: 1.05rem;
}

.preview blockquote p {
  margin: 0;
}

.preview p {
  margin-block: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.preview > *:first-child {
  margin-top: 0;
}

.preview > *:last-child {
  margin-bottom: 0;
}

/* ─── Post link (whole-card clickable) ─── */
a.post-link,
a.post-link:hover {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.post-link .preview p:last-of-type::after {
  content: " \2192";
  color: var(--accent);
  transition: margin-left 0.25s;
  margin-left: 0;
}

a.post-link:hover .preview p:last-of-type::after {
  margin-left: 4px;
}

/* ─── Single post/page ─── */
article.post,
article.page {
  display: grid;
  gap: var(--space-md);
}

article.post time,
article.page time {
  margin-bottom: var(--space-sm);
}

/* ─── Eye of Kanaloa end-mark ─── */
article.post .content::after,
article.page .content::after {
  content: "";
  display: block;
  width: 4rem;
  height: 4rem;
  margin: var(--space-xl) auto var(--space-md);
  background: url('eye-of-kanaloa.svg') center / contain no-repeat;
  opacity: 0.25;
}

/* ─── Content (markdown output) ─── */
.content {
  line-height: 1.85;
}

.content > *:first-child {
  margin-top: 0;
}

.content > *:last-child {
  margin-bottom: 0;
}

.content p {
  margin-block: var(--space-md);
  hanging-punctuation: first;
}

.content ul,
.content ol {
  margin-block: var(--space-md);
  padding-left: 1.4em;
}

.content li {
  margin-block: var(--space-xs);
}

.content li > ul,
.content li > ol {
  margin-block: var(--space-xs);
}

.content blockquote {
  margin: var(--space-lg) 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.content blockquote p {
  margin: 0;
}

.content pre {
  margin-block: var(--space-lg);
  padding: var(--space-md);
  background: #f0ede8;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
}

.content code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.88em;
  background: #f0ede8;
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.content pre code {
  background: none;
  padding: 0;
  font-size: 1em;
}

.content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin-block: var(--space-xl);
}

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

.content img {
  border-radius: var(--radius);
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--space-lg);
  font-size: 0.93rem;
}

.content th,
.content td {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--rule);
  text-align: left;
}

.content th {
  background: #f0ede8;
  font-weight: 600;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding-top: var(--space-xl);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}

.pagination a {
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
  background: var(--accent);
  color: #fff;
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.pagination .disabled {
  color: var(--rule);
}

.pagination .ellipsis {
  color: var(--text-muted);
}

/* ─── Footer ─── */
footer {
  background: var(--bg-card);
  max-width: var(--measure);
  margin: -4rem auto 4rem;
  padding: var(--space-lg) 4rem;
  border-top: 1px solid var(--rule);
  box-shadow: 0 0 80px rgba(0,0,0,0.3);
}

footer nav {
  position: static;
  background: none;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding-bottom: 0;
}

.footer-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.footer-nav li {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  padding: 0.5rem 1rem;
  font-weight: 600;
}

.footer-nav a::before,
.footer-nav a::after {
  display: none;
}

.footer-nav a:hover {
  color: var(--accent);
  background: none;
}

/* ─── Nested menu ─── */
nav:not(.pagination) > ul > li:has(ul) {
  display: contents;
}

nav:not(.pagination) > ul ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  order: 99;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.2s ease, opacity 0.15s ease;
}

nav:not(.pagination) > ul ul a {
  font-size: 0.72rem;
}

nav:not(.pagination) > ul ul a:hover,
nav:not(.pagination) > ul ul a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

nav:not(.pagination) > ul > li:has(> a.active) ul,
nav:not(.pagination) > ul > li:has(ul a.active) ul {
  max-height: 3rem;
  opacity: 1;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  site-title {
    font-size: 3.5rem;
    letter-spacing: 0.06em;
    width: 100%;
    margin: 0 0.75rem 0;
    transform: none;
    line-height: 0.9;
  }

  tag-line {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    margin: 0.2rem 0.75rem 0.5rem;
    font-size: 0.95rem;
  }

  .site-header {
    padding: 1rem 1rem 0.4rem;
    min-height: auto;
    gap: 0;
  }

  /* Nav: tabs centered, search below */
  nav:not(.pagination) {
    flex-wrap: wrap;
    justify-content: center;
  }

  nav:not(.pagination) > ul {
    flex-wrap: wrap;
    justify-content: center;
    flex: unset;
    width: 100%;
  }

  nav:not(.pagination) a {
    padding: 0.4rem 0.65rem;
    font-size: 0.72rem;
  }

  .search-form {
    flex: unset;
    width: 100%;
    margin-left: 0;
    padding: 0.15rem 1.5rem 0.5rem;
    justify-content: center;
  }

  .search-form input[type="search"] {
    width: 100%;
    max-width: 16rem;
    padding-top: 0.3em;
    padding-bottom: 0.3em;
  }

  /* Tighten content to show more headlines */
  main {
    padding: 1.25rem 1.25rem;
  }

  footer {
    padding: 1.5rem;
  }

  .post-list > li {
    padding-block: 0.5rem 0.35rem;
  }

  time {
    font-size: 0.75rem;
    margin: 0.6rem 0 0.1rem;
  }

  .preview h1 {
    font-size: 1.3rem;
  }

  h1 {
    font-size: 1.6rem;
    margin-bottom: var(--space-md);
  }

  .preview p,
  .preview blockquote {
    font-size: 0.9rem;
    margin-block: 0.2rem;
    line-height: 1.65;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  site-title {
    font-size: 2.6rem;
    letter-spacing: 0.05em;
  }

  tag-line {
    font-size: 0.9rem;
  }

  .site-header {
    padding: 1.2rem 0.75rem 0.5rem;
  }

  main {
    padding: 1.25rem 0.85rem;
  }

  .preview h1 {
    font-size: 1.15rem;
  }
}

/* ─── Print ─── */
@media print {
  body {
    background: white;
    color: black;
  }

  body::before,
  .site-header,
  nav,
  .pagination {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
    box-shadow: none;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }
}
