/*
 * Hikari by JNF - what the platform needs on top of the old stylesheet (styles.css), loaded last.
 *
 * The old pages were driven by Alpine.js; its x-show/x-cloak became the `hidden` attribute, which a
 * rule with display:block in styles.css would otherwise beat.
 */
[hidden] {
  display: none !important;
}

/* The account menu's sign out is a form now (a POST), drawn as the old button. */
.header-account form,
.drawer-account-menu form {
  margin: 0;
}

/* account */
/*
 * The account screens (views/pages signin, signup, password_*, account). The old profile page and
 * its components carried these rules in inline <style> blocks scoped to a generated id; here they
 * are scoped to their own classes instead. Values unchanged.
 */

/* the message boxes: session.js sets data-kind; an ok message wears the old .login-ok / .pf-ok tones */
.hk-auth-notice[data-kind="ok"] {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

/* the header is fixed and transparent, so the page clears it itself */
.profile-page {
  padding-top: calc(var(--nav-h) + clamp(40px, 5vw, 80px));
}
.profile-page .pp-head {
  max-width: 62ch;
}
.profile-page .pp-head .h-serif {
  margin: 16px 0 14px;
}
.profile-page .pp-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(40px, 5vw, 72px);
  align-items: start;
}
.profile-page .pp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px 26px;
  text-align: center;
}
.profile-page .pp-avatar {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--greige-2);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.profile-page .pp-name {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}
.profile-page .pp-mail {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.profile-page .pp-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
}
.profile-page .pp-links a,
.profile-page .pp-signout {
  font-family: var(--ff);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.profile-page .pp-links a:hover,
.profile-page .pp-signout:hover {
  color: var(--ink);
}
.profile-page .pp-links form {
  margin: 0;
}
.profile-page .pp-panel-title {
  margin: 0 0 26px;
  font-family: var(--fs);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 30px);
  color: var(--ink);
}
.profile-page .pp-panel-title--next {
  margin-top: clamp(40px, 5vw, 64px);
}
.profile-page .pp-panel .delete-account {
  margin-top: clamp(40px, 5vw, 64px);
}
@media (max-width: 900px) {
  .profile-page .pp-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* the profile form (old components/profile_form.php) */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.profile-form .pf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 26px;
}
.profile-form .pf-span-2 {
  grid-column: 1 / -1;
}
.pf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.pf-field input,
.pf-field select {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 14px 15px;
  font-family: var(--ff);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.pf-field .pw-input input {
  width: 100%;
  /* the field's padding above would otherwise run under the reveal toggle */
  padding-right: 46px;
}
.pf-field input:focus,
.pf-field select:focus {
  border-color: var(--ink);
}
.pf-field input:disabled,
.pf-field select:disabled {
  color: var(--ink-3);
}
.pf-field input[readonly] {
  background: var(--panel);
}
.profile-form .pf-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-form .btn[disabled],
.delete-account .btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.pf-alert {
  padding: 13px 16px;
  border-radius: 4px;
  font-size: 14px;
}
.pf-error {
  border: 1px solid #d98b8b;
  background: #f6e4e4;
  color: #8a2f2f;
}
@media (max-width: 720px) {
  .profile-form .pf-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* closing the account (old components/delete_account.php) */
.delete-account {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px 26px;
}
.delete-account .da-title {
  margin: 0 0 14px;
  font-family: var(--fs);
  font-weight: 400;
  font-size: clamp(19px, 1.8vw, 24px);
  color: var(--ink);
}
.delete-account .da-warning {
  margin: 0 0 24px;
  max-width: 68ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
}
.delete-account .da-trigger {
  gap: 10px;
  border-color: var(--line-2);
}
/* z-index clears the fixed navbar (100) and the lightbox (200) */
.delete-account .da-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.delete-account .da-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 10, 7, 0.6);
}
.delete-account .da-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 32px);
}
.delete-account .da-dialog-title {
  margin: 0 0 18px;
  font-family: var(--fs);
  font-weight: 400;
  font-size: clamp(19px, 1.8vw, 22px);
  line-height: 1.35;
  color: var(--ink);
}
.delete-account .da-irreversible {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}
.delete-account .da-irreversible svg {
  flex: none;
  margin-top: 3px;
  color: var(--accent);
}
/* the platform asks for the password before closing an account; the old dialog had no field */
.delete-account .da-field {
  margin-top: 22px;
}
.delete-account .da-alert {
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px solid #d98b8b;
  border-radius: 4px;
  background: #f6e4e4;
  font-size: 14px;
  color: #8a2f2f;
}
.delete-account .da-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
}
@media (max-width: 520px) {
  .delete-account .da-actions {
    flex-direction: column-reverse;
  }
  .delete-account .da-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* products */
/*
 * The catalogue's own rules - the products listing and the product page (views/pages/products.php,
 * views/pages/product.php). The old pages carried them inline (<style> in products.php and
 * product.php, a per-instance block in the lightbox component); they are here unchanged, the
 * lightbox scoped to .hk-lightbox instead of a generated id.
 */

/* the trail sits under the fixed bar on the catalogue pages, as the old $breadcrumbStyles did */
.hk-catalog-crumb .crumb { margin-top: var(--nav-h); border-top: 0; }
.hk-catalog { padding-top: clamp(40px, 6vw, 90px); }

.prod-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: end; padding-bottom: 14px; }
.prod-intro p { max-width: 46ch; }
@media (max-width: 900px) { .prod-intro { grid-template-columns: 1fr; gap: 24px; } }

