/* layout.css - Nav bar, footer, main container, grid, reader-prompt */

/* Top navigation bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid #e5e7eb;
  padding: 0 1rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #4b5563;
}

.topbar-item {
  padding: 0.25rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.topbar-item:hover {
  background-color: #f3f4f6;
}

.topbar-item.active {
  color: #111827;
  font-weight: 500;
}

.topbar-sep {
  color: #d1d5db;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #6b7280;
}

.topbar-right a:hover {
  color: #111827;
  text-decoration: none;
}

/* Cover image */
.cover {
  width: 100%;
  height: 12rem;
  overflow: hidden;
  position: relative;
}

@media (min-width: 640px) {
  .cover {
    height: 16rem;
  }
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.8;
}

.cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.2), transparent);
}

/* Main content container */
.main-container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
  margin-top: -3rem;
  position: relative;
  z-index: 10;
}

@media (min-width: 640px) {
  .main-container {
    padding: 0 3rem 6rem;
  }
}

/* Page icon */
.page-icon {
  font-size: 4.5rem;
  margin-bottom: 1rem;
  user-select: none;
  cursor: default;
  transition: transform 0.15s;
  transform-origin: bottom left;
  width: fit-content;
}

.page-icon:hover {
  transform: scale(1.05);
}

/* Page title */
.page-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #37352f;
  letter-spacing: -0.025em;
}

/* Section titles */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title-icon {
  background-color: #f3f4f6;
  border-radius: 0.25rem;
  padding: 0.25rem;
  font-size: 1.25rem;
}

/* Section description */
.section-desc {
  color: #4b5563;
  margin-bottom: 1.5rem;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.footer-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.footer-tag {
  background-color: #f3f4f6;
  color: #4b5563;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-quote {
  max-width: 28rem;
}

.footer-quote p {
  font-style: italic;
  margin-bottom: 0.25rem;
}

.footer-quote small {
  font-size: 0.75rem;
  color: #9ca3af;
}

.footer-right {
  text-align: left;
}

@media (min-width: 640px) {
  .footer-right {
    text-align: right;
  }
}

.footer-links {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .footer-links {
    justify-content: flex-end;
  }
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Reader-prompt overlay */
[data-component="typeface"] {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
}

.raised[data-component="typeface"] {
  block-size: var(--h);
  background: var(--content-fade);
  backdrop-filter: blur(var(--ui-blur));
  z-index: var(--ui-depth);
  -webkit-backdrop-filter: blur(var(--ui-blur));
}

.raised {
  --h: 100vh;
  --h: 100dvh;
}

.blink {
  align-items: center;
  position: absolute;
  inset-block-end: 0;
  block-size: max(360px, 45vh);
  display: flex;
  flex-direction: column;
  inset-inline: 0;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.blink h2 {
  font-size: 1.6rem;
  margin: 1rem 0 0.5rem;
  color: #1a1a1a;
}

.blink p {
  color: #555;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

/* Prompt buttons */
.primpast {
  background: #2563eb;
  color: white;
  border: none;
  font-weight: 500;
  transition: background 0.2s;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.primpast:hover {
  background: #1d4ed8;
}

.secondpast {
  margin-top: 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  background: none;
  border: none;
  color: #666;
  text-decoration: underline;
}

/* Floating action button (mobile) */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: #37352f;
  color: white;
  padding: 0.75rem;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.15s;
}

.fab:hover {
  background-color: #111827;
}

@media (min-width: 640px) {
  .fab {
    display: none;
  }
}

/* Prose content */
.prose {
  font-size: 1.125rem;
  color: #37352f;
  line-height: 1.75;
}

.prose p {
  margin-bottom: 1rem;
}

.prose .highlight {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  color: #1f2937;
  font-weight: 500;
}
