/*
 * Behavioural styling that Adobe's page stylesheet did not carry, plus the
 * replacements for the parts of Portfolio's 355 KB runtime bundle we actually
 * use: cover hover transitions, the image lightbox and the cookie banner.
 *
 * Deliberately NOT carried over: Portfolio's `.transition-enabled { opacity: 0 }`
 * page fade. It hides the whole page until JavaScript adds a class, so a script
 * error leaves a blank site — a bad trade for a 250ms fade nobody notices.
 */

/* --- Buttons that stand in for Portfolio's clickable divs ---------------- */

/* The hamburger, the drawer's close control and the form's submit were <div>s
   in Portfolio's markup. They are real buttons here so they are keyboard
   reachable, which means resetting the styling the UA adds. */
.hamburger-click-area,
.close-responsive-click-area,
.submit-button {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: inherit;
}

.hamburger-click-area,
.close-responsive-click-area,
.submit-button {
  cursor: pointer;
}

/* Portfolio's `.hamburger { width: 24px }` (position: relative) only works on a
   block-level box. `.close-responsive-button` gets away with the same pattern
   because `position: fixed` forces block-level regardless of display — but
   `.hamburger` uses `position: relative`, which does not. Our markup uses a
   <span> for both (so a screen reader announces one icon, not three), and an
   inline span ignores `width` entirely: the icon collapsed to 0x0 and vanished,
   taking the mobile menu button with it. */
.hamburger {
  display: inline-block;
}

/* --- Cover grid hover ---------------------------------------------------- */

.link-transition a {
  transition: background 0.2s ease, color 0.2s ease;
}

.link-transition a svg {
  transition: fill 0.2s ease;
}

.project-cover .details {
  transition: background 0.2s ease;
}

.project-cover .title,
.project-cover .description,
.project-cover .date {
  transition: color 0.2s ease;
}

/* Portfolio sized covers with a padding-bottom box and absolutely positioned
   images. We use a plain aspect-ratio box instead, which needs no JS. */
.project-cover .cover-image {
  aspect-ratio: 16 / 7;
  overflow: hidden;
}

.project-cover .cover__img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* --- Logo ---------------------------------------------------------------- */

/* Portfolio's markup had no width/height attributes on the logo; WordPress
   emits both, and they fight the sizing rules in style.css — `.logo-image
   { max-width: 250px }` on desktop and `.logo-image img { max-height: 150px }`
   below 932px. Letting both dimensions resolve from the intrinsic ratio keeps
   the logo undistorted under either constraint. */
.logo img {
  height: auto;
  width: auto;
}

/* The logo anchor is an inline-block, so by default it sits on the text
   baseline and the line box reserves descender space under it — 3px of extra
   header height that the Portfolio markup did not have. Aligning to the top of
   the line box removes it. */
.logo .image-link {
  vertical-align: top;
}

/* --- Content images ------------------------------------------------------ */

/* WordPress wraps an image block in a <figure>, and wp-block-library gives that
   a 1em bottom margin. Portfolio's module had none, and its own 40px bottom
   padding already provides the spacing. */
.project-module-image figure {
  margin: 0;
}

.project-module-image img {
  display: block;
  height: auto;
  max-width: 100%;
}

.project-module-image .lightbox-link {
  cursor: zoom-in;
  display: block;
}

/* Portfolio's `.module-caption-container`: 800px centred, 14px/18px, #888,
   left-aligned, 15px clear of the photo. Used by the carers' introductions on
   /de-leidsters. */
.project-module-image figcaption {
  color: #888;
  font-family: var(--hb-font);
  font-size: 14px;
  font-weight: 300;
  line-height: 18px;
  margin: 0 auto;
  max-width: 800px;
  padding-top: 15px;
  text-align: left;
  width: 100%;
}

/* --- Page content -------------------------------------------------------- */

/*
 * Portfolio put every paragraph inside a `.project-module.text` wrapper capped
 * at 800px, and set the actual type inline on each span: 14px/28px, weight 300,
 * rgb(48,48,48). Its own stylesheet says 20px/#888, which is not what the site
 * looks like — so those are the values to reproduce here, once, instead of
 * carrying the inline styles over into the content.
 *
 * Spacing, measured off the live page: 10px above a run of paragraphs, 28px
 * between them (Portfolio used an empty <div><br></div> for the gap), 25px
 * below the run. Expressed with sibling selectors so a run of any length lands
 * in the same place as the original module did.
 */

/* Establishes a block formatting context so the first paragraph's top margin
   stays inside the container instead of collapsing through it and pushing the
   whole content block down. */
#project-modules {
  display: flow-root;
}

#project-modules > p {
  color: #303030;
  font-family: var(--hb-font);
  font-size: 14px;
  font-weight: 300;
  line-height: 28px;
  margin: 0 auto;
  max-width: 800px;
  text-align: center;
  width: 100%;
}

#project-modules > p.has-text-align-left {
  text-align: left;
}

#project-modules > p.has-text-align-right {
  text-align: right;
}

#project-modules > p:first-child,
#project-modules > :not(p) + p {
  margin-top: 10px;
}

#project-modules > p + p {
  margin-top: 28px;
}

#project-modules > p + :not(p) {
  margin-top: 25px;
}

#project-modules > p:last-child {
  margin-bottom: 25px;
}

