/*-- change all variables here --*/

:root {
	/* colours */
	--text: #3b2620;
    --link: #7E9632;
    --linkHover: #d28a3a;
    --main: #bea846;
    --light: #D6C48B;
    --dark:#e89a35;
    --accent: #D28A3A;
	--bg: #DED1AD;

    /* from https://www.magicpattern.design/tools/css-backgrounds */
   background-color: #DED1AD;
opacity: 0.95;
background-image:  repeating-linear-gradient(to right, transparent 0, transparent 1.6666666666666667px, #DED1AD 1.6666666666666667px, #DED1AD 5px, transparent 5px, transparent 6.666666666666667px), repeating-linear-gradient(to bottom, transparent 0, transparent 1.6666666666666667px, #DED1AD 1.6666666666666667px, #DED1AD 5px, transparent 5px, transparent 6.666666666666667px), linear-gradient(to bottom, #D28A3A 0.6px, transparent 0.6px), linear-gradient(to right, #D28A3A 0.6px, transparent 0.6px) ;
background-size: 100% 100%, 100% 100%, 20px 20px, 20px 20px;
background-position: 0 0, 0 0, 0 -0.2px, -0.2px 0;

    /* fonts. these are all web-safe fonts, feel free to use your own or mess around. */
    --bodyfont: monospace;
    --titlefont: sans-serif;
    --cursivefont: cursive;
    --text-size: 14px;

	/* misc */
	--solid: 3px solid var(--linkHover);
	--underline: solid 1px var(--main);
    --outline: solid 2px var(--link);
    --transparent: #00000000;

    --grad-light: linear-gradient(to top, var(--light), var(--transparent));
    --grad-dark: linear-gradient(var(--dark), var(--transparent));

    /*columns*/
    --min-img-width: 150px;
    --max-img-width: 400px;
    --max-columns: 3;
    --column-gap: var(--spacing);

    /*spacing*/
    --spacing: 0.5em;
    --doublespacing: 1em;
}


/*-- body --*/

* {
    box-sizing: border-box;
}

body {
    color:var(--text);
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--bg);
    background-image: var(--bg-pattern);
    background-size: var(--bg-size);
    background-position: var(--bg-position);
    font-family: var(--bodyfont);
    font-size: var(--text-size);
}

main {
    background-color: var(--bg);
    border-right: var(--solid);
    border-left: var(--solid);
    padding: var(--spacing);
}

.head {
    padding: 0 var(--doublespacing);
}

.micro {
    margin-top: 4em;
    margin: auto;
    padding: var(--doublespacing);
    border: var(--solid);
    border-radius: 5px;
    box-shadow: var(--text) 3px 4px;
    background-color: var(--light);
    width: 80%;
    font-size: large;
}
.micro h3{margin-top: 0; text-transform: uppercase;}

footer {
    text-align: center;
    margin-top: calc(var(--doublespacing) * 2);
    padding: var(--spacing);
    background-color: var(--bg);
    width: 100%;
    bottom: 0;
    left: 0;
}


/*links*/
a{
    color: var(--link);
    background: none;
    background-color: none;
    outline: none;
    border:none;
    border-radius: none;
    text-decoration: underline;
    font-weight: bold;
    font-family: var(--bodyfont);
}
a:hover{
    color: var(--linkHover);
    background: none;
    background-color: none;
    background-image: var(--grad-light);
    outline: none;
    border:none;
    text-decoration-thickness: 3px;
}
a::after{
    content: "*"; /*change the icon if you wish, or remove it!*/
}
nav{
    text-align: center;
    text-transform: uppercase;
    font-size: larger;
}


/* headings */
h1, h2, h3, h4 {
    font-family: var(--titlefont);
    text-transform: lowercase;
}
h2 {
    background-color: var(--main);
    text-align: center;
    color: var(--background);
}
h3 {
    text-align: center;
    text-decoration: underline;
    text-decoration-style: double;
    margin: var(--spacing);
}


