/* M&D Foundations: company, projects & contact page extras
   (loaded with `css: pages` in a page's meta block; site.css stays untouched) */

/* ---------- project galleries: caption cards ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.gallery > li { display: flex; }
.gcard {
  position: relative; display: flex; flex-direction: column; width: 100%; min-height: 220px;
  border-radius: var(--radius); padding: 24px 22px 22px; background: var(--white); color: var(--ink);
  border: 1px solid var(--line); overflow: hidden; isolation: isolate;
}
.gcard::before { content: ""; position: absolute; left: 0; top: 0; width: 40px; height: 6px; background: var(--red); }
.dark .gcard, .deep .gcard { background: var(--navy-soft); color: var(--white); border-color: var(--line-dark); }
.gcard .tag { align-self: flex-start; display: inline-block; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; padding: 5px 9px; }
.gcard h3 { font-size: 21px; margin-top: 16px; line-height: 1.12; }
.gcard .loc { margin-top: 8px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13.5px; opacity: .7; }
.gcard .method { margin-top: auto; padding-top: 18px; font-size: 14px; line-height: 1.45; opacity: .82; }
.gcard .method b { display: block; font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--red); }
.dark .gcard .method b, .deep .gcard .method b { color: var(--white); opacity: .7; }
/* photo version: image fills the card, caption sits on a dark fade */
.gcard.photo { color: var(--white); border: 0; justify-content: flex-end; min-height: 340px; background: var(--navy-soft); grid-column: span 2; }
.gcard.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.gcard.photo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(12, 26, 36, .92) 0%, rgba(12, 26, 36, .3) 55%, rgba(12, 26, 36, 0) 100%); }
.gcard.photo .method b { color: var(--white); opacity: .7; }
.gallery > li.wide { grid-column: span 2; }
.gallery-count { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; opacity: .65; margin-bottom: 18px; }

/* ---------- enquiry forms ---------- */
.form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form legend { padding: 0; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.form legend span { font-weight: 500; opacity: .6; }
.form .consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.form .consent input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--red); }
.form .consent a { color: var(--red); font-weight: 700; }
.form .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form-done h3 { font-size: 26px; }
.form-done p { margin-top: 10px; opacity: .88; }
.form-done:focus { outline: none; }
.form-panel { background: var(--white); color: var(--ink); border-radius: var(--radius); padding: clamp(24px, 3.4vw, 44px); border: 1px solid var(--line); }
.form-panel > h2 { font-size: clamp(30px, 3.2vw, 44px); }
.form-panel > p { margin: 12px 0 28px; opacity: .8; }

/* ---------- contact details & maps ---------- */
.contact-list { list-style: none; margin: 22px 0 0; display: grid; gap: 14px; }
.contact-list li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; font-size: 16px; line-height: 1.5; }
.contact-list li > b { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--red); padding-top: 3px; }
.dark .contact-list li > b, .deep .contact-list li > b { color: var(--white); opacity: .65; }
.contact-list a { font-weight: 800; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.map { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--navy-soft); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.office .send { display: inline-block; margin-top: 12px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; color: var(--red); }
.dark .office .send, .deep .office .send { color: var(--white); }
.office .gap { font-style: italic; opacity: .65; }
.head-office img { width: 100%; max-width: 620px; margin: 0 auto; }

/* ---------- 404 ---------- */
.lost { min-height: 62vh; display: grid; align-items: center; }
.lost h1 { font-size: clamp(44px, 7vw, 110px); letter-spacing: -.035em; margin-top: 16px; }
.lost h1 .arr { color: var(--red); }
.lost .lede { font-size: clamp(17px, 1.4vw, 20px); margin-top: 18px; max-width: 54ch; opacity: .88; }
.lost .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

@media (max-width: 1080px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .gcard.photo, .gallery > li.wide { grid-column: auto; }
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
}
/* photo cards: keep the caption together at the foot, over the dark fade */
.gcard.photo .method { margin-top: 0; padding-top: 12px; }
