/*
Theme Name: Neurosurgery
Theme URI: https://example.com/neurosurgery
Description: Child theme for the Nightingale theme
Author: Your Name
Template: nightingale
Version: 1.0.0
Text Domain: neurosurgery
*/

/* =================================================
   NHS SPACING SCALE
   ================================================= */

:root {
  --nhs-spacing-1: 4px;
  --nhs-spacing-2: 8px;
  --nhs-spacing-3: 16px;
  --nhs-spacing-4: 24px;
  --nhs-spacing-5: 32px;
  --nhs-spacing-6: 40px;
}

/* =================================================
   TEXT
   ================================================= */

h1.wp-block-heading,
h2.wp-block-heading,
h3.wp-block-heading,
h4.wp-block-heading,
h5.wp-block-heading {
  color: #333 !important;
}

h2.nhs-blue {
  color: #005eb8 !important;
  font-size: 1.6rem !important;
}

.has-nhs-dark-blue-background-color h1,
.has-nhs-dark-blue-background-color p {
  color: #fff !important;
}

/* Step 1: make columns stretch */
.our-work-region .wp-block-columns {
  align-items: stretch;
}

/* Step 2: make panels fill columns */
.our-work-region .wp-block-column .wp-block-nhsblocks-panel1 {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Step 3: distribute content inside panel */
.our-work-region .wp-block-nhsblocks-panel1 .nhsuk-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.our-work-region .nhsuk-card__content h2 {
	font-size: 1.5rem;
} 
.our-work-region .nhsuk-card__content {
	padding: 16px;
}
.neuro-region h2.wp-block-heading {
  position: relative;
  padding-left: 42px; /* aligns with NHS spacing scale (8px grid) */
  line-height: 1.3;
}

.neuro-region h2.wp-block-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-image: url('/wp-content/themes/neurosurgery/images/mappoint.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.neuro-region p {
	padding-left: 42px;
}

.neuro-region .wp-block-column:nth-child(odd) {
  border-right: 1px solid #d8dde0; /* NHS grey */
  padding-right: 16px; /* space between text and border */
}
/* =================================================
   COOKIE BANNER
   ================================================= */

.cky-consent-container {
  position: static !important;
  box-shadow: 0 0 4px 0 #212b32;
  border-bottom: 1px solid #555;
}

.cky-btn {
  border-radius: 5px !important;
  border-bottom: 4px solid #212b32 !important;
}

.cky-btn:hover {
  background-color: #00662f !important;
  border-color: #00662f !important;
}

.cky-policy:focus,
.cky-btn:focus {
  background-color: #ffeb3b !important;
  border: 0;
  border-bottom: 4px solid #212b32 !important;
  color: #212b32 !important;
}

.cky-policy:focus-visible,
.cky-btn:focus-visible {
  outline: 0 !important;
}

.cky-switch input[type="checkbox"]:checked {
  background-color: #007f3b !important;
}

.cky-switch input[type="checkbox"] {
  background-color: #d0d5d2 !important;
}

/* =================================================
   HEADER
   ================================================= */

.nhsuk-header__container {
  padding-bottom: 0px !important;
}

.nhsuk-header__logo img {
  max-width: 300px !important;
}

.custom-header-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nhsuk-header__content {
  flex: 1;
  margin: 0 var(--nhs-spacing-5);
  display: flex;
  align-items: center;
}

.nhsuk-header__search {
  width: 100%;
}

.nhsuk-header__search form {
  margin-bottom: 0;
}

.header-nhs-logo {
  flex: 0 0 auto;
}

.header-nhs-logo svg {
  display: block;
  height: 40px;
  transform: translateY(-8px);
}

.nhs-logo {
  height: 40px;
  display: block;
}

/* Entry header banner */

header.entry-header {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background-color: #003087;
  background-image: url("/wp-content/themes/neurosurgery/images/cta-logo.png");
  background-repeat: no-repeat;
  background-position: calc(50% + 420px) center;
  background-size: contain;
}

header.entry-header .entry-title,
header.entry-header .nhsuk-heading-xl {
  max-width: 960px;
  margin: auto;
  padding: var(--nhs-spacing-5) var(--nhs-spacing-3);
  color: #fff;
}

/* =================================================
   NAVIGATION
   ================================================= */

.nhsuk-header--white .nhsuk-navigation-container {
  background: #fff !important;
}

.nhsuk-header__navigation-link {
  color: #005eb8 !important;
  text-decoration: none;
}

.nhsuk-header__navigation-link:hover,
.nhsuk-header__navigation-link:focus {
  color: #003087 !important;
  text-decoration: underline;
  background: #fff !important;
}

.current-menu-item a {
  border-bottom: solid 5px #00a499 !important;
}

/* =================================================
   LAYOUT + HOME
   ================================================= */

.nhsuk-main-wrapper,
.entry-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.home h1.entry-title {
  display: none;
}

/* Homepage header */

.homepage-header {
  margin-bottom: var(--nhs-spacing-6);
  min-height: 300px;
  background:
    url("/wp-content/themes/neurosurgery/images/Header-image.jpg") left 75%
      top / auto no-repeat,
    linear-gradient(
      to right,
      #003087 0%,
      #003087 50%,
      #00a499 50%,
      #00a499 100%
    );
	padding:0 !important;
}

.homepage-header-col1 {
  padding: var(--nhs-spacing-4) !important;
  padding-right: 40% !important;
padding-top: 24px !important;
}

.homepage-header h1 {
  color: #fff !important;
  font-size: 2.5rem;
}

/* buttons */

.nhs-blue-button {
	background-color: #003087 !important;
}

.nhs-blue-button:focus {
	background-color: #ffeb3b !important;
}

.nhsuk-button.is-style-reverse:link,
.nhsuk-button.is-style-reverse:visited {
  color: #005EB8 !important;
}

.nhsuk-button.is-style-reverse:hover
 {
	color: #000 !important;

}
.nhsuk-button.is-style-reverse:active

{
	background-color: #b3b3b3 !important;
}



/* =================================================
   NHS COMPONENT TWEAKS
   ================================================= */

.nhsuk-care-card__arrow:before,
.nhsuk-care-card__arrow:after {
  border: none !important;
}

.nhsuk-action-link__link .nhsuk-icon__arrow-right-circle {
  fill: #005eb8 !important;
}

/* =================================================
   FULL WIDTH SECTIONS
   ================================================= */

.wp-block-group.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: var(--nhs-spacing-1) 0;
}

