*,
:after,
:before {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    font-family: system-ui;
    font-weight: 400;
    font-style: normal;
    color: #000;
    font-size: 16px;
    line-height: 1.6em;
    background-color: #fff;
}

a {
    color: #000;
    text-decoration: none;
}

a:hover {
    color: #395fff;
}

.status-message {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 10px;
    font-size: 1.2rem;
    border-radius: 100px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    background-color: #89edbb;
    -webkit-transition: opacity 300ms ease, -webkit-transform 300ms ease;
    transition: opacity 300ms ease, -webkit-transform 300ms ease;
    transition: transform 300ms ease, opacity 300ms ease;
    transition: transform 300ms ease, opacity 300ms ease, -webkit-transform 300ms ease;
    opacity: 0;
    white-space: nowrap;
    line-height: 1.4rem;
}

.status-message.visible {
    -webkit-transform: translate(-50%, -40%);
    transform: translate(-50%, -40%);
    opacity: 1;
}

.status-message .emoji {
    font-size: 1.6rem;
    display: block;
    margin-right: 4px;
    padding-top: 2px;
}

.content-head {
    margin-top: 1em;
}


main .grid {
    display: flex;
}

main .grid .content {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    padding: 20px 30px 60px 40px;
}

main .grid aside {
    padding-top: 54px;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 40vw;
    max-width: 502px;
}

nav#content-nav .wrapper ul {
    display: flex;
    align-items: center;
    flex-flow: row wrap;
    gap: 10px;
    margin-bottom: 2em;
}

nav#content-nav .wrapper ul li {
    list-style-type: none;
}

nav#content-nav .wrapper ul li:last-child {
    margin-right: 0;
}

nav#content-nav .wrapper ul li a,
nav#content-nav .wrapper ul li div {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    background-color: #f4f4f4;
    border-radius: 8px;
    white-space: nowrap;
    transition: color 400ms ease, background-color 400ms ease;
}

nav#content-nav .wrapper ul li a:hover {
    color: #000;
    background-color: #e7e7e7;
}

nav#content-nav .wrapper ul li.active.has-children a:after,
nav#content-nav .wrapper ul li.active.has-children div:after {
    background-image: url(/images/icon-arrow-white.svg);
}

nav#content-nav .wrapper ul li.has-children {
    position: relative;
}

nav#content-nav .wrapper ul li.has-children a,
nav#content-nav .wrapper ul li.has-children div {
    position: relative;
    padding: 8px 30px 8px 16px;
}

nav#content-nav .wrapper ul li.has-children a:after,
nav#content-nav .wrapper ul li.has-children div:after {
    content: "";
    position: absolute;
    right: 14px;
    top: 0;
    width: 8px;
    height: 100%;
    background-image: url(/images/icon-arrow-black.svg);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% auto;
    -webkit-transition: -webkit-transform 200ms ease;
    transition: -webkit-transform 200ms ease;
    transition: transform 200ms ease;
    transition: transform 200ms ease, -webkit-transform 200ms ease;
}

nav#content-nav .wrapper ul li.has-children:hover a {
    border-radius: 8px 8px 0 0;
}

nav#content-nav .wrapper ul li.has-children:hover a:after {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}

nav#content-nav .wrapper ul li.has-children:hover .subnav {
    display: block;
}

nav#content-nav .wrapper ul li .subnav {
    display: none;
    position: absolute;
    left: 0;
    background-color: #f4f4f4;
    border-radius: 0 8px 8px 8px;
    overflow: hidden;
    z-index: 100;
}

nav#content-nav .wrapper ul li .subnav li {
    margin: 0;
    width: 100%;
}

nav#content-nav .wrapper ul li .subnav li a {
    width: 100%;
    border-radius: 0;
    background-color: transparent;
    color: #000;
}

nav#content-nav .wrapper ul li .subnav li a:after {
    display: none;
}

nav#content-nav .wrapper ul li .subnav li a:hover {
    background-color: #e7e7e7;
    border-radius: 0;
}

