/* Cedarwick Press V5 — controlled editorial preview layer.
   Loaded last so Cedarwick-specific mobile and visual rules win over shared corporate responsive styles.
   Fiction asset routing lives separately in cedarwick-v5-book-assets.css so approved art and layout rules cannot drift together.
   This file is preview-only until Founder visual approval. */

.cedarwick-site {
  --cw-paper: #faf5ec;
  --cw-parchment: #eee2d2;
  --cw-ink: #202624;
  --cw-cedar: #263d35;
  --cw-brass: #aa7f3f;
  --cw-oxblood: #6a303b;
  --cw-navy: #0d2230;
  --cw-gold: #c79b4f;
  --cw-rule: rgba(32, 38, 36, .19);
  background:
    radial-gradient(circle at 88% 7%, rgba(199, 155, 79, .055), transparent 26rem),
    var(--cw-paper);
}

/* One deliberate masthead system. */
.cedarwick-site-header {
  background: rgba(250, 245, 236, .97);
  border-bottom-color: rgba(170, 127, 63, .34);
  box-shadow: 0 8px 30px rgba(13, 34, 48, .035);
}

.cedarwick-header-inner {
  position: relative;
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
}

.cedarwick-header-brand {
  width: fit-content;
  max-width: 100%;
  gap: .8rem;
}

.cedarwick-header-icon {
  width: 54px;
  height: 54px;
}

.cedarwick-header-wordmark {
  width: clamp(178px, 17vw, 218px);
}

.cedarwick-primary-nav a {
  color: var(--cw-navy);
  font-weight: 650;
}

.cedarwick-primary-nav a:hover,
.cedarwick-primary-nav a[aria-current="page"] {
  color: var(--cw-oxblood);
}

.cedarwick-site .nav-toggle span:not(.sr-only) {
  width: 30px;
  height: 2px;
  margin: 6px 0;
  background: var(--cw-navy);
}

/* The press opens with identity, but gets readers to the books sooner. */
.cw-masthead {
  padding: clamp(3.7rem, 7vw, 6.8rem) 1.5rem clamp(3.8rem, 7vw, 6.4rem);
  background:
    radial-gradient(circle at 50% 1%, rgba(199, 155, 79, .09), transparent 23rem),
    linear-gradient(180deg, rgba(255,255,255,.3), transparent 42%),
    var(--cw-paper);
}

.cw-masthead-inner {
  width: min(890px, 100%);
}

.cw-masthead-icon {
  width: min(205px, 46vw);
}

.cw-masthead-wordmark {
  width: min(405px, 76vw);
}

.cw-masthead-brand {
  margin-bottom: 1.7rem;
}

.cw-masthead-brand p {
  color: rgba(32, 38, 36, .62);
}

.cw-masthead-rule {
  width: min(360px, 68vw);
  margin-bottom: 1.8rem;
}

.cw-masthead h1 {
  max-width: 730px;
  font-size: clamp(2.55rem, 5vw, 4.35rem);
  text-wrap: balance;
}

.cw-masthead-deck {
  max-width: 700px;
  margin-top: 1.35rem;
  color: rgba(32, 38, 36, .76);
}

/* Featured title feels like an editorial opening spread rather than a card. */
.cw-featured {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 40%, rgba(199, 155, 79, .12), transparent 26rem),
    linear-gradient(135deg, #20362f, var(--cw-cedar));
}

.cw-featured::after {
  content: "";
  position: absolute;
  width: min(34vw, 470px);
  aspect-ratio: 1;
  right: -12%;
  bottom: -42%;
  border: 1px solid rgba(239, 226, 210, .11);
  border-radius: 50%;
  pointer-events: none;
}

.cw-featured-grid {
  position: relative;
  z-index: 1;
  gap: clamp(3rem, 7vw, 6.5rem);
}

.cw-featured-copy h2 {
  text-wrap: balance;
}

/* Presentation treatment only. Approved fiction asset selection is isolated in cedarwick-v5-book-assets.css. */
.cedarwick-site .cw-book-cover-link img,
.cedarwick-site .publishing-3d-art {
  object-fit: contain;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 24px 25px rgba(13, 34, 48, .15));
}

/* Current & forthcoming: full editorial title features instead of uneven small cards. */
.cw-catalog {
  padding: clamp(4.7rem, 8vw, 7.8rem) 0;
}

.cw-section-heading {
  margin-bottom: clamp(2.2rem, 5vw, 4rem);
}

.cw-book-shelf {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.cw-book-entry,
.cw-book-entry-1,
.cw-book-entry-2,
.cw-book-entry-3 {
  grid-column: auto;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(255px, .82fr) minmax(0, 1.18fr);
  grid-template-rows: none;
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6.5rem);
  padding: clamp(3.2rem, 7vw, 6.2rem) 0;
  border-top: 1px solid var(--cw-rule);
}

.cw-book-entry:last-child {
  border-bottom: 1px solid var(--cw-rule);
}