.wp-block-group.alignfull > .wp-block-group__inner-container {
  max-width: 960px;
  margin: 0 auto;
}

/* =================================================
   QUERY LOOP CARDS
   ================================================= */

.wp-block-query .nhsuk-card {
  height: 100%;
}

.wp-block-query .nhsuk-card img {
  width: 100%;
  display: block;
}

.wp-block-query .nhsuk-card__content {
  padding: var(--nhs-spacing-4);
}

.wp-block-query .nhsuk-card__content h3 {
  margin-top: 0;
}

/* =================================================
   EVENTS (FLEX + NHS SPACING)
   ================================================= */

.nhs-events-list .nhsuk-grid-row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(-1 * var(--nhs-spacing-3));
  margin-right: calc(-1 * var(--nhs-spacing-3));
}

.nhs-events-list .nhsuk-grid-column-one-half\@desktop {
  width: 50%;
  padding: 0 var(--nhs-spacing-3);
  /* margin-bottom: var(--nhs-spacing-4); */
	margin-bottom: 0;
  box-sizing: border-box;
}

.nhs-events-list .nhsuk-u-margin-bottom-7 {
	margin-bottom: 0 !important;
}

/* Target NHS grid event items */
.nhsuk-grid-row > div:nth-child(n + 3) {
  border-top: 1px solid #d8dde0;
  padding-top: 16px;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .nhs-events-list .nhsuk-grid-column-one-half\@desktop {
    width: 100%;
  }
}

.nhs-events-list__meta {
  margin-bottom: var(--nhs-spacing-2);
  color: #505a5f;
}

.nhs-events-list__title {
  margin-bottom: var(--nhs-spacing-2);
}

.nhs-events-list__summary {
  max-width: 38em;
}

.nhs-events-list__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--nhs-spacing-2);
}

.nhs-events-list__icon {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  fill: #005eb8;
}

/* =================================================
   SIGN-UP BLOCK
   ================================================= */

.sign-up {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;

  padding: var(--nhs-spacing-4) var(--nhs-spacing-4) var(--nhs-spacing-4) 96px !important;
  color: #fff !important;

  background: url("/wp-content/themes/neurosurgery/images/cta-logo.png")
    no-repeat left center / 72px;
  background-size: contain;
}

.sign-up h2 {
  color: #fff !important;
  margin-bottom: 0 !important;
}

.sign-up .nhsuk-button {
  margin-bottom: 0 !important;
}

/* =================================================
   MISC
   ================================================= */

.our-work .wp-block-columns {
    display: flex;
}

.our-work .wp-block-column {
    display: flex;
}

.our-work .nhsuk-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.our-work .nhsuk-card__content {
    flex-grow: 1;
}

.latest-events-region {
	margin-top: 20px;
}

.wp-block-separator {
	border: none !important;
	border-bottom: 0.5px solid #d8dde0 !important;
}

.our-partners {
  border: 1px solid #d8dde0;
}

