/* HRP offline page styles */

:root {
  /* Typography — Open Sans is HRP's web font; humanist-sans system fallback */
  --font-body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* Colors — Historic Royal Palaces brand palette (sourced from hrp.org.uk) */
  --color-petrol-blue: #00566b;     /* header bar */
  --color-sun-yellow: #ffe800;      /* brand accent */
  --color-platinum-grey: #e3e3e3;   /* hairline borders */
  --color-white-smoke: #f5f5f5;     /* footer band */
  --color-blue-hosta: #66c0bf;      /* social hover accent */
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-header-bg: var(--color-petrol-blue);
  --color-header-text: #ffffff;
  --color-link: var(--color-petrol-blue);
  --color-cta-bg: #000000;          /* black pill buttons, as on hrp.org.uk */
  --color-cta-text: #ffffff;
  --color-footer-bg: var(--color-white-smoke);
  --color-footer-text: #000000;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;

  --max-width: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

/* Full-height layout so header + main + footer fit one viewport */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header,
.site-footer { flex: 0 0 auto; }

a { color: var(--color-link); }
img, svg { display: block; max-width: 100%; height: auto; }

/* Header */
.site-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
}

.site-header__logo img {
  height: 48px;
  width: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}

/* Right-pointing chevron, as on hrp.org.uk — mask inherits the button text colour */
.btn::after {
  content: "";
  width: 0.6em;
  height: 0.6em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'><path d='M1 1l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'><path d='M1 1l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat;
  transition: transform 0.2s ease;
}

.btn:hover::after { transform: translateX(3px); }

.btn--primary {
  background: var(--color-cta-bg);
  color: var(--color-cta-text);
}

.btn--primary:hover { background: #1a1a1a; }

/* Main offline section — flexes to fill the space between header and footer */
.offline {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-3);
}

.offline__inner {
  max-width: 640px;
  text-align: center;
}

.offline h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin: 0 0 var(--space-2);
  line-height: 1.15;
}

.offline p {
  font-size: 1rem;
  margin: 0;
}

.offline__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

/* Palace ribbon — buy tickets by palace, styled after hrp.org.uk */
.palace-ribbon {
  width: 100%;
  max-width: 1100px;
  text-align: center;
}

.palace-ribbon__title {
  font-weight: 700;
  font-size: 1.125rem;
  margin: 0 0 var(--space-2);
}

.palace-ribbon__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
}

.palace-ribbon__list li {
  display: flex;
  border-left: 1px solid var(--color-platinum-grey);
}

/* Whole cell — icon + name — is one clickable link */
.palace-ribbon__list a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-2);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
}

/* HRP's ticket icon (font glyph \e92f) above every palace name */
.palace-ribbon__list a::before {
  content: "";
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
  background: url("assets/icons/ticket.svg") center / contain no-repeat;
}

.palace-ribbon__list a:hover {
  color: var(--color-petrol-blue);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .palace-ribbon__list a::before { width: 40px; height: 40px; }
}

/* drop the divider on the first cell of each row, per column count */
@media (max-width: 639px) {
  .palace-ribbon__list li:nth-child(2n + 1) { border-left: 0; }
}

@media (min-width: 640px) and (max-width: 1239px) {
  .palace-ribbon__list { grid-template-columns: repeat(3, 1fr); }
  .palace-ribbon__list li:nth-child(3n + 1) { border-left: 0; }
}

/* Wide screens: content-width columns, centred, names on one line so the
   dividers sit an equal distance from each palace name */
@media (min-width: 1240px) {
  .palace-ribbon__list {
    grid-template-columns: repeat(6, auto);
    justify-content: center;
  }
  .palace-ribbon__list li:nth-child(6n + 1) { border-left: 0; }
  .palace-ribbon__list a { white-space: nowrap; }
}

/* Footer — mirrors the bottom band of hrp.org.uk */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: var(--space-4) var(--space-3);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  text-align: center;
}

.site-footer__main { flex: 1 1 320px; }

/* Social icons — white circular badges, as on hrp.org.uk */
.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2);
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: #ffffff;
  border-radius: 999px;
  transition: background 0.2s ease-in-out;
}

.social-icons img {
  width: 22px;
  height: 22px;
  filter: brightness(0);              /* black glyphs at rest */
  transition: filter 0.2s ease-in-out;
}

.social-icons a:hover { background: var(--color-petrol-blue); }
.social-icons a:hover img { filter: brightness(0) invert(1); }  /* white glyph on hover */

.site-footer__legal {
  font-size: 0.8125rem;
  line-height: 1.7;
}

.site-footer__legal p { margin: 0; }

.site-footer__logo img { width: 200px; max-width: 60vw; }

@media (min-width: 768px) {
  .site-footer__inner { justify-content: space-between; text-align: left; }
  .social-icons { justify-content: flex-start; }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}
