/* Parker Russell Spain.
   From the PRI Branding Guidelines (2021): brand colours, Verdana, PRI Member's
   logo on the home page, graduated dark grey footer. The header follows our own
   design (single white row), as the Italian member site does. */

:root {
  /* Brand colours (guidelines p. 8). */
  --red: #ed1941;
  --red-deep: #c8102e;   /* for small text on white: PR Red is under 4.5:1 */
  --grey: #465a65;
  --ink: #1e282d;
  --mist: #eef1f2;
  --rule: #d3dade;
  --paper: #ffffff;

  /* Verdana is the approved screen typeface (guidelines p. 12).
     The "moderna" option in the Customizer overrides these (fonts.css). */
  --font-display: Verdana, Geneva, 'DejaVu Sans', sans-serif;
  --font-body: Verdana, Geneva, 'DejaVu Sans', sans-serif;
  --heading-weight: 700;
  --heading-tracking: -0.03em;

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  --step-4: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(4rem, 8vw, 7rem);
}

/* Verdana runs wide and large: scale it down so it sets like the modern pair. */
body:not(.type-modern) {
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.35rem + 1.7vw, 2.4rem);
  --step-4: clamp(2.1rem, 1.4rem + 3.2vw, 3.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  line-height: 1.1;
  letter-spacing: var(--heading-tracking);
  margin: 0 0 0.5em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; }

p { margin: 0 0 1em; max-width: 66ch; }

a { color: var(--red-deep); text-underline-offset: 0.2em; }
a:hover { color: var(--red); }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tint { background: var(--mist); }

.lead { font-size: var(--step-1); line-height: 1.45; color: var(--grey); max-width: 44ch; }

