/* ================================
   Day – desktop
================================ */

.day {
    margin-top: 9px;
    margin-bottom: 29px;
}

.ad--top .ad__inner {
    display: flex;
    justify-content: center;

    text-align: center;
}

.day__title {
    max-width: 680px;
    margin: 20px auto 15px;

    font-size: 26px;
    font-weight: 700;
    text-align: center;
}

.moon-layout {
    position: relative;
}

.moon-datepicker {
    display: flex;
    gap: 4px;

    position: absolute;
    top: -35px;
    right: 0;
}

#datepicker {
    border: 1px solid #B8B8B8;
    border-radius: 3px;
    padding: 0 30px 0 31px;
    width: 197px;
    height: 30px;

    text-align: left;

    font-size: 14px;
    font-weight: 500;
    color: #444444;

    cursor: pointer;

    background:
            url("https://static.todaysmoonphase.com/static/img/icons/icon-calendar.svg") no-repeat 4px center / 20px 20px,
            url("https://static.todaysmoonphase.com/static/img/icons/icon-caret.svg") no-repeat right 4px center / 20px 20px,
            #ffffff;

    appearance: none;
    -webkit-appearance: none;
}

#search-btn {
    border: solid 1px #B8B8B8;
    border-radius: 3px;
    padding: 0;
    width: 30px;
    height: 30px;

    cursor: pointer;

    background:
            url("https://static.todaysmoonphase.com/static/img/icons/icon-search.svg") no-repeat center / 18px 18px,
            #ffffff;

    appearance: none;
    -webkit-appearance: none;
}

@media (hover: hover) and (pointer: fine) {
    #search-btn:hover {
        background-color: #EAEAEA;
    }
}

#search-btn.todaysmoonphase-search-btn--pointerdown {
    background-color: #EAEAEA;
}

.moon-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    padding: 25px 29px 22px 50px;
    width: 100%;

    background: #303A62;
}

/* Left moon summary card */
.moon-banner__summary {
    flex-shrink: 0;

    padding: 15px 16px 14px;
    min-width: 276px;

    color: #ffffff;
    text-align: center;

    background: #414B77;
}

.moon-banner__summary-date {
    font-size: 20px;
    font-weight: 500;
}

.moon-banner__image-wrap {
    margin-top: 12px;
}

.moon-banner__image-wrap picture {
    display: block;
}

.moon-banner__image {
    display: block;

    margin: 0 auto;
    width: 158px;
    height: 158px;
}

.moon-banner__phase {
    margin-top: 6px;

    font-size: 20px;
    font-weight: 600;
}

.moon-banner__illumination {
    margin-top: 1px;

    font-size: 16px;
    font-weight: 400;
}

/* Middle moon details */
.moon-banner__details {
    display: flex;
    flex-direction: column;

    flex: 1 0 auto;

    margin-top: 10px;
    margin-left: 21px;

    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
}

.moon-banner__detail + .moon-banner__detail {
    margin-top: 15px;
}

.moon-banner__emoji-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;

    margin-top: 13px;
}

.moon-banner__copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;

    flex-shrink: 0;

    border: none;
    border-radius: 3px;
    padding: 0 9px 0 8px;
    height: 31px;

    font-size: 14px;
    font-weight: 500;
    color: #444444;

    background: #ffffff;
}

.moon-banner__copy-icon {
    width: 15px;
    height: 15px;
}

.moon-banner__copy-btn.is-copied {
    padding: 0 9px;
}

.moon-banner__copy-btn.is-copied .moon-banner__copy-icon {
    display: none;
}

.moon-banner__map-ad-row {
    flex-shrink: 0;
}

.moon-banner__map-area {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 340px;
}

.moon-banner__map-wrap {
    width: 298px;
    height: 242px;
}

.moon-banner__map {
    width: 100%;
    height: 100%;
}

.leaflet-popup-content {
    text-align: center;
}