/*text stylings*/
em {
    font-size: larger;
}
mark {
    background-color: var(--light);
}
code{
    font-weight: bold;
    background-color: var(--light);
}
hr {
    width: 100%;
    border: var(--underline);
}
blockquote{
    border-left: var(--dark) solid 4px;
    background-image: var(--grad-light);
    padding: var(--spacing) var(--doublespacing);
}

summary{
    cursor: pointer;
}

/*filterDiv stylings*/
#container {
    overflow: scroll;
}/*stops the flex from cutting off the boxes*/

#container.columns {
    columns: var(--min-img-width) var(--max-columns);
    gap: var(--spacing);
} /*change the column number back up at the root!*/

/*this is what styles the "boxes"*/
.filterDiv {
    background-color: var(--bg);
    color: var(--text);
    border-radius: 5px;
    border: var(--solid);
    margin: 0 0 0.5em 0;
    width: 100%;
    overflow: hidden;
    display: none; /* Hidden by default */
}

.filterDiv p{
    padding: 0 1em;
}
.filterDiv h1{
    padding: 0 var(--spacing);
    margin: 0;
}
.filterDiv img{
    width: 100%;
    height: 100%;
    object-fit:contain;
}

/* The "show" class is added to the filtered elements */
.show {
  display: block;
}

/* buttons */
.btn {
    outline: none;
    border: none;
    padding: 0.7em;
     padding-top: 0.3em;
     padding-bottom: 0.3em;
    background-color: var(--link);
    color: var(--bg);
    display: inline-block;
    font-family: var(--bodyfont);
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 5px;
}
.btn:hover {
    background-color: var(--linkHover);
    outline: var(--outline);
}
/*when the button is "clicked"*/
.btn.active {
    background-color: var(--linkHover);
    outline: var(--outline);
    font-style: italic;
}
.btn::before {
    content:"#";
}

'use strict';

