/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap");

:root {
  --bg: #f6f1ea;
  --ink: #1c1916;
  --muted: #6f6257;
  --accent: #cb4f27;
  --accent-deep: #9b3b1c;
  --surface: #fffdf8;
  --surface-2: #f2e9de;
  --border: rgba(28, 25, 22, 0.12);
  --shadow: 0 24px 60px rgba(28, 25, 22, 0.12);
  --shadow-soft: 0 12px 24px rgba(28, 25, 22, 0.08);
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Fraunces", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #fff5e7 0%, #f6f1ea 45%, #efe5d9 100%);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.7;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav .nav-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 0.2rem;
}

.site-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

.site-nav .nav-link:hover::after,
.site-nav .nav-link:focus-visible::after {
  width: 100%;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  opacity: 0.8;
  transition: transform 0.18s ease;
  margin-top: -0.1rem;
}

.nav-dropdown[open] > summary::before {
  transform: rotate(45deg);
}

.nav-popover {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 14rem;
  max-height: min(60vh, 22rem);
  overflow: auto;
  background: rgba(255, 253, 248, 0.98);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 0.65rem;
  display: grid;
  gap: 0.15rem;
}

.nav-popover-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
}

.nav-popover-link:hover,
.nav-popover-link:focus-visible {
  outline: none;
  background: var(--surface-2);
  color: var(--accent-deep);
}

.hero {
  background: linear-gradient(120deg, rgba(203, 79, 39, 0.15), rgba(255, 253, 248, 0.85));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 3rem;
}

.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent-deep);
  font-weight: 600;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 0.5rem 0 1rem;
  line-height: 1.1;
}

.hero .lede {
  font-size: 1.15rem;
  max-width: 620px;
  color: var(--muted);
}

article {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

article img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.6rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.8rem;
  margin: 2.5rem 0 1.25rem;
}

p {
  margin: 0 0 1.2rem;
}

a {
  color: var(--accent);
}

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

.post-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.post-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.home-posts-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 0 0 1rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.post-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.post-card a {
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.post-card a:hover {
  color: var(--accent);
}

.yt-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 1.5rem 0;
  box-shadow: 0 12px 28px rgba(31, 27, 22, 0.12);
}

.yt-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pagination {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  color: var(--muted);
  font-weight: 600;
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 3rem;
  background: rgba(255, 253, 248, 0.8);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    gap: 1rem;
  }

  .nav-popover {
    left: 0;
    right: auto;
  }

  .hero {
    padding: 2rem;
  }

  article {
    padding: 2rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  main {
    padding: 2rem 1.25rem 4rem;
  }

  .hero {
    padding: 1.75rem;
  }
}
