/*
Theme Name: TU Clean
Theme URI: https://trollandunicorn.com
Author: Spinning Monkey Studios
Description: Clean, lightweight Troll & Unicorn theme focused on maintainability.
Version: 0.2.0
Text Domain: tu-clean
*/

:root {
  --bg: #d8e3f8;
  --surface: #ffffff;
  --ink: #131d31;
  --muted: #5c6a82;
  --brand: #f28a11;
  --brand-dark: #d96c00;
  --navy: #254f95;
  --line: #d9e3f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(1160px, 94vw); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}

.site-branding a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 900;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.menu-item a {
  display: inline-block;
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
  font-weight: 700;
}

.menu a,
.page_item a {
  display: inline-block;
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
  font-weight: 700;
}

.menu-item a:hover {
  background: #edf3ff;
  text-decoration: none;
}

.menu a:hover,
.page_item a:hover {
  background: #edf3ff;
  text-decoration: none;
}

.main-content { padding: 1.3rem 0 3rem; flex: 1; }

.button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand-dark);
  box-shadow: -5px 7px 0 #203252;
  border-radius: 0;
  padding: 0.55rem 1rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.button.ghost {
  background: #fff;
  color: var(--ink);
  border-color: #203252;
}

.button:hover {
  text-decoration: none;
  transform: translateX(-3px);
}

.tu-hero {
  --tu-bg-offset: 0px;
  background: url("./assets/images/banner.png") 50% calc(50% + var(--tu-bg-offset)) / cover no-repeat;
  padding: 2.3rem 0 2.8rem;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.tu-hero-card {
  width: min(1060px, 92vw);
  margin: 0 auto;
  background: url("./assets/images/bannerinfobg.png") center/cover no-repeat;
  border-radius: 16px;
  border: 2px solid #111f39;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.4rem;
}

.tu-hero-copy .kicker {
  margin: 0;
  color: #d8e7ff;
  font-weight: 700;
}

.tu-hero-copy h1 {
  margin: 0.2rem 0 0.5rem;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.95;
}

.tu-hero-copy p {
  color: #f2f6ff;
  margin-bottom: 1rem;
  max-width: 56ch;
}

.tu-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.tu-hero-art { text-align: center; }
.tu-hero-art img { max-height: 300px; width: auto; max-width: 100%; }

.tu-start-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: center;
  margin-top: 0.4rem;
  padding: 1.35rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 207, 102, 0.32), transparent 32%),
    linear-gradient(135deg, #182947, #233f70 55%, #2b5ca5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tu-start-hero-copy h1 {
  margin: 0.2rem 0 0.5rem;
  font-size: clamp(2rem, 4.8vw, 3.3rem);
  line-height: 0.95;
}

.tu-start-hero-copy p {
  max-width: 58ch;
  color: #edf3ff;
}

.tu-start-hero-art {
  text-align: center;
}

.tu-start-hero-art img {
  max-width: 100%;
  max-height: 320px;
  width: auto;
}

.tu-start-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.tu-start-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.tu-start-card p {
  margin: 0 0 0.6rem;
}

.tu-start-card a {
  font-weight: 800;
}

.tu-start-lore {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1rem;
}

.tu-start-lore-copy,
.tu-start-lore-callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.tu-start-lore-copy h2,
.tu-start-lore-callout h3 {
  margin-top: 0;
}

.tu-start-lore-copy p {
  margin: 0.6rem 0 0;
}

.tu-start-points {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
}

.tu-start-points li + li {
  margin-top: 0.45rem;
}

.character-section {
  margin-top: 1.6rem;
  padding: 1rem 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  position: relative;
}

.character-section::before,
.character-section::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  background: url("./assets/images/dotted.png") center/contain no-repeat;
  opacity: 0.6;
}

.character-section::before { top: -16px; left: -14px; }
.character-section::after { bottom: -16px; right: -10px; transform: rotate(180deg); }

.character-section h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
}

.character-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  text-align: center;
  padding: 0.55rem;
}

.character-card img {
  width: 100%;
  height: 145px;
  object-fit: contain;
  background: #f2f7ff;
  border-radius: 9px;
}

.character-card h3 {
  margin: 0.55rem 0 0;
  font-size: 0.96rem;
}

