@import url('theme.css');

/* Layout head */
.layout__head--fixed {
    position: fixed;
    z-index: 2;
    background-color: #FFFFFF;
    top: 0;
    right: 0;
    left: 0;
    transition: all 400ms ease-in-out; 
}

/* Search Section */

.search-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray_100);
    height: 96px;
    padding: 0 1.125rem;
    opacity: 1;
    border-top: 1px solid var(--gray_200);
    border-bottom: 1px solid var(--gray_200);
    transition: all 200ms ease-in-out; 
}

.search-bar__form {
    display: flex;
    align-items: center;
    background-color: #FFFFFF;
    padding: 0.938rem 1rem 0.875rem 1rem;
    border: 1px solid var(--gray_400);
    border-radius: 6px;
    height: 46px;
    width: 100%;
}

.search-bar--fixed {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 20px;
    margin: 0;
    box-shadow: 0 5px 5px -5px rgba(0,0,0, 0.25);
    transition: all 200ms ease-in-out; 
}

[dir] .search-bar__button {
    height: 1.5rem;
    width: 1.5rem;
    background-size: 1.5rem;
    object-fit: contain;
    cursor: pointer;
    border: none;
    background-color: inherit;
    background-repeat: no-repeat;
}

.search-bar__form:hover,
.search-bar__form:focus-within {
    border: 2px solid var(--brand_01);
}

.search-bar__form:focus-within {
    box-shadow: 0px 0px 0px 3px #B2C8FF;
}

.search-bar__form > input[type='search'] {
    border: none;
    background-color: inherit;
    padding: 0;
    font-size: 0.875rem;
    text-align: left;
    color: var(--text-600);
}

.search-bar__form > input[type='search']::placeholder {
    color: var(--gray_400);
}

.search-bar__form > input[type='search']::-webkit-search-cancel-button,
.search__bar .search__form .search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    position: relative;
    right: 7px;
    height: 1rem;
    width: 1rem;
    background-size: contain;
    opacity: 0;
    pointer-events: none;
}

.search-bar__form > input[type="search"]:focus::-webkit-search-cancel-button,
.search__bar .search__form .search__input::-webkit-search-cancel-button {
    opacity: 1;
    pointer-events: all;
}

.breadcrumbs-section {
    padding: 0 1.125rem;
    margin-top: 2.5rem;
}

.breadcrumbs-section > .breadcrumbs {
    padding: 0;
    padding-inline-start: 0;
    margin: 0;
}

.breadcrumbs-section > .breadcrumbs > li a{
    text-align: left;
    color: var(--gray_500);
    font-size: 0.875rem;
}

.breadcrumbs-section > .breadcrumbs > li:nth-child(n+2)::before {
    content: ' ';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
    background-size: 1rem;
    object-fit: contain;
    background-repeat: no-repeat;
}

/* Article */

.article-page__container {
    padding: 0 1.125rem;
}

.article-main {
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
    margin-bottom: 2.5rem;
}

/* Article Sidenav */

.article-main__sidenav {
    display: none;
    font-weight: normal;
    font-stretch: normal;
    line-height: normal;
    letter-spacing: var(--letter-spacing-none);
    text-align: left;
    order: 1;
}

[dir] .sidenav-menu,
[dir] .sidenav-submenu {
    list-style: none;
    margin: 0 0;
}

.sidenav-menu {
    padding-inline-start: 0;
}

.sidenav-menu__item {
    width: 13.75rem;
    margin-bottom: 0.75rem;
}

.sidenav-menu__text {
    display: block;
    margin-bottom: 0.75rem;
}

.sidenav-menu__item-has-submenu {
    padding-bottom: 1.125rem;
    border-bottom: 1px solid var(--gray_300);
    overflow: hidden;
}

.sidenav-menu__item-has-submenu > .sidenav-menu__text {
    padding: 0.938rem 0;
    margin-bottom: 0;
}

.sidenav-menu__item:last-of-type {
    border-bottom: none;
}

.sidenav-submenu {
    padding-inline-start: 10px;
    position: relative; 
}

.sidenav-submenu__item {
    display: block;
    position: relative;
}