.leaflet-popup-content .location-text {
    font-size: 13px;
    font-weight: 500;
    color: #444;
}

.moon-banner__map-link {
    margin-top: 9px;

    font-size: 14px;
    font-weight: 400;
    color: #C4F5E8;

    text-align: center;

    text-decoration: underline;
}

/* Desktop label formatting */
.map-space {
    display: none;
}

.moon-banner__ad,
.ad__slot--tablet-middle {
    display: none;
}

.moon-banner__note {
    margin-top: 4px;

    font-size: 12px;
    font-weight: 500;
    color: #767676;
}

.moon-banner__note--fallback {
    color: #E15757;
}

.five-day-moon-section__title {
    margin: 28px 0 18px;

    font-size: 20px;
    font-weight: 600;
    color: #444444;
}

.five-day-moon-section__title-text--mobile {
    display: none;
}

.five-day-moon-section__strip {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.five-day-moon-section__divider {
    flex-shrink: 0;

    width: 1px;
    height: 285px;

    background: #C9C9C9;
}

.five-day-moon-section__divider--center-left,
.five-day-moon-section__divider--center-right {
    height: 342px;
}

.five-day-moon-section__col {
    display: flex;
    flex-direction: column;
    align-items: center;

    flex: 1 1 0;

    padding: 0 16px;
    max-width: 219px;
    min-width: 193px;

    color: #444444;
    text-align: center;
}

a.five-day-moon-section__col:hover, a.five-day-moon-section__col:focus-visible {
    text-decoration: none;
}

.five-day-moon-section__col--current{
    flex: 1.4 1 0;

    max-width: 318px;
    min-width: 256px;
}

.five-day-moon-section__date {
    margin-top: 42px;

    font-size: 17px;
    font-weight: 600;
}

.five-day-moon-section__date--current {
    margin-top: 25px;

    font-size: 20px;
}

.five-day-moon-section__image-wrap {
    margin-top: 15px;
}

.five-day-moon-section__image-wrap--current {
    margin-top: 20px;
}

.five-day-moon-section__image-wrap picture {
    display: block;
}

.five-day-moon-section__image {
    display: block;

    width: 123px;
    height: 123px;
}

.five-day-moon-section__image--current {
    width: 176px;
    height: 176px;
}

.five-day-moon-section__phase {
    margin-top: 10px;

    font-size: 16px;
    font-weight: 500;
}

.five-day-moon-section__phase--current {
    margin-top: 11px;

    font-size: 19px;
}

.five-day-moon-section__illumination {
    font-size: 14px;
    font-weight: 500;
}

.five-day-moon-section__illumination--current {
    font-size: 17px;
}

.five-day-moon-section__link-wrap {
    text-align: right;
}

.five-day-moon-section__link {
    font-size: 16px;
    font-weight: 500;
    color: #4E65B5;
}

.five-day-moon-section__link--mobile {
    display: none;
}

.five-day-moon-section__link-text {
    text-decoration: underline;
}

.five-day-moon-section__link-icon {
    display: inline-block;

    width: 23px;
    height: 23px;

    vertical-align: text-bottom;
}

@media (hover: hover) and (pointer: fine) {
    .five-day-moon-section__link:hover {
        color: #6A7EC4;
    }
}

.ad--middle-1 {
    margin-top: 19px;
    margin-bottom: 35px;
}

.ad--middle-1 .ad__inner {
    display: flex;
    justify-content: center;

    text-align: center;
}

.moon-info-section__title {
    margin-bottom: 13px;

    font-size: 23px;
    font-weight: 600;
    color: #444444;
}

.moon-info-section__text-1,
.moon-info-section__text-2 {
    font-size: 17px;
    font-weight: 400;
    color: #444444;
}

.moon-info-section__text-1 {
    margin-bottom: 24px;
}

.moon-info-section__text-2 {
    margin-bottom: 12px;
}

.sun-moon-chart {
    position: relative;

    height: 214px;
}

.sun-moon-chart canvas {
    width: 100%;
    height: 100%;
}

.sun-moon-chart__note {
    margin-top: 2px;

    font-size: 12px;
    font-weight: 400;
    color: #767676;
}

.sun-moon-chart__note--fallback {
    color: #E15757;
}

.moon-detail-section {
    margin-top: 38px;

    counter-reset: feature-counter;
}

.moon-detail-section__title {
    margin-bottom: 13px;

    font-size: 23px;
    font-weight: 600;
    color: #444444;
}

.moon-detail-section__text {
    margin-bottom: 30px;

    font-size: 17px;
    font-weight: 400;
    color: #444444;
}

.moon-detail-section__feature-title {
    margin-bottom: 17px;

    font-size: 19px;
    font-weight: 600;
    color: #444444;
}

.moon-detail-section__feature-item {
    display: flex;

    margin-bottom: 15px;

    font-size: 17px;
    font-weight: 400;
    color: #444444;

    counter-increment: feature-counter;
}

.moon-detail-section__feature-item:last-child {
    margin-bottom: 0;
}

.moon-detail-section__feature-item::before {
    content: counter(feature-counter) ".";

    flex-shrink: 0;

    margin-right: 8px;
    width: 18px;

    font-weight: 600;
    text-align: right;
}

.moon-detail-section__feature-content {
    flex-grow: 1;
}

.moon-detail-section__feature-label {
    font-weight: 600;
}

.ad--middle-2 {
    margin-top: 60px;
    margin-bottom: 28px;
}

.ad--middle-2 .ad__inner {
    display: flex;
    justify-content: center;

    text-align: center;
}

.major-phases-section {
    margin-bottom: 33px;
}

.major-phases-section__title {
    margin-bottom: 24px;

    font-size: 25px;
    font-weight: 600;
    color: #444444;
    text-align: center;
}

.major-phases-section__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.major-phases-section__card:hover, .major-phases-section__card:focus-visible {
    text-decoration: none;
}

.major-phases-section__card {
    position: relative;

    flex: 1 1 0;

    border: 1px solid #BCBCBC;
    padding: 16px;
    max-width: 282px;

    background-color: #FFFFFF;
    box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.25);
}

