/*  
Theme Name: Spiderban Theme
Theme URI: http://sww.co.nz/
Description: Custom WordPress theme by Stellar Web Works
Version: 1.0
Author: Aidan Curran
Author URI: http://sww.co.nz/
*/

/* 
   Contents:
   0. Variables
   1. Basics
   2. Header
   3. Sticky Header
   4. Navigation Menus
   5. Dropdown Menu
   6. Lists
   7. Blockquotes
   8. Style classes for use in Editor
   9. Sections (Groups)
   10. Columns
   11. Cover Block
   12. Call to action
   14. Photo Layout
   17. Cards   
   20. Footer
   21. Gutenberg overrides and workarounds


   R. Responsive Elements
   R1. Defaults
   R2. MEDIUM-WIDE SCREEN (max-width: 1200px)
   R3. MEDIUM-SMALL SCREEN (max-width: 1000px)
   R4. SMALL SCREEN (max-width: 700px)

*/

/* -------------------------------------------------------------------------------------------------------------------- 
   0. Variables
*/
:root {
   /* colour shortcuts */
   --red: var(--wp--preset--color--red);
   --pure-red: var(--wp--preset--color--pure-red);
   --dark-red: var(--wp--preset--color--dark-red);
   --blue: var(--wp--preset--color--blue);
   --light-grey: var(--wp--preset--color--light-grey);
   --grey: var(--wp--preset--color--grey);
   --dark-grey: var(--wp--preset--color--dark-grey);
   --grey-tint: var(--wp--preset--color--grey-tint);
   --dark: var(--wp--preset--color--dark);

   /* font size shortcuts */
   --xs: var(--wp--preset--font-size--x-small); /* 15-17px */
   --sm: var(--wp--preset--font-size--small); /* 17-22px */
   --m: var(--wp--preset--font-size--medium); /* 18-24px */
   --l: var(--wp--preset--font-size--large); /* 24-32px */
   --xl: var(--wp--preset--font-size--x-large); /* 32-48px */
   --xx: var(--wp--preset--font-size--xx-large); /* 32-64px */
   --xw: var(--wp--preset--font-size--xw-large); /* 16-64px */

   /* spacing shortcuts */
   --sp1: var(--wp--preset--spacing--10); /* 8-16px */
   --sp2: var(--wp--preset--spacing--20); /* 16-32px */
   --sp3: var(--wp--preset--spacing--30); /* 24-48px */
   --sp4: var(--wp--preset--spacing--40); /* 32-64px */
   --sp5: var(--wp--preset--spacing--50); /* 48-96px */
   --sp6: var(--wp--preset--spacing--60); /* 70-140px */
   --sp7: var(--wp--preset--spacing--70); /* 80-160px */

   --header-height-full: 180px;
   --header-height-mobile-full: 100px;
   --sticky-height: 80px;
}


/* -------------------------------------------------------------------------------------------------------------------- 
   1. Basics
*/
/* set a reasonable absolute max width for the entire site (for massive screens) */
body {
   max-width: 3000px;
   margin-left: auto;
   margin-right: auto;
   min-width: 300px;
}
/* Set content width as percentage when max width is not in play (because styles > spacing > padding does not get applied to content inside a full width block ) */
body .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
   width: 90%;
}
/* cancel out above rule affecting image alignment block editor */
.block-editor-block-list__layout figure {
   width: auto;
}
h3 a {
   text-decoration: none;
   color: var(--dark);
}
h3 a:hover {
   color: var(--pure-red);
}


/* -------------------------------------------------------------------------------------------------------------------- 
   2. Header
*/
header.wp-block-group {
   background-color: var(--light-grey);
   padding: 0;
   height: 80px;
   overflow: visible;
}
#header-container {
   #height: var(--header-height-full);
   display: flex;
   justify-content: space-between;
   align-items: top;
   padding-top: 15px;
}
#headermiddle {
   flex-basis: 300px;
   flex-grow: 0;
   flex-shrink: 0; 
   background-color: white;  
   border-bottom-left-radius: 15px;
   border-bottom-right-radius: 15px;
   padding: 10px;
   z-index: 10;
}
#headerleft, #headerright {
   flex-grow: 1;
   flex-shrink: 1;
   position: relative;
   flex-basis: 50%;
}
header #logo {
   display: block;
   width: 250px;
   margin: 0 auto;
   height: auto;
   transition: all 0.25s;
}
header #logo img {
   width: 100%;
   height: 100%;
   object-fit: contain;
   overflow: hidden;
   transition: all 0.2s;
}
header #logo img:hover {
   scale: 1.02;
}
@media screen and (max-width: 500px) {	
   #headermiddle {
      flex-basis: 60%;
   }
   header #logo {
      width: auto;
   }

}

