/* Explain: App-specific layout utilities and structural styles. */
/* ---- Header ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #fff;
    box-shadow: 0 1px 0 var(--border-color);
}

.topbar {
    background: var(--secondary-color);
    color: #c3cbd6;
    font-size: .78rem;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
}

.topbar-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: capitalize;
}

.topbar-right {
    display: inline-flex;
    align-items: center;
    gap: 18px;
}

.topbar-link:hover {
    color: #fff;
}

.topbar-social {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.topbar-social a:hover {
    color: #fff;
}

@media (max-width: 767px) {
    .topbar-link,
    .topbar-social {
        display: none;
    }
    .topbar-inner {
        justify-content: center;
    }
}

.brandbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.menu-toggle {
    display: none;
    order: 1;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--text-color);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    order: 2;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--primary-color);
    border-radius: 3px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.brand-text em {
    color: var(--primary-color);
    font-style: normal;
}

.header-search {
    display: flex;
    flex: 1;
    order: 4;
    align-items: center;
    max-width: 340px;
    margin-left: auto;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
}

.header-search input {
    flex: 1;
    min-width: 0;
    padding: 11px 18px;
    background: transparent;
    border: 0;
    outline: none;
    font-size: .9rem;
}

.header-search button {
    flex: none;
    padding: 11px 18px;
    color: #fff;
    background: var(--primary-color);
    border: 0;
    transition: background .25s ease;
}

.header-search button:hover {
    background: var(--primary-hover);
}

.btn-subscribe {
    order: 3;
    flex: none;
    padding: 11px 20px;
    color: #fff;
    background: var(--secondary-color);
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background .25s ease;
}

.btn-subscribe:hover {
    background: var(--primary-color);
}

@media (max-width: 991px) {
    .menu-toggle {
        display: grid;
    }
    .brand {
        margin: 0 auto;
    }
    .header-search {
        flex-basis: 100%;
        max-width: none;
        margin-left: 0;
    }
}

@media (max-width: 520px) {
    .btn-subscribe {
        display: none;
    }
    .brand-text {
        font-size: 1.35rem;
    }
}

/* ---- Category nav ---- */
.catnav {
    background: #fff;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.catnav-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.catnav-list {
    display: none;
    flex: 1;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
}

.catnav-list a {
    display: block;
    padding: 12px 12px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    transition: color .2s ease;
}

.catnav-list a:hover {
    color: var(--primary-color);
}

.catnav-list a.is-live {
    color: var(--primary-color);
}

.catnav-more {
    position: relative;
    margin-left: auto;
}

.catnav-more > button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: var(--text-color);
    background: transparent;
    border: 0;
    font-size: .82rem;
    font-weight: 700;
}

.catnav-more > button:hover {
    color: var(--primary-color);
}

.catnav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 70;
    display: none;
    min-width: 220px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.catnav-dropdown.is-open {
    display: block;
}

.catnav-dropdown a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: .86rem;
    font-weight: 600;
}

.catnav-dropdown a:hover {
    color: var(--primary-color);
    background: var(--surface-color);
}

@media (min-width: 1000px) {
    .catnav-list {
        display: flex;
    }
    .catnav-more {
        margin-left: 0;
    }
}

/* ---- Mobile nav panel ---- */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    background: rgba(16, 24, 40, .55);
}

.mobile-nav.is-open {
    display: block;
}

.mobile-nav-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(88vw, 350px);
    padding: 20px;
    overflow-y: auto;
    background: #fff;
}

.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.mobile-nav-head button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--surface-color);
    border: 0;
    border-radius: var(--radius-sm);
}

.mobile-nav-list {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.mobile-nav-list a {
    display: block;
    padding: 13px 4px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}

.mobile-nav-list a:hover {
    color: var(--primary-color);
}

.mobile-nav-social {
    display: flex;
    gap: 12px;
}

.mobile-nav-social a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--secondary-color);
    border-radius: var(--radius-sm);
}

/* ---- Page layout grids ---- */
.section-pad {
    padding: 44px 0;
}

.latest-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.latest-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1020px) {
    .latest-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

.cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 760px) {
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.list-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .list-page-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- Footer ---- */
.site-footer {
    margin-top: 56px;
    background: var(--secondary-color);
    color: #aab4c0;
    font-size: .9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 52px;
    padding-bottom: 40px;
}

.footer-grid h3 {
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
}

.footer-grid ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-grid li {
    margin-bottom: 10px;
}

.footer-grid a:hover {
    color: #fff;
}

.footer-brand .brand-text {
    color: #fff;
}

.footer-brand p {
    margin: 16px 0 20px;
    max-width: 40ch;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-radius: var(--radius-sm);
    transition: background .25s ease;
}

.footer-social a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .8rem;
}

@media (min-width: 760px) {
    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
    }
}

/* ---- Back to top ---- */
.to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 50;
    display: none;
    place-items: center;
    width: 46px;
    height: 46px;
    color: #fff;
    background: var(--secondary-color);
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.to-top.is-visible {
    display: grid;
}

.to-top:hover {
    background: var(--primary-color);
}