.major-phases-section__icon {
    position: absolute;
    top: -1px;
    right: 4px;

    width: 57px;
    height: 57px;
}

.major-phases-section__moon-image {
    margin: 32px auto 11px;
    width: 151px;
    height: 151px;
}

.major-phases-section__moon-name {
    margin-bottom: 25px;

    font-size: 21px;
    font-weight: 500;
    color: #444444;

    text-align: center;
}

.faq-section__title {
    margin-bottom: 17px;

    font-size: 25px;
    font-weight: 600;
    color: #444444;
}

.faq-section__item {
    margin-bottom: 20px;
}

.faq-section__item:last-child {
    margin-bottom: 0;
}

.faq-section__question {
    margin-bottom: 7px;

    font-size: 19px;
    font-weight: 500;
    color: #1A3190;
}

.faq-section__answer {
    font-size: 17px;
    font-weight: 400;
    color: #444444;
}

.faq-section__answer::before {
    content: "> ";
}

.ad--bottom {
    margin-top: 62px;
    margin-bottom: 29px;
}


.ad--bottom .ad__inner {
    min-height: 50px;
}





/* ================================
   Day – mobile
================================ */

@media (max-width: 1240px) { /* Moon banner responsive width adjustment 1: 1163px + 32px + 26px + 19px = 1240px */
    .moon-banner__summary {
        flex-shrink: 1;
    }
}

@media (max-width: 1232px) { /* Title 1: Title layout breakpoint, No scrollbar below this width, so subtract 15px */
    .day__title {
        margin-bottom: 41px;
    }
}

@media (max-width: 1170px) { /* Moon banner responsive width adjustment 2: 1062px + 32px + 26px + 50px = 1170px */
    .moon-banner {
        padding-right: 4px;
        padding-left: 25px;
    }
}