/* --------------------------------------------------------------------------------------------------------------------
   3. Sticky Header
*/
/* The sticky class is added to the header with JS when it reaches its scroll position */
#header-sticky.sticky {
   position: fixed;
   top: 0;
   width: 100%;
   z-index: 10;
   /*height: var(--sticky-height);*/
   box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.1);
   background-color: rgba(255,255,255,0.9);
}
#header-sticky.mobile-menu-open {
   /*position: static;*/
   height: auto;
}
#header-sticky.sticky #header-container {
   max-height: var(--sticky-height);
}
#header-sticky.mobile-menu-open #header-container {
   max-height: var(--header-height-mobile-full);
}
.admin-bar #header-sticky {
   top: 32px;
}
@media screen and (max-width: 782px) {
   .admin-bar #header-sticky {
      top: 46px;
   }
}
@media screen and (max-width: 600px) {
   .admin-bar #header-sticky {
      top: 0;
   }
}
#header-sticky.sticky #logo {
   width: 130px;
}
#header-sticky.sticky #headertext {
   display: none;
}
/* Add some top padding to the page content to prevent sudden quick movement (as the header gets a new position at the top of the page (position:fixed and top:0) */
/* this should be equal to the initial header height */
#header-sticky.sticky + * {
   XXXpadding-top: var(--header-height-full);
}


/* --------------------------------------------------------------------------------------------------------------------
   4. Navigation Menus
*/
nav {
   text-align: center;
}
nav ul, #subnav ul, footer nav ul {
   list-style: none;
   margin: 0;
   padding: 0;
}
nav li, #subnav li, footer nav li {
   display: inline;
   list-style: none;
   margin: 0;
   padding: 0;
   background: none;
}
nav a {
   text-decoration:none;
   display: inline-block;
   transition: all 0.4s ease;
}

.topnav {
   line-height: 30px;
}
.topnav a {
   position: relative;
   color: white;
   font-weight: bold;
   text-transform: uppercase;
   font-size: var(--sm);
   padding: 10px;
}
.topnav ul {
   display: flex;
   gap: 1px;
}
.topnav ul li {
   background-color: var(--red);
   color: white;
   flex-grow: 1;
   position: relative;
}
.topnav li:hover {
   background-color: var(--pure-red);
}
.topnav .current_page_item::after {
   font-family: 'icomoon';
	content: '\e921';
   font-size: 16px;
   line-height: 16px;
	position: absolute;
   bottom: 0;
   left: 0;
   right: 0;
   color: var(--light-grey);
}

/* --------------------------------------------------------------------------------------------------------------------
   5. Dropdown Menu
*/
.topnav ul.sub-menu { 
	display: none; 
	position: absolute; 
	top: 30px;
   left: 0;
	min-width: 150px;
	z-index: 21;
   background-color: white;
   box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.1);
   padding: 3px 20px;
}
.sticky .topnav ul.sub-menu { 
   background-color: rgba(250,250,250,0.9);
}
/* second sub level */
.topnav ul.sub-menu ul.sub-menu { 
   position: static;
   padding: 0 0 0 15px;
}
.topnav ul.sub-menu ul.sub-menu a { 
   padding: 0;
   margin: 0;
}
.topnav ul.sub-menu ul.sub-menu a::before { 
   content: " - ";
}
.topnav ul.sub-menu > li.menu-item-has-children > a {
   margin-bottom: 0;
}
.topnav ul.sub-menu li { 
   display: block;
   text-align: left;
}
.topnav ul.sub-menu.open {
	display: block;
}
.topnav ul.sub-menu a {
   opacity: 0.9;
}
#menu-main-menu > li {
	position: relative;
}
#menu-main-menu > li::before { /* to create hover buffer around menu item */
	position: absolute;
   content: '';
   width: 100%;
   height: 60px;
   top: -10px;
   left: 0;
   z-index: -1;
}
.topnav ul.sub-menu li { 
   margin:0;
}
.topnav ul.sub-menu a { 
   display: inline-block;
   padding: 2px 0;
   margin: 10px 0;
}
/*give the dropdowns an indicator arrow */
.topnav ul:not(.sub-menu) > li.menu-item-has-children > a:after {
   font-family: 'icomoon';
	content: '\e90e';
   font-size: 14px;
	display: inline-block;
	padding-left: 10px;
}
.sticky .topnav ul:not(.sub-menu) > li.menu-item-has-children > a:after {
   color: initial;
}
@media screen and (max-width: 700px) {
   .topnav ul:not(.sub-menu) > li.menu-item-has-children > a:after {
      color: initial;
   }
      
}