.btn {
  display: inline-block;
  padding: 0.85em 1.4em;
  border: 2px solid var(--red-deep);
  border-radius: 999px;
  background: var(--red-deep);
  color: #fff;
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--light { background: #fff; border-color: #fff; color: var(--red-deep); }
.btn--light:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
body:not(.type-modern) .btn { font-size: 0.875rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: #fff; padding: 0.5rem 1rem; }
.skip:focus { top: 1rem; }

/* ---------- Header: logo left, menu, language and contact button in one row ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.96);
  border-bottom: 1px solid var(--rule);
}
.admin-bar .site-header { top: 32px; }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }
/* Minimum on-screen logo width is 140 px (guidelines p. 6). */
.site-logo img { width: 190px; min-width: 140px; }

.main-nav { display: flex; align-items: center; gap: 1.75rem; }
.main-nav .menu { display: flex; align-items: center; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.main-nav .menu a,
.lang-switch {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
body:not(.type-modern) .main-nav .menu a,
body:not(.type-modern) .lang-switch { font-size: 0.875rem; }
.main-nav .menu a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a,
.main-nav .current_page_item > a { border-bottom-color: var(--red); }
.lang-switch { color: var(--grey); font-weight: 400; }
.lang-switch:hover { color: var(--ink); border-bottom-color: var(--red); }
.nav-cta { padding: 0.6em 1.2em; }

.member-logo { display: inline-block; text-decoration: none; }
.member-logo img { width: 132px; }
.member-logo--pending {
  display: grid; place-items: center;
  width: 132px; min-height: 44px; padding: 0.4rem;
  border: 1px dashed #98a4aa;
  font-family: var(--font-body);
  font-size: 0.625rem; line-height: 1.3; text-align: center; color: var(--grey);
}

.nav-toggle { display: none; width: 2.75rem; height: 2.75rem; border: 0; background: none; cursor: pointer; position: relative; }
.nav-toggle-lines, .nav-toggle-lines::before, .nav-toggle-lines::after {
  position: absolute; left: 50%; width: 1.5rem; height: 2px; background: var(--ink); transform: translateX(-50%); transition: transform 0.2s;
}
.nav-toggle-lines { top: 50%; }
.nav-toggle-lines::before, .nav-toggle-lines::after { content: ''; }
.nav-toggle-lines::before { top: -7px; }
.nav-toggle-lines::after { top: 7px; }
.is-open .nav-toggle-lines { background: transparent; }
.is-open .nav-toggle-lines::before { transform: translateX(-50%) translateY(7px) rotate(45deg); }
.is-open .nav-toggle-lines::after { transform: translateX(-50%) translateY(-7px) rotate(-45deg); }

@media (max-width: 60rem) {
  .site-logo img { width: 160px; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 1rem var(--gutter) 1.5rem;
  }
  .is-open .main-nav { display: flex; }
  .main-nav .menu { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .main-nav .menu a, .lang-switch,
  body:not(.type-modern) .main-nav .menu a,
  body:not(.type-modern) .lang-switch { font-size: var(--step-1); }
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 11vw, 8.5rem);
  border-bottom: 1px solid var(--rule);
  /* A quiet disc, echoing the round mark without reproducing the logo. */
  background: radial-gradient(circle at 92% 50%, var(--mist) 0 min(30vw, 24rem), transparent calc(min(30vw, 24rem) + 1px));
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; }
.hero--image {
  color: #fff;
  border-bottom: 0;
  background: var(--ink);
  min-height: min(44rem, 80vh);
  display: flex;
  align-items: center;
}
.hero--image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(20 27 31 / 0.82) 0%, rgb(20 27 31 / 0.55) 45%, rgb(20 27 31 / 0.1) 80%);
}
.hero--image .hero-inner { width: 100%; }
.hero--image h1 { color: #fff; }
.hero--image .lead { color: #eef1f2; }
.hero--image .btn--ghost { color: #fff; border-color: rgb(255 255 255 / 0.7); }
.hero--image .btn--ghost:hover { border-color: #fff; color: #fff; }
.hero-credit {
  position: absolute;
  right: var(--gutter);
  bottom: 0.75rem;
  z-index: 1;
  margin: 0;
  font-size: 0.6875rem;
  color: rgb(255 255 255 / 0.75);
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 { max-width: 14ch; }
body:not(.type-modern) .hero h1 { max-width: 17ch; }

@media (max-width: 56rem) {
  .hero:not(.hero--image) { background: none; }
  .hero--image::after { background: rgb(20 27 31 / 0.6); }
}

/* ---------- Network map ---------- */

.network-map { margin: 3rem 0 0; }
.network-map img { width: 100%; height: auto; }
.network-map figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: 1rem;
  font-size: var(--step--1);
  color: var(--grey);
}
.map-key { display: inline-flex; align-items: center; gap: 0.5rem; }
.map-key::before { content: ''; width: 0.85rem; height: 0.85rem; border-radius: 2px; background: var(--grey); }
.map-key--es::before { background: var(--red); }
.map-source { margin-left: auto; }

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

.section-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 3rem; margin-bottom: 2.5rem; }
.section-intro h2, .section-intro .lead { margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1.3fr; gap: 2rem 4rem; align-items: start; }
.split .btn { margin-top: 0.5rem; }
.split .member-logo { margin-top: 0.5rem; }

.service-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.service-list li { border-bottom: 1px solid var(--rule); }
.service-list a {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) 2fr auto;
  align-items: baseline;
  gap: 1rem 2.5rem;
  padding-block: 1.75rem;
  color: inherit;
  text-decoration: none;
}
.service-list h3 { margin: 0; font-size: var(--step-2); }
.service-list p { margin: 0; color: var(--grey); }
.service-list .more {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  font-size: 1rem;
  color: var(--red-deep);
  white-space: nowrap;
}
body:not(.type-modern) .service-list .more { font-size: 0.875rem; }
.service-list a:hover h3 { color: var(--red); }
.service-list a:hover .more { text-decoration: underline; }

.home-about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 0 4rem; }
.home-about > h2 { grid-column: 1; grid-row: 1 / span 20; }
.home-about > :not(h2) { grid-column: 2; }

.contact-band { background: var(--red-deep); color: #fff;  /* PR Red gives 4.36:1 with white text; AA needs 4.5 */
  padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.band { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 4rem; align-items: center; }
.band h2 { color: #fff; }
.band p { margin: 0; font-size: var(--step-1); }
.band-contact { display: grid; gap: 0.5rem; justify-items: start; }
.band-big { color: #fff; font-family: var(--font-display); font-weight: var(--heading-weight); font-size: var(--step-2); text-decoration: none; }
.band-big:hover { color: #fff; text-decoration: underline; }
.band .btn { margin-top: 1rem; }
.contact-band :focus-visible { outline-color: #fff; }

/* ---------- Inner pages ---------- */

.page-header {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
  background: radial-gradient(circle at 100% 0, var(--mist) 0 18rem, transparent 18rem);
}
.page-header h1 { max-width: 18ch; }
.page-header .lead { margin: 0; max-width: 50ch; }
.page-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--grey);
}
body:not(.type-modern) .page-back { font-size: 0.875rem; }

.entry-content > * { max-width: 66ch; }
.entry-content h2 { margin-top: 2.5rem; }
.entry-content ul { padding-left: 1.25rem; }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content li::marker { color: var(--red); }

.service-detail { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem 5rem; }
.service-content ul { list-style: none; padding: 0; margin: 0 0 2.5rem; border-top: 2px solid var(--ink); }
.service-content li { padding: 1rem 0 1rem 1.75rem; margin: 0; border-bottom: 1px solid var(--rule); position: relative; font-size: var(--step-1); }
.service-content li::before { content: ''; position: absolute; left: 0; top: 1.55rem; width: 0.6rem; height: 0.6rem; background: var(--red); border-radius: 50%; }
body:not(.type-modern) .service-content li { font-size: var(--step-0); }
body:not(.type-modern) .service-content li::before { top: 1.5rem; }
.service-aside { align-self: start; background: var(--mist); padding: 1.75rem; border-radius: 4px; }
.service-aside h2 { font-size: var(--step-1); }
.service-aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.service-aside a { color: var(--ink); }
.service-aside a:hover { color: var(--red); }
body:not(.type-modern) .service-aside ul { font-size: 0.9375rem; }

.member-block { margin-top: 2.5rem; }

.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem 5rem; }
.contact-form { display: grid; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.contact-form label { display: grid; gap: 0.4rem; }
.contact-form label > span { font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
body:not(.type-modern) .contact-form label > span { font-size: 0.875rem; font-weight: 700; }
.contact-form input, .contact-form textarea {
  font: inherit; padding: 0.75rem 0.9rem; width: 100%;
  border: 1px solid #aab5ba; border-radius: 4px; background: #fff; color: var(--ink);
}
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 3px solid var(--red); outline-offset: 0; border-color: var(--ink); }
.contact-form .consent { grid-template-columns: auto 1fr; align-items: start; gap: 0.75rem; }
.contact-form .consent input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--red-deep); }
.contact-form .consent span { font-family: var(--font-body); font-weight: 400; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.25rem; border-radius: 4px; margin: 0; max-width: none; }
.notice--ok { background: #e6f4ea; color: #14532d; }
.notice--error { background: #fde8ec; color: #8a0020; }
.office { align-self: start; border-top: 3px solid var(--red); padding-top: 1.5rem; }
.office h2 { font-size: var(--step-2); }
.office address { font-style: normal; font-size: var(--step-1); margin-bottom: 1rem; }
.office-direct { font-family: var(--font-display); font-weight: var(--heading-weight); font-size: var(--step-1); line-height: 1.8; }
.office-direct a { color: var(--ink); text-decoration: none; }
.office-direct a:hover { color: var(--red); }
body:not(.type-modern) .office address,
body:not(.type-modern) .office-direct { font-size: var(--step-0); }

.sitemap ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.sitemap ul ul { padding: 0.6rem 0 0.2rem 1.25rem; border-left: 2px solid var(--rule); margin-left: 0.25rem; }

.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2rem; }
.post-date { color: var(--grey); font-size: var(--step--1); }

/* ---------- Footer (guidelines p. 23): graduated dark grey ---------- */

.site-footer {
  background: linear-gradient(180deg, var(--grey) 0%, #26333a 100%);
  color: #d5dcdf;
  padding-block: 4rem 2rem;
  font-size: 1rem;
}
body:not(.type-modern) .site-footer { font-size: 0.875rem; }
.site-footer a { color: #d5dcdf; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer address { font-style: normal; line-height: 1.8; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-about { font-family: var(--font-display); font-weight: var(--heading-weight); color: #fff; font-size: var(--step-1); line-height: 1.3; max-width: 16ch; }
.footer-h { font-size: 1rem; color: #fff; margin-bottom: 1rem; letter-spacing: 0; }
.footer-legal { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / 0.15); font-size: var(--step--1); color: #d0d8db; }
body:not(.type-modern) .footer-legal { font-size: 0.75rem; }
.footer-legal p { max-width: none; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-top: 1.5rem; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 0; }
.footer-links li + li { border-left: 1px solid rgb(255 255 255 / 0.3); }
.footer-links a { padding: 0 0.75rem; color: #d0d8db; }
.footer-links li:first-child a { padding-left: 0; }

@media (max-width: 56rem) {
  .split, .band, .home-about, .service-detail, .contact-grid { grid-template-columns: 1fr; }
  .home-about > h2 { grid-row: auto; }
  .home-about > :not(h2) { grid-column: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 40rem) {
  .service-list a { grid-template-columns: 1fr; gap: 0.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .band-big { font-size: var(--step-1); }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
