/* ============================================================
   Durre Theme — CRT Terminal Aesthetic
   Inspired by lainzine.org
   ============================================================ */

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  overflow-x: hidden;
  overscroll-behavior-x: none;
  position: relative;
  max-width: 100%;
  width: 100%;
  background-color: #131313;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 6px,
    rgba(0, 0, 0, 0.13) 6px,
    rgba(0, 0, 0, 0.13) 8px
  );
  background-size: 8px 8px;
  color: rgb(57, 219, 57);
  font-family: "Consolas", "Andale Mono", "Lucida Console", monospace;
  font-size: 1rem;
  line-height: 1.7;
  animation: fade-in 2s;
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

@keyframes fade-in {
  from { opacity: 0; filter: blur(0.2px); }
  to   { opacity: 1; }
}

/* ------------------------------------------------------------
   Links
   ------------------------------------------------------------ */
a:link, a:visited, a:active {
  color: rgb(219, 67, 181);
  text-decoration: none;
  transition: color ease-in-out 0.2s, text-shadow ease-in-out 0.2s;
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}

a:hover {
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */
/* page-wrapper handles sticky footer; body is left as plain block */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.main-content {
  flex: 1;
  padding-top: 0;
  padding-bottom: 2.5rem;
}

/* ------------------------------------------------------------
   Headings
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  color: rgb(57, 219, 57);
  font-family: inherit;
  font-weight: bold;
  line-height: 1.3;
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

h1 { font-size: 1.4rem; text-align: center; margin-bottom: 1rem; font-weight: normal; letter-spacing: 0.08em; }
h2 { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.6rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

hr {
  border: none;
  border-top: 1px solid rgba(57, 219, 57, 0.3);
  margin-block: 1.5rem;
}

/* ------------------------------------------------------------
   Site Header
   ------------------------------------------------------------ */
.site-header {
  text-align: center;
  padding-block: 1rem 0.5rem;
}

/* Fade title: shows title by default, tagline on hover.
   Both spans share the same grid cell — no absolute positioning. */
.site-title {
  display: grid;
  grid-template-columns: 100%;
  place-items: center;
  width: 100%;
  margin-bottom: 1.25rem;
}

.site-title__text,
.site-title__alt {
  grid-area: 1 / 1;
  font-size: 1.6rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-align: center;
  width: 100%;
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
  transition: opacity ease-in-out 0.5s;
  text-decoration: none;
}

.site-title__alt {
  opacity: 0;
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}

.site-title:hover .site-title__text { opacity: 0; }
.site-title:hover .site-title__alt  { opacity: 1; }

/* Nav */
.site-nav {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.site-nav__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.site-nav__item {
  display: flex;
  align-items: center;
}

.site-nav__item + .site-nav__item::before {
  content: "•";
  padding-inline: 0.5rem;
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

.site-nav__link {
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}
.site-nav__link:hover,
.site-nav__link--active {
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

.site-header__divider {
  border: none;
  border-top: 1px solid rgba(57, 219, 57, 0.25);
  margin-inline: auto;
  max-width: 760px;
}

/* ------------------------------------------------------------
   Hero (homepage)
   ------------------------------------------------------------ */
.hero {
  text-align: center;
  padding-block: 2rem;
}

.hero__tagline {
  font-size: 0.95rem;
  color: rgba(57, 219, 57, 0.75);
  margin-bottom: 2rem;
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.5);
}

/* ------------------------------------------------------------
   Post Cards (homepage grid)
   ------------------------------------------------------------ */
.post-cards {
  margin-top: 2rem;
}

.post-cards__heading {
  font-size: 0.85rem;
  color: rgba(57, 219, 57, 0.6);
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: none;
}

.post-cards__list {
  list-style: none;
  padding: 0;
  border-top: 1px solid rgba(57, 219, 57, 0.2);
}

.post-card {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.6rem;
  border-bottom: 1px solid rgba(57, 219, 57, 0.1);
}

.post-card__date {
  font-size: 0.8rem;
  color: rgba(57, 219, 57, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: none;
}

.post-card__title a {
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}
.post-card__title a:hover {
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

/* ------------------------------------------------------------
   Page Header
   ------------------------------------------------------------ */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(57, 219, 57, 0.2);
}

.page-header--compact {
  margin-bottom: 0;
}

.page-header__desc {
  font-size: 0.9rem;
  color: rgba(57, 219, 57, 0.65);
  text-shadow: none;
  margin-top: 0.4rem;
}

/* ------------------------------------------------------------
   Section Sub-Nav
   ------------------------------------------------------------ */
.section-nav {
  font-size: 0.9rem;
  margin: 0;
}

.section-nav__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.section-nav__item {
  display: flex;
  align-items: center;
}

.section-nav__item + .section-nav__item::before {
  content: "•";
  padding-inline: 0.5rem;
  color: rgba(57, 219, 57, 0.4);
}

.section-nav__link {
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}

.section-nav__link:hover,
.section-nav__link--active {
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

/* ------------------------------------------------------------
   Post List (section pages)
   ------------------------------------------------------------ */
.post-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid rgba(57, 219, 57, 0.2);
}

.post-list__item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.65rem;
  border-bottom: 1px solid rgba(57, 219, 57, 0.1);
}

.post-list__date {
  font-size: 0.75rem;
  color: rgba(57, 219, 57, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: none;
}

.post-list__section,
.post-list__sep {
  font-size: 0.75rem;
  color: rgba(57, 219, 57, 0.45);
  text-shadow: none;
}

.post-list__title {
  font-size: 0.8rem;
}

.post-list__title a {
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}
.post-list__title a:hover {
  color: rgb(57, 219, 57);
}

.post-list__excerpt {
  font-size: 0.85rem;
  color: rgba(57, 219, 57, 0.6);
  text-shadow: none;
  margin-top: 0.2rem;
}

/* ------------------------------------------------------------
   Single Post
   ------------------------------------------------------------ */
.post__header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(57, 219, 57, 0.2);
}

.post__title {
  margin-bottom: 0.5rem;
}

.post__meta {
  font-size: 0.8rem;
  color: rgba(57, 219, 57, 0.5);
  text-shadow: none;
}

.post__body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgb(150, 200, 150);
  text-shadow: none;
}

.post__body p  { margin-bottom: 1.1rem; }
.post__body ul,
.post__body ol { margin-bottom: 1.1rem; padding-left: 1.5rem; }
.post__body li { margin-bottom: 0.3rem; }

.post__body blockquote {
  border-left: 2px solid rgb(219, 67, 181);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: rgba(57, 219, 57, 0.7);
  font-style: italic;
}

.post__body code {
  font-family: inherit;
  font-size: 0.9em;
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}

.post__body pre {
  background: rgba(57, 219, 57, 0.05);
  border: 1px solid rgba(57, 219, 57, 0.2);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.post__body pre code {
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

.post__body h2,
.post__body h3 {
  text-align: left;
}

.post__body h2 {
  color: rgb(30, 120, 30);
  text-shadow: none;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgb(30, 120, 30);
  padding-bottom: 0.25rem;
  margin-bottom: 0.75rem;
}

.post__body a {
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
}
.post__body a:hover {
  color: rgb(57, 219, 57);
}

.post__footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(57, 219, 57, 0.2);
  text-align: center;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------
   Images (CRT box-shadow effect)
   ------------------------------------------------------------ */
img {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow:
    0.06rem 0.12rem 0 rgba(200, 100, 100, 0.5),
    0 0.06rem 0 rgba(200, 100, 100, 0.5),
    0 0 8px rgba(0, 0, 0, 0.4);
  transition: filter ease-in-out 0.2s, transform ease-in-out 0.2s, box-shadow ease-in-out 0.2s;
}

img:hover {
  filter: hue-rotate(90deg);
  transform: translateY(-4px);
  box-shadow:
    0.06rem 0.12rem 0 rgba(200, 100, 100, 0.5),
    0 0.06rem 0 rgba(200, 100, 100, 0.5),
    0 10px 12px rgba(0, 0, 0, 0.3);
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.empty-state {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(57, 219, 57, 0.5);
  text-shadow: none;
  padding: 2rem 0;
}

/* ------------------------------------------------------------
   Site Footer
   ------------------------------------------------------------ */
.site-footer {
  text-align: center;
  padding-block: 1.5rem 2rem;
  font-size: 0.8rem;
  border-top: 1px solid rgba(57, 219, 57, 0.15);
  color: rgba(57, 219, 57, 0.5);
  text-shadow: none;
}

.site-footer a {
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.3);
}

.site-footer__links {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 0;
}

.site-footer__links li {
  display: flex;
  align-items: center;
}

.site-footer__links li + li::before {
  content: "•";
  padding-inline: 0.5rem;
  color: rgba(57, 219, 57, 0.35);
}

/* ------------------------------------------------------------
   Responsive — portrait orientation (phones & tablets in portrait)
   Same approach as lainzine.org: max-aspect-ratio: 7/8
   Triggers when height > width * 8/7, i.e. portrait mode
   ------------------------------------------------------------ */
@media (max-aspect-ratio: 7/8) {
  body {
    background-image: repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 5px,
      rgba(0, 0, 0, 0.10) 5px,
      rgba(0, 0, 0, 0.10) 6px
    );
    background-size: 6px 6px;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-title__text,
  .site-title__alt {
    font-size: 1.3rem;
  }

  /* Stack date + title vertically on narrow screens */
  .post-card {
    flex-direction: column;
    gap: 0.1rem;
  }

  /* Wrap long code lines rather than overflowing */
  .post__body pre {
    white-space: pre-wrap;
    word-break: break-all;
  }

  /* Add padding so hover-swap title doesn't clip */
  .site-title {
    padding-bottom: 2em;
  }
}

/* ------------------------------------------------------------
   Hangman
   ------------------------------------------------------------ */
.hangman {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.hm-scaffold {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
  text-align: left;
}

.hm-word {
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  color: rgb(57, 219, 57);
}

.hm-wrong {
  font-size: 0.75rem;
  color: rgba(57, 219, 57, 0.45);
  text-shadow: none;
  min-height: 1.2em;
}

.hm-msg {
  font-size: 0.85rem;
  color: rgb(219, 67, 181);
  text-shadow: 0.06em 0 0.5px rgba(200, 200, 0, 0.5);
  min-height: 1.2em;
}

.hm-keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.hm-keyboard__row {
  display: flex;
  gap: 0.3rem;
}

.hm-key {
  background: none;
  border: 1px solid rgba(57, 219, 57, 0.35);
  color: rgb(57, 219, 57);
  font-family: inherit;
  font-size: 0.75rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  text-shadow: none;
  transition: border-color 0.1s, color 0.1s;
}

.hm-key:hover:not(:disabled) {
  border-color: rgb(57, 219, 57);
  text-shadow: -0.06em 0 0.5px rgba(255, 200, 100, 0.9);
}

.hm-key--used {
  opacity: 0.25;
  cursor: default;
}

.hm-key--wrong {
  color: rgb(219, 67, 181);
  border-color: rgba(219, 67, 181, 0.35);
}

.hm-new {
  background: none;
  border: none;
  color: rgba(57, 219, 57, 0.6);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-shadow: none;
  padding: 0;
}

.hm-new:hover {
  color: rgb(57, 219, 57);
}