/* --------------------------------------------------------------------------------------------------------------------
   6. Lists
*/
ul.is-style-fancy,
ul.is-style-checkmark {
   list-style-type: none;
   padding-left: 20px;
}
ul.is-style-fancy li,
ul.is-style-checkmark li {
   margin: 15px 0;
   padding-left: 30px;
   position: relative;
}
ul.is-style-fancy li::before,
ul.is-style-checkmark li::before {
   font-family: 'icomoon';
   content: '\ea1e';
   color: var(--red);
   padding-right: 10px;
   position: absolute;
   left: 0;
   top: 3px;
}
ul.is-style-fancy li a {
   text-decoration: none;
}
ul.is-style-fancy li a:hover {
   text-decoration: underline;
}
ul.is-style-checkmark li {
   padding-left: 2rem;
}
ul.is-style-checkmark li::before {
   content: '\ea52';
   top: 4px;
}

/* --------------------------------------------------------------------------------------------------------------------
   7. Blockquotes
*/
blockquote.is-style-fancy {
   position: relative;
}
blockquote.is-style-fancy::before {
   content: "";
   position: absolute;
   display: block;
   width: 100%;
   height: 100%;
   top: 0;
   left: 0;
   background: url(images/quotes.svg) left center no-repeat;
}
.has-dark-background-color blockquote.is-style-fancy {
   background-image: linear-gradient(to right, #191919, rgba(0,0,0,0), rgba(0,0,0,0), rgba(0,0,0,0));
   color: var(--light-grey);
}
.has-dark-background-color blockquote.is-style-fancy-dark::before {
   background: url(images/quotes-dk.svg) left center no-repeat;
}


/* --------------------------------------------------------------------------------------------------------------------
   8. Style classes for use in Editor
*/
/* contact/social icons */
.fb-icon::before {
   font-family: 'icomoon';
   content: '\e904';
   display: inline-block;
   padding-right: 6px;
}
.phone-icon::before {
   font-family: 'icomoon';
   content: '\e942';
   display: inline-block;
   padding-right: 6px;
}
.mobile-icon::before {
   font-family: 'icomoon';
   content: '\e91c';
   display: inline-block;
   padding-right: 6px;
}
.mail-icon::before {
   font-family: 'icomoon';
   content: '\e903';
   display: inline-block;
   padding-right: 6px;
}
/* icons section */
.icons img {
   padding: 20px;
   width: 180px;
   border-color: var(--red);
}
@media (max-width: 700px) {
   .icons {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      grid-row-gap: 20px !important;
   }
   .icons p {
      margin-top: 10px;
   }
}

/* .nounderline */
.nounderline a {
   text-decoration: none;
   color: var(--red);
}
.nounderline a:hover {
   color: var(--pure-red);
}

/* nobr - prevent breaking inside marked text */
.nobr mark {
   white-space: nowrap;
}

.nooverflow {
   overflow: hidden;
}

/* --------------------------------------------------------------------------------------------------------------------
   9. Sections (Groups)
*/

.wp-block-group.is-style-no-padding {
   padding: 0;
}


/* --------------------------------------------------------------------------------------------------------------------
   10. Columns
*/
@media (max-width: 781px) {
   .wp-block-columns.is-style-2col-image-right {
        flex-direction: column-reverse;
   }
   .wp-block-columns.is-style-2col-image-right .wp-block-column > figure,
   .wp-block-columns.is-style-2col-image-left .wp-block-column > figure {
      max-width: 400px;
      margin:auto;
   }
}


/* --------------------------------------------------------------------------------------------------------------------
   11. Cover Block
*/
.pagetitle {
   background: var(--light-grey) url(images/web-background.webp) center center no-repeat;
   background-size: cover;
   background-position: 50% 100%;
   padding-top: 140px !important;
}
.pagetitle .inner {
   width: max-content;
   background-color: white;
   margin: 0 auto;
   border-top-left-radius: 15px;
   border-top-right-radius: 15px;
}
.pagetitle h1 {
   text-transform: uppercase;
}

/* hero */
.wp-block-cover.hero {
   height: 40vw;
   max-height: 600px;
   min-height: 300px;
   padding-top: 140px !important;
}
.wp-block-cover.hero .wp-block-group {
   width: max-content;
   background-color: rgba(255,255,255,0.75);
   border-radius: 15px;
}
@media screen and (max-width: 1000px) {
   .wp-block-cover.hero {
      height: auto;
   }
   .wp-block-cover.hero .wp-block-group {
      width: auto;
   }   
}


/* --------------------------------------------------------------------------------------------------------------------
   12. Call to action
*/
.wp-block-cover.cta {
   padding-top: var(--sp7);
   padding-bottom: var(--sp7);
}
.wp-block-cover.cta p {
   font-size: var(--xl);
   border-left: var(--sp3) solid var(--red);
   padding-left: var(--sp3);
   text-shadow: 0 0 10px black; 
}


/* --------------------------------------------------------------------------------------------------------------------
   14. Photo Layout
       using grid layout for photos, e.g. Tasman Carter
       Remove if not used
*/
.photo-layout .wp-block-image {
   height: 100%;
}
.photo-layout .wp-block-image img {
   height: 100%;
   object-fit: cover;
}

/* photo section at bottom of home page */
.photo-section .photo-layout {
   max-width: 2800px;
   margin-left: auto;
   margin-right: auto;
}
@media screen and (max-width: 1400px) {
   .photo-section .photo-layout .wp-block-group.is-layout-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
   }
   .photo-section .photo-layout .wp-block-group.is-layout-grid .stack2 {
      display: none;
   }
}