.cw-book-entry:nth-child(even) .cw-book-cover-link {
  order: 2;
}

.cw-book-entry:nth-child(even) .cw-book-meta {
  order: 1;
}

.cw-book-cover-link {
  display: grid;
  place-items: center;
  min-height: clamp(360px, 42vw, 570px);
}

.cw-book-cover-link img {
  width: min(100%, 480px);
  max-height: 570px;
}

.cw-book-meta {
  max-width: 610px;
  padding-top: 0;
}

.cw-book-meta h3 {
  max-width: 580px;
  margin-top: .65rem;
  font-size: clamp(2.15rem, 4.6vw, 4.2rem);
  line-height: 1.02;
  text-wrap: balance;
}

.cw-book-meta > p:not(.cw-book-status):not(.cw-book-category):not(.cw-book-author) {
  max-width: 570px;
  font-size: 1.02rem;
  line-height: 1.76;
}

.cw-book-author {
  font-size: 1.04rem;
}

/* Editorial sections use rules and spacing instead of corporate card language. */
.cw-shelves {
  background:
    linear-gradient(90deg, rgba(199,155,79,.05), transparent 22%, transparent 78%, rgba(199,155,79,.04)),
    var(--cw-parchment);
}

.cw-shelf-columns article {
  min-height: 285px;
}

.cw-shelf-columns h3 {
  text-wrap: balance;
}

.cw-colophon-grid {
  max-width: 1020px;
}

.cw-info-list article h2,
.cw-info-list article h3 {
  text-wrap: balance;
}

.cedarwick-site-footer {
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 30%),
    var(--cw-parchment);
}

/* Mobile navigation is a Cedarwick panel, never the shared corporate overlay.
   This explicitly fixes the dark-on-dark menu state visible in production screenshots. */
@media (max-width: 980px) {
  .cedarwick-header-inner {
    min-height: 86px;
  }

  .cedarwick-site .cedarwick-primary-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 90;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .55rem 0;
    border: 1px solid rgba(170, 127, 63, .32);
    border-top: 0;
    border-radius: 0;
    background: rgba(250, 245, 236, .995);
    box-shadow: 0 24px 50px rgba(13, 34, 48, .16);
  }

  .cedarwick-site .cedarwick-primary-nav[data-open="true"] {
    display: flex;
  }

  .cedarwick-site .cedarwick-primary-nav a {
    display: block;
    padding: .88rem 1.15rem;
    color: var(--cw-navy) !important;
    font-size: 1rem;
    line-height: 1.3;
  }

  .cedarwick-site .cedarwick-primary-nav a::after {
    display: none;
  }

  .cedarwick-site .cedarwick-primary-nav a:hover,
  .cedarwick-site .cedarwick-primary-nav a:focus-visible,
  .cedarwick-site .cedarwick-primary-nav a[aria-current="page"] {
    background: rgba(170, 127, 63, .09);
    color: var(--cw-oxblood) !important;
  }
}

@media (max-width: 760px) {
  .cw-masthead {
    padding: 3.25rem 1rem 3.8rem;
  }

  .cw-masthead-brand {
    gap: .38rem;
    margin-bottom: 1.35rem;
  }

  .cw-masthead-icon {
    width: min(175px, 45vw);
  }

  .cw-masthead-wordmark {
    width: min(350px, 82vw);
  }

  .cw-masthead h1 {
    font-size: clamp(2.3rem, 10.2vw, 3.5rem);
  }

  .cw-masthead-deck {
    font-size: 1.06rem;
    line-height: 1.68;
  }

  .cw-book-entry,
  .cw-book-entry-1,
  .cw-book-entry-2,
  .cw-book-entry-3 {
    grid-template-columns: 1fr;
    gap: 1.7rem;
    padding: 3.2rem 0 3.7rem;
  }

  .cw-book-entry:nth-child(even) .cw-book-cover-link,
  .cw-book-entry:nth-child(even) .cw-book-meta {
    order: initial;
  }

  .cw-book-cover-link {
    min-height: 0;
  }

  .cw-book-cover-link img {
    width: min(100%, 470px);
    max-height: 530px;
  }

  .cw-book-meta h3 {
    font-size: clamp(2rem, 9.5vw, 3.15rem);
  }
}

@media (max-width: 560px) {
  .cedarwick-header-inner {
    min-height: 76px;
  }

  .cedarwick-header-brand {
    gap: .45rem;
  }

  .cedarwick-header-icon {
    width: 40px;
    height: 40px;
  }

  .cedarwick-header-wordmark {
    width: min(152px, 45vw);
  }

  .cedarwick-site .nav-toggle {
    padding: 6px;
  }

  .cedarwick-site .cedarwick-primary-nav a {
    padding: .9rem 1rem;
  }

  .cw-masthead-rule {
    width: min(290px, 72vw);
  }

  .cw-featured-grid {
    gap: 2.2rem;
  }

  .cw-book-cover-link img {
    width: min(100%, 430px);
  }
}
