/* ─── Reset & Base ──────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #111;
  background: #fff;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

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

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
}

.header-logo-bar {
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 40px;
}

.logo {
  display: flex;
  justify-content: center;
}

.logo-img {
  height: 48px;
  width: auto;
  filter: brightness(0) invert(1);
}

.header-nav-bar {
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 40px;
  height: 42px;
  border-bottom: 3px solid #111;
}

/* ── Nav ────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  justify-self: center;
  grid-column: 2;
}

.nav-link {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.08em;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
  text-decoration: none;
}

.nav-link:hover { color: #111; }
.nav-link svg { transition: transform 0.2s; }

/* ── Dropdowns ──────────────────────────────────────────── */

.nav-dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 180px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 12px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 700;
}

.nav-dropdown.open .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown.open .nav-link svg {
  transform: rotate(180deg);
}

.dropdown-item {
  display: block;
  padding: 10px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.08em;
  color: #555;
  transition: color 0.15s, background 0.15s;
}

.dropdown-item:hover {
  color: #111;
  background: #fafafa;
}

/* ── Header icons ───────────────────────────────────────── */

.header-icons {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-self: end;
  grid-column: 3;
}

.icon-link {
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.icon-link:hover { color: #111; }

/* ─── Mosaic Grid (Pocket-style) ────────────────────────── */

.mosaic {
  margin-top: 117px; /* logo bar + nav bar */
}

.mosaic-row {
  display: flex;
  width: 100%;
}

/* ── Tile ───────────────────────────────────────────────── */

.tile {
  position: relative;
  overflow: hidden;
  display: block;
  height: 50vh;
  flex-shrink: 0;
}

.tile-half { width: 50%; }
.tile-full { width: 100%; }
.tile-hero { height: 100vh; }

.tile-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.tile:hover .tile-bg {
  transform: scale(1.03);
}

/* Dark overlay on hover */
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.tile:hover::after { opacity: 1; }

.tile-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px;
  z-index: 2;
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
}

.tile-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}

.tile-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 900;
  text-transform: none;
  color: #fff;
  line-height: 1.15;
}

.tile-hero .tile-title { font-size: 48px; }

/* ─── Latest / Editorial Section ───────────────────────── */

.latest {
  padding: 56px 0 80px;
  background: #fff;
}

.latest-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Editorial grid ─────────────────────────────────────── */

.editorial-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  align-items: stretch;
}

.editorial-feature {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.editorial-feature .editorial-img {
  flex: 1;
  min-height: 320px;
  overflow: hidden;
  position: relative;
  transition: opacity 0.3s;
}

.editorial-feature:hover .editorial-img { opacity: 0.88; }

.editorial-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.editorial-small {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.editorial-small .editorial-img {
  flex: 1;
  min-height: 140px;
  overflow: hidden;
  position: relative;
  transition: opacity 0.3s;
}

.editorial-small:hover .editorial-img { opacity: 0.88; }

.editorial-meta {
  padding: 14px 0 2px;
}

.editorial-category {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 5px;
}

.editorial-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #111;
  line-height: 1.1;
}

.editorial-feature .editorial-title { font-size: 28px; }

.editorial-desc {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #888;
  margin-top: 7px;
  line-height: 1.55;
}

@media (max-width: 768px) {
  .latest-inner { padding: 0 20px; }
  .editorial-grid { grid-template-columns: 1fr; }
  .editorial-stack { flex-direction: row; }
  .editorial-feature .editorial-img { min-height: 240px; }
  .editorial-small .editorial-img { min-height: 120px; }
}

@media (max-width: 480px) {
  .editorial-stack { flex-direction: column; }
  .editorial-feature .editorial-title { font-size: 22px; }
}

/* ─── Breadcrumb ────────────────────────────────────────── */

.breadcrumb {
  position: fixed;
  top: 117px; left: 0; right: 0;
  padding: 14px 40px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em;
  text-align: center;
  color: rgba(30,25,15,0.35);
  background: transparent;
  z-index: 10;
}
.breadcrumb a { color: rgba(30,25,15,0.35); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: rgba(30,25,15,0.75); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .current { color: rgba(30,25,15,0.65); }

@media (max-width: 768px) {
  .breadcrumb { top: 94px; padding: 12px 20px; }
}

/* ─── Footer ────────────────────────────────────────────── */

.footer {
  background: #fff;
  padding: 40px 0 32px;
  text-align: center;
  border-top: 1px solid #eee;
}

.footer-logo-img {
  height: 36px;
  width: auto;
  margin: 0 auto 24px;
  display: block;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-icons a {
  color: #555;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.footer-icons a:hover { color: #111; }

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 36px;
}

.footer-nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.08em;
  color: #777;
  transition: color 0.15s;
}

.footer-nav a:hover { color: #111; }

.back-to-top {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  transition: border-color 0.2s, background 0.2s;
  color: #555;
}

.back-to-top:hover {
  border-color: #111;
  background: #fafafa;
  color: #111;
}

.footer-copy {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #aaa;
}

/* ─── Books Page (Tetragrammaton-style) ────────────────── */

.books-page {
  margin-top: 117px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  padding: 60px 24px 80px;
}

.books-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.08em;
  color: #111;
  margin-bottom: 48px;
}

.books-grid {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.book-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
}

.book-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
  margin-bottom: 4px;
}

.book-author {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.book-note {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #999;
  line-height: 1.5;
}

.books-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 56px;
}

.pager-arrow {
  font-size: 18px;
  color: #111;
  text-decoration: none;
  transition: opacity 0.15s;
}

.pager-arrow:hover { opacity: 0.5; }

.pager-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #999;
}

@media (max-width: 480px) {
  .books-page { padding: 40px 16px 60px; }
  .books-heading { margin-bottom: 32px; }
  .books-grid { gap: 36px; }
}

/* ─── Hamburger ─────────────────────────────────────────── */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  justify-self: start;
  grid-column: 1;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #555;
  transition: all 0.25s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 117px;
  left: 0; right: 0;
  background: #fff;
  border-bottom: 3px solid #111;
  padding: 16px 0;
  z-index: 490;
  flex-direction: column;
}

.mobile-menu.open { display: flex; }

.mobile-menu-item {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #555;
  padding: 12px 24px;
  display: block;
  transition: color 0.15s;
}

.mobile-menu-item:hover { color: #111; }

.mobile-menu-sub {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  padding: 8px 24px 8px 40px;
}

.mobile-menu-sub:hover { color: #444; }

.mobile-menu-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 8px 0;
}

/* ─── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
  .header-logo-bar { padding: 10px 20px; }
  .header-nav-bar { padding: 0 20px; }

  /* Show hamburger, hide desktop nav + icons */
  .hamburger { display: flex; }
  .nav { display: none; }
  .header-icons { display: none; }

  /* Mobile header = 52px logo bar + 42px nav bar = 94px */
  .mobile-menu { top: 94px; }
  .mosaic { margin-top: 94px; }
  .books-page { margin-top: 94px; }

  .mosaic-row { flex-wrap: wrap; }
  .tile-half { width: 100%; height: 50vh; }
  .tile { height: 45vh; }
  .tile-hero { height: 70vh; }
  .tile-title { font-size: 22px; }
  .tile-hero .tile-title { font-size: 36px; }
}

@media (max-width: 480px) {
  .logo-img { height: 32px; }
  .tile { height: 40vh; }
  .tile-hero { height: 70vh; }
  .footer-nav { flex-wrap: wrap; }
}
