/*-------------------------------------------------------------- >>> TABLE OF CONTENTS: ---------------------------------------------------------------- 0. CSS Reset 1. Layout 2. Navbar 3. Header 4. Search 5. Slider 6. Popular posts component 7. Main content, core layout 8. Post/Page article 9. Footer 10. Scroll Up Button 11. Comments Form 12. Keyframes Animations ----------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ /* 0. CSS Reset /* -------------------------------------------------------------------------- */ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;900&display=swap'); $sm: 60em; $md: 70em; *, *::before, *::after { margin:0; padding:0; box-sizing: border-box; -ms-word-break: break-all; word-break: break-all; word-break: break-word; } :root { --primary-color: #000000; --secondary-color: #577b84; --white-color: #ffffff; --grey-color: #cecece; } html { font-size: 62.5%; } body { font-size: 1.6rem; font-family: 'Montserrat', sans-serif; background: var(--white-color); } pre { white-space: pre; white-space: pre-wrap; } /* -------------------------------------------------------------------------- */ /* 1. Layout /* -------------------------------------------------------------------------- */ .container { max-width: 144rem; margin: 0 auto; @media(max-width:$md) { padding: 1rem; } } section.container { padding: 6rem 0; } .section__title { text-align: center; padding: 3rem; color: var(--primary-color); font-size: 2rem; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 2rem; } /* -------------------------------------------------------------------------- */ /* 2. Navbar /* -------------------------------------------------------------------------- */ .nav { &__search-btn { color: var(--primary-color); font-size: 3rem; cursor: pointer; transition: color .4s ease; &:hover, &:focus { color: var(--secondary-color); } } & > .container { display: flex; flex-direction: column; } &__buttons { display: flex; justify-content: center; align-items: center; @media(max-width:$sm) { margin-bottom: 1rem; } } &__navigation { display: flex; justify-content: space-between; padding: 2rem; @media(max-width:$sm) { flex-direction: column-reverse; justify-content: center; align-items: center; } } &__brand { font-size: 5rem; font-weight: bold; color: var(--primary-color); text-decoration: none; text-transform: uppercase; letter-spacing: -1px; padding: 2rem; align-self: center; text-align: center; & > img { display: block; height: 6rem; } } &__menu-list, ul { position: fixed; list-style: none; z-index: 999; top:0; left:0; width:100%; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; align-content: center; background: var(--primary-color); text-align: center; text-transform: uppercase; display:none; &.active { display: flex; } li { position: relative; padding: 0.8rem 1.6rem; color: var(--grey-color); } li a { color: var(--grey-color); transition: color .4s ease; display: inline-block; //padding: 0.5rem 1rem; text-decoration: none; text-transform: uppercase; cursor: pointer; } li a:hover, li a:active, li a:focus { color: var(--secondary-color); } li ul { list-style: none; display: none; background-color: var(--primary-color); position: absolute; top:100%; right:0; max-width: 20rem; width: 100%; z-index: 2; min-height: 5rem; border-radius: 5px; box-shadow: 0 0 0 2px var(--white-color), 0 0 0 4px var(--primary-color), 0 0 0 6px var(--white-color); width: 100%; min-width: max-content; max-width: 32rem; transition: all 1s ease-in; animation: listShow 1s; } li:hover > ul, li:focus > ul, li:active > ul { display: flex; } li.has-child::after { content: '\021F5'; color: var(--secondary-color); font-size: 17px; } &-close { position: absolute; top: 3rem; right: 3rem; color: var(--secondary-color); font-size: 5rem; cursor: pointer; transition: color .4s ease; &:hover, &:focus { color: var(--white-color); } } } &__social { display: flex; align-items: center; & > * + * { margin-left: 1rem; } &-icon { color: var(--primary-color); font-size: 2rem; transition: all .5s ease; &:hover, &:focus { color: var(--secondary-color); } } } &__menu-toggle { //position: absolute; //right:50%; transform: translateX(0); //z-index: 999; cursor: pointer; width: 50px; height: 50px; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease; margin-right: 2rem; &:hover { opacity:0.5; } } &__bar { width: 40px; height: 5px; background: var(--primary-color); transition: 2s ease; } &__bar::after { content: ''; width: 40px; height: 5px; background: var(--primary-color); position: absolute; top: 10px; transition: transform 1s; } &__bar::before { content: ''; width: 40px; height: 5px; background: var(--primary-color); position: absolute; top: 35px; transition: transform 1s; } &__menu-toggle.active &__bar { background: transparent; } &__menu-toggle.active &__bar::before { transform: rotate(45deg); top:20px; } &__menu-toggle.active &__bar::after { transform: rotate(-45deg); top:20px; } } /* -------------------------------------------------------------------------- */ /* 3. Header /* -------------------------------------------------------------------------- */ .header { width: 100%; height: 70rem; position: relative; &__overlay { width:100%; height:100%; position: absolute; top:0; left:0; //background-image: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.5)); //background-image: linear-gradient(to top, rgba(0,0,0,0.9), rgba(255,255,255,0.7)); } &_a::before { content: ''; position: absolute; top:0; left:0; width:100%; height:100%; background-image: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.5)); background-image: linear-gradient(to top, rgba(0,0,0,0.9), rgba(255,255,255,0.7)); } &__thumb { width: 100%; height: 100%; object-fit: cover; } &__content { position: absolute; bottom:0; min-height: 15rem; width: 70%; background: var(--white-color); left:50%; transform: translateX(-50%); padding: 3rem; display: flex; flex-direction: column; align-content: center; justify-content: center; } &__title { color: var(--primary-color); font-size: 5rem; font-weight: 400; text-align: center; line-height: 1; @media(max-width: $sm) { font-size: 3.5rem; } } } /* -------------------------------------------------------------------------- */ /* 4. Search /* -------------------------------------------------------------------------- */ .ashare-search { position: fixed; top:0; left:0; z-index: 50; background: rgba(#000, 0.7); width: 100vw; height: 100vh; display: none; flex-direction: column; justify-content: center; align-items: center; &.open { display: flex; } &__form { display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--secondary-color); min-width: 50%; min-height: 50%; color: var(--white-color); border-radius: 10px; position: relative; @media(max-width: 60em) { min-width: 80%; } } &__label { margin-bottom: 1rem; font-size: 6rem; text-transform: uppercase; font-family: 'Dancing Script', cursive; } &__input { border: 2px solid var(--white-color); font-size: 2rem; padding: 1rem 2rem; margin-bottom: 1rem; } &__btn { border: 2px solid var(--white-color); font-size: 2rem; padding: 1rem 2rem; cursor: pointer; color: var(--secondary-color); background: var(--white-color); transition: all 1s; &:hover, &:focus { background: var(--secondary-color); color: var(--white-color); } } &__close { position: absolute; top: 1rem; right: 1rem; font-size: 3rem; cursor: pointer; transform: scale(1); transition: transform 0.3s; &:hover { transform: scale(1.2); } } } /* -------------------------------------------------------------------------- */ /* 5. Slider /* -------------------------------------------------------------------------- */ .slider { width: 100%; //height: auto; //height: 100%; padding: 1rem 0; &__content { position: relative; width:100%; height: 50rem; & > * { display: flex; flex-flow: wrap; justify-content: center; width: 100%; height:100%; position: absolute; top:0; left:0; display:none; } & > *.active { display: flex; } & > * > * + * { margin-left: 1rem; } } &__btns { //background: red; padding: 2rem; display: flex; justify-content: center; & > * + * { margin-left: 1rem; } & > span { display: block; width: 15px; height: 15px; border-radius: 50%; background-color: var(--grey-color); cursor: pointer; transition: all 0.4s ease; } & > span.active { background-color: var(--primary-color); } & > span:hover, & > span:focus { opacity: 0.5; } } } /* -------------------------------------------------------------------------- */ /* 6. Popular posts component /* -------------------------------------------------------------------------- */ .popular-post { width: 80%; position: relative; height: 90%; &__thumb { display: block; width: 100%; height: 100%; object-fit: cover; //margin-bottom: 3rem; } &__content { background: rgba(255, 255, 255, 0.8); position: absolute; height: 50%; width: 80%; bottom:0; left:50%; margin: 0 auto 0 auto; padding: 2rem; transform: translateX(-50%); display: flex; flex-direction: column; justify-content: center; } &__category { list-style: none; text-align: center; padding: 0.5rem 1rem; text-transform: uppercase; margin-bottom: 1rem; line-height: 1.6; display: flex; flex-flow: wrap; justify-content: center; & > * + * { margin-left: 1rem; } & > li > a { text-decoration: none; color: var(--primary-color); border-bottom: 1px solid currentColor; transition: all 0.5s linear; } & > li > a:hover, & > li > a:focus { color: var(--secondary-color); } } &__title { display:block; width: fit-content; color: var(--primary-color); font-size: 2rem; margin: 0 auto; font-weight: 400; text-decoration: none; transition: color .5s ease; &:hover, &:focus { color: var(--secondary-color); } } } /* -------------------------------------------------------------------------- */ /* 7. Main Content, Core Layout /* -------------------------------------------------------------------------- */ .main { display: flex; flex-flow: wrap; padding: 4rem; min-height: 400px; background: var(--white-color); @media(max-width:$sm) { padding: 1rem; } &__404 { flex-direction: column; background-color: var(--primary-color); padding: 10rem; @media(max-width:$sm) { padding: 1rem; } & .main__search-desc { color: var(--white-color); text-align: center; margin-bottom: 8rem; @media(max-width:$sm) { margin-bottom: 4rem; } } &-title { text-align: center; font-size: 12rem; color: var(--white-color); margin-bottom: 5rem; @media(max-width:$sm) { font-size: 10rem; margin-bottom: 3rem; } } } &__title { text-align: center; font-weight: 400; color: var(--primary-color); margin-bottom: 1rem; text-transform: uppercase; } &__content { flex: 1 0 70%; @media(max-width:$sm) { flex: 1 0 100%; } .comment-list { margin-bottom: 1rem; } .comment-reply-title { margin-bottom: 1rem; } .comment { margin-bottom: 2rem; } .comment-body > * { margin-bottom: 1rem; } } &__posts { display: flex; flex-flow: wrap; } &__no-posts { text-align: center; color:var(--primary-color); margin: 4rem auto 2rem auto; } &__sidebar { flex: 1 0 30%; padding: 0 2rem; &-title { margin-bottom: 1rem; color: var(--primary-color); letter-spacing: 1px; text-transform: uppercase; } &-list, ul { list-style: none; margin-bottom: 3rem; display: flex; flex-flow: wrap; gap: 1rem; } li { list-style: none; box-shadow: 0 1rem 2rem var(--grey-color); color: var(--primary-color); img { width: 100%; } } li.widget { margin-bottom: 2rem; padding: 1rem; background: var(--white-color); } a { color: var(--primary-color); font-size: 1.5rem; text-decoration: none; text-transform: uppercase; display: inline-block; //background: var(--grey-color); //box-shadow: 0 1rem 2rem var(--grey-color); padding: 0.5rem 1rem; transition: all .4s ease; } a:hover, a:focus { color: var(--secondary-color); } } &__search { padding: 2rem; } &__search-desc { color: var(--primary-color); margin-bottom: 2rem; @media(max-width:$sm) { text-align: center; } } &__search-form { background: red; min-width: 30rem; max-width: 40%; margin: 0 auto; position: relative; } &__search-input { padding: 1rem 2rem; width: 100%; border: 2px solid var(--grey-color); } &__search-btn { position: absolute; top: 50%; transform: translateY(-50%); right: 0; cursor: pointer; height: 100%; width: 4rem; background: transparent; border: none; & > i { color: var(--primary-color); } &:hover, &:focus { background-color: var(--primary-color); & > i { color: var(--white-color); } } } &__category { text-align: center; font-weight: 400; color: var(--primary-color); margin-bottom: 1rem; text-transform: uppercase; list-style: none; display: flex; justify-content: center; & > * + * { margin-left: 1rem; } & a { text-decoration: none; color: var(--primary-color); transition: all .4s; } & a:hover { color: var(--secondary-color); } } &__comments { padding: 0 1rem 6rem 1rem; border-top: 1px solid var(--grey-color); width:95%; margin: 0 auto; &-title { text-align: center; text-transform: uppercase; margin-bottom: 4rem; font-weight: bold; background: var(--white-color); width: fit-content; margin: -2rem auto 6rem auto; padding: 1rem 2rem; letter-spacing: 1px; color: var(--primary-color); } } &__x { display: grid; grid-template-columns: 1fr 1fr; padding: 6rem 1rem; @media(max-width:$sm) { grid-template-columns: 1fr; } } &__x-left { &-thumb, img { width:10rem; float: left; margin: 0 3rem 3rem 0; } &-desc { color: var(--grey-color); text-transform: uppercase; text-align: left; margin-bottom: 1rem; font-size: 1.4rem; letter-spacing: -0.5px; } &-title { text-align: left; } a { color: var(--primary-color); font-size: 2rem; text-decoration: none; } } &__x-right { &-thumb, img { width:10rem; float: right; margin: 0 0 3rem 3rem; } &-desc { color: var(--grey-color); text-transform: uppercase; text-align: right; margin-bottom: 1rem; font-size: 1.4rem; letter-spacing: -0.5px; } &-title { text-align: right; } a { color: var(--primary-color); font-size: 2rem; text-decoration: none; } } } /* -------------------------------------------------------------------------- */ /* 8. Post/Page article /* -------------------------------------------------------------------------- */ .post { flex: 1 0 45%; padding: 1rem; margin-bottom: 2rem; //box-shadow: 0 1rem 2rem var(--grey-color); @media(max-width: $md) { flex: 1 0 100%; } &:first-child, &.sticky { flex: 1 0 100%; } &__title { font-size: 3rem; font-weight: 400; color: var(--primary-color); line-height: 1.3; text-align: center; margin-bottom: 1rem; } &__meta { display: flex; flex-flow: wrap; justify-content: center; margin-bottom: 1rem; color: var(--grey-color); text-transform: uppercase; line-height: 1.7; & a { color: var(--secondary-color); text-decoration: none; transition: color 0.5s; } & a:hover, & a:focus { color: var(--primary-color); } & > * + * { margin-left: 10px; } } &__author { color: var(--grey-color); } &__thumbnail { width: 100%; margin-bottom: 1rem; & > img { width: 100%; } } &__content { text-align: center; font-size: 1.5; padding: 1rem; color: var(--primary-color); line-height: 1.7; margin-bottom: 1rem; } &__read-more { font-weight: bold; line-height: 1.6; text-transform: uppercase; color: var(--primary-color); display: block; width: fit-content; margin: 0 auto; transition: all .5; &:hover, &:focus { color: var(--grey-color); } } &__pagination { display: flex; list-style: none; justify-content: center; align-items: center; padding: 2rem; color: var(--primary-color); & > li + * { margin-left: 1rem; } & a { text-decoration: none; color: var(--secondary-color); } & a, & span { margin-left: 1rem; } } &__share { display: flex; align-items: center; &-title { color:var(--grey-color); text-transform: uppercase; margin-right: 1rem; font-size: 2rem; } &-social { & > a { color: var(--primary-color); font-size: 2rem; margin-right: 1rem; transition: all .3s ease; } & > a:hover { color: var(--secondary-color); } } } &__tags-list { display: flex; list-style: none; margin: 2rem 0 2rem 0; justify-content: center; & > * + * > a { margin-left: 5px; } a { display: inline-block; padding: 5px 10px; color: var(--white-color); transition: color .4s ease; background: var(--primary-color); border-radius: 5px; text-decoration: none; text-transform: uppercase; } a:hover, a:focus { color: var(--secondary-color); } } } /* -------------------------------------------------------------------------- */ /* 9. Footer /* -------------------------------------------------------------------------- */ .footer { background-color: var(--primary-color); padding: 4rem; &__content { color: var(--white-color); & > .nav__social { justify-content: center; } & > .nav__social > a { color: var(--white-color); transition: all .5; } & > .nav__social > a:hover, & > .nav__social > a:focus { color: var(--secondary-color); } } &__copy { padding: 1rem; color: var(--white-color); text-align: center; & > a { color: var(--secondary-color); text-decoration: none; text-transform: lowercase; font-size: 1.5rem; } } } /* -------------------------------------------------------------------------- */ /* 10. Scroll Up Button /* -------------------------------------------------------------------------- */ #scroll-up { display: flex; justify-content: center; align-items: center; width: 4rem; height: 4rem; background: var(--primary-color); position: fixed; bottom: 2rem; right: 2rem; animation: arrowDance 2s infinite ease-in-out; cursor: pointer; display: none; &.scroll { display: flex; } & > .arrow { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 15px solid var(--grey-color); } } /* -------------------------------------------------------------------------- */ /* 11. Comments Form /* -------------------------------------------------------------------------- */ .comments-form, .comment-form { display: flex; flex-direction: column; color: var(--grey-color); &__label { margin-bottom: 2rem; font-size: 1.4rem; } p { display: flex; flex-direction: column; margin-bottom: 1rem; } &__btn, input.submit { margin-top: 2rem; align-self: flex-start; padding: 1.5rem 2rem; color: var(--white-color); background-color: var(--primary-color); border: none; text-transform: uppercase; font-weight: bold; letter-spacing: 1px; cursor: pointer; transition: all .4s; &:hover, &:focus { background-color: var(--secondary-color); } } &__input, input { padding: 2rem; border: 1px solid var(--grey-color); background-color: var(--white-color); outline: none; cursor: pointer; transition: all 1s; & + & { border-top: none; } &:hover, &:focus { background: var(--secondary-color); } } } /* -------------------------------------------------------------------------- */ /* 12. Keyframes animations /* -------------------------------------------------------------------------- */ @keyframes menuOpen { 0% { transform: translateY(-100%); } 100% { transform: translateY(0); } } @keyframes arrowDance { 0% { transform: translateY(-20%); } 100% { transform: translateY(0); } } @keyframes listShow { 0% { opacity: 0; transform: translateX(100%); } 100% { opacity: 1; transform: translateX(0); } }