nav#content-nav .wrapper ul li .subnav li.active a {
    background-color: #395fff;
    color: #fff;
    border-radius: 0;
}

aside .emoji-group {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 7.5px;
    padding-left: 30px;
    padding-right: 40px;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

aside .emoji-group a {
    font-weight: 400;
    cursor: pointer;
}

aside .emoji-list {
    padding-left: 30px;
    padding-right: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #d9d9d9;
}

aside .emoji-list .emoji:hover {
    background-color: #fff;
}

aside .emoji-list:last-of-type {
    border-bottom: none;
    padding-bottom: 15px;
}

.emoji-list {
    display: flex;
    width: 100%;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-flow: row wrap;
    flex-flow: row wrap;
    margin-top: 7.5px;
    margin-bottom: 45px;
}

.emoji-list .emoji {
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background-color: transparent;
    cursor: pointer;
    -webkit-transition: border 400ms ease, background-color 400ms ease;
    transition: border 400ms ease, background-color 400ms ease;
}

.emoji-list .emoji .emoji-symbol {
    font-size: 2rem;
    display: block;
    padding-top: 2px;
    -webkit-transition: -webkit-transform 400ms ease;
    transition: -webkit-transform 400ms ease;
    transition: transform 400ms ease;
    transition: transform 400ms ease, -webkit-transform 400ms ease;
}

.emoji-list .emoji:hover,
.emoji-list .emoji.active {
    background-color: #f4f4f4;
    border: 1px solid #ccc;
}

.emoji-list .emoji:hover .emoji-symbol,
.emoji-list .emoji.active .emoji-symbol {
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
}

.emoji-list.emoji-term .emoji-with-text {
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    background-color: #f4f4f4;
    border: 1px solid transparent;
    border-radius: 8px;
    margin-right: 10px;
    margin-bottom: 10px;
    -webkit-transition: border 400ms ease;
    transition: border 400ms ease;
    cursor: pointer;
}

.emoji-list.emoji-term .emoji-with-text .emoji {
    border: none;
    width: 2.4rem;
    height: 2.4rem;
}

.emoji-list.emoji-term .emoji-with-text .emoji .emoji-symbol {
    font-size: 1.7rem;
}

.emoji-list.emoji-term .emoji-with-text .emoji-text {
    display: block;
    padding-right: 10px;
}

.emoji-list.emoji-term .emoji-with-text:hover {
    border: 1px solid #d2d2d2;
}

.emoji-list.emoji-term .emoji-with-text:hover .emoji {
    background-color: transparent;
    border: none;
}

.emoji-list.emoji-term .emoji-with-text:hover .emoji .emoji-symbol {
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
}

.emoji-list.emoji-term .emoji-with-text.hidden {
    display: none;
}

.menu-btn {
    display: none;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.menu-btn:focus {
    outline: none;
}

.menu-btn:active {
    outline: none;
}

header {
    background: linear-gradient(135deg, #3A469A 0%, #33A9CB 100%);
    padding: 15px 20px;
    width: 100%;
}

.nav_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
}

.nav_top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    height: 35px;
    width: auto;
}

.search_box {
    display: flex;
    align-items: center;
}

.search_box form {
    display: flex;
    align-items: center;
}

.search_input {
    height: 40px;
    min-width: 250px;
    padding: 0 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
}

.search_button {
    height: 40px;
    padding: 0 20px;
    background-color: #fff;
    color: #33a9cb;
    border: none;
    border-radius: 0 4px 4px 0;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    transition: background-color .3s;
}

.search_button:hover {
    background-color: #f0f0f0;
}

.hamburger .line {
    width: 40px;
    height: 5px;
    background-color: #ecf0f1;
    display: block;
    margin: 8px auto;
    -webkit-transition: all .3s ease-in-out;
    -o-transition: all .3s ease-in-out;
    transition: all .3s ease-in-out;
}

.hamburger:hover {
    cursor: pointer;
}

#hamburger-1.is-active .line:nth-child(2) {
    opacity: 0;
}