const marquee = {
  
  // default speed in pixels per second
  pps: 72,
  
  // scroll
  animHoriz: (el) => {
    let pps = Number(el.parentElement.getAttribute('data-speed')||marquee.pps );
    
    let pWidth =  el.parentElement.offsetWidth;
    let sWidth = el.offsetWidth;
    
    el.style.setProperty ('--p-offset', pWidth + 'px');
    el.style.setProperty ('--s-offset', (-sWidth) + 'px');
    el.style.setProperty ('--duration', ((pWidth+sWidth)/pps) + 's');
  },
  animVert: (el) => {    
    let pps = Number(el.parentElement.getAttribute('data-speed')||marquee.pps );
    
    let pHeight =  el.parentElement.offsetHeight;
    let sHeight = el.offsetHeight; 
    
    el.style.setProperty ('--p-offset', pHeight + 'px');
    el.style.setProperty ('--s-offset', (-sHeight) + 'px');
    el.style.setProperty ('--duration', ((pHeight+sHeight)/pps) + 's');
  },
  
  // alternate
  animAltHoriz: (el) => {
    let pps = Number(el.parentElement.getAttribute('data-speed')||marquee.pps );
    
    let offset = el.parentElement.offsetWidth - el.offsetWidth ;

    el.style.setProperty ('--s-offset', offset + 'px');
    el.style.setProperty ('--duration', Math.abs(offset/pps) + 's');
  },
  animAltVert: (el) => {
    let pps = Number(el.parentElement.getAttribute('data-speed')||marquee.pps );
    
    let offset =  el.parentElement.offsetHeight - el.offsetHeight;
    
    el.style.setProperty ('--s-offset', offset + 'px');
    el.style.setProperty ('--duration', Math.abs(offset/pps) + 's');
  },
  
  // slide
  animSlideHoriz: (el) => {
    let pps = Number(el.parentElement.getAttribute('data-speed')||marquee.pps );
    
    let pWidth =  el.parentElement.offsetWidth;
    
    el.style.setProperty ('--p-offset', pWidth + 'px');
    el.style.setProperty ('--s-offset', (-pWidth) + 'px');
    el.style.setProperty ('--duration', (pWidth/pps) + 's');
  },
  animSlideVert: (el) => {
    let pps = Number(el.parentElement.getAttribute('data-speed')||marquee.pps );
    
    let pHeight =  el.parentElement.offsetHeight;
    
    el.style.setProperty ('--p-offset', pHeight + 'px');
    el.style.setProperty ('--s-offset', (-pHeight) + 'px');
    el.style.setProperty ('--duration', (pHeight/pps) + 's');
  },
  
  /* LISTENERS */
  
  // redefine --*-offset on resize
  resize: () => {
    for (let k in marquee.elements) {
      marquee.elements[k].forEach(e=>{
        marquee[k](e)
      });
    }
  },
  
  // check if .marquee is onscreen before
  //  starting animation for the first time
  checkView: () => {
    document.querySelectorAll('.marquee-guts.pausit')
      .forEach(e=>{
        let rect = e.parentElement.getBoundingClientRect();
        // fully in view
        if (rect.top > -1 && rect.bottom <= window.innerHeight)
          e.classList.remove('pausit');
      });

    if(!document.querySelector('.marquee-guts.pausit'))
      removeEventListener('scroll',marquee.checkView);
  },
  
  // call marquee.setup() at end of document
  // preferably BEFORE load event
  setup: ()=> {
    marquee.sty = document.createElement('style');
    marquee.sty.setAttribute('name','marquee');
    marquee.sty.textContent = marquee.css;
    
    let head = document.querySelector('head');
    head.insertBefore(marquee.sty,head.firstChild);
      
    let o = {
      animHoriz:[],
      animVert:[],
      animAltHoriz:[],
      animAltVert:[],
      animSlideHoriz:[],
      animSlideVert:[]
    }
    
    document.querySelectorAll('.marquee').forEach( e => {
      
      let div = document.createElement('div');
      div.setAttribute('class','marquee-guts pausit');
      while(e.childNodes[0]) {
        div.append(e.childNodes[0]);
      }
      e.append(div);
    
      
      if (e.classList.contains('slide')) {
        if (checkVert(e))
          return o.animSlideVert.push(div);
        else
          return o.animSlideHoriz.push(div);
      }
      
      if (e.classList.contains('alt')){
        if (checkVert(e))
          return o.animAltVert.push(div);
        else
          return o.animAltHoriz.push(div);
      }
      
      if (checkVert(e))
        return o.animVert.push(div);
      else
        return o.animHoriz.push(div);
      
    });
      
    marquee.elements = o;
    
    addEventListener ('resize', marquee.resize);
    addEventListener ('scroll', marquee.checkView);

    marquee.resize();
    marquee.checkView();
    
    function checkVert(e) {
      return (e.classList.contains('up')||
              e.classList.contains('down'));
    }

  },
  
  css: (`/* marquee */
.marquee {
  overflow: hidden;
  border:0;
  padding:0;
  
  /* default animations */
  --loop: infinite;
  --delay: 0s;
  --hover: unset;
}

.marquee:hover .marquee-guts {
  animation-play-state: var(--hover);
}

.marquee .marquee-guts.pausit {
  animation-play-state: paused;
}

/* scrollers */
.marquee > .marquee-guts
{
  display: block;
  width: fit-content;
  
  animation-fill-mode: both;
  animation-duration: var(--duration);
  animation-timing-function: linear;
  animation-iteration-count: var(--loop);
  animation-delay: var(--delay);
  
  /* default: .left */
  animation-name: scroll-left;
  white-space: nowrap;
}

/* animation name */
.marquee.up > .marquee-guts,
.marquee.down > .marquee-guts {
  animation-name: scroll-up;
  white-space: unset;
  width: 100%;
}

.marquee.alt > .marquee-guts {
  animation-name: alt-left;
  animation-direction: alternate;
}
.marquee.up.alt > .marquee-guts,
.marquee.down.alt > .marquee-guts {
  animation-name: alt-up;
}


.marquee.slide {
  --loop: 1;
}
.marquee.slide > .marquee-guts {
  animation-name: slide-left;
}
.marquee.slide.right > .marquee-guts {
  animation-name: slide-right;
  animation-direction: normal;
  float: right;
}
.marquee.slide.up > .marquee-guts {
  animation-name: slide-up;
}

/* to stay down */
.marquee.slide.down {
  display: flex;
  align-items: flex-end;
}
.marquee.slide.down > .marquee-guts {
  flex: none;
  animation-name: slide-down;
  animation-direction: normal;
}


/* direction */
.marquee.right > .marquee-guts,
.marquee.down > .marquee-guts {
  animation-direction: reverse;
}
.marquee.left.alt > .marquee-guts,
.marquee.up.alt > .marquee-guts {
  animation-direction: alternate;
}
.marquee.right.alt > .marquee-guts,
.marquee.down.alt > .marquee-guts {
  animation-direction: alternate-reverse;
}

.marquee-guts img {
  max-width: unset;
}


/* keyframes */
@keyframes scroll-left {
  0% {
    transform: translate( var(--p-offset) , 0);
  }
  100% {
    transform: translate( var(--s-offset) , 0);
  }
}
@keyframes scroll-up {
  0% {
    transform: translate(0, var(--p-offset) );
  }
  100% {
    transform: translate(0, var(--s-offset) );
  }
}

@keyframes alt-left {
  0% {
    transform: translate( var(--s-offset) ,0);
  }
  100% {
    transform: translate(0,0);
  }
}
@keyframes alt-up {
  0% {
    transform: translate(0, var(--s-offset) );
  }
  100% {
    transform: translate(0,0);
  }
}


@keyframes slide-left {
  0% {
    transform: translate( var(--p-offset) ,0);
  }
  100% {
    transform: translate(0,0);
  }
}
@keyframes slide-right {
  0% {
    transform: translate( var(--s-offset), 0);
  }
  100% {
    transform: translate(0,0);
  }
}

@keyframes slide-up {
  0% {
    transform: translate(0, var(--p-offset));
  }
  100% {
    transform: translate(0,0);
  }
}
@keyframes slide-down {
  0% {
    transform: translate(0, var(--s-offset));
  }
  100% {
    transform: translate(0,0);
  }
}`),

}

#myBtnContainer{
    margin: var(--spacing) auto;
    margin-bottom: var(--doublespacing);
    text-align: center;
    padding: var(--doublespacing);
    width: 60%;
    line-height: 2em;
}
#myBtnContainer h2{
    margin-top: 0;
}





<style>
.link {
position: relative;
transition: clip-path 275ms ease;
}
.link:hover span::before, .link:focus span::before {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.link span {
position: relative;
display: inline-block;
}
.link span::before {
position: absolute;
content: attr(data-content);
text-decoration: underline;
clip-path: polygon(0 0, 0 0, 0% 100%, 0 100%);
transition: clip-path 275ms ease;
}
span.wavy::before {
text-decoration-style: wavy;
}
</style>


<style>
.text{
     transition: 0.5s;
   }
   
.text:hover{
  letter-spacing: 7px;
}
</style>

/* Mobile Styling */
@media only screen and (max-width: 800px){
    main{border: none} /*removes border for mobile*/
    blockquote{ margin: 0;}
    #myBtnContainer{
        width: 100%;
        line-height: 2.5em;
        margin-bottom: var(--spacing);
    }
    .micro{
        width: 100%;
        margin: auto;
    }
#container.columns {
    columns: 1;} /*single column for mobile*/
}