/*
 Theme Name:   NPHAIB
 Theme URI:    https://generatepress.com
 Description:  A custom theme built on top of GeneratePress.
 Author:       MSI Communications
 Author URI:   https://msialaska.com
 Template:     generatepress
 Version:      0.1
*/


/* ------------------------------------------------------------
   Site-wide focus ring (WCAG 2.2 AA, SC 2.4.7 / 2.4.11)
   GeneratePress and GenerateBlocks strip outlines on some controls.
   :where() keeps specificity at zero so components can refine it.
   ------------------------------------------------------------ */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent, #007777);
  outline-offset: 2px;
}

/* Inputs: keep the ring tight to the field */
:where(input, select, textarea):focus-visible {
  outline-offset: 0;
}

/* Accent-filled controls get a white ring so it stays visible */
:where(.gb-button, .wp-block-button__link, .wp-block-search__button):focus-visible {
  outline-color: #fff;
  outline-offset: -4px;
}

@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-color: Highlight;
  }
}

/* Search block (button-inside style): core removes the input outline,
   so ring the pill wrapper whenever the field or button has focus */
.wp-block-search__button-inside .wp-block-search__inside-wrapper:focus-within {
  outline: 3px solid var(--accent, #007777);
  outline-offset: 2px;
}


/* The Events Calendar - use our font stack please */

[class*="tribe-events-"],
[class*="tribe-common-"] {
	font-family: Lato, sans-serif !important;
}


/* PIH People CSS - move this later */

.pih-people-directory .pih-people-area,
.pih-people-directory .pih-people-committee {
  margin-block-end: 3rem;
}

.pih-people-directory .pih-people-area > h3 {
  margin-block: 2.25rem 1rem;
}

.pih-people-directory .pih-staff-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}

.pih-people-directory .pih-staff strong,
.pih-people-directory .pih-staff span {
  display: block;
}

.pih-people-directory .pih-staff span {
  margin-block-start: .2rem;
}

/* Compact Executive Committee cards */
.pih-committee-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.pih-committee-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9dee2;
  background: #fff;
}

.pih-committee-photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f2f3f1;
}

.pih-committee-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

