/* topvpn-extra.css — the few pieces the Hugo port adds to the WordPress
   theme: the compare table, callouts, inline citations, the FAQ accordion,
   資料來源, the breadcrumb and 延伸閱讀. Loaded after custom.css, and written
   in its palette (navy #132846, blue #2b6c9d / #36a9e0, rule #e3e8ee, body
   #47576f) so nothing here reads as a second design. Nothing in this file
   restyles a selector the WordPress CSS already owns. */

/* --- compare table ------------------------------------------------------ */
.topvpn-compare {
    margin: 1.5rem 0 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e3e8ee;
    border-top: .1875rem solid #132846;
    background: #fff;
}
.topvpn-compare:focus-visible { outline: 2px solid #36a9e0; outline-offset: 2px; }
.topvpn-compare__table {
    width: 100%;
    min-width: 34rem;
    border-collapse: collapse;
    font-size: .9375rem;
    color: #47576f;
}
.topvpn-compare__table th,
.topvpn-compare__table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid #e3e8ee;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}
.topvpn-compare__table thead th {
    color: #132846;
    font-weight: 700;
    background: #f5f8fa;
    white-space: nowrap;
}
.topvpn-compare__table thead th a { color: #2b6c9d; }
.topvpn-compare__table tbody th {
    color: #132846;
    font-weight: 600;
    white-space: nowrap;
    background: #fbfcfd;
}
.topvpn-compare__table tr:last-child th,
.topvpn-compare__table tr:last-child td { border-bottom: 0; }
.topvpn-compare__cta .button {
    display: inline-block;
    padding: .5rem 1rem;
    font-size: .875rem;
    white-space: nowrap;
}

/* --- inline CTA ---------------------------------------------------------- */
.topvpn-cta { margin: 1.5rem 0; text-align: center; }
.topvpn-cta .button { display: inline-block; }

/* --- card placed in the body by {{< vendor-card >}} ----------------------
   Wrapped in .review-list-container (without .container, so none of the
   pull-up margins apply) because the theme's phone layout of a card is
   written against that ancestor. */
.topvpn-inline-card { margin: 2rem 0; }

/* --- callout ------------------------------------------------------------- */
.topvpn-note {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #eef7fc;
    border-left: .25rem solid #36a9e0;
    color: #47576f;
}
.topvpn-note--warning { background: #fff7e8; border-left-color: #f0a202; }
.topvpn-note__label {
    margin: 0 0 .35rem;
    font-weight: 700;
    color: #132846;
}
.topvpn-note p:last-child { margin-bottom: 0; }

/* --- inline citation ------------------------------------------------------ */
.topvpn-cite { font-size: .875em; color: #6b7a8f; white-space: normal; }
.topvpn-cite a { color: #2b6c9d; }

/* --- FAQ accordion -------------------------------------------------------- */
.topvpn-faq { margin: 2.5rem 0 1rem; }
.container.background-2 .topvpn-faq__title { margin-bottom: 1.25rem; }
.topvpn-faq__item {
    background: #fff;
    border: 1px solid #e3e8ee;
    margin: 0 0 .75rem;
}
.topvpn-faq__q {
    cursor: pointer;
    list-style: none;
    position: relative;
    padding: 1rem 3rem 1rem 1.25rem;
    font-weight: 600;
    color: #132846;
    line-height: 1.5;
}
.topvpn-faq__q::-webkit-details-marker { display: none; }
.topvpn-faq__q::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.375rem;
    font-weight: 400;
    color: #2b6c9d;
}
.topvpn-faq__item[open] > .topvpn-faq__q::after { content: '−'; }
.topvpn-faq__q:focus-visible { outline: 2px solid #36a9e0; outline-offset: -2px; }
.topvpn-faq__a {
    padding: 0 1.25rem 1rem;
    color: #47576f;
    line-height: 1.7;
}
.topvpn-faq__a p:last-child { margin-bottom: 0; }

/* --- 資料來源 --------------------------------------------------------------- */
.topvpn-sources {
    margin: 2.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid #e3e8ee;
    font-size: .875rem;
    color: #6b7a8f;
}
.container.background-2 .topvpn-sources__title {
    font-size: 1rem;
    margin: 0 0 .5rem;
    color: #132846;
}
.topvpn-sources__list { margin: 0; padding-left: 1.25rem; }
.topvpn-sources__list a { color: #2b6c9d; word-break: break-word; }
.topvpn-sources__date { margin-left: .25rem; }

/* --- breadcrumb + 延伸閱讀 (sits in a .related-reviews block) --------------- */
.topvpn-related .topvpn-breadcrumb {
    font-size: .875rem;
    color: #6b7a8f;
    margin: 0 0 1.25rem;
    line-height: 1.6;
}
.topvpn-breadcrumb a { color: #2b6c9d; }
.topvpn-breadcrumb__sep { margin: 0 .5rem; color: #a8b7c2; }
.topvpn-related .related-reviews__item > a { min-height: 3.5rem; }
.topvpn-related .related-reviews__name { font-size: .9375rem; }
/* in the stacked phone layout the 14rem flex-basis would become a height */
@media (max-width: 40rem) {
    .topvpn-related .related-reviews__item { flex: 0 0 auto; }
    .topvpn-related .related-reviews__item > a { min-height: 0; }
}

@media (max-width: 40rem) {
    .topvpn-compare__table { font-size: .875rem; }
    .topvpn-compare__table th,
    .topvpn-compare__table td { padding: .625rem .75rem; }
    .topvpn-faq__q { padding: .875rem 2.75rem .875rem 1rem; }
    .topvpn-faq__a { padding: 0 1rem .875rem; }
}

/* --- Markdown tables in article bodies ----------------------------------
   The WordPress CSS never styled a body table (no migrated page has one), so
   a pipe table rendered as bare text. Scoped to the article band and to
   tables with no class of their own, so the compare table keeps its look. */
.container.background-2 table:not([class]) {
    width: 100%;
    margin: 1.5rem 0 2rem;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-top: .1875rem solid #132846;
    font-size: .9375rem;
    color: #47576f;
}
.container.background-2 table:not([class]) th,
.container.background-2 table:not([class]) td {
    padding: .75rem 1rem;
    border-bottom: 1px solid #e3e8ee;
    text-align: left;
    vertical-align: top;
    line-height: 1.55;
}
.container.background-2 table:not([class]) thead th {
    background: #f5f8fa;
    color: #132846;
    font-weight: 700;
}
.container.background-2 table:not([class]) tbody tr:nth-child(even) td { background: #fbfcfd; }
.container.background-2 table:not([class]) tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 768px) {
    /* no wrapper element in Markdown output, so the table scrolls itself */
    .container.background-2 table:not([class]) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .container.background-2 table:not([class]) th,
    .container.background-2 table:not([class]) td { padding: .625rem .75rem; white-space: normal; min-width: 7rem; }
}

/* --- two-level site menu ------------------------------------------------
   The theme's .topmenu rules were written for one level: `.topmenu ul` is
   the bar (and, on a phone, the fixed drawer), so every sub-menu rule below
   is written one step more specific (`.topmenu ul.sub-menu`) to undo that. */
#menu-topmenu-hk > li { position: relative; }
.topvpn-sub-toggle {
    -webkit-appearance: none; appearance: none;
    background: transparent; border: 0; padding: 0; margin: 0;
    cursor: pointer; color: #a8b7c2;
}
.topvpn-sub-toggle::before {
    content: ''; display: inline-block;
    width: .4375rem; height: .4375rem;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-30%) rotate(45deg);
    transition: transform .15s ease;
}
.topvpn-open > .topvpn-sub-toggle::before { transform: translateY(15%) rotate(-135deg); }
.topvpn-sub-toggle:focus-visible { outline: 2px solid #36a9e0; outline-offset: -2px; }
.topmenu ul li.current-menu-ancestor > a { border-top-color: #36a9e0; color: #fff; }

@media only screen and (min-width: 768px) {
    #menu-topmenu-hk > li { display: flex; align-items: stretch; }
    .topmenu #menu-topmenu-hk > li > a { padding: 0 .375rem 0 .875rem; }
    .topmenu #menu-topmenu-hk > li:not(.menu-item-has-children) > a { padding-right: .875rem; }
    .topvpn-sub-toggle {
        height: 5rem; width: 1.5rem; padding-right: .5rem;
        border-top: .1875rem solid transparent;
    }
    #menu-topmenu-hk > li:hover > .topvpn-sub-toggle,
    #menu-topmenu-hk > li.topvpn-open > .topvpn-sub-toggle { color: #fff; }
    .topmenu ul.sub-menu {
        display: none;
        position: absolute; top: 100%; left: 0; z-index: 60;
        height: auto; min-width: 13.5rem;
        flex-direction: column; flex-wrap: nowrap;
        padding: .5rem 0; margin: 0;
        background: #0b182c;
        border-top: .1875rem solid #36a9e0;
        box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .35);
    }
    #menu-topmenu-hk > li:last-child > ul.sub-menu { left: auto; right: 0; }
    .topmenu li.topvpn-open > ul.sub-menu,
    .topmenu li:focus-within > ul.sub-menu { display: flex; }
    .topmenu ul.sub-menu li { width: 100%; }
    .topmenu ul.sub-menu li a,
    .topmenu ul li.current-menu-item ul.sub-menu li a,
    .topmenu ul li.current-menu-ancestor ul.sub-menu li a {
        height: auto; line-height: 1.45;
        padding: .5625rem 1.25rem;
        font-size: .9375rem; white-space: nowrap;
        border-top: 0; border-left: .1875rem solid transparent;
        color: #a8b7c2;
    }
    .topmenu ul.sub-menu li a:hover,
    .topmenu ul.sub-menu li a:focus,
    .topmenu ul li ul.sub-menu li.current-menu-item a {
        color: #fff; border-left-color: #36a9e0; background: rgba(255, 255, 255, .04);
    }
}
@media only screen and (min-width: 768px) and (max-width: 1100px) {
    .topmenu #menu-topmenu-hk > li > a { padding: 0 .25rem 0 .5rem; font-size: .9375rem; }
    .topmenu #menu-topmenu-hk > li:not(.menu-item-has-children) > a { padding-right: .5rem; }
    .topvpn-sub-toggle { width: 1.125rem; padding-right: .25rem; }
}

@media only screen and (max-width: 767px) {
    /* the drawer scrolls when every section is open */
    .topmenu ul#menu-topmenu-hk { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .topmenu ul.sub-menu,
    .expanded .topmenu ul.sub-menu {
        display: none;
        position: static; transform: none; transition: none;
        width: 100%; height: auto; max-width: none;
        padding: 0 0 .5rem 1rem; margin: 0;
        background: transparent; flex-direction: column; flex-wrap: nowrap;
    }
    .topmenu li.topvpn-open > ul.sub-menu { display: flex; }
    .topvpn-sub-toggle {
        position: absolute; top: 0; right: -1.875rem;
        width: 3.125rem; height: 3.125rem;
    }
    .topmenu ul.sub-menu li a {
        height: 2.75rem; line-height: 2.75rem; font-size: .9375rem;
    }
    /* the home page's legacy popup style hid the hamburger on every width;
       the site menu has to be reachable there too */
    body.page-template-homepage #main-menu-activator { display: flex; }
}

/* --- /blog/ overview ------------------------------------------------------ */
.blog_items .topvpn-overview__title {
    font-size: 1.5rem; line-height: 1.35; font-weight: 600; color: #132846;
    margin: 3rem 0 .5rem;
}
.blog_items > .container > .topvpn-overview__title:first-child { margin-top: 2.5rem; }
.topvpn-overview__title a { color: #132846; }
.topvpn-overview__title a:hover { color: #2b6c9d; }
.topvpn-overview__count { font-size: .875rem; font-weight: 400; color: #6b7a8f; margin-left: .75rem; }
.topvpn-overview { border-top: 1px solid #e3e8ee; }
.topvpn-overview__list,
.topvpn-hublist__list {
    list-style: none; margin: 0 0 1rem; padding: 0;
    columns: 3 16rem; column-gap: 2rem;
}
.topvpn-overview__list li,
.topvpn-hublist__list li {
    break-inside: avoid; padding: .4375rem 0; line-height: 1.5;
    border-bottom: 1px solid #eef1f4;
}
.topvpn-overview__list a,
.topvpn-hublist__list a { color: #2b6c9d; }
.topvpn-overview__list li.is-hub a { font-weight: 700; color: #132846; }
.blog_items .topvpn-overview:last-child { margin-bottom: 4rem; }

/* --- 本專題全部文章 ------------------------------------------------------------- */
.topvpn-hublist { margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1px solid #e3e8ee; }
.container.background-2 .topvpn-hublist__title { font-size: 1.5rem; line-height: 1.35; margin: 0 0 1rem; }
.container.background-2 .topvpn-hublist__list li { padding: .4375rem 0; }

/* --- /reviews/ card for a vendor without a data file ---------------------- */
.topvpn-plain-card .section-logo .logo { min-height: 1rem; }

/* --- footer column of cluster hubs --------------------------------------- */
@media only screen and (max-width: 767px) {
    #main-footer ul.footer-menu li.topvpn-footer-hubs { flex: 1 1 50%; }
}
