* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #f3e7a6;
  font-family: serif;
}

.page {
  max-width: 900px;
  margin: 40px auto;
  background: #fff8dc;
  border: 2px solid #c9b27c;
  padding: 16px;
}

/* ---------- global layout ---------- */

.layout {
  display: flex;
  gap: 16px;
}

.content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- header ---------- */

.site-title {
  font-size: 2.5rem;
  margin: 0 0 12px 0;
  text-align: center;
}

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

.top-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.top-nav a {
  border: 1px solid #c9b27c;
  background: #fff1b8;
  padding: 6px 12px;
  text-decoration: none;
  color: #333;
}

.top-nav a:hover {
  background: #ffed9c;
}

/* ---------- homepage layout ---------- */

.home-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-bottom: 24px;
  align-items: start;
}

.home-left,
.home-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- homepage image ---------- */

.home-image img {
  width: 100%;
  display: block;
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 4px;
}

/* ---------- intro ---------- */

.intro-text {
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 8px;
}

.intro-text h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

.intro-text p {
  margin-top: 0;
  margin-bottom: 0;
}

/* ---------- books box ---------- */

.books-box {
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 10px;
}

/* title */

.books-box h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

/* clickable title */

.books-title-link:link,
.books-title-link:visited {
  color: inherit;
  text-decoration: none;
}

.books-title-link:hover {
  text-decoration: underline;
}

/* covers link */

.books-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* grid */

.book-covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  justify-items: center;
}

.book-covers img {
  width: 100%;
  max-width: 90px;
  height: auto;
  display: block;
}

/* ---------- social links box (homepage) ---------- */

.social-box {
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 10px;
}

.social-box h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.social-links {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.social-links img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- latest post (homepage) ---------- */

.latest-post-wrapper {
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 10px;
  width: 100%;
}

.latest-post-wrapper h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.latest-post-box {
  padding: 8px 8px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: inherit;
}

/* links inside the box */

.latest-post-box a {
  color: inherit;
  text-decoration: none;
}

.latest-post-box a:hover {
  text-decoration: underline;
}

.latest-post-image-link {
  display: block;
}

/* title */

.latest-post-box h3 {
  margin-top: 10px;
  margin-bottom: 0;
  text-align: center;
}

/* image */

.latest-post-box img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.latest-post-image-link:hover {
  text-decoration: none;
}

/* excerpt */

.latest-excerpt {
  margin: 4px 0 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* read more link */

.read-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: #555;
  text-decoration: none;
  font-style: normal;
  text-align: right;
}

.read-more:hover {
  text-decoration: underline;
}

/* ---------- updates (homepage + updates page) ---------- */

.updates {
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 10px;
}

/* title */

.updates-title {
  margin-top: 0;
  margin-bottom: 8px;
}

.updates-page-title {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
}

/* list reset */

.updates-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* one update row */

.update-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid #e4d7a6;
}

.update-item:last-child {
  border-bottom: none;
}

/* body (title + subtitle block) */

.update-body {
  display: block;
}

/* header line (title + date) */

.update-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

/* thumbnail */

.update-thumb-link {
  display: inline-block;
}

.update-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid #c9b27c;
}

/* no thumbnail layout */

.update-item.no-thumb {
  grid-template-columns: 1fr;
}

.update-item.no-thumb .update-body {
  grid-column: 1;
}

/* title */

.update-title {
  font-weight: bold;
}

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

.update-title a:hover {
  text-decoration: underline;
}

/* subtitle */

.update-subtitle {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-top: 2px;
  color: #333;
}

/* date (now beside title) */

.update-date {
  font-size: 0.8rem;
  font-style: italic;
  color: #777;
  white-space: nowrap;
}

/* link to full updates page (homepage only) */

.updates-archive-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  color: #555;
}

.updates-archive-link:hover {
  text-decoration: underline;
}

/* ---------- pagination (updates page only) ---------- */

.updates-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.page-link {
  border: 1px solid #c9b27c;
  background: #fff1b8;
  padding: 4px 8px;
  text-decoration: none;
  color: #333;
  font-size: 0.85rem;
}

.page-link:hover {
  background: #ffed9c;
}

.page-link.current {
  background: #ffe48a;
  font-weight: bold;
  pointer-events: none;
}

.page-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- sidebar (blog pages) ---------- */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 0.9rem;
}

.sidebar a {
  text-decoration: none;
  color: #333;
  padding: 0;
  border: none;
  background: none;
  line-height: 1.4;
}

