/* ==========================================================================
   Hero follow-up (v4), for the 2 Dec content package layout.
   Loads after css/styles.css. Adds one token (--ink). The four-step
   "From policy to permit" band is not touched.
   1. Bigger, bolder Ink wordmark
   2. "Explore services" hero tag, as a link
   3. "Ways Michael can help" Services strip (replaces the old Services section)
   4. Tablet header fix
   ========================================================================== */

:root {
  --ink: #16212C;
}

/* 1. Wordmark: Plus Jakarta Sans ExtraBold in Ink. No box, lines or ticks.
   The font is already self-hosted for the headings. */
.brand,
.site-lines {
  color: var(--ink);
}

.site-lines {
  min-width: 128px;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 800;
  font-synthesis: none;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

@media (max-width: 799px) {
  .site-lines {
    min-width: 0;
    font-size: 1.5rem;
  }
}

/* The footer is dark, so its wordmark stays light. */
.site-footer .brand,
.site-footer .site-lines {
  color: var(--sky-100);
}

/* 4. Tablet widths (800 to 959px): the full nav, the bigger wordmark and the long
   call button do not fit on one row. The same call button is right below in the
   hero, so the header copy steps aside until there is room (960px and up). */
@media (min-width: 800px) and (max-width: 959px) {
  .header-cta {
    display: none;
  }
}

/* 2. Hero action button (was the yellow tag). A real secondary button:
   Marigold pill, Ink text (8.67:1), arrow in a small Ink disc, 44px high, shown at
   every width. It stays smaller and lighter than the sky-blue "Book a 20-minute
   project call" button (48px, solid blue, full width on phones), so the call
   button remains the main action. */
a.hero-tag {
  position: absolute;
  z-index: 2;
  left: 0.85rem;
  bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  max-width: calc(100% - 1.7rem);
  min-height: 2.75rem;
  margin: 0;
  padding: 0.35rem 0.4rem 0.35rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--marigold);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 33, 44, 0.28);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

@media (min-width: 960px) {
  a.hero-tag {
    left: 1rem;
    bottom: 1.15rem;
    max-width: calc(100% - 2rem);
  }
}

a.hero-tag .arrow-disc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--marigold);
  transition: transform 0.15s ease;
}

a.hero-tag .arrow {
  display: block;
}

a.hero-tag:hover {
  background: #e5a11f;           /* deeper Marigold; Ink on it is 7.34:1 */
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(22, 33, 44, 0.34);
  transform: translateY(-1px);
}

a.hero-tag:hover .arrow-disc {
  transform: translateX(2px);
}

a.hero-tag:active {
  background: #d4931a;           /* pressed; Ink on it is 6.2:1 */
  box-shadow: 0 1px 4px rgba(22, 33, 44, 0.3);
  transform: none;
}

/* The button sits on a dark coat, so focus is a white ring outside the Ink border. */
a.hero-tag:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--white), 0 2px 8px rgba(22, 33, 44, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  a.hero-tag:hover,
  a.hero-tag:hover .arrow-disc {
    transform: none;
  }
}

/* 3. Services strip. It sits right under the four-step band. The hero already
   has bottom padding, so the strip needs none on top. The band above is white;
   the strip is sky, with white cards, so the two read as different things. */
.services-strip {
  padding-top: 0;
}

.services-strip .card {
  background: var(--white);
}

.services-strip .card-link {
  text-underline-offset: 0.18em;
}

/* ==========================================================================
   v4 additions
   ========================================================================== */

/* 5. Services strip, four services. Strongest, most repeatable work first.
   One column on phones, 2 x 2 on tablets, one row of four on wide screens. */
.services-strip .cards-services {
  gap: 1rem;
}

.services-strip .cards-services .card {
  min-height: 0;
  padding: 1.5rem 1.35rem 1.35rem;
}

.services-strip .card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1875rem;
}

.services-strip .card p {
  margin-bottom: 1.1rem;
}

.services-strip .card .card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  text-decoration: none;
  font-weight: 600;
}

.services-strip .card .card-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.services-strip .arrow {
  display: block;
  flex: none;
  transition: transform 0.15s ease;
}

.services-strip .card-link:hover .arrow {
  transform: translateX(3px);
}