/* --------------------------------------------------------------------------------------------------------------------
   17. Cards
*/
.cards .wp-block-column {
   background-color: var(--red);
   padding: 0;
}
.cards .wp-block-column h3,
.cards .wp-block-column h3 a {
   color: white;
   margin: 0;
   padding: var(--sp1);
   font-size: var(--m);
}
.cards .wp-block-column {
   position: relative;
   transition: all 0.25s;
}
.cards .wp-block-column h3 a::after {
   content: '';
   position: absolute;
   left: 0;
   top: 0;
   right: 0;
   bottom: 0;
}
.cards .wp-block-column:hover {
   scale: 1.015;
   background-color: var(--pure-red);
}
@media screen and (max-width: 900px) {
   .cards .wp-block-column {
      max-width: 400px;
      margin-left: auto;
      margin-right: auto;
   }
}


/* --------------------------------------------------------------------------------------------------------------------
   20. Footer
*/
footer {
   background: var(--dark-red);
   background-image: linear-gradient(to bottom, var(--red), var(--dark-red) 120%);
   color: #fff;
   overflow: hidden;
   font-size: var(--sm);
}
#footer-container {
   padding: 50px 0;
}
#footerlogo {
   text-align: center;
}
#footerlogo img {
   width: 225px;
   height: auto;   
   padding: 0; 
   z-index: 10;
}
#footerhtml h4:first-child {
   margin-top: 0;
}
footer h4 {
   color: #fff;
   margin-bottom: 5px;
}
footer a {
   color: #fff;
   text-decoration:none;
}
.footercols {
   display: flex;
   align-items: center;
}
.footercol {
   flex-basis: 33.33%;
}
.footercol .inner {
   width: max-content;
   margin: 0 auto;
}
footer nav ul {
   text-align: center;
}
footer nav li {
   display: block;
   padding: 5px 0;
   text-align: left;
   line-height: 1.2em;
}
footer nav li a {
   padding: 0 0 0 10px;
   margin: 0;
   font-weight: normal;
   border-left: 15px solid rgba(255,255,255,0.1);
}
footer nav li.current_page_item > a,
footer nav a:hover {
   border-left: 15px solid white;
}
footer .phone {
   font-size: var(--l);
   font-weight: bold;
   margin: 1em 0;
}
footer .email, footer .social {
   font-size: 20px;
   font-weight: bold;
   margin: 1em 0;
}
footer a.button {
   background-color: var(--grey-tint);
   color: var(--dark);
   padding: 12px 24px;
   font-weight: bold;
   font-size: var(--m);
   text-transform: uppercase;
   margin-top: 20px;
   display: inline-block;
   border-radius: 5px;
}
footer a.button:hover {
   background-color: white;
   color: var(--red);
   scale: 1.02;
}
#credits {
   text-align: center;
   font-size: 14px;
   color: #999;
   background-color: var(--dark-red);
   padding: 10px 0;
   width: 100%;
}
#credits a {
   text-decoration: none;
   color: #999;
}
#credits a:hover {
   text-decoration: underline;
}
a.scrollup {
	width: 67px;
	height: 67px;
	position: fixed;
	bottom: 25px;
	right: 25px;
	display: none;
	text-indent: -9999px;
	background: url('images/top.png') no-repeat;
	opacity: 0.3;
}
@media screen and (max-width: 750px) {
   .footercols {
      flex-direction: column;
      text-align: center;
   }
   .footercols ul {
      width: fit-content;
      margin: auto;
   }
   #footerlogo img {
      width: 175px;
   }   
}