.prodgrid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 300px; gap: clamp(14px, 1.6vw, 28px); }
.pcard { position: relative; overflow: hidden; border-radius: 6px; display: flex; align-items: flex-end; color: #fff; }
.pcard .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 1.1s var(--ease); }
.pcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.62) 100%); }
.pcard:hover .bg { transform: scale(1.06); }
.pcard .pc-in { z-index: 1; position: relative; padding: 32px; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pcard .pc-t { font-family: var(--fs); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; }
.pcard .pc-s { font-size: 13px; opacity: .82; font-weight: 300; margin-top: 6px; }
.pcard .pc-arw { width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; transition: .3s var(--ease); }
.pcard:hover .pc-arw { background: #fff; color: var(--ink); }
.pcard .pc-soon { position: absolute; top: 24px; left: 24px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; background: rgba(255,255,255,.18); backdrop-filter: blur(4px); padding: 6px 12px; border-radius: 40px; }
@media (max-width: 820px) {
  .prodgrid { grid-auto-rows: 240px; }
  .pcard { grid-column: 1 / -1 !important; grid-row: auto !important; }
}

.psubcard { text-align: center; max-width: 640px; margin: 0 auto; }
.psubcard h1 { font-family: var(--fd); font-weight: 700; font-size: clamp(34px, 4.6vw, 64px); letter-spacing: -.02em; }
.psubcard p { margin-top: 18px; color: var(--ink-3); font-weight: 300; font-size: 17px; line-height: 1.7; }

.plisting-filters { display: flex; justify-content: center; gap: 8px; margin: 44px 0 8px; flex-wrap: wrap; }
.plisting-filters button { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 10px 20px; border-radius: 40px; border: 1px solid var(--line-2); color: var(--ink-3); transition: .25s var(--ease); }
.plisting-filters button:hover { border-color: var(--ink); color: var(--ink); }
.plisting-filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.4vw, 40px); margin-top: 44px; }
@media (max-width: 980px) { .agrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .agrid { grid-template-columns: 1fr; } }
.acard { display: block; }
.acard .ac-img { position: relative; aspect-ratio: 4/3.3; border-radius: 5px; overflow: hidden; background: var(--panel); }
.acard .ac-img .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 1s var(--ease), opacity .5s var(--ease); }
.acard .ac-img .bg.b2 { opacity: 0; }
.acard:hover .ac-img .bg.b1 { opacity: 0; }
.acard:hover .ac-img .bg.b2 { opacity: 1; transform: scale(1.05); }
.acard .ac-tag { position: absolute; top: 14px; left: 14px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; background: #fff; color: var(--ink); padding: 5px 11px; border-radius: 40px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.acard .ac-name { font-weight: 500; font-size: 18px; margin-top: 18px; }
.acard .ac-sub { font-size: 13.5px; color: var(--muted); font-weight: 300; margin-top: 4px; }
.acard .ac-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); opacity: 0; transform: translateY(4px); transition: .3s var(--ease); }
.acard:hover .ac-go { opacity: 1; transform: none; }

/* the configurator call to action that closes a product page (old product.php <style>) */
.labcta { position: relative; min-height: 440px; display: flex; align-items: center; overflow: hidden; }
.labcta .container { z-index: 1; }
.labcta .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.labcta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,19,14,.62) 0%, rgba(20,19,14,.15) 100%); }
.labcta .lc-in { position: relative; color: #fff; max-width: 520px; }
.labcta .lc-kicker { color: rgba(255,255,255,.75); }
.labcta h2 { font-family: var(--fs); font-size: clamp(28px, 3.4vw, 46px); margin: 14px 0 16px; line-height: 120%; }
.labcta p { color: rgba(255,255,255,.85); font-weight: 300; margin-bottom: 26px; }

/* the drawings viewer (old components/lightbox.php); z-index clears the fixed navbar at 100 */
.hk-lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.hk-lightbox .lb-backdrop { position: absolute; inset: 0; background: rgba(11, 10, 7, 0.94); }
.hk-lightbox .lb-stage { position: relative; margin: 0; display: flex; max-width: min(92vw, 1600px); }
.hk-lightbox .lb-stage img { max-width: 100%; max-height: 86vh; width: auto; height: auto; object-fit: contain; }
.hk-lightbox .lb-btn { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); background: rgba(0,0,0,0.25); color: #fff; transition: 0.25s var(--ease); }
.hk-lightbox .lb-btn:hover { background: #fff; border-color: #fff; color: var(--ink); }
.hk-lightbox .lb-close { top: clamp(16px, 3vw, 32px); right: clamp(16px, 3vw, 32px); }
.hk-lightbox .lb-prev,
.hk-lightbox .lb-next { top: 50%; transform: translateY(-50%); }
.hk-lightbox .lb-prev { left: clamp(12px, 3vw, 40px); }
.hk-lightbox .lb-next { right: clamp(12px, 3vw, 40px); }
/* tabular figures stop the counter shifting sideways as the digits change */
.hk-lightbox .lb-count { position: absolute; bottom: clamp(16px, 3vw, 32px); left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.72); font-size: 12px; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .hk-lightbox .lb-btn { width: 44px; height: 44px; }
  .hk-lightbox .lb-stage { max-width: 100vw; }
}
/* end products */
