/*
Theme Name: Castle Hill 2026
Author: Brett Donald
*/

:root {
  --clr-blackish: #1e2b3e;
  --clr-blackish-50: #1e2b3e80;
  --clr-dark-grey: #2b323b; /* #342e37; */
  --clr-mid-grey: #707f95; /* #748091; */
  --clr-pale-grey: #f0f2f4;
  --clr-button: #d70080; /* #377e22; */
  --clr-highlight: #e6a800;
  --clr-highlighter: #ffc933; /* #ffbb00; */
  --clr-red: #cc0000;
  --gra-grey: radial-gradient(circle, rgba(88, 98, 122, 1) 0%, rgba(67, 79, 103, 1) 100%);
  --content-width-limit: 1000px;
  --tra-short: 250ms;
}

/* generic elements */
body, input, select, textarea, button {
  font-family: Cause, sans-serif;
  font-size: 16px;
  color: var(--clr-blackish);
}

input, select, textarea, button {
  font-weight: 500;
}

img {
  max-width: 100%;
}

a {
  text-underline-offset: 2px;
}

nav a {
  color: inherit;
}

.featured {
  display: block;
  margin-bottom: 2em;
}

.post-nav, .archive-nav .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
}

.archive-nav {
  margin-top: 3em;
  .nav-links {
    a {
      color: #a3adbb;
      text-decoration: none;
    }
  }
}

/* block styles and overrides */

.wp-block-button__link, .wpcf7-submit {
  padding: 0.4em 1em;
  border-radius: 0.5em;
  border: 0;
  background-color: var(--clr-button);
  color: white;
  font-size: 1.125em;
  transition: var(--tra-short);
  &:hover {
    background-color: var(--clr-highlight);
  }
}

.thin .wp-block-button__link {
  padding: 0.2em 0.5em;
}

.wp-block-embed__wrapper {
	width: 100%;
}

.aspect-16-9, .wp-embed-aspect-16-9>.wp-block-embed__wrapper {
	aspect-ratio: 16/9;
}

.aspect-18-9, .wp-embed-aspect-18-9>.wp-block-embed__wrapper {
	aspect-ratio: 18/9;
}

.wp-block-embed__wrapper>iframe {
  width: 100%;
  height: 100%;
}

/* contact form 7 */

/*
.wpcf7 {
  color: var(--clr-dark-grey);
}
*/

.wpcf7 label {
  color: var(--clr-mid-grey);
}


input[type=text], input[type=email], select, textarea {
  border: 1px solid rgb(0 0 0 / 0.2);
  padding: 3px 10px;
  border-radius: 6px;
  background: white;
  /* color: var(--clr-blackish); */
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  margin-top: 0.25em;
}

input[type=text], input[type=email], select {
  width: 300px;
}

textarea {
  width: 600px;
}

select {
  appearance: none;
  cursor: pointer;
}

/* contact form 7 messages */