[dir] .sidenav-submenu__text {
    display: block;
    position: relative;
    padding-top: 0.375rem;
    padding-bottom: 0.438rem;
    padding-right: 1.5rem;
    padding-left: 100%;
    margin-left: -100%;
    cursor: pointer;
}

.sidenav-submenu__item-has-children > .sidenav-submenu {
    /* display: none; */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidenav-submenu__item-has-children > .sidenav-submenu__text::after {
    display: block;
    content: ' ';
    position: absolute;
    margin: 0.375rem 0 0.438rem 0;
    right: 0;
    top: 0;
    width: 1rem;
    height: 1rem;
    background-size: 1rem;
    transition: transform 400ms ease-in-out;  
}

[dir] .sidenav-submenu-active {
    /* display:block; */
    max-height: 1000px;
}

.sidenav-submenu__text-bg-active {
    background-color: var(--sub_blue_01);
}

[dir] .sidenav-submenu__text-active a {
    color: var(--brand_01);
}

.sidenav-submenu__text-active::after {
    transform: rotate(180deg);
    transition: transform 400ms ease-in-out;
}

/* Hover state for sidenav */

.sidenav-submenu__text:hover {
    background-color: var(--sub_blue_01);
}

/* Fourth Submenu Depth */
.sidenav-submenu__item-has-children .sidenav-submenu__item-has-children .sidenav-submenu__item-has-children > .sidenav-submenu {
    border-left: 2px solid var(--gray_200);
}

.sidenav-submenu__item-has-children .sidenav-submenu__item-has-children .sidenav-submenu__item-has-children > .sidenav-submenu .sidenav-submenu__text:hover a,
.sidenav-submenu__item-has-children .sidenav-submenu__item-has-children .sidenav-submenu__item-has-children > .sidenav-submenu .sidenav-submenu__text-active a  {
    padding-left: 10px;
    margin-left: -12px;
    color: var(--sub_blue_02);
    border-left: 2px solid var(--sub_blue_02);
}

/* Article Content */

.article-main__content {
    width: 100%;
    word-wrap: break-word;
    vertical-align: text-top;
    order: 2;
    line-height: 1.5;
}

.article-body {
    word-break: break-word;
}

.article-body a {
    color: var(--brand_01);
}

/* Review Section */

iframe {
    max-width: 100%;
}

.review-section {
    background-color: var(--gray_100);
    border-radius: 0.375rem;
    padding: 2.625rem 1rem;
}

.review-textarea {
    display: none;
    margin-top: 0;
    transition: all 400ms ease-in-out;
}

.review-textarea-show {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2.375rem;
    transition: all 400ms ease-in-out;
}

[dir] .review-textarea__input {
    resize: none;
    border-color: var(--gray_300);
    padding: 0.75rem;
}

[dir] .review-textarea__input:focus {
    border-color: var(--sub_blue_02);
}

[dir] .review-textarea__input::placeholder {
    font-size: 13px;
    color: var(--gray_400);
    letter-spacing: var(--letter-spacing);
}

.review-textarea__button {
    margin-top: 1.438rem;
    width: 102px;
}

.review-textarea__button-text {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center; 
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: var(--font-normal);
    font-stretch: normal;
    height: 40px;
    padding: 0.625rem 1.75rem;
}

.review-textarea__button-text:focus,
.review-textarea__button-text:hover  {
    outline: none;
    background-color: var(--brand_02);
}

/* Like/Dislike Section */

.review-vote {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 0;
}

.review-vote__title {
    color: var(--gray_600);
    font-family: inherit;
    margin-bottom: 0.983rem;
    font-weight: var(--font-bold);
    font-size: 1.125rem;
}

.review-vote__wrapper {
    display: flex;
    width: 100%;
    margin: 0 auto;
    justify-content: center;
}

.review-vote__button {
    background-color: #FFFFFF;
    border: 1px solid var(--sub_blue_02);
    border-radius: 0.25rem;
    color: var(--sub_blue_02);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.25;
    width: 102px;
    height: 40px;
    padding: 0;
}

.review-vote__button:hover {
    border-color: var(--brand_02);
    color: var(--brand_02);
}

[dir] .review-vote__button-yes {
    margin-right: 0.5rem;
}

[dir] .vote-button__text-yes,
[dir] .vote-button__text-no {
    position: relative;
    display: block;
    padding: 0.625rem 0;
    width: 100%;
}

.review-vote__button-selected {
    color: #FFFFFF;
    background-color: var(--sub_blue_02);
}

.review-vote__button-selected:hover {
    color: #FFFFFF;
    border-color: var(--sub_blue_02);
}

.vote-helper-button,
[dir] .form-helper-button {
    display: none;
}

.review-toast-wrapper {
    position: fixed;
    top: 9rem;
    right: 0;
    left: 0;
    z-index: 3;
    opacity: 1;
    transition: opacity ease-in 500ms;
}

.review-toast {
    max-width: 250px;
    border-radius: 4px;
    border: 1px solid var(--gray_400);
    background-color: #FFFFFF;
    padding: 1.125rem;
    margin: 0 auto;
    color: var(--gray_600);
}

.review-toast--success {
    border-color: var(--correct_500);
}

.review-toast--info {
    border-color: var(--gray_400);
}

.review-toast__title {
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.review-toast__description {
    font-weight: 500;
    margin-left: 5px;
}

.review-toast--success .review-toast__title::before,
.review-toast--info .review-toast__title::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 4px;
}

.review-toast__title,
.review-toast__description {
    font-size: 1rem;
}

.test-toast {
    top: 20rem;
}

/* Table of contents section */

.article-main__toc {
   word-wrap: break-word;
   border: 1px solid var(--gray_300);
   border-radius: 0.375rem;
   padding: 0.75rem 1rem 0.75rem 1.5rem;
   order: 3;
}

.article-main__toc--mobile {
    display: block;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.article-main__toc--desktop {
    display: none;
    padding: 0.75rem 0rem;
}

.toc-title {
    position: relative;
    font-size: 1rem;
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
}

.toc-title::after {
    display: inline-block;
    position: absolute;
    right: 0;
    content: ' ';
    width: 24px;
    height: 24px;
    background-size: 24px;
    object-fit: contain;
}

.toc-content {
    display: none;
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
}

.toc-content-show {
    display: block;
    word-wrap: break-word;
}

.toc-menu {
    padding-inline-start: 0;
    list-style: none;
}

.toc-menu__item {
    margin: 1rem 0;
}

.toc-submenu {
    padding-inline-start: 1.25rem;
    list-style-type: none;
}

.toc-submenu__item {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.toc-submenu__item::before {
    content: "\2022";
    color: var(--gray_500);
    width: 0.5rem;
    font-size: 0.5rem;
}

[dir] .toc-menu,
[dir] .toc-submenu {
    margin: 0;
}

.toc-header--on-scroll {
    scroll-margin-top: 40px;
}

/* Video Main */

.video-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4rem;
}

.video-main-list {
    display: grid;
    grid-template-columns: minmax(0, 320px);
    grid-row-gap: 1.5rem;
    justify-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.video-card {
    position: relative;
    border: 1px solid var(--gray_300);
    border-radius: 5px;
    width: 100%;
}

.video-card:nth-child(n + 7) {
    display: none;
}

.video-card__header {
    background-color: #f2f2f2;
    height: 10rem;
}

[dir] .video-card__image {
    object-fit: fill;
    width: 100%;
    height: 100%;
}

.video-card__header,
.video-card__image {
    border-radius: 5px 5px 0 0;
}

.video-card__body {
    background-color: #FFFFFF;
    padding: 1.5rem 1.5rem 1.5rem;
    text-align: left;
    border-radius: 0 0 5px 5px;
}

.video-card__title {
    font-size: 1rem;
    font-weight: var(--font-bold);
    color: var(--text-600);
    line-height: 1.63;
    margin-bottom: 0.625rem;
    -webkit-line-clamp: 1;
}

.video-card__description {
    font-size: 1rem;
    color: var(--gray_600);
    line-height: 1.5;
    -webkit-line-clamp: 3;
}

.video-card__title,
.video-card__description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card__link {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    pointer-events: auto;
    content: "";
    color: transparent;
    background-color: rgba(0,0,0,0);
    opacity: 0;
}

.video-main-button {
    padding: 0.625rem 2.125rem;
    border: 1px solid var(--gray_300);
    border-radius: 4px;
    background-color: #FFFFFF;
}

.video-main-button--hidden {
    display: none;
}

.video-main-button__text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-600);
    display: flex;
    align-items: center;
}

.video-main-button__text::after {
    display: inline-block;
    content: ' ';
    width: 16px;
    height: 16px;
    background-size: 16px;
    object-fit: contain;
    margin-left: 0.25rem;
    background-repeat: no-repeat;
}

.video-main-button__text:hover,
.video-main-button__text:focus {
    color: var(--text-600);
}

/* Tablet */

@media only screen and (min-width: 768px) {

    .article-page__container,
    .breadcrumbs-section {
        padding: 0 2.5rem;
    }

    /* Search bar section */

    .search-bar--fixed {
        height: 80px;
    }

    /* Review Section */
    .review-toast-wrapper {
        top: 11rem;
        right: 1.5rem;
        left: auto;
    }

    /* Video Main */
    
    .video-main-list {
        grid-template-columns: repeat(2, minmax(0, 320px));
        grid-column-gap: 1.5rem;
    }  
}

/* Desktop */

@media only screen and (min-width: 1024px) {
    /* Article */
    
    .article-page__container {
        margin: 0 4rem;
        padding: 0 0;
    }

    .breadcrumbs-section {
        margin: 1.031rem 4rem;
        padding: 0 0;
    }

    .article-main {
        flex-direction: row;
        margin-bottom: 7.5rem;
        margin-top: 3.5rem;
    }

    /* Article Sidenav */

    .article-main__sidenav {
        display: block;
        padding-right: 2.938rem;
        border-right: 1px solid var(--gray_200);
    }

    .article-main__sidenav--hidden {
        display: none;
    }
    
    /* Article Content */
    
    .article-main__content {
        margin-left: 4.375rem;
        /* margin-right: 2.625rem; */
    }

    /* Article Table of Contents */

    .article-main__toc {
        border: none;
        align-self: flex-start;
    }

    .article-main__toc--mobile {
        display: none;
    }

    .article-main__toc--desktop {
        display: block;
        position: sticky;
        top: 11rem;
        margin-top: 0;
        transition: top 200ms ease-in-out; 
        margin-left: 2.625rem;
    }

    .toc-title::after,  
    .toc-title-active::after {
      content: none;
    }

    .toc-title {
        font-size: 16px;
        vertical-align: text-top;
        display: flex;
        align-items: center;
        width: 12.5rem;
    }

    .toc-title::before {
        display: inline-block;
        content: ' ';
        width: 16px;
        height: 16px;
        background-size: 16px;
        object-fit: contain;
        margin-right: 0.25rem;
    }

    .toc-content {
        display: block;
        word-wrap: break-word;
        width: 12.5rem;
        font-size: 16px;
    }

    /* Review Section */

    .review-section {
        margin-bottom: 3rem;
        margin-top: 2rem;
    }

    .review-toast-wrapper {
        top: 2rem;
        right: 3rem;
    }

    /* Search bar section */

    .search-bar {
        height: 124px;
    }

    .search-bar--fixed {
        height: 80px;
    }

    .search-bar__form {
        width: 31.25rem;
        height: 46px;
    }

    .search-bar__form > input[type='search'] {
        font-size: 0.875rem;
    }

    /* Video Main */

    .video-main {
        margin-bottom: 0;
    }

    .video-main-list {
        justify-content: space-evenly;
    }

    .video-main-button {
        padding: 1.063rem 3.563rem;
    }

    .video-main-button__text {
        font-size: 1rem;
    }

    .video-main-button__text::after {
        width: 24px;
        height: 24px;
        background-size: 24px;
    }
}

@media only screen and (min-width: 1366px) {
    /* Article */

    .article-page__container,
    .breadcrumbs-section {
        /* margin: 1.031rem 15rem; */
        margin: 1.031rem auto;
        max-width: 1280px;
    }

    /* Review Section */

    .review-section {
        margin-bottom: 6.25rem;
    }

    /* Video Main */

    .video-main-list {
        grid-template-columns: repeat(3, 1fr)
    }

    .video-card:nth-child(n + 7) {
        display: block;
    }

    .video-card:nth-child(n + 13) {
        display: none;
    }
}

@media only screen and (min-width: 1920px) {
    /* Article */

    .article-page__container,
    .breadcrumbs-section {
        margin: 1.031rem 20rem;
    }
}