@media (max-width: 1120px) { /* Moon banner responsive width adjustment 3: 1062px + 32px + 26px = 1120px */
    .moon-banner {
        flex-wrap: wrap;
        gap: 29px;

        padding-right: 25px;
    }

    .moon-banner__summary,
    .moon-banner__details {
        flex: 1 1 0;
    }

    .moon-banner__details {
        margin-left: 0;
        min-width: 390px; /* 380px + 10px = 390px, Reduce the extra spacing from 26px to 10px */
    }

    .moon-banner__map-ad-row {
        display: flex;
        align-items: flex-start;
        gap: 29px;

        flex: 0 0 100%;

        min-width:0
    }

    .moon-banner__map-area {
        flex: 1 1 0;

        min-width: 0;
        width: auto;
    }

    .moon-banner__map-wrap {
        width: 100%;
        padding: 0 16px;
    }
}

@media(min-width: 778px) and (max-width: 1120px) {
    .moon-banner__ad {
        display: flex;
        justify-content: center;

        flex: 1 1 0;

        min-width:333px;
        min-height: 300px;

        text-align: center;
    }

    .ad__slot--tablet-middle {
        display:block;
    }
}

/* Five Days Moon Section [1] */
@media (max-width: 1065px) {
    .five-day-moon-section__divider {
        height: 270px;
    }

    .five-day-moon-section__divider--center-left,
    .five-day-moon-section__divider--center-right {
        height: 316px;
    }

    .five-day-moon-section__col {
        max-width: 191px;
        min-width: 165px;
    }

    .five-day-moon-section__col--current{
        flex: 1.4 1 0;

        max-width: 263px;
        min-width: 226px;
    }

    .five-day-moon-section__date {
        margin-top: 44px;

        font-size: 16px;
    }

    .five-day-moon-section__date--current {
        margin-top: 22px;

        font-size: 19px;
    }

    .five-day-moon-section__image-wrap {
        margin-top: 13px;
    }

    .five-day-moon-section__image-wrap--current {
        margin-top: 16px;
    }

    .five-day-moon-section__image {
        width: 101px;
        height: 101px;
    }

    .five-day-moon-section__image--current {
        width: 164px;
        height: 164px;
    }

    .five-day-moon-section__phase {
        margin-top: 11px;

        font-size: 15px;
    }

    .five-day-moon-section__phase--current {
        margin-top: 11px;

        font-size: 18px;
    }

    .five-day-moon-section__illumination {
        font-size: 14px;
    }

    .five-day-moon-section__illumination--current {
        font-size: 15px;
    }

    .five-day-moon-section__link-wrap{
        margin-top: 15px;
    }
}

@media (max-width: 1094px) { /* Title 2: Title layout breakpoint */
    .day__title {
        margin-bottom: 53px;
    }
}

/* Five Days Moon Section [2] */
@media (max-width: 923px) {
    .five-day-moon-section__divider {
        height: 215px;
    }

    .five-day-moon-section__divider--center-left,
    .five-day-moon-section__divider--center-right {
        height: 236px;
    }

    .five-day-moon-section__col {
        padding: 0 8px;
        max-width: 168px;
        min-width: 131px;
    }

    .five-day-moon-section__col--current{
        flex: 1.3 1 0;

        max-width: 209px;
        min-width: 179px;
    }

    .five-day-moon-section__date {
        margin-top: 37px;

        font-size: 14px;
    }

    .five-day-moon-section__date--current {
        margin-top: 21px;

        font-size: 15px;
    }

    .five-day-moon-section__image-wrap {
        margin-top: 13px;
    }

    .five-day-moon-section__image-wrap--current {
        margin-top: 14px;
    }

    .five-day-moon-section__image {
        width: 71px;
        height: 71px;
    }

    .five-day-moon-section__image--current {
        width: 101px;
        height: 101px;
    }

    .five-day-moon-section__phase {
        margin-top: 10px;

        font-size: 13px;
    }

    .five-day-moon-section__phase--current {
        margin-top: 8px;

        font-size: 15px;
    }

    .five-day-moon-section__illumination {
        font-size: 12px;
    }

    .five-day-moon-section__illumination--current {
        font-size: 13px;
    }
}