/* Portfolio's theme styled content links the same grey as the text, but the
   "Voor de ouders" page set them blue inline — which is where nearly every link
   on the site lives. Blue, once, for all of them. */
#project-modules > p a {
  color: #1769ff;
  text-decoration: none;
}

#project-modules > p a:hover,
#project-modules > p a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 932px) {
  #project-modules > p {
    max-width: 100%;
  }
}

/* --- Lightbox ------------------------------------------------------------ */

.hb-lightbox {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  bottom: 0;
  cursor: zoom-out;
  display: flex;
  justify-content: center;
  left: 0;
  opacity: 0;
  padding: 40px;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.2s ease;
  z-index: 100000;
}

.hb-lightbox[hidden] {
  display: none !important;
}

.hb-lightbox.is-open {
  opacity: 1;
}

.hb-lightbox img {
  box-shadow: 0 2px 40px rgba(0, 0, 0, 0.15);
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.hb-lightbox__close {
  background: none;
  border: 0;
  color: #444;
  cursor: pointer;
  font: 300 40px/1 var(--hb-font);
  padding: 10px 18px;
  position: absolute;
  right: 10px;
  top: 10px;
}

/* --- Cookie banner ------------------------------------------------------- */

/* Colours taken from Portfolio's own runtime config:
   cookie_banner: { text: "#212121", bg: "#EDEEEE" } */
.cookie-banner {
  background: #edeeee;
  color: #212121;
}

.cookie-banner .close-btn {
  font-size: 22px;
  line-height: 1;
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
}

.cookie-banner button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  margin-left: 10px;
  text-decoration: underline;
}

/* --- Contact form (Gravity Forms) ---------------------------------------- */

/* Gravity Forms' own stylesheet is switched off (inc/gravity-forms.php); the
   field, label and button rules in style.css (`.modules .form`,
   `.project-module-form`) style the form. What follows covers the parts of
   Gravity Forms' markup those rules do not know about. */
.project-module-form .gform_wrapper,
.project-module-form .gform_fields {
  display: block;
  margin: 0;
  padding: 0;
}

.project-module-form .gfield {
  border: 0;
  margin: 0;
  padding: 0;
}

.project-module-form .gfield_required {
  margin-left: 0.25em;
}

.project-module-form .gfield_required .gfield_required {
  margin-left: 0;
}

/* No form title is shown, and the character counter under the message field
   was not there before. */
.project-module-form .gform_heading,
.project-module-form .ginput_counter {
  display: none;
}

/* The submit is a <button> inside #project-modules, whose content rules would
   centre and pad it like a paragraph. Restate the button's values at a
   specificity that wins. */
.modules .form .gform_footer .submit-button {
  background: none;
  border-radius: 5px;
  height: 40px;
  line-height: 38px;
  margin: 0;
  padding: 0 30px;
}

.project-module-form .gform_footer {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
}

@media (max-width: 932px) {
  .modules .form .gform_footer .submit-button {
    height: 38px;
    line-height: 36px;
  }
}

/* Portfolio's own error line (`.form-error`): red, small, pulled up under the
   field so it does not add to the gap before the next label. */
.project-module-form .gfield_validation_message {
  color: #c00;
  font-size: 12px;
  line-height: 12px;
  margin-bottom: 30px;
  margin-top: -25px;
}

.project-module-form .gfield_error input,
.project-module-form .gfield_error textarea {
  border-color: #c00;
}

@media (max-width: 932px) {
  .project-module-form .gfield_validation_message {
    margin-bottom: 18px;
    margin-top: -13px;
  }
}

@media (max-width: 540px) {
  .modules .form .gform_footer .submit-button {
    height: 35px;
    line-height: 33px;
  }

  .project-module-form .gfield_validation_message {
    margin-bottom: 16px;
    margin-top: -11px;
  }
}

/* The message above the form (not valid) and the confirmation that replaces
   it once sent, as the same filled notice as the rest of the site. */
.project-module-form .gform_validation_errors,
.project-module-form .gform_confirmation_message {
  border: 0;
  border-radius: 4px;
  font-family: var(--hb-font);
  font-size: 16px;
  line-height: 24px;
  margin: 0 0 30px;
  padding: 14px 18px;
  text-align: left;
}

.project-module-form .gform_validation_errors {
  background: #fde8e8;
  color: #7a2020;
}

.project-module-form .gform_validation_errors h2 {
  font: inherit;
  margin: 0;
}

/* The list of fields repeats the messages under each field. */
.project-module-form .gform_validation_errors ol {
  display: none;
}

.project-module-form .gform_confirmation_message {
  background: #dbf9c7;
  color: #2f4f1e;
}

/* The honeypot. Kept out of sight; Gravity Forms already hides it from
   assistive technology. */
.project-module-form .gform_validation_container,
.project-module-form .gform_validation_container * {
  display: none !important;
}

/* --- Accessibility ------------------------------------------------------- */

.screen-reader-text {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link:focus {
  background: #fff;
  color: #444;
  clip-path: none;
  font-family: var(--hb-font);
  height: auto;
  left: 10px;
  padding: 12px 20px;
  top: 10px;
  width: auto;
  z-index: 100001;
}

:where(a, button, input, textarea):focus-visible {
  outline: 2px solid #444;
  outline-offset: 2px;
}