.character-hook {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.tu-linked-image {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.tu-linked-image::after {
  content: "View";
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(180deg, rgba(21, 35, 58, 0), rgba(21, 35, 58, 0.9));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 0.7rem 0.5rem 0.45rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tu-linked-image img {
  transition: transform 0.28s ease;
}

.tu-linked-image:hover::after,
.tu-linked-image:focus::after {
  opacity: 1;
}

.tu-linked-image:hover img,
.tu-linked-image:focus img {
  transform: scale(1.04);
}

.story-panel {
  margin-top: 1.6rem;
  --tu-bg-offset: 0px;
  background: url("./assets/images/ourstorybg.png") 50% calc(50% + var(--tu-bg-offset)) / cover no-repeat;
  border-radius: 16px;
  padding: 2rem 1rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.story-inner {
  max-width: 830px;
  margin: 0 auto;
  position: relative;
  text-align: center;
}

.story-inner h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.7rem);
}

.story-inner p {
  margin: 0.9rem auto 0;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  max-width: 56ch;
}

.quote {
  width: 24px;
  height: auto;
  position: absolute;
}

.q1 { top: -8px; left: 10%; }
.q2 { bottom: -8px; right: 10%; }

.episodes-panel {
  margin-top: 1.6rem;
  border-radius: 16px;
  padding: 1rem;
  --tu-bg-offset: 0px;
  background: url("./assets/images/allepisodebg.png") 50% calc(50% + var(--tu-bg-offset)) / cover no-repeat;
}

.episodes-panel h2 {
  margin: 0.3rem 0 0.9rem;
  color: #fff;
  font-size: clamp(1.4rem, 3.2vw, 2.3rem);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.books-panel {
  margin-top: 1.6rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
}

.community-panel {
  margin-top: 1.6rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
}

.community-panel h2 {
  margin: 0.2rem 0 0.25rem;
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
}

.community-sub {
  margin: 0 0 0.95rem;
  color: var(--muted);
}

.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.95rem;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.9rem;
}

.feed-card {
  border: 1px solid #d5dded;
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem;
}

.feed-card h3 {
  margin: 0 0 0.35rem;
}

.feed-card p {
  margin: 0.55rem 0 0.3rem;
  color: var(--muted);
}

.feed-note {
  font-size: 0.9rem;
}

.feed-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.feed-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tu-deferred-embed {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d2f4f, #294574);
}

.tu-embed-load {
  min-width: 210px;
  text-align: center;
}

.feed-embed-facebook {
  padding-top: 0;
  height: 640px;
  background: #f5f7fb;
}

.video-panel {
  margin-top: 1rem;
  border: 1px solid #d5dded;
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem;
}

.video-panel h3 {
  margin: 0 0 0.65rem;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.updates-panel {
  margin-top: 1.6rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
}

.updates-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.updates-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
}

.updates-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.update-card {
  display: flex;
  flex-direction: column;
}

.update-card h3 {
  margin: 0.1rem 0 0.45rem;
}

.update-card p {
  margin: 0 0 0.6rem;
}

.update-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.books-panel h2 {
  margin: 0.2rem 0 0.25rem;
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
}

.books-sub {
  margin: 0 0 0.95rem;
  color: var(--muted);
}

.book-card h3 {
  margin: 0.45rem 0 0.35rem;
  font-size: 1.02rem;
}

.book-meta {
  margin: 0.05rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.card {
  background: #fff;
  border: 1px solid #d5dded;
  border-radius: 12px;
  padding: 0.6rem;
}

.episode-card h3 {
  margin: 0.45rem 0 0.2rem;
  font-size: 1rem;
}

.comic-thumb {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 9px;
  background: #f2f7ff;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.95rem 0;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
}

.footer-copy {
  font-size: 0.92rem;
}

.character-detail {
  margin-top: 1.4rem;
}

.book-detail {
  margin-top: 1.4rem;
}

.comic-reader {
  padding: 1.1rem;
}

.comic-kicker {
  margin: 0 0 0.35rem;
  color: var(--brand-dark);
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.comic-cover {
  margin-bottom: 1rem;
}

.comic-cover img {
  width: 100%;
  border-radius: 12px;
  background: #f2f7ff;
}

.comic-reader-content > p:first-child {
  font-size: 1.08rem;
  color: var(--muted);
}

.comic-scenes-nav {
  margin: 1rem 0 1.4rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #f5f8ff;
  border: 1px solid var(--line);
}

.comic-scenes-nav h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.comic-scenes-nav ul {
  margin: 0;
  padding-left: 1.15rem;
  columns: 2;
}

.comic-scenes-nav li + li {
  margin-top: 0.3rem;
}

.comic-scene {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 14px;
  background: #fbfdff;
  border: 1px solid var(--line);
}

.comic-scene h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
}

.comic-script {
  margin: 0;
  white-space: pre-wrap;
  font: 500 0.98rem/1.65 "IBM Plex Mono", "Consolas", monospace;
  color: var(--ink);
}

.tu-art-slot {
  margin-top: 0.9rem;
}

.tu-art-slot-label {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.tu-art-slot-frame {
  border-radius: 12px;
  border: 1px dashed #9db2d7;
  background: linear-gradient(180deg, #f9fbff, #eef4ff);
  overflow: hidden;
}

.tu-art-slot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.tu-art-slot-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--navy);
  font-weight: 800;
  text-align: center;
}

.comic-reader-nav {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.comic-reader-nav a {
  font-weight: 800;
}

.book-detail-card {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
}

.book-detail-image img {
  width: 100%;
  border-radius: 10px;
  background: #f2f7ff;
}

.character-detail-card {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 1rem;
}

.character-detail-image img {
  width: 100%;
  border-radius: 10px;
  background: #f2f7ff;
}

.tu-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(11, 19, 35, 0.7);
  z-index: 120;
}

.tu-modal.is-open {
  display: flex;
}

.tu-modal-card {
  width: min(420px, 94vw);
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 1rem;
  text-align: center;
  position: relative;
}

.tu-modal-image {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 10px;
  background: #f2f7ff;
}

.tu-modal-card h3 {
  margin: 0.7rem 0;
}

.tu-modal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 700px) {
  .tu-hero-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .tu-start-hero,
  .tu-start-lore {
    grid-template-columns: 1fr;
  }
  .tu-hero-actions {
    justify-content: center;
  }
}

@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .menu { flex-wrap: wrap; gap: 0.5rem; }
  .tu-hero { border-radius: 14px; }
  .comic-thumb { height: 200px; }
  .character-detail-card {
    grid-template-columns: 1fr;
  }
  .book-detail-card {
    grid-template-columns: 1fr;
  }
  .comic-scenes-nav ul {
    columns: 1;
  }
  .updates-head .button {
    width: 100%;
    text-align: center;
  }
  .community-links .button {
    width: 100%;
    text-align: center;
  }
  .feed-grid {
    grid-template-columns: 1fr;
  }
  .feed-embed-facebook {
    height: 580px;
  }
  .footer-social {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tu-hero,
  .story-panel,
  .episodes-panel {
    --tu-bg-offset: 0px !important;
  }
}
