/* 03-layout.css — App shell, navbar, hero, footer, page structure */

/* ─── Film Grain Overlay ─── */

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ─── App Shell ─── */

.app-shell {
  position: relative;
}

.app-navbar {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-accent);
  z-index: 1030;
}

.navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  color: var(--ivory-100);
}

.brand-dot {
  color: var(--amber-400);
  margin: 0 0.05em;
  font-weight: 700;
}

.brand-tagline {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.35rem;
  color: var(--amber-400);
}

.navbar .nav-link {
  color: var(--ivory-300);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--duration-normal) ease;
  position: relative;
  padding-bottom: 0.6rem;
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
  color: var(--ivory-100);
}

.navbar .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.5rem;
  right: 0.5rem;
  height: 1px;
  background: var(--amber-400);
}

.navbar .btn {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.navbar .dropdown-menu {
  background: var(--noir-800);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}

.navbar .dropdown-item {
  color: var(--ivory-200);
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background: rgba(212, 168, 83, 0.1);
  color: var(--amber-300);
}

.navbar .dropdown-divider {
  border-color: var(--border-default);
}

.navbar-toggler {
  border-color: var(--border-accent-hover);
}

.navbar-toggler-icon {
  filter: invert(1) brightness(0.8);
}

/* ─── Mobile Nav (collapsed state) ─── */

@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--noir-800);
    border-top: 1px solid var(--border-accent);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: var(--space-4) 0;
    margin-top: var(--space-2);
  }

  .navbar-nav {
    padding: 0 var(--space-3);
  }

  .navbar .nav-link {
    padding: 0.75rem var(--space-4);
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
  }

  .navbar .nav-link.active {
    border-left-color: var(--amber-400);
    background: rgba(212, 168, 83, 0.06);
  }

  .navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .navbar .d-flex.align-items-center {
    padding: var(--space-3) var(--space-4);
    margin-top: var(--space-2);
    border-top: 1px solid var(--border-default);
  }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.75rem 1.5rem;
  background: var(--amber-400);
  color: var(--noir-950);
  z-index: 2000;
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  border-radius: var(--radius-sm);
  color: var(--noir-950);
}

.app-main {
  padding: 3rem 0 4rem;
}

/* ─── HTMX Indicators ─── */

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* ─── Hero (Homepage) ─── */

.hero {
  position: relative;
  padding: 4rem 0 3rem;
  background: var(--noir-950);
  color: var(--ivory-100);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 50%, rgba(139, 41, 66, 0.2), transparent 70%),
    radial-gradient(ellipse 600px 400px at 80% 30%, rgba(212, 168, 83, 0.15), transparent 70%),
    radial-gradient(ellipse 1200px 800px at 50% 100%, rgba(139, 41, 66, 0.08), transparent 60%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero__title {
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 1rem 0 1.5rem;
  letter-spacing: -0.03em;
}

.hero__title em {
  font-style: italic;
  color: var(--amber-400);
}

.hero__lead {
  font-size: 1.15rem;
  color: var(--ivory-300);
  max-width: 32rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.hero__panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  color: var(--ivory-100);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
}

.hero__panel h3 {
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber-400);
  margin-bottom: 1.5rem;
}

.hero__list {
  display: grid;
  gap: 0;
}

.hero__list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-default);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ivory-100);
}

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

.hero__list-item span {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory-400);
}

/* ─── Sections ─── */

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--ivory-300);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* ─── Page Header ─── */

/* Browse page header */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--space-5) 0 var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -9999px;
  right: -9999px;
  bottom: 0;
  background: linear-gradient(180deg, rgba(139, 41, 66, 0.04) 0%, transparent 100%);
  z-index: -1;
}

.page-header__eyebrow {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--amber-400);
  margin-bottom: var(--space-1);
}

.page-header__title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.page-header__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--ivory-100);
  letter-spacing: -0.02em;
  margin: 0;
}

.page-header__count {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  font-size: 0.7rem;
  color: var(--ivory-300);
}

.page-header__description {
  font-size: 0.85rem;
  color: var(--ivory-200);
  margin-top: var(--space-1);
  max-width: 360px;
  line-height: 1.5;
}

.page-header h1 {
  font-size: 2.5rem;
}

.page-header p {
  color: var(--ivory-300);
  margin-bottom: 0;
}

/* ─── Footer ─── */

footer {
  background: var(--noir-900);
  color: var(--ivory-300);
  border-top: 1px solid var(--border-default);
}

footer a {
  color: var(--ivory-200);
  transition: color var(--duration-normal) ease;
}

footer a:hover {
  color: var(--amber-400);
}

footer .footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ivory-100);
}

footer h6 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ivory-400);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

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

footer .footer-links li + li {
  margin-top: 0.5rem;
}

footer .footer-links a {
  font-size: 0.9rem;
  color: var(--ivory-300);
}

footer .footer-links a:hover {
  color: var(--amber-400);
}
