/*
 * Template 0817 "App shell", one of the responsive templates from 0707 on: written by
 * tools/responsive-templates (node render.js --media) from base.css and themes/n-app.css, edit those.
 * The fonts (fontsource, SIL Open Font License) are in ../../fonts, the pictures (CC0) in ../img.
 */

/* public-sans-vietnamese-wght-normal */
@font-face {
  font-family: 'Public Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../../fonts/public-sans-vietnamese-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* public-sans-latin-ext-wght-normal */
@font-face {
  font-family: 'Public Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../../fonts/public-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* public-sans-latin-wght-normal */
@font-face {
  font-family: 'Public Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../../fonts/public-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/*
 * The shared part of the modern templates: the page structure of template.phtml, the menu of
 * GenerateMenuHelper::generateOldMenu (flat <li>: headings, separators, submenu entries as siblings), the content of the
 * editor (.hpage_content) and the phone layout. A theme sets the custom properties and styles its masthead.
 */

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

html { -webkit-text-size-adjust: 100%; }

body.hp {
    margin: 0;
    background: var(--hp-bg);
    color: var(--hp-text);
    font-family: var(--hp-body-font);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.hp-site { min-height: 100vh; display: flex; flex-direction: column; }

/* Masthead: the theme gives it its picture or colour */
.hp-masthead { position: relative; }
.hp-masthead__inner {
    position: relative;
    max-width: var(--hp-max, 1200px);
    margin: 0 auto;
    padding: 0 32px;
}
.hp-brand { font-family: var(--hp-heading-font); line-height: 1.1; }
.hp-brand a { color: inherit; text-decoration: none; }
.hp-brand img { max-width: 100%; height: auto; display: block; }

/* Sidebar and content */
.hp-layout {
    position: relative;
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--hp-max, 1200px);
    margin: 0 auto;
    padding: 40px 32px 64px;
    display: grid;
    grid-template-columns: var(--hp-sidebar, 260px) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
    /* short pages: the extra height below the content, not between the rows */
    align-content: start;
}

.hp-nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.hp-sidebar {
    background: var(--hp-sidebar-bg, transparent);
    border-radius: var(--hp-radius, 0);
    padding: var(--hp-sidebar-padding, 0);
}
.hp-sidebar__title {
    display: block;
    font-family: var(--hp-heading-font);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hp-muted);
    padding: 0 14px 12px;
}

.hp-menu { list-style: none; margin: 0; padding: 0; }
.hp-menu li { margin: 0; padding: 0; }
.hp-menu li > a {
    display: block;
    padding: 9px 14px;
    border-radius: var(--hp-menu-radius, 8px);
    color: var(--hp-menu-text, var(--hp-text));
    text-decoration: none;
    line-height: 1.35;
    transition: background-color .15s, color .15s;
}
.hp-menu li > a:hover { background: var(--hp-menu-hover-bg); color: var(--hp-menu-hover-text, var(--hp-menu-text, var(--hp-text))); }
.hp-menu li.active > a {
    background: var(--hp-menu-active-bg, var(--hp-accent));
    color: var(--hp-menu-active-text, var(--hp-accent-contrast));
    font-weight: 600;
}
/* An entry with a submenu: its link is "#" */
.hp-menu li > a[href="#"]::after { content: ""; float: inline-end; margin-top: .45em; width: .45em; height: .45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .55; }
.hp-menu li.submenu_item > a { padding-inline-start: 30px; font-size: .94em; }
.hp-menu li.menu_heading {
    margin: 22px 0 6px;
    padding: 0 14px;
    font-family: var(--hp-heading-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--hp-muted);
}
.hp-menu li.menu_separator hr { border: 0; border-top: 1px solid var(--hp-line); margin: 14px 14px; }

.hp-main {
    min-width: 0;
    background: var(--hp-surface, transparent);
    border-radius: var(--hp-radius, 0);
    padding: var(--hp-main-padding, 0);
}
.hp-main__title {
    font-family: var(--hp-heading-font);
    font-size: clamp(30px, 3.2vw, 42px);
    font-weight: var(--hp-heading-weight, 700);
    line-height: 1.15;
    color: var(--hp-heading, var(--hp-text));
    margin: 0 0 24px;
}
.hp-main__body > p:empty { display: none; }

/* The content of the editor */
.hpage_content { overflow-wrap: break-word; }
.hpage_content p { margin: 0 0 1.1em; }
.hpage_content h1, .hpage_content h2, .hpage_content h3, .hpage_content h4 {
    font-family: var(--hp-heading-font);
    font-weight: var(--hp-heading-weight, 700);
    color: var(--hp-heading, var(--hp-text));
    line-height: 1.25;
    margin: 1.6em 0 .55em;
}
.hpage_content > :first-child, .hpage_content > p:first-child > :first-child { margin-top: 0; }
.hpage_content h1 { font-size: 1.75em; }
.hpage_content h2 { font-size: 1.4em; }
.hpage_content h3 { font-size: 1.15em; }
.hpage_content a { color: var(--hp-link, var(--hp-accent)); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hpage_content a:hover { text-decoration-thickness: 2px; }
.hpage_content img { border-radius: var(--hp-image-radius, 6px); }
/* Nothing wider than the content; pictures and videos keep their proportions (not spacers and lines: a picture of
   1 x 1 pixel would become square). The same as the mobile layout of the old templates (mobile_layout.css). */
.hpage_content :is(img, video, iframe, embed, object) { max-width: 100%; }
.hpage_content :is(img, video):not([height="0"], [height="1"], [height="2"], [height="3"], [height="4"], [height="5"], [width="1"], [width="2"], [width="3"], [width="4"], [width="5"]) { height: auto; }
.hpage_content pre { white-space: pre-wrap; }
.hpage_content :is(input, textarea, select) { max-width: 100%; box-sizing: border-box; }
.hpage_content ul, .hpage_content ol { padding-inline-start: 1.3em; margin: 0 0 1.1em; }
.hpage_content li { margin: .25em 0; }
.hpage_content li::marker { color: var(--hp-accent); }
.hpage_content blockquote {
    margin: 1.5em 0;
    padding-block: .2em;
    padding-inline: 1.2em 0;
    border-inline-start: 3px solid var(--hp-accent);
    font-style: italic;
    color: var(--hp-muted);
}
.hpage_content hr { border: 0; border-top: 1px solid var(--hp-line); margin: 2em 0; }
/* The tables of the content editor; not the layout tables of the addons (guestbook, calendar, forms: with border,
   cellpadding, cellspacing, a class or an id) */
.hpage_content table:not([border], [cellpadding], [cellspacing], [class], [id]) { border-collapse: collapse; margin: 0 0 1.4em; font-size: .95em; }
.hpage_content table:not([border], [cellpadding], [cellspacing], [class], [id], [width], [style*="width"]) { width: 100%; }
.hpage_content table:not([border], [cellpadding], [cellspacing], [class], [id]) > * > tr > :is(th, td) { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--hp-line); vertical-align: top; }
.hpage_content table:not([border], [cellpadding], [cellspacing], [class], [id]) > * > tr > th { font-weight: 600; color: var(--hp-table-head-text, var(--hp-heading, var(--hp-text))); background: var(--hp-table-head, transparent); }
.hpage_content table:not([border], [cellpadding], [cellspacing], [class], [id]) > tbody > tr:nth-child(even) > td { background: var(--hp-table-stripe, transparent); }

.hp-footer { height: var(--hp-footer-height, 0); background: var(--hp-footer-bg, transparent); }

/* Phones and small tablets: one column, the menu behind its title */
@media (max-width: 1023px) {
    body.hp { font-size: 16px; }
    .hp-masthead__inner { padding: 0 20px; }
    .hp-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 16px 48px; }
    .hp-sidebar { padding: 0; background: var(--hp-sidebar-mobile-bg, var(--hp-surface, #fff)); border-radius: var(--hp-radius-mobile, 12px); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
    .hp-sidebar__title {
        position: relative;
        padding-block: 14px;
        padding-inline: 18px 52px;
        cursor: pointer;
        color: var(--hp-text);
        user-select: none;
    }
    .hp-sidebar__title::after {
        content: "";
        position: absolute;
        inset-inline-end: 18px;
        top: 50%;
        width: 18px;
        height: 12px;
        margin-top: -6px;
        background: linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
                    linear-gradient(currentColor, currentColor) 0 5px / 100% 2px no-repeat,
                    linear-gradient(currentColor, currentColor) 0 10px / 100% 2px no-repeat;
    }
    .hp-menu { display: none; padding: 0 8px 12px; }
    .hp-nav-toggle:checked ~ .hp-sidebar .hp-menu { display: block; }
    .hp-main { padding: var(--hp-main-padding-mobile, 0); }

    /* The content as in the mobile layout of the old templates (mobile_layout.css): an iframe without a height gets
       the proportions of a video, tables of a fixed width scroll sideways, pictures floated beside the text take at
       most half the width */
    .hpage_content iframe:not([height], [style*="height"]) { aspect-ratio: 16 / 9; height: auto; }
    .hpage_content table:is([width], [style*="width"]):not([width="100%"], [style*="width: 100%"], [style*="width:100%"]) { display: block; overflow-x: auto; }
    .hpage_content table { max-width: 100%; }
    .hpage_content :is(img, video, table, div):is([style*="float: left"], [style*="float:left"], [style*="float: right"], [style*="float:right"]):not([style*="absolute"]),
    .hpage_content :is(img, table)[align="left"],
    .hpage_content :is(img, table)[align="right"] {
        max-width: 45% !important;
    }
}

/* Phones: forms with the label above the field and fields as wide as the form (mobile_layout.css) */
@media (max-width: 600px) {
    .hpage_content form :is(table, tbody, tr, td, th) { display: block; width: auto !important; max-width: 100%; box-sizing: border-box; }
    .hpage_content form tr:has(> :nth-child(3)) { display: flex; flex-wrap: wrap; gap: 4px; }
    .hpage_content form :is(textarea, select, input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="hidden"], [type="file"])) { width: 100% !important; }
}

/* App shell: like a modern software dashboard: a dark shell, a fixed navigation rail with fine borders, a hairline on top, the content on a light rounded card */
:root {
    --hp-sidebar-padding: 0;
    --hp-bg: #0e0f12;
    --hp-surface: #ffffff;
    --hp-text: #1b1d22;
    --hp-muted: #646a75;
    --hp-heading: #0e0f12;
    --hp-accent: #6366f1;
    --hp-accent-contrast: #ffffff;
    --hp-link: #4f46e5;
    --hp-line: #e7e8ec;
    --hp-heading-font: 'Public Sans Variable', 'Segoe UI', system-ui, sans-serif;
    --hp-body-font: 'Public Sans Variable', 'Segoe UI', system-ui, sans-serif;
    --hp-heading-weight: 700;
    --hp-radius: 16px;
    --hp-menu-radius: 8px;
    --hp-menu-text: #b7bbc5;
    --hp-menu-hover-bg: #1b1d23;
    --hp-menu-hover-text: #ffffff;
    --hp-menu-active-bg: #23262e;
    --hp-menu-active-text: #ffffff;
    --hp-table-head: #f6f7f9;
    --hp-image-radius: 12px;
    --hp-main-padding: 44px 52px;
    --hp-main-padding-mobile: 26px 20px;
    --hp-sidebar-mobile-bg: #15171c;
    --hp-max: 1080px;
}

body.hp { font-size: 15.5px; }
.hp-brand { display: flex; align-items: center; gap: 12px; color: #ffffff; font-size: 17px; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
.hp-brand::before { content: ""; flex: none; width: 28px; height: 28px; border-radius: 8px; background: conic-gradient(from 210deg, #6366f1, #22d3ee, #a78bfa, #6366f1); box-shadow: inset 0 0 0 6px #15171c; }
.hp-main { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 60px rgba(0, 0, 0, .4); }
.hp-main__title { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.025em; padding-bottom: 18px; border-bottom: 1px solid var(--hp-line); }
.hpage_content h2 { font-size: 1.25em; }
.hp-menu li > a { font-size: 14.5px; font-weight: 500; padding: 8px 12px; }
.hp-menu li.active > a { box-shadow: inset 2px 0 0 #6366f1; }
.hp-menu li.menu_heading { color: #5d6270; font-size: 11px; padding: 0 12px; }
.hp-menu li.menu_separator hr { border-top-color: #262931; margin: 12px; }
.hp-menu li > a[href="#"]::after { opacity: .4; }

@media (min-width: 1024px) {
    body.hp { padding-left: 264px; }
    body.hp::before { content: ""; position: fixed; top: 0; left: 264px; right: 0; z-index: 30; height: 1px; background: linear-gradient(90deg, rgba(99, 102, 241, .8), rgba(34, 211, 238, .5) 40%, transparent); }
    .hp-masthead { position: fixed; top: 0; left: 0; width: 264px; z-index: 41; background: #15171c; border-right: 1px solid #23262e; border-bottom: 1px solid #23262e; }
    .hp-masthead__inner { padding: 20px 18px; max-width: none; }
    .hp-layout { grid-template-columns: minmax(0, 1fr); padding: 40px 40px 72px; }
    .hp-sidebar { position: fixed; top: 69px; bottom: 0; left: 0; width: 264px; z-index: 40; overflow-y: auto; padding: 14px 12px 24px; background: #15171c; border-right: 1px solid #23262e; }
    .hp-sidebar__title { display: none; }
}
@media (max-width: 1023px) {
    .hp-masthead { background: #15171c; border-bottom: 1px solid #23262e; }
    .hp-masthead__inner { padding-top: 16px; padding-bottom: 16px; }
    .hp-sidebar { border: 1px solid #23262e; }
    .hp-sidebar__title { color: #ffffff; }
}