@media (min-width: 1100px) {
  .services-strip .cards-services {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 640px) and (max-width: 1099px) {
  .services-strip .cards-services {
    grid-template-columns: 1fr 1fr;
  }
}

/* The closing line under the cards: a text link, not a fifth card. */
.services-more {
  margin: 1.5rem 0 0;
  font-weight: 600;
}

.services-more a,
.inline-cta a {
  display: inline-block;
  padding: 0.65rem 0;
  color: var(--sky-600);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.services-more .arrow,
.inline-cta .arrow {
  display: inline-block;
  margin-left: 0.3rem;
  vertical-align: -0.12em;
  transition: transform 0.15s ease;
}

.services-more a:hover .arrow,
.inline-cta a:hover .arrow {
  transform: translateX(3px);
}

/* 6. Hero photo. The new headshots are grey-backed, so the card gets a soft
   Sky 100 plate behind it. It lifts the photo off the Sky 50 page without any
   lines. On photos with a tie, the button moves to the right so it never
   covers the tie (hero-media photo-1, photo-3). */
.hero-media::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 12px -12px -12px 12px;
  border-radius: 22px;
  background: var(--sky-100);
}

@media (min-width: 960px) {
  .hero-media::before {
    inset: 14px -14px -14px 14px;
    border-radius: 30px;
  }
}

.hero-media img {
  background: var(--sky-100);
}

/* Photos 1 and 3 have a tie that runs to the bottom edge of the card, so the
   button hangs over the bottom edge (half on the photo, half below it) at the
   right, clear of the face, chin and tie. */
.hero-media.photo-1 a.hero-tag,
.hero-media.photo-3 a.hero-tag {
  left: auto;
  right: 0.85rem;
  bottom: -1.375rem;
}

.hero-media.photo-1,
.hero-media.photo-3 {
  margin-bottom: 1.75rem;
}

@media (min-width: 960px) {
  .hero-media.photo-1 a.hero-tag,
  .hero-media.photo-3 a.hero-tag {
    right: 1rem;
    bottom: -1.375rem;
  }

  .hero-media.photo-1,
  .hero-media.photo-3 {
    margin-bottom: 0;
  }
}

/* 7. Header button is now "Send a project brief" (shorter, so it fits at 800px
   and up). It replaces the v3 rule that hid the call button at 800 to 959px. */
@media (min-width: 800px) and (max-width: 959px) {
  .header-cta {
    display: inline-flex;
  }
}

/* 8. The phone call bar is gone, so no space is reserved for it. */
body.show-callbar {
  padding-bottom: 0;
}

/* 9. Section rhythm now that the mid-page call band and the Approach section
   are gone: Work (sky), About (white), Community (sky), Contact (white). */
#community.section-white {
  background: transparent;
}

#community.section-white .card,
#community.section-white .step {
  background: var(--white);
}

/* 10. About portrait, from the second headshot. */
@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 3.5rem;
  }
}

.about-figure {
  position: relative;
  max-width: 14rem;
}

@media (min-width: 960px) {
  .about-figure {
    max-width: 16rem;
  }
}

.about-figure .portrait {
  position: relative;
  z-index: 1;
  border-color: var(--sky-200);
  border-radius: 20px;
  background: var(--sky-100);
  object-position: center 8%;
}

.about-figure::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 10px -10px -10px 10px;
  border-radius: 20px;
  background: var(--sky-100);
}

/* 11. Centre the "at a glance" strip. `.trust ul { margin: 0 }` in styles.css
   overrides the auto side margins from .wrap, so the strip sat to the left on
   wide screens. */
.trust ul {
  margin-right: auto;
  margin-left: auto;
}

/* ==========================================================================
   QA fixes (2 Dec, after independent QA of the preview)
   ========================================================================== */

/* 12. Header, 800 to 859px: "How it works" wrapped onto two lines and the long
   header button crowded the nav. Keep the links on one line, and let the
   hero's own buttons carry the call to action until there is room. */
.primary-nav a {
  white-space: nowrap;
}

@media (min-width: 800px) and (max-width: 859px) {
  .header-cta {
    display: none;
  }
}

