/* Created by Chia-Hsiang Ma, 20260923*/
/* 左欄固定，右欄至少是左欄三倍。 */
table.corpus-query-layout {
    --menu-width: 14rem;
    --corpus-heading-size: clamp(20px, 1.4vw, 32px);
    --corpus-gear-size: clamp(22px, 1.2vw, 30.6px);
    min-width: calc(var(--menu-width) * 4);
}

table.corpus-query-layout > tbody > tr > td.minwidth {
    width: var(--menu-width);
    min-width: var(--menu-width);
    max-width: var(--menu-width);
}

table.corpus-query-layout > tbody > tr > td.minwidth nav {
    width: 100%;
    box-sizing: border-box;
}

table.corpus-query-layout > tbody > tr > td.fullwidth {
    width: auto;
    min-width: calc(var(--menu-width) * 4);
}

/* 左上「選單」，大於下方分類標題。 */
table.corpus-query-layout > tbody > tr > td.minwidth > nav:first-of-type > a.menuItem.header {
    font-size: var(--corpus-heading-size);
    line-height: 1.3;
}

/* 右上語料庫名稱。 */
table.corpus-query-layout > tbody > tr > td.fullwidth
> table.layout-frame:first-of-type > tbody > tr:first-child > th.layout-strong {
    position: relative;
    font-size: var(--corpus-heading-size);
    line-height: 1.3;
}

/* 齒輪跟著語料庫名稱縮放，置中於同一標題格。 */
table.corpus-query-layout .topcorner {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: normal;
}

table.corpus-query-layout .topcorner .lang-menu-trigger {
    width: max(44px, calc(var(--corpus-gear-size) + 16px));
    height: max(44px, calc(var(--corpus-gear-size) + 16px));
}

table.corpus-query-layout .topcorner .lang-menu-trigger-icon {
    width: var(--corpus-gear-size);
    height: var(--corpus-gear-size);
}

/* 次層選單標題：約 16 → 19 px；最上方 Menu 保持原設定。 */
table.corpus-query-layout > tbody > tr > td.minwidth
> nav:not(:first-of-type) > a.menuItem.header {
    font-size: 1.2rem;
    line-height: 1.3;
}

/* 一般選單項目：約 13 → 15–16 px，長英文可在欄內換行。 */
table.corpus-query-layout > tbody > tr > td.minwidth
nav a.menuItem:not(.header) {
    font-size: 0.96rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

/* 右側各功能區標題；排除第一個語料庫名稱標題。 */
table.corpus-query-layout > tbody > tr > td.fullwidth
> table.layout-frame:not(:first-of-type)
> tbody > tr:first-child > th.layout-strong {
    font-size: 1.2rem;
    line-height: 1.3;
}

/* 右側功能區的內容：約 13 px 提高到 16 px。 */
table.corpus-query-layout > tbody > tr > td.fullwidth
> table.layout-frame:not(:first-of-type) > tbody > tr > td {
    font-size: 1rem;
    line-height: 1.4;
}

/* 表單控制項有自己的瀏覽器預設字級，需另行指定。 */
table.corpus-query-layout > tbody > tr > td.fullwidth
> table.layout-frame:not(:first-of-type) > tbody > tr > td
:is(input:not([type="hidden"]), select, textarea, button) {
    font-size: 1rem;
    line-height: 1.3;
}

/* 查詢表單每列第一格：欄位標籤 */
table.corpus-query-layout > tbody > tr > td.fullwidth td.basicbox:first-child {
    font-size: 1rem;
    line-height: 1.4;
}
