/**
 * Portal page shell (templates/shell.php): base styles that used to come from the theme.
 *
 * Loaded on every front-end page, logged in or not (styles.css loads only on merchant screens).
 * Colours: --kthb-page-text comes from platform/{salla,zid}.php, dark mode sets --kthb-page-bg
 * and --kthb-page-link in styles.css. Plan: docs/THEME-PLAN.md.
 */

:root{
  --kthb-page-bg: #f8f8f8;
}

/* --------------------------------------------------------------------------
 * Reset
 * ----------------------------------------------------------------------- */

html{
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

blockquote, body, dd, dl, dt, fieldset, figure, h1, h2, h3, h4, h5, h6, hr, html, iframe, legend, li, ol, p, pre, textarea, ul{
  margin: 0;
  padding: 0;
  border: 0;
}

main{
  display: block;
}

body,
button,
input,
select,
textarea{
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
}

body{
  background-color: var(--kthb-page-bg);
  color: var(--kthb-page-text, #1a1a1a);
}

button, input, optgroup, select, textarea{
  font-family: inherit;
  font-size: 100%;
  margin: 0;
}

/* --------------------------------------------------------------------------
 * Typography
 * ----------------------------------------------------------------------- */

p{
  margin-bottom: 1.5em;
}

h1, h2, h3, h4, h5, h6{
  font-family: inherit;
  font-style: inherit;
  font-weight: 400;
  line-height: 1.2em;
  margin-bottom: 20px;
}

h1{ font-size: 42px; font-weight: 600; }
h2{ font-size: 35px; }
h3{ font-size: 29px; }
h4{ font-size: 24px; }
h5{ font-size: 20px; }
h6{ font-size: 100%; }

ol,
ul{
  margin: 0 0 1.5em;
  margin-inline-start: 3em;
}

ul{ list-style: disc; }
ol{ list-style: decimal; }

li > ol,
li > ul{
  margin-bottom: 0;
  margin-inline-start: 1.5em;
}

b, strong, th, dt{ font-weight: 700; }
small{ font-size: 75%; }

hr{
  background-color: rgba(0, 0, 0, .1);
  height: 1px;
  margin-block: 40px;
}

table{
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 1.5em;
  width: 100%;
}

img{
  height: auto;
  max-width: 100%;
}

embed,
iframe,
object{
  max-width: 100%;
}

/* Video embeds keep their shape (block-library CSS is trimmed in includes/bootstrap/wp-trim.php). */
.wp-block-embed iframe{
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.wp-embed-aspect-4-3 iframe{ aspect-ratio: 4 / 3; }
.wp-embed-aspect-9-16 iframe{ aspect-ratio: 9 / 16; }
.wp-embed-aspect-1-1 iframe{ aspect-ratio: 1; }

a{
  color: var(--kthb-page-link, var(--kthb-page-text));
  text-decoration: none;
  transition: color .1s ease-in-out, background-color .1s ease-in-out;
}

a:hover,
a:focus{
  text-decoration: underline;
}

.kthb-nav a,
a.button,
.wp-block-button__link{
  text-decoration: none;
}

/* --------------------------------------------------------------------------
 * Form controls (plugin controls style themselves on top)
 * ----------------------------------------------------------------------- */

button,
input[type="button"],
input[type="reset"],
input[type="submit"]{
  background: #55555e;
  color: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  -webkit-appearance: button;
  padding: 10px 20px;
  transition: color .1s ease-in-out, background-color .1s ease-in-out;
}

button:hover,
button:focus,
input[type="button"]:hover,
input[type="button"]:focus,
input[type="reset"]:hover,
input[type="reset"]:focus,
input[type="submit"]:hover,
input[type="submit"]:focus{
  background-color: #3f4047;
  color: #fff;
}

input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
select,
textarea{
  color: var(--kthb-page-text);
  background-color: var(--kthb-page-bg);
  border: 1px solid #f0f0f0;
  border-radius: 0;
  padding: 10px 15px;
  max-width: 100%;
}

input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus{
  border-color: #ccc;
}

textarea{
  width: 100%;
}

/* --------------------------------------------------------------------------
 * WordPress helpers
 * ----------------------------------------------------------------------- */

.screen-reader-text{
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus{
  clip: auto !important;
  clip-path: none;
  display: block;
  height: auto;
  width: auto;
  inset-inline-start: 5px;
  top: 5px;
  padding: 15px 23px 14px;
  z-index: 100000;
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, .6);
  color: #21759b;
  font-size: .875rem;
  font-weight: 700;
  line-height: normal;
  text-decoration: none;
}

.aligncenter{
  clear: both;
  display: block;
  margin-inline: auto;
}

.kthb-entry-content .alignfull{
  margin-inline: calc(-100vw / 2 + 100% / 2);
  max-width: 100vw;
  width: auto;
}

.wp-block-group__inner-container{
  max-width: 1250px;
  margin-inline: auto;
}

.kthb-main .wp-block-group__inner-container{
  padding: 40px;
}

/* --------------------------------------------------------------------------
 * Layout
 * ----------------------------------------------------------------------- */

.kthb-container{
  margin-inline: auto;
  max-width: 1250px;
}

.kthb-site{
  word-wrap: break-word;
}

.kthb-main{
  margin-block: 20px;
}

.kthb-main > *{
  margin-bottom: 20px;
}

.kthb-main > :last-child{
  margin-bottom: 0;
}

/* Logged-out header (login page): logo at the inline start of a plain bar. */
.kthb-header{
  background-color: var(--kthb-surface, #fff);
}

.kthb-header-inner{
  display: flex;
  align-items: center;
  padding: 20px 40px;
}

.kthb-header .kthb-header-logo{
  display: block;
  line-height: 0;
}

.kthb-header .kthb-header-logo img{
  width: 100px;
  height: auto;
}

.kthb-footer-inner{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  text-align: center;
  font-size: 15px;
}

/* "© year" then the portal logo, on one line. */
.kthb-copyright{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kthb-copyright .kthb-header-logo{
  display: flex;
  line-height: 0;
}

.kthb-copyright .kthb-header-logo img{
  max-height: 20px;
  width: auto;
}

/* --------------------------------------------------------------------------
 * Pages
 * ----------------------------------------------------------------------- */

body.page-login .kthb-site{
  max-width: 560px;
  padding-inline: 16px;
  min-height: calc(100vh - 100px);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

body.page-login .kthb-entry{
  background-color: var(--kthb-surface, #fff);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 12px 32px rgb(0 0 0 / 6%);
  padding: 40px 48px;
  text-align: center;
}

/* The page's block group (heading + button) adds no padding of its own inside the card. */
body.page-login .kthb-main .wp-block-group__inner-container{
  padding: 0;
}

/* Login card brand: app name · by · portal logo, like the app header. */
.kthb-login-brand{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgb(0 0 0 / 6%);
}

.kthb-login-brand-name{
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.kthb-login-brand small{
  font-size: 12px;
  opacity: .6;
}

.kthb-login-brand .kthb-header-logo{
  display: flex;
  align-items: center;
  line-height: 0;
}

.kthb-login-brand .kthb-header-logo img{
  max-height: 26px;
  width: auto;
}

body.page-login .kthb-entry-content h2{
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 20px; /* alignfull would pull it out of the card. */
}

body.page-login .kthb-entry-content > :empty{
  display: none;
}

.kthb-login-signup{
  margin: 16px 0 0;
  font-size: 14px;
  opacity: .85;
}

.kthb-login-signup a{
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

body.page-support .kthb-site{
  max-width: 1000px;
  margin: 60px auto;
  padding: 20px 30px;
  border-radius: 14px;
  background-color: var(--kthb-surface, #fff);
}

@media (max-width: 768px){
  .kthb-header-inner,
  .kthb-footer-inner{
    padding-inline: 30px;
  }

  .kthb-main .wp-block-group__inner-container{
    padding: 30px;
  }

  body.page-login .kthb-entry{
    padding: 28px 20px;
    border-radius: 20px;
  }
}
