/* 43 Evergreen Gardens, Carramar
   RIZE Property single property landing page

   Colours and type are the RIZE brand kit, from
   rizeproperty.com.au/our-meeting-v4/

   Breakpoints: mobile up to 767px, tablet 768 to 1024px, desktop 1025px up.
   Only mobile needs rules. clamp() and a fluid container carry the rest. */


/* Fonts
   ------------------------------------------------------------------------ */

/* Four faces, which is every weight the page actually asks for. Headings are
   Ivy Mode 400, body copy Questrial 400, labels Montserrat 600 and 700. */

@font-face {
  font-family: "Ivy Mode";
  src: url("../fonts/IvyMode-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Questrial";
  src: url("../fonts/Questrial-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* Tokens
   ------------------------------------------------------------------------ */

:root {
  --black: #010101;
  --charcoal: #1a1a1c;
  --line: #232326;
  --label: #6f6a61;
  --stone: #ccc8c0;
  --offwhite: #f8f8f8;
  --white: #ffffff;
  --text: #333333;
  --orange: #f08419;

  --font-display: "Ivy Mode", Georgia, "Times New Roman", serif;
  --font-body: "Questrial", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1140px;
  --wrap-text: 640px;
  --gutter: 20px;
  --gap: 16px;
  --section-space: clamp(72px, 9vw, 130px);

  /* The shape every photo is shown in. Change it here and the page follows. */
  --photo: 3 / 2;
}


/* Base
   ------------------------------------------------------------------------ */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  color: var(--black);
}

h1 {
  font-size: clamp(2.75rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2.25rem, 4vw, 3.125rem);
}

h3 {
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
}

p {
  margin: 0 0 1.1em;
}

p:last-child {
  margin-bottom: 0;
}


/* Shared pieces
   ------------------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin: 0 0 22px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
}

.button {
  display: inline-block;
  padding: 18px 28px 16px;
  border-radius: 50px;
  background: var(--orange);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
  transition: background 0.25s ease;
}

.button:hover,
.button:focus-visible {
  background: #ff9c3c;
}


/* Site header
   ------------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--black);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  padding-block: 14px;
}

.site-header__logo img {
  width: 122px;
}

@media (max-width: 767px) {
  .site-header__inner {
    min-height: 68px;
  }

  .site-header__logo img {
    width: 96px;
  }

  .site-header .button {
    font-size: 11px;
    padding: 15px 18px 13px;
  }
}


/* Hero
   ------------------------------------------------------------------------ */

.hero {
  padding-block: clamp(56px, 8vw, 104px) clamp(40px, 5vw, 64px);
  background: radial-gradient(at 50% 0%, rgba(240, 132, 25, 0.13) 0%, rgba(240, 132, 25, 0) 70%),var(--black);
  text-align: center;
}

.hero .eyebrow {
  color: var(--orange);
}

.hero h1 {
  max-width: 15ch;
  margin-inline: auto;
  color: var(--white);
}

.hero__lead {
  max-width: 54ch;
  margin: 28px auto 0;
  color: var(--stone);
}


/* Video
   ------------------------------------------------------------------------ */

/* Shared by the poster button and by the YouTube player that replaces it, so
   nothing shifts at the moment of the swap. 16:9 because both videos will be. */
.video {
  display: block;
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  background: var(--charcoal);
  border: 0;
}

.hero .video {
  margin-top: clamp(40px, 5vw, 64px);
}

/* The poster button. Nothing is fetched from YouTube until this is clicked. */
.video--poster {
  position: relative;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

/* "contain" lets the poster, which is not 16:9, sit inside the frame whole
   rather than being cropped to fill it. */
.video__poster {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--white);
  transition: background 0.25s ease, transform 0.25s ease;
}

/* A triangle drawn from borders, so the play mark needs no file of its own.
   The 4px nudge sets it on the optical centre rather than the measured one. */
.video__play::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  transform: translateX(4px);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent var(--charcoal);
}

.video--poster:hover .video__play,
.video--poster:focus-visible .video__play {
  background: var(--orange);
  transform: scale(1.06);
}

.video--poster:hover .video__play::before,
.video--poster:focus-visible .video__play::before {
  border-left-color: var(--white);
}


/* Key facts
   ------------------------------------------------------------------------ */

.facts {
  padding-block: clamp(44px, 5vw, 64px);
  background: var(--charcoal);
}

.facts__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px 20px;
  text-align: center;
}