#hamburger-1.is-active .line:nth-child(1) {
    -webkit-transform: translateY(13px) rotate(45deg);
    -ms-transform: translateY(13px) rotate(45deg);
    -o-transform: translateY(13px) rotate(45deg);
    transform: translateY(13px) rotate(45deg);
}

#hamburger-1.is-active .line:nth-child(3) {
    -webkit-transform: translateY(-13px) rotate(-45deg);
    -ms-transform: translateY(-13px) rotate(-45deg);
    -o-transform: translateY(-13px) rotate(-45deg);
    transform: translateY(-13px) rotate(-45deg);
}

.nothing-found {
    line-height: 2.5rem;
    font-size: 1.5rem;
    color: #999;
    margin-top: 2em;
}

footer {
    background-color: #000;
    color: #fff;
    text-align: center;
    padding: 20px 15px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.footer-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color .3s;
}

.footer-nav a:hover {
    color: #156b1b;
}

footer p {
    margin: 0;
    font-size: 14px;
}


.page_content h2 {
    font-size: 1.5rem;
    margin-top: 1em;
    margin-bottom: 10px;
    color: #000;
}

.page_content h1 {
    font-size: 2rem;
    margin-top: 1em;
    margin-bottom: 10px;
    color: #000;
}

.page_content ul,
.page_content ol {
    list-style-position: inside;
}

/* --- Media Queries --- */

@media (max-width: 768px) {
    main .grid aside {
        width: 100%;
        max-width: 100%;
    }

    main .grid {
        display: block;
    }

    main .grid .content {
        padding-left: 25px;
        padding-right: 15px;
    }

    .status-message {
        width: 94vw;
        white-space: normal;
    }

    .status-message .emoji {
        margin-right: 8px;
    }

    .menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #content-nav {
        display: none;
    }

    #content-nav ul li {
        width: 48%;
    }

    .nav_wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .search_box {
        width: 100%;
    }

    .search_box form {
        width: 100%;
    }

    .search_input {
        flex: 1;
        min-width: unset;
    }
}


/* --- New Styles for Compact Desktop Layout --- */

/* This rule applies to screens wider than 768px (desktops) */
@media (min-width: 769px) {

    /* 1. Constrain and center the main content area */
    main {
        max-width: 1280px; /* You can adjust this value */
        margin-left: auto;
        margin-right: auto;
        padding-left: 20px; /* Adds some space on the sides */
        padding-right: 20px;
    }

    /* 2. Give the right sidebar a more consistent width */
    main .grid aside {
        flex-basis: 340px; /* Sets a base width for the sidebar */
        width: 340px; /* Explicitly sets the width */
        max-width: 340px; /* Overrides the previous max-width */
        flex-shrink: 0; /* Prevents the sidebar from shrinking */
    }

    /* 3. Constrain and center the header to match the main content */
    .nav_wrapper {
        max-width: 1280px; /* Must be the same as 'main' */
    }

}

main .content .emoji-group a {
    color: red !important;
}

/* --- Styles for New Desktop Horizontal Menu --- */

/* Hide on mobile by default */
.desktop-nav {
    display: none;
}

/* Styles for the horizontal menu on desktop */
@media (min-width: 769px) {
    .desktop-nav {
        display: block; /* Show on desktop */
        margin: 0 20px; /* Adds some space around the menu */
    }

    .desktop-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex; /* This creates the horizontal layout */
        align-items: center;
        gap: 10px; /* Space between menu items */
    }

    .desktop-nav ul li a {
        color: #fff;
        text-decoration: none;
        padding: 8px 12px;
        display: block;
        border-radius: 4px;
        transition: background-color 0.3s;
        font-weight: 500;
        white-space: nowrap;
    }

    .desktop-nav ul li a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        text-decoration: none;
    }
}