/* --------------------------------------------------------------------------------------------------------------------
   21. Gutenberg overrides and workarounds
*/
/* fix for fixed cover background issue on ipad */
@supports (-webkit-touch-callout: inherit) {
   .wp-block-cover .has-parallax {
      background-attachment: scroll !important;
   }
}
.wp-block-cover {
   overflow: hidden;
}
main .wp-block-cover .wp-block-cover__image-background {
   margin: auto;
}
.wp-block-spacer {
   margin: 0 !important;
}


/* --------------------------------------------------------------------------------------------------------------------
   R. Responsive Elements
*/

/* R1. Defaults: computer monitors, tablets in landscape, standard and large screens (typically wider than 1024px), old browsers */
#mobilemenu { display: none; }
img {
   max-width: 100%; 
   height: auto; 
}
   
/* R2. MEDIUM-WIDE SCREEN */
/* width 900px - 1200px */
@media screen and (max-width: 1200px) {


}

/* R3. MEDIUM-SMALL SCREEN */
/* width 700px - 1000px */
@media screen and (max-width: 1000px) {	
   #headerleft nav, 
   #headerright nav {
      background-color: var(--red);
      height: 60px;
   }
   #headerleft nav li, 
   #headerright nav li {
      display: none;
   }
   .topnav {
      background-color: #fff;
   }
   #header-sticky.sticky #headerleft {
      height: var(--sticky-height);
   }
   #header-sticky.sticky + * {
      padding-top: var(--header-height-mobile-full);
   }
   #header-container {
      width: 100%;
   }
   #mobilemenu {
      display: block;
      position: absolute;
      background-color: rgba(255,255,255,1);
      width: 100%;
      z-index: 11;
      top: 52px
   }
   header {
      position: relative;
   }   
   #mobile-menu-btn { 
      width: 32px;
      height: 32px;
      padding: 4px;
      cursor: pointer;
      position: absolute;
      top: 24px;
      right: 20px;
      background-color: var(--red);
      margin: 0;
      line-height: 36px;
   }
   #mobile-menu-btn::after { 
      font-family: 'icomoon';
      content: '\e910';
      font-size: 36px;
      color: white;
   }
   header.mobile-menu-open #mobilemenu {
      padding: 20px 0;
   }
   header.mobile-menu-open #mobile-menu-btn::after {
      content: '\e911';
   }   
   #header-sticky.sticky #mobilemenu {
      padding-top: 0;
   }   
   #mobilemenu .menu { 
      padding-bottom: 15px;
   }
   #mobilemenu ul { display:none; }
   #mobilemenu ul.open {  
     width: 100%;  
     display: block;  
     height: auto;  
     padding-top: 0;
     margin-top:0;
   }  
   #mobilemenu li {  
     width: auto;  
     float: none;  
     position: relative;  
   }  
   #mobilemenu li a {  
     display: block;
     color: var(--dark);
     background-color: white;
     text-transform: uppercase;
     font-weight: bold;
     margin: 0;
     padding: 6px 0px;
     text-align: left;  
     width: 100%;  
     text-indent: 25px;  
     line-height: 30px;
     border-left: 15px solid rgba(255,255,255,0);
   }
   #mobilemenu li.current_page_item > a {
      border-left: 15px solid var(--red);
      background-color: var(--grey-tint);
   }
   #mobilemenu li a:hover {
      border-left: 15px solid var(--red);
      color: var(--red);
   }   
   #mobilemenu ul.sub-menu { 
      display: block; 
      position: static; 
      background-color: transparent !important;
      padding: 3px 10px;
      box-shadow: none;
   }
   #mobilemenu ul.sub-menu a {
      margin: 0 0 0 10px;
      padding: 0;
   }
   #mobilemenu ul li.menu-item-has-children > a:after {
      content: '';
      padding: 0;
   }

}


/* R4. SMALL SCREEN */
/* width 320px - 700px */
@media screen and (max-width: 700px) {
   #mobile-menu-btn {
      right: 10px;
   }

}