/* Brandon's logo placeholder */
.pih-committee-card:nth-child(3) .pih-committee-photo img {
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.pih-committee-card-body {
  padding: .75rem;
}

.pih-committee-card-body h3 {
  font-size: 1rem;
  line-height: 1.25;
  margin-block: 0 .4rem;
  font-weight: 700;
}

.pih-committee-card-body p {
  font-size: .8rem;
  line-height: 1.35;
  margin-block: .25rem;
}
.pih-committee-position {
  font-weight: 700;
}

@media (max-width: 900px) {
  .pih-people-directory .pih-staff-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pih-committee-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .pih-people-directory .pih-staff-list {
    grid-template-columns: 1fr;
  }

  .pih-committee-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .pih-committee-grid {
    grid-template-columns: 1fr;
  }
}

.pih-people-directory .pih-staff .pih-staff-identity strong,
.pih-people-directory .pih-staff .pih-staff-affiliation {
  display: inline;
}

.pih-people-directory .pih-staff .pih-staff-title {
  display: block;
  margin-top: .2rem;
}

/* divider line */
.pih-staff-directory .pih-people-area > h3 {
  margin-block: 2.75rem 1.25rem;
}

.pih-staff-directory .pih-people-area > h3::before {
  content: "";
  display: block;
  height: 8px;
  margin-bottom: 1.25rem;
  background: var(--pih-desert);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='8' viewBox='0 0 80 8'%3E%3Cpath d='M0 4 Q20 1 40 4 T80 4' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='8' viewBox='0 0 80 8'%3E%3Cpath d='M0 4 Q20 1 40 4 T80 4' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") repeat-x;
}

/* end PIH People CSS */


/* Upcoming Events using The Events Calendar on front page
--------------------------------------------- */

.pih-upcoming-events {
	display: grid;
	gap: 2rem;
	max-width: 42rem;
}

.pih-upcoming-event {
	display: grid;
	grid-template-columns: 4rem 1fr;
	gap: 1.25rem;
	align-items: start;
}

/* Date block */

.pih-upcoming-event__date {
	text-align: left;
	line-height: 1;
}

.pih-upcoming-event__month {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.pih-upcoming-event__day {
	display: block;
	font-size: 2rem;
	font-weight: 400;
	margin-top: 0.15rem;
}

/* Event content */

.pih-upcoming-event__content {
	min-width: 0;
}

.pih-upcoming-event__title {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
}

.pih-upcoming-event__title a {
	color: inherit;
	text-decoration: none;
}

.pih-upcoming-event__title a:hover,
.pih-upcoming-event__title a:focus {
	text-decoration: underline;
}

.pih-upcoming-event__time,
.pih-upcoming-event__location {
	font-size: 0.875rem;
	line-height: 1.35;
}

.pih-upcoming-event__location {
	margin-top: 0.15rem;
}

/* The Events Calendar inserts its own wrapper in schedule details */

.pih-upcoming-event__time .tribe-events-schedule {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
}

/* Event Details */

.pih-upcoming-event__button {
	display: inline-block;
	margin-top: 0.75rem;
	padding: 0.4rem 0.8rem;
	border: 2px solid currentColor;
	border-radius: 4px;
	color: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
}

/* View Calendar */

.pih-upcoming-events__calendar {
	justify-self: center;
	display: inline-block;
	padding: 0.5rem 1.25rem;
	border-radius: 999px;
	background: var(--pih-legacy);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	
	&:hover {
		background: var(--pih-pnw);
		color: #fff;
	}
}

/* Mobile */

@media (max-width: 600px) {
	.pih-upcoming-event {
		grid-template-columns: 3.25rem 1fr;
		gap: 0.75rem;
	}

	.pih-upcoming-events__calendar {
		justify-self: start;
	}
}
/* End front page formating for The Events Calendar shortcode */

a[href^="mailto:" i]:not(.site-footer a, footer a, .no-email-icon)::before {
  content: "";
  display: inline-block;
  inline-size: 1.125em;
  block-size: 1.125em;
  margin-inline-end: 0.2em;
  vertical-align: -0.2em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

a[href^="mailto:" i]:not(.site-footer a, footer a, .no-email-icon) {
  color: var(--pih-legacy);
  font-weight: 600;
}


/* ---------- Search Results ---------- */

.search-results #main {
	max-width: var(--gb-container-width);
	margin-inline: auto;
	padding: 3rem 1.5rem;
}

/* Search Results for: ... */
.search-results .page-header {
	margin-bottom: 3rem;
}

.search-results .page-title {
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1.1;
}

/* ---------- Individual Results ---------- */

.search-results article {
	margin: 0 0 2rem;
	padding: 0 0 2rem;
	border-bottom: 2px solid var(--pih-yellow);
}

/* Result titles */
.search-results .entry-title {
	margin: 0 0 0.75rem;
	font-size: 1.5rem;
	line-height: 1.25;
}

.search-results .entry-title a {
	color: var(--pih-legacy);
	text-decoration: none;
}

.search-results .entry-title a:hover,
.search-results .entry-title a:focus {
	text-decoration: underline;
}

/* Excerpts */
.search-results .entry-summary {
	margin: 0;
	max-width: 55rem;
}

.search-results .entry-summary p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
}

/* Read more */
.search-results .read-more {
	font-weight: 700;
	white-space: nowrap;
}


/* ---------- Results With Featured Images ---------- */

.search-results article.has-post-thumbnail .inside-article {
	display: grid;
	grid-template-columns: 12rem 1fr;
	grid-template-areas:
		"image title"
		"image summary";
	gap: 0.5rem 1.5rem;
	align-items: start;
}

.search-results article.has-post-thumbnail .entry-header {
	grid-area: title;
}

.search-results article.has-post-thumbnail .post-image {
	grid-area: image;
	margin: 0;
}

.search-results article.has-post-thumbnail .entry-summary {
	grid-area: summary;
}

/* Consistent 4:3 thumbnail */
.search-results .post-image img {
	display: block;
	width: 12rem;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}


/* ---------- Mobile ---------- */

@media (max-width: 600px) {

	.search-results #main {
		padding: 2rem 1rem;
	}

	.search-results .page-header {
		margin-bottom: 2rem;
	}

	.search-results article.has-post-thumbnail .inside-article {
		display: block;
	}

	.search-results article.has-post-thumbnail .post-image {
		margin: 0 0 1rem;
	}

	.search-results .post-image img {
		width: 100%;
		max-width: 20rem;
	}

}
/* End Search Results formatting */