.facts__value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  line-height: 1;
  color: var(--white);
}

.facts__label {
  margin-top: 12px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}

@media (max-width: 767px) {
  .facts__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .facts__item:last-child {
    grid-column: 1 / -1;
  }
}


/* Chapters
   ------------------------------------------------------------------------ */

.chapter {
  padding-block: var(--section-space);
}

.chapter + .chapter {
  padding-top: 0;
}

.chapter--lead {
  text-align: center;
}

.chapter__lead {
  max-width: 62ch;
  margin-inline: auto;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  color: var(--black);
}


/* Section heading block, used by chapters, the owner interview and contact
   ------------------------------------------------------------------------ */

.section-head {
  max-width: var(--wrap-text);
  margin: 0 auto clamp(40px, 5vw, 64px);
  text-align: center;
}

.section-head h2 {
  margin-bottom: 26px;
}

/* A section with no images below it carries no trailing space. */
.section-head:last-child {
  margin-bottom: 0;
}


/* Photographs
   ------------------------------------------------------------------------ */

/* Files are never cropped. Every JPEG is the full frame the photographer
   delivered. The 3:2 window below is CSS only, so the grid reads evenly while
   scrolling, and the lightbox gives back the whole frame on click. */

.feature,
.gallery img {
  width: 100%;
  aspect-ratio: var(--photo);
  object-fit: cover;
  cursor: zoom-in;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.feature + .gallery {
  margin-top: var(--gap);
}

/* An odd-numbered gallery would leave its last photo alone beside a gap.
   Let it run the full width and close the section instead. */
.gallery img:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

@media (max-width: 767px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}


/* Owner interview
   ------------------------------------------------------------------------ */

.owners {
  padding-block: var(--section-space);
  background: var(--offwhite);
}


/* Contact
   ------------------------------------------------------------------------ */

.contact {
  padding-block: var(--section-space);
  text-align: center;
}

/* Narrower than the heading above it so the line turns after "questions,"
   and Peter's number is not stranded on its own line. */
.contact__note {
  max-width: 30rem;
  margin-inline: auto;
}

.agent {
  margin-top: clamp(40px, 5vw, 56px);
}

.agent__photo {
  width: 148px;
  margin-inline: auto;
  border-radius: 50%;
  background: var(--stone);
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top center;
}

.agent__name {
  margin: 22px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
  line-height: 1;
  color: var(--black);
}

.agent__role {
  margin: 0 0 28px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}


/* Site footer
   ------------------------------------------------------------------------ */

.site-footer {
  padding-block: 44px;
  background: var(--black);
  text-align: center;
}

.site-footer img {
  width: 120px;
  margin-inline: auto;
}


/* Lightbox, built by main.js
   ------------------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(1, 1, 1, 0.94);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  display: flex;
}

.lightbox.is-shown {
  opacity: 1;
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: min(1400px, 92vw);
  max-height: 88vh;
  margin: 0;
}

/* The whole frame, scaled to fit. Nothing is cut off. */
.lightbox__figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__figure figcaption {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  text-align: center;
}

.lightbox__count {
  margin-left: 14px;
  color: var(--label);
}

.lightbox button {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  opacity: 1;
}

.lightbox__close {
  top: 22px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-family: var(--font-body);
  font-size: 34px;
}

.lightbox__nav {
  top: 50%;
  width: 56px;
  height: 56px;
  margin-top: -28px;
}

.lightbox__nav::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin-inline: auto;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.lightbox__nav--prev {
  left: 12px;
}

.lightbox__nav--prev::before {
  transform: rotate(-135deg);
}

.lightbox__nav--next {
  right: 12px;
}

.lightbox__nav--next::before {
  transform: rotate(45deg);
}

/* Swiping replaces the arrows on a touch screen. */
@media (max-width: 767px) {
  .lightbox__nav {
    display: none;
  }

  .lightbox__figure {
    max-width: 100vw;
  }

  .lightbox__figure img {
    max-height: 72vh;
  }
}


/* Scroll entrance
   ------------------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lightbox {
    transition: none;
  }

  .video__play {
    transition: none;
  }

  .video--poster:hover .video__play,
  .video--poster:focus-visible .video__play {
    transform: none;
  }
}