.wpcf7 form .wpcf7-response-output {
  margin: 2em 0 1em;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1em;
}
.wpcf7 form.init .wpcf7-response-output {
  display: none;
}
.wpcf7 form.sent .wpcf7-response-output {
  border: 0;
}
.wpcf7 form.sent .wpcf7-response-output::before {
  content: ' ';
  background-image: url(img/icon-ok.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 3em;
  height: 3em;
}
.wpcf7 form.failed .wpcf7-response-output, .wpcf7 form.aborted .wpcf7-response-output, .wpcf7 form.spam .wpcf7-response-output {
  border: 0;
}
.wpcf7 form.failed .wpcf7-response-output::before, .wpcf7 form.aborted .wpcf7-response-output::before, .wpcf7 form.spam .wpcf7-response-output::before {
  content: ' ';
  background-image: url(img/icon-error.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 3em;
  height: 3em;
}
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.unaccepted .wpcf7-response-output {
  border: 0;
}
.wpcf7 form.invalid .wpcf7-response-output::before, .wpcf7 form.unaccepted .wpcf7-response-output::before {
  content: ' ';
  background-image: url(img/icon-warn.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 3em;
  height: 3em;
}
.wpcf7-not-valid-tip {
  color: var(--clr-red);
  margin-top: 2px;
}

/* generic layout */

body {
  margin: 0;
  @media (min-width: 1000px) {margin-bottom: 2em; margin-top: 2em;}
  background-color: var(--clr-blackish);
  background-image: url(img/texture.webp);
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

.boxed {
  margin: 0 max(0em, calc((100vw - var(--content-width-limit)) / 2));
  display: flex;
  flex-direction: column;
  @media (min-width: 740px) {
    gap: 5px;
    min-height: 100svh;
  }
  @media (min-width: 1000px) {
    min-height: calc(100svh - 10px);
  }
}

nav.mobile {
  background: var(--gra-grey);
  color: white;
  padding: 1em;
  @media (min-width: 450px) {padding-left: 2em;}
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1em;
  align-items: start;
  > :nth-child(2) {
    width: 2em;
    align-self: end;
  }
  > :last-child {
    grid-column: 1 / span 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
  }
  @media (min-width: 740px) {display: none;}
}

.mobile-search, .sidebar-search {
  font-family: Cause, sans-serif, 'Font Awesome 7 Free';
  appearance: none;
  border-radius: 0.5em;
  padding: 0.25em 0.25em 0.25em 0.75em;
  width: 200px;
  &::placeholder {
    position: relative;
    top: 1px;
  }
}

.mobile-search {
  border: 1px solid rgb(255 255 255 / 0.5);
  background: rgb(0 0 0 / 0.1);
  color: white;
  &::placeholder {color: rgb(255 255 255 / 0.5);}
}

.sidebar-search {
  border: 1px solid var(--clr-blackish-50);
  background: rgb(255 255 255 / 0.5);
  &::placeholder {color: var(--clr-blackish-50);}
  display: block;
}

.mobile-search::-webkit-search-cancel-button, .sidebar-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 16px;
  aspect-ratio: 1;
  border-radius: 99em;
  cursor: pointer;
}

.mobile-search::-webkit-search-cancel-button {
  background: url('img/close-white-50.svg') no-repeat center;
  background-size: cover;
}

.sidebar-search::-webkit-search-cancel-button {
  background: url('img/close-blackish-50.svg') no-repeat center;
  background-size: cover;
}

.main-layout {
  flex: 1;
  display: grid;
  @media (min-width: 740px) {
    grid-template-columns: minmax(0, 7fr) 4fr;
    gap: 5px;
    .main-background, main {
      grid-row: 1;
      grid-column: 1;
    }
    .sidebar-background, .sidebar {
      grid-row: 1;
      grid-column: 2;
    }
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 3px 1em;
  font-size: 15px;
  > * {
    display: contents;
    > :first-child {
      font-weight: bold;
      /* justify-self: center; */
    }
  }
  .two-span {
    justify-self: start;
    grid-column: span 2;
  }
}

main, .sidebar {
  padding: 1em 1em 2em;
  @media (min-width: 450px) {padding: 1em 2em 2em;}
}

.main-background, main {
  background-color: white;
}

.sidebar-background, .sidebar {
  background-color: rgb(255 255 255 / 0.75);
}

.main-background, .sidebar-background {
  width: 100%;
  height: 100%;
}

main, .sidebar {
  height: fit-content;
  container-type: inline-size;
}

main :is(img, iframe) {
  border-radius: 0.5em;
}

.sidebar {
  padding-top: 2em;
  @media (min-width: 740px) {background-color: initial;}
  nav {
    margin: 1em 0 2em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
  }
}

footer {
  padding: 2em 1em;
  @media (min-width: 450px) {padding: 2em;}
  background: var(--gra-grey);
  color: white;
  display: grid;
  gap: 2em;
  @media (min-width: 740px) {grid-template-columns: 1fr auto;}
  section {
    display: flex;
    flex-direction: column;
    gap: 1em;
    > p {margin: 0;}
    nav {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5em 1.5em;
      a:hover {
        color: var(--clr-highlighter);
      }
    }
  }
  .logo {
    width: 220px;
    max-width: 75%;
    @media (min-width: 740px) {max-width: 100%;}
  }
}

.posts {
  margin: 1em 0;
  display: flex;
  flex-direction: column;
  gap: 1em;
  .post {
    padding: 1em;
    margin: 0 -1em;
    display: grid;
    grid-template-columns: 7fr 4fr;
    gap: 0 1em;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    @media (min-width: 450px) {
      gap: 0 2em;
      border-radius: 0.75em;
    }
    transition: var(--tra-short);
    &:hover {
      background: #e7edf1; /* #e6eef2; */
    }
    h4 {
      margin: 0;
      grid-column: 1 / span 2;
      a {
        color: inherit;
        text-decoration: none;
        &::before {                       /* style the link to cover the whole card — refer to this SO answer: https://stackoverflow.com/a/61714604/2518285 */
          content: '';
          position: absolute;
          inset: 0;
        }
      }
    }
    .text {
      padding-top: 0.5em;
    }
    .categories {
      font-size: 0.75em;
      text-transform: uppercase;
      font-weight: 600;
      a {
        display: inline-block;
        background: var(--clr-mid-grey);
        color: white;
        padding: 2px 6px 1px;
        border-radius: 5px;
        text-decoration: none;
        position: relative;
        z-index: 1;
        &:hover {background: var(--clr-highlight);}
      }
    }
    .excerpt > :last-child {margin-bottom: 0;}
    .image {
      padding-top: 1em;
      img {
        height: 100%;
        object-fit: cover;
      }
    }
  }
}

/* order of service styles */

.order-of-service-flex {
  gap: 0;
  margin-left: -1em;
  margin-right: -1em;
  text-wrap: balance;
  @media (min-width: 500px) {
    margin-left: -0.5em;
    margin-right: 0;
  }
  > * {
    align-items: start;
    gap: 1em;
    padding: 0.5em 1em;
    @media (min-width: 500px) {padding: 0.5em;}
    > :last-child {text-align: right;}
    /*
    > :is(:first-child, :last-child):not(.shrinkable) {flex-shrink: 0;}
    */
    @container (min-width: 300px) {
      > :not(.shrinkable) {flex-shrink: 0;}
    }
  }
  > :nth-child(odd) {
    background-color: var(--clr-pale-grey);
    border-radius: 4px;
  }
/*
  a {
    color: inherit;
    text-decoration-color: rgb(0 0 0 / 0.5);
  }
*/
  @container (max-width: 360px) {
    .hide-360 {font-size: 0;}
    .remove-360 {display: none;}
    .left-360 {text-align: left;}
    .right-360 {text-align: right;}
    .shrinkable-360 {flex-shrink: 1;}
  }
  @container (max-width: 400px) {
    .hide-400 {font-size: 0;}
    .remove-400 {display: none;}
    .left-400 {text-align: left;}
    .right-400 {text-align: right;}
    .shrinkable-400 {flex-shrink: 1;}
  }
  @container (max-width: 475px) {
    .hide-475 {font-size: 0;}
    .remove-475 {display: none;}
    .left-475 {text-align: left;}
    .right-475 {text-align: right;}
    .shrinkable-475 {flex-shrink: 1;}
  }
  @container (max-width: 550px) {
    .hide-550 {font-size: 0;}
    .remove-550 {display: none;}
    .left-550 {text-align: left;}
    .right-550 {text-align: right;}
    .shrinkable-550 {flex-shrink: 1;}
  }
  @container (min-width: 475px) {
    .remove-475-inverse {display: none;}
  }
}

.credits2 {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #999;
  font-size: 0.8em;
  li {margin-bottom: 0.25em;}
}

@media (min-width: 500px) {
  .credits {
    margin-left: 0.5em;
    font-size: 0.8em;
  }
}

/* rosters page styles */

.page-id-266 {

  .wp-block-table {
    margin-left: -1em;
    margin-right: -1em;
  }
  
  @media (min-width: 500px) {
    .wp-block-table {
      margin-left: 0;
      margin-right: 0;
    }
  }
  
  .wp-block-table table {
    border-collapse: separate;
    border-spacing: 0;
    padding-bottom: 1em;
  }
  
  .wp-block-table :is(th, td) {
    min-width: 7em;
    border: 1px solid #888;
    border-left-width: 0;
    border-top-width: 0;
    text-align: left;
  }
  
  .wp-block-table th {
    padding-top: 0;
  }
  
  .wp-block-table :is(th, td):first-child {
    position: sticky;
    left: 0;
    font-weight: 600;
    background: #333;
    color: white;
  }

  .wp-block-table thead :is(th, td):first-child {
    background: white;
  }

  @media (max-width: 499.999px) {
    .wp-block-table :is(th, td):first-child {
      min-width: unset;
    }
  }
}

/* contact page styles */

.page-id-63 {

/*
  --clr-burnt-orange: #c73c12;

  .feature-image {
    border-bottom: 2px solid white;
  }
*/
  .main-background, main {
    background-color: var(--clr-pale-grey);
  }
  main {
    @media (min-width: 740px) {background-color: initial;}
  }
/*  
  input[type=text], input[type=email], select, textarea {
    border: 0;
  }

  input[type=submit] {
    background-color: var(--clr-burnt-orange);
  }
  
  input[type=submit]:hover {
    background-color: var(--clr-dark-grey);
  }

  .wpcf7-not-valid-tip {
    color: var(--clr-burnt-orange);
  }
*/
}
