/* ==========================================================================
   Sovereign Quay RTM - site styles
   Brand palette (from Sovereign Quay Brand guidelines):
     Grey       #818586
     Dark blue  #569BA0  (primary teal)
     Light blue #C1E1E1
     Yellow     #F6D869  (accent)
   ========================================================================== */

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

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/sourcesans3-latin.woff2") format("woff2");
}

:root {
  --sq-teal: #569BA0;
  --sq-teal-dark: #427b7f;
  --sq-light: #C1E1E1;
  --sq-light-tint: #eef7f7;
  --sq-grey: #818586;
  --sq-yellow: #F6D869;
  --sq-ink: #33383a;
  --max-width: 1080px;
  --font-head: "Montserrat", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

/* Anchored elements land below the sticky header instead of underneath it */
[id] { scroll-margin-top: 96px; }

body {
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.65;
  color: var(--sq-ink);
  background: #fff;
}

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

a { color: #35646a; }
a:hover { color: var(--sq-teal); }

strong { font-weight: 600; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  color: var(--sq-ink);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Skip link (visible only when focused via keyboard) ---------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 200;
  background: var(--sq-ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus { top: 0; color: #fff; }

/* Header ------------------------------------------------------------------ */

.site-header {
  background: #fff;
  border-bottom: 1px solid #e4e9e9;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.brand { flex-shrink: 0; }

.brand img { display: block; height: 52px; width: auto; }

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #4d5456;
  border-radius: 6px;
  white-space: nowrap;
}

.site-nav a:hover { color: #2c545a; background: var(--sq-light-tint); }
.site-nav a.active { color: #2c545a; background: var(--sq-light-tint); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #d8dede;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 1.2rem;
  color: #35646a;
  cursor: pointer;
}

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

.hero {
  background:
    linear-gradient(100deg, rgba(19, 42, 44, 0.72) 0%, rgba(19, 42, 44, 0.45) 55%, rgba(19, 42, 44, 0.15) 100%),
    url("/assets/images/hero-1600.jpg") center / cover no-repeat;
  background:
    linear-gradient(100deg, rgba(19, 42, 44, 0.72) 0%, rgba(19, 42, 44, 0.45) 55%, rgba(19, 42, 44, 0.15) 100%),
    url("/assets/images/hero-1800.webp") center / cover no-repeat;
  padding: 6.5rem 0 6rem;
}

@media (max-width: 700px) {
  .hero {
    background:
      linear-gradient(100deg, rgba(19, 42, 44, 0.72) 0%, rgba(19, 42, 44, 0.5) 100%),
      url("/assets/images/hero-900.webp") center / cover no-repeat;
  }
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 700;
  max-width: 22ch;
  color: #fff;
}

.hero p.lead {
  margin-top: 1.1rem;
  font-size: 1.25rem;
  color: #dcebeb;
  max-width: 58ch;
}

.hero .btn-secondary {
  border-color: #fff;
  color: #fff;
}

.hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hero .actions { margin-top: 1.8rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  border: 2px solid var(--sq-teal);
}

.btn-primary { background: var(--sq-teal-dark); border-color: var(--sq-teal-dark); color: #fff; }
.btn-primary:hover { background: #35646a; border-color: #35646a; color: #fff; }
.btn-secondary { background: transparent; color: var(--sq-teal-dark); }
.btn-secondary:hover { background: var(--sq-light-tint); }

/* Page hero (interior pages) --------------------------------------------- */

.page-hero {
  background:
    linear-gradient(135deg, rgba(70, 126, 130, 0.92) 0%, rgba(46, 82, 85, 0.92) 100%),
    url("/assets/images/hero-1600.jpg") center / cover no-repeat;
  background:
    linear-gradient(135deg, rgba(70, 126, 130, 0.92) 0%, rgba(46, 82, 85, 0.92) 100%),
    url("/assets/images/hero-1800.webp") center / cover no-repeat;
  color: #fff;
  padding: 3.2rem 0;
}

@media (max-width: 700px) {
  .page-hero {
    background:
      linear-gradient(135deg, rgba(70, 126, 130, 0.92) 0%, rgba(46, 82, 85, 0.92) 100%),
      url("/assets/images/hero-900.webp") center / cover no-repeat;
  }
}

.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.page-hero p { margin-top: 0.5rem; color: var(--sq-light); font-size: 1.1rem; max-width: 62ch; }

/* Sections ---------------------------------------------------------------- */

.section { padding: 3.5rem 0; }
.section.alt { background: var(--sq-light-tint); }

.section h2 {
  font-size: 1.7rem;
  margin-bottom: 1rem;
}

.section > .container > h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 0.6rem;
  border-radius: 2px;
  background: var(--sq-yellow);
}

.section h3 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
.section p + p { margin-top: 0.9rem; }

.prose { max-width: 72ch; }
.prose ul, .prose ol { margin: 0.9rem 0 0.9rem 1.4rem; }
.prose li + li { margin-top: 0.35rem; }

/* Cards ------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.card {
  background: #fff;
  border: 1px solid #e4e9e9;
  border-top: 4px solid var(--sq-teal);
  border-radius: 10px;
  padding: 1.5rem;
}

.card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.card p { color: #555b5d; font-size: 1rem; }
.card a.more {
  display: inline-block;
  margin-top: 0.8rem;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

/* Photos ------------------------------------------------------------------ */

.media-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem 2.5rem;
  align-items: start;
}

.photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

figure.photo { margin: 0; }

figure.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  cursor: zoom-in;
}

figure.photo.photo-wide img {
  max-height: 420px;
  object-fit: cover;
}

figure.photo figcaption {
  padding: 0.5rem 0.2rem 0;
  font-size: 0.9rem;
  color: #555b5d;
}

figure.photo .credit {
  display: block;
  font-size: 0.78rem;
  color: #5c6163;
  margin-top: 0.1rem;
}

dialog.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(1200px, 94vw);
}

dialog.lightbox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

dialog.lightbox::backdrop { background: rgba(15, 25, 26, 0.85); }

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

/* News list --------------------------------------------------------------- */

.news-item {
  background: #fff;
  border: 1px solid #e4e9e9;
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
}

.news-item + .news-item { margin-top: 1rem; }

.news-item h2 { margin: 0.25rem 0 0.4rem; font-size: 1.15rem; }

.news-item .date {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #35646a;
}

.news-item h3 { margin: 0.25rem 0 0.4rem; font-size: 1.15rem; }
.news-item p { color: #555b5d; font-size: 1rem; }

/* Notice / highlight ------------------------------------------------------ */

.notice {
  background: #fdf6dc;
  border: 1px solid #ecd98a;
  border-left: 5px solid var(--sq-yellow);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* Definition rows (contact page etc.) ------------------------------------ */

.info-rows { margin-top: 1.5rem; max-width: 640px; }

.info-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid #e4e9e9;
}

.info-row dt { font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; color: #4d5456; }
.info-row dd { margin: 0; }

/* Footer ------------------------------------------------------------------ */

.site-footer {
  background: var(--sq-ink);
  color: #c9cdce;
  padding: 3rem 0 2rem;
  margin-top: 0;
}

.site-footer .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.site-footer h3 {
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.site-footer .footer-logo {
  display: block;
  width: 139px;
  height: auto;
  margin-bottom: 0.9rem;
  opacity: 0.95;
}

.site-footer ul { list-style: none; }
.site-footer li + li { margin-top: 0.35rem; }
.site-footer a { color: var(--sq-light); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.site-footer .legal {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid #4a5052;
  font-size: 0.9rem;
  color: #abb0b2;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1060px) {
  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e4e9e9;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  }

  .site-nav.open { display: block; }

  .site-nav ul { flex-direction: column; padding: 0.5rem 1rem 1rem; }
}

@media (max-width: 860px) {
  .info-row { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* Data tables (e.g. cores and flat numbers) */
.table-wrap {
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid #e4e9e9;
  border-top: 4px solid var(--sq-teal);
  border-radius: 10px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.data-table th {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  color: var(--sq-teal-dark);
  border-bottom: 2px solid var(--sq-light);
  padding: 0.85rem 1.1rem 0.6rem;
  white-space: nowrap;
}

.data-table td {
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--sq-light-tint);
  white-space: nowrap;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table td:first-child {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--sq-teal-dark);
  white-space: nowrap;
}

/* Location map */
figure.map { margin: 1.5rem 0 0; }

figure.map img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e4e9e9;
}

figure.map figcaption {
  padding: 0.5rem 0.2rem 0;
  font-size: 0.9rem;
  color: #555b5d;
}

figure.map .credit {
  display: block;
  font-size: 0.78rem;
  color: #5c6163;
  margin-top: 0.1rem;
}

@media (max-width: 540px) {
  .data-table { font-size: 0.92rem; }
  .data-table th { padding: 0.75rem 0.55rem 0.5rem; }
  .data-table td { padding: 0.55rem 0.55rem; }
}

/* In-page maps chooser */
dialog.map-chooser {
  margin: auto;
  border: none;
  border-top: 4px solid var(--sq-teal);
  border-radius: 12px;
  padding: 1.75rem;
  width: min(420px, calc(100vw - 2rem));
  font-family: var(--font-body);
  color: var(--sq-ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

dialog.map-chooser::backdrop { background: rgba(19, 42, 44, 0.55); }

dialog.map-chooser h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }

dialog.map-chooser p { color: #555b5d; }

.map-btns { display: grid; gap: 0.6rem; margin-top: 1.1rem; }

.map-btns .btn { text-align: center; }

.map-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: #5c6163;
  cursor: pointer;
  padding: 0.3rem;
}

.map-close:hover { color: var(--sq-ink); }