/* 13. "At a glance" strip on phones (719px and down): the old rule made the last
   item span both columns, which left "2018" alone. Four items sit in a 2 x 2. */
@media (max-width: 719px) {
  .trust li:last-child {
    grid-column: auto;
  }
}

/* 14. "Full credentials" summary: 44px tap target. It stays a list item
   (not flex) so the disclosure triangle still shows. */
.creds summary {
  min-height: 2.75rem;
  line-height: 2.75rem;
}

/* 15. Short pages (404): keep the footer at the bottom of the window. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

/* 16. Hero photo on tablets (600 to 959px): the card ran the full width of the
   page, about 780px wide and 1,040px tall. Cap it near the phone-to-desktop
   size. The image `sizes` hint in index.html matches this width. */
@media (min-width: 600px) and (max-width: 959px) {
  .hero-media {
    max-width: 26rem;
  }
}

/* ==========================================================================
   Round 3 (2 Dec, Michael's requests)
   ========================================================================== */

/* 17. About portrait: the earlier portrait (3:4), shown whole. The v4 crop is
   gone, so no object-position or forced aspect ratio is needed. */
.about-figure .portrait {
  aspect-ratio: 1095 / 1460;
  object-fit: contain;
  object-position: center;
}

/* 18. One heading style for every section. Plus Jakarta Sans 800 on every h1
   and h2 at one size, and the same family and weight on h3 and h4 card and
   list titles. The "From policy to permit, in four steps." title was smaller
   (1.5rem) than the other h2s, and some titles were Inter 600. */
.path-title {
  margin: 0;
  font-size: clamp(1.75rem, 2.6vw, 2.375rem);
  line-height: 1.08;
}

h3,
.card h3,
.step h3,
.feature-card > h3,
.path-step h3,
.service-item h3,
.cred-groups h3,
.example-card h4,
.access-key h4 {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.trust strong {
  font-family: var(--serif);
  font-weight: 800;
}

/* 19. Community development and public art. */
.community-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .community-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .community-photos {
    grid-template-columns: 1fr 1fr;
  }
}

.community-card {
  min-height: 0;
}

.community-card .tag {
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.community-photo {
  margin: -0.15rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--sky-200);
  border-radius: 12px;
  background: var(--sky-50);
}

.community-photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* 20. Accessible features key under the garden suite plan. */
.access-key {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--sky-200);
  border-radius: 12px;
  background: var(--sky-50);
}

.access-key h4 {
  margin: 0 0 0.6rem;
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--sky-950);
}

.access-key ol {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.access-key li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 1rem;
  line-height: 1.4;
}

.key-num {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--sky-600);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.access-key .key-note {
  margin: 0.75rem 0 0;
  color: var(--sky-700);
  font-size: 0.9375rem;
}

/* Photo cards sit in their own two-up row, so text-only cards stay compact. */
@media (min-width: 720px) {
  .community-photos {
    grid-template-columns: 1fr 1fr;
    margin-top: 1.25rem;
  }
}

.community-photos {
  margin-top: 1.25rem;
}

.community-note {
  margin: 1.5rem 0 0;
  color: var(--sky-950);
  font-size: 1.0625rem;
}

/* Work menu: Current projects and Past work */
.nav-has-menu {
  position: relative;
}

.nav-menu {
  position: relative;
}

.nav-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  color: var(--sky-700);
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

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

.nav-menu > summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.nav-menu[open] > summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.nav-submenu {
  position: absolute;
  top: calc(100% - 0.15rem);
  left: 0;
  z-index: 6;
  min-width: 12.5rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--sky-50);
  border: 1px solid var(--sky-200);
  box-shadow: 0 10px 24px rgba(13, 47, 79, 0.1);
}

.primary-nav .nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.primary-nav .nav-submenu a {
  display: flex;
  width: 100%;
  padding: 0.35rem 0.9rem;
  white-space: nowrap;
}

.nav-menu > summary:hover,
.nav-menu > summary:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 799px) {
  .nav-submenu {
    position: static;
    min-width: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0.2rem 0.75rem;
  }
}

/* Past work is its own page. Match the section-heading size, not the hero. */
.page-past-work h1 {
  font-size: clamp(1.75rem, 2.6vw, 2.375rem);
}