@media (max-width: 777px) { /* Moon banner responsive width adjustment 4: 735px + 32px + 10px = 777px */
    .moon-banner {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 27px;

        padding: 25px;
    }

    .moon-banner__summary,
    .moon-banner__details,
    .moon-banner__map-ad-row {
        flex: 0 0 auto;
    }

    .moon-banner__summary {
        min-width: auto;
    }

    .moon-banner__details {
        margin-top: 2px;
        min-width: auto;
    }

    .moon-banner__map-ad-row {
        display: block;

        min-width: auto;
    }

    .moon-banner__map-area {
        min-width: auto;
    }

    .moon-banner__map-wrap {
        padding: 0;
    }
}

/* Five Days Moon Section [3] */
@media (max-width: 740px) {
    .five-day-moon-section__title-text--desktop {
        display: none;
    }

    .five-day-moon-section__title-text--mobile {
        display: inline;
    }

    .five-day-moon-section__scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .five-day-moon-section__strip {
        justify-content: normal;
    }

    .five-day-moon-section__divider--outer-left,
    .five-day-moon-section__divider--outer-right,
    .five-day-moon-section__col--outer {
        display: none;
    }

    .five-day-moon-section__col:not(.five-day-moon-section__col--current) .illumination-label {
        display: none;
    }

    html[lang="th"] .five-day-moon-section__phase {
        white-space: nowrap;
    }

    .five-day-moon-section__col {
        max-width: 222px;
        min-width: auto;
        /* min-width: 87px; */
    }

    .five-day-moon-section__col--current{
        flex: 1.4 1 0;

        max-width: 260px;
        min-width: auto;
        /* min-width: 142px; */
    }

    .five-day-moon-section__image {
        min-width: 71px;
        min-height: 71px;
    }

    .five-day-moon-section__image--current {
        min-width: 101px;
        min-height: 101px;
    }

    .five-day-moon-section__link--desktop {
        display: none;
    }

    .five-day-moon-section__link--mobile {
        display: inline;
    }
}

@media (max-width: 415px) { /* 384px + 32px - 1px */
    .five-day-moon-section__link-wrap {
        text-align: start;
    }

    .five-day-moon-section__link-icon {
        display: none;
    }
}

/* Mobile label formatting */
@media (max-width: 359px) { /* ru, nl, uk, and el wrap into three lines. */
    .map-br {
        display: none;
    }

    .map-space {
        display: inline;
    }
}





/* Major Phases Section */
@media (max-width: 1231px) {
    .major-phases-section__grid {
        gap: 23px;
    }
}

@media (max-width: 1144px) {
    .major-phases-section__card {
        flex-basis: calc(50% - 13px); /* flex: 1 1 calc((100% - 23px) / 2); */

        max-width: none;
    }
}

@media (max-width: 576px) {
    .major-phases-section__grid {
        gap: 21px;
    }

    .major-phases-section__card {
        flex-basis: calc(50% - 12px); /* flex: 1 1 calc((100% - 21px) / 2); */

        padding: 8px;
    }

    .major-phases-section__icon {
        width: 55px;
        height: 55px;
    }

    .major-phases-section__moon-image {
        margin: 50px auto 16px;
        width: 128px;
        height: 128px;
    }

    .major-phases-section__moon-name {
        margin-bottom: 44px;

        font-size: 18px;
        font-weight: 500;
    }
}

@media (max-width: 356px) {
    .major-phases-section__card {
        flex-basis: 100%;
    }
}

/* 그리고 col 쪽 current href 없애야해 */