.no-bottom-spacing {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Biographies Region and Biographies */

.bio-region .wp-block-image {
  margin: 0 !important;
}

.bio-region .nhsuk-heading-m {
  font-size: 1.2rem !important;
  color: #000;
}

.bio-region .wp-block-columns {
	margin-bottom: 0px;
}

.bio-region .nhsuk-card__content {
	padding: 16px;
}

.bio-feature  {max-width: 50%;}

/* make columns in each row equal height */
.bio-region .wp-block-columns.is-layout-flex {
  display: flex !important;       /* force flex just in case */
  align-items: stretch !important; /* make all columns same height */
}

/* make each column a vertical flex container */
.bio-region .wp-block-column {
  display: flex !important;
  flex-direction: column !important;
}

/* make the card inside the column fill remaining space */
.bio-region .wp-block-column .wp-block-nhsblocks-promo1 {
  flex-grow: 1 !important;         /* fill available space */
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between;  /* keep heading at top, buttons at bottom */
}

/* make the content inside the card distribute nicely */
.bio-region .wp-block-column .wp-block-nhsblocks-promo1 .nhsuk-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}



.news-block .category-news, .news-block .category-blog {
	border: solid 1px #d8dde0;
	border-bottom: solid 2px #d8dde0;
	background-color: #fff;
}
.news-block .wp-block-post-featured-image {
	margin: 0;
}

.wp-block-media-text>.wp-block-media-text__content {
	padding-left: 8%;
	padding-right: 0px;
}

.has-media-on-the-right .wp-block-media-text__content {
	padding-left: 0px; }

/* Equal Height Columns in Group Blocks*/

.equal-height-group, .equal-height-group .wp-block-group__inner-container .wp-block-columns .nhsuk-card{
	margin-bottom: 0  !important;
	padding-bottom: 0 !important;
}
/* 1. Force columns to stretch (WP already uses flex) */
.equal-height-group .wp-block-column {
  align-self: stretch !important;
  display: flex !important;
}

/* 2. Force the NHS card to fill the column */
.equal-height-group .nhsuk-card {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  width: 100%;
}

/* 3. Make inner content stretch */
.equal-height-group .nhsuk-card__content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 4. Push description down */
.equal-height-group .nhsuk-card__description {
  margin-top: auto;
}


/* details/summary accordions */
details {background: #f6f6f6; padding: 10px;
border: 1px solid #d8dde0;}




/* =================================================
   FOOTER
   ================================================= */

footer .nhsuk-footer-container,
footer .nhsuk-footer {
  background-color: #003087;
  color: #fff !important;
}

.nhsuk-footer-container,
.nhsuk-footer * {
  color: #fff !important;
}

.footer-nhsuk-logo {
  width: 100px;
  height: auto;

}


#nhsuk-footer-widgets .nhsuk-logo {
  width: 140px;
  float: right;
}

#nhsuk-footer p {
  font-size: 1rem;
}

/* footer nav */



#menu-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1rem;
}

#menu-footer-links li a {
  color: #fff !important;
}

#menu-footer-links .current-menu-item a {
  border-bottom: none !important;
}

.footer-block {
  text-align: right;
}


/* LinkedIn square icon with rounded corners */
.menu-footer-links-container .menu-item-linkedin > a {
  position: relative;
  display: inline-block;
  padding-left: 36px; /* space for the icon */
  color: #fff;         /* fallback text color */
  text-decoration: none;
}

/* White square background with rounded corners */
.menu-footer-links-container .menu-item-linkedin > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;           /* square size */
  height: 32px;
  background-color: #fff; /* white background */
  border-radius: 6px;     /* rounded corners */
}

/* Knockout "in" letters showing footer background */
.menu-footer-links-container .menu-item-linkedin > a::after {
  content: "in";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  font-size: 14px;
  text-align: center;
  line-height: 32px;
  color: #003087;            /* match footer background color */
  pointer-events: none;   /* keeps link clickable */
}


.footer-text {
  clear: both;
  padding-top: 10px;
  display: flex;
  flex-direction: column;   /* stack vertically */
  align-items: flex-end;    /* align right */
}

.footer-text * {margin-top: 16px;margin-bottom: 16px; text-align:right;}

.nhsuk-footer {display: none !important;}

/* =================================================
   MOBILE
   ================================================= */

@media (max-width: 768px) {
	.homepage-header {
		background: #003087;
	}
	
	.homepage-header .homepage-header-col1 {
		padding-right: 5% !important
	}
	
  .custom-header-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .nhsuk-header__logo {
    order: 2;
  }

  .nhsuk-header__content {
    order: 3;
    width: 100%;
    margin: var(--nhs-spacing-3) 0;
  }

  .header-nhs-logo {
    order: 1;
    margin: var(--nhs-spacing-3);
    transform: none;
  }
	
	.sign-up {
		padding: 20px !important;
	}
	
.footer-text {
    align-items: flex-start;  /* align left on mobile */

  }
	
	.footer-text * {
		text-align: left;
	}
	
	.nhsuk-footer__copyright {
		display: none;
	}	
}