.sidebar a:hover {
  text-decoration: underline;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section ul {
  margin: 6px 0 0 0;
  padding-left: 14px;
}

.sidebar input[type="search"] {
  width: 100%;
  padding: 6px;
  font-size: 0.9rem;
}

.sidebar details {
  margin-bottom: 8px;
}

.sidebar summary {
  cursor: pointer;
}

/* ---------- blog list pages ---------- */

.layout-blog {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
}

.blog-page-title {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
}

.post-date {
  font-style: italic;
  color: #777;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.post-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 8px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.post-card:hover {
  background: #fff6d6;
}

.post-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin-bottom: 6px;
}

.post-card h3 {
  margin: 6px 0 0 0;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
}

/* ---------- pagination ---------- */

.pagination {
  margin-top: 20px;
}

/* ---------- blog post page ---------- */

.layout-blog .content {
  display: block;
  max-width: none;
}

.blog-post {
  max-width: 640px;
}

.blog-post figure {
  margin: 24px 0;
  text-align: center;
}

.blog-post figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 4px;
}

.blog-post figcaption {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.blog-italic-link {
  font-style: italic;
}

/* ---------- books page ---------- */

.books-page {
  max-width: 720px;
  margin: 0 auto;
}

.books-page-title {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
}

.book-entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;

  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 12px;
  margin-bottom: 16px;
}

.book-cover img {
  width: 100%;
  height: auto;
  display: block;

  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 4px;
}

.book-info h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

.book-blurb {
  margin-top: 0;
  margin-bottom: 6px;
}

.book-meta {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  font-style: italic;
  color: #555;
}

.book-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* buttons */

.btn {
  border: 1px solid #c9b27c;
  background: #fff1b8;
  padding: 6px 12px;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

.btn:hover {
  background: #ffed9c;
}

.btn.secondary {
  background: #fffdf0;
}

.btn.secondary:hover {
  background: #fff6d6;
}

/* ---------- videos page ---------- */

.videos-page-title {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.video-card {
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 8px;
}

.video-card summary {
  list-style: none;
  cursor: pointer;
}

.video-card summary::-webkit-details-marker {
  display: none;
}

.video-card summary img {
  width: 100%;
  display: block;
  border: 1px solid #c9b27c;
  margin-bottom: 6px;
}

.video-card summary h3 {
  margin: 4px 0 0 0;
  font-size: 1rem;
  text-align: center;
}

.video-panel {
  margin-top: 10px;
}

/* 16:9 video box */
.video-embed {
  position: relative;
  padding-top: 56.25%;
  margin-bottom: 8px;
}

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

.video-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.video-date {
  margin-top: 2px;
  font-size: 0.8rem;
  color: #777;
  font-style: italic;
  text-align: center;
}

/* ---------- thumbnail → video swap ---------- */

.video-embed {
  display: none;
}

.video-card[open] .video-embed {
  display: block;
}

.video-card[open] summary img {
  display: none;
}

.video-card[open] .video-panel {
  margin-top: 0;
}

/* ---------- music page ---------- */

.music-page-title {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.music-card {
  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 8px;
}

.music-card summary {
  list-style: none;
  cursor: pointer;
}

.music-card summary::-webkit-details-marker {
  display: none;
}

.music-card summary img {
  width: 100%;
  display: block;
  border: 1px solid #c9b27c;
  margin-bottom: 6px;
}

.music-card summary h3 {
  margin: 4px 0 0 0;
  font-size: 1rem;
  text-align: center;
}

.music-date {
  margin-top: 2px;
  font-size: 0.8rem;
  color: #777;
  font-style: italic;
  text-align: center;
}

.music-panel {
  margin-top: 10px;
}

/* SoundCloud player */

.music-embed iframe {
  width: 100%;
  height: 166px;
  border: 0;
}

/* description */

.music-description {
  margin: 8px 0 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ---------- cover → player swap ---------- */

.music-embed {
  display: none;
}

.music-card[open] .music-embed {
  display: block;
}

.music-card[open] summary img {
  display: none;
}

.music-card[open] .music-panel {
  margin-top: 0;
}

/* ---------- about page ---------- */

.about-page {
  max-width: 720px;
  margin: 0 auto;
}

.about-page-title {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
}

.about-entry {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;

  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 12px;
}

.about-photo img {
  width: 100%;
  height: auto;
  display: block;

  border: 1px solid #c9b27c;
  background: #fffdf0;
  padding: 4px;
}

.about-info {
  align-self: center;
}

.about-info p {
  margin-top: 0;
  margin-bottom: 8px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .about-entry {
    grid-template-columns: 1fr;
  }
}
