/*
 * Component library.
 *
 * Components only use semantic tokens, so the colour mode switches them.
 * .is-hover and .is-focus mirror :hover and :focus-visible for the local
 * component library; templates never print them.
 */

/* Containers ------------------------------------------------------------ */

.thiek-container-content {
  width: min(var(--content-width), calc(100% - var(--page-gutter) * 2));
  margin-inline: auto;
}

.thiek-container-narrow {
  width: min(720px, calc(100% - var(--page-gutter) * 2));
  margin-inline: auto;
}

.thiek-section {
  padding-block: var(--spacing-2xl);
  background: var(--color-bg);
  color: var(--color-text);
}

.thiek-section-tight {
  padding-block: var(--spacing-xl);
}

.thiek-section-surface {
  background: var(--color-surface);
}

.thiek-section + .thiek-section:not(.thiek-section-surface, .thiek-inverse) {
  border-top: 1px solid var(--color-line);
}

.thiek-panel {
  padding: var(--spacing-md);
  border: 1px solid var(--color-line);
  background: var(--color-surface);
}

.thiek-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 4), minmax(0, 1fr));
  gap: var(--spacing-lg) var(--spacing-md);
}

.thiek-grid-3 {
  --grid-columns: 3;
}

.thiek-grid-2 {
  --grid-columns: 2;
}

.thiek-stack > * + * {
  margin-top: var(--stack-gap, var(--spacing-sm));
}

/* Section heading ------------------------------------------------------- */

.thiek-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.thiek-section-heading-text {
  max-width: 760px;
}

.thiek-section-heading .thiek-eyebrow {
  margin-bottom: var(--spacing-xs);
}

.thiek-section-title {
  font-size: var(--text-h2);
}

.thiek-section-intro {
  margin-top: var(--spacing-sm);
  max-width: var(--measure);
  font-size: var(--text-lede);
  color: var(--color-muted);
}

.thiek-section-heading-center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.thiek-section-heading-center .thiek-section-intro {
  margin-inline: auto;
}

.thiek-section-heading-small .thiek-section-title {
  font-size: var(--text-h3);
}

/* Buttons --------------------------------------------------------------- */

.thiek-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  min-height: var(--control-height);
  padding: 0 var(--spacing-md);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-ui);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-ui);
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

.thiek-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.thiek-btn.is-focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.thiek-btn-primary {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: var(--color-white);
}

.thiek-btn-primary:hover,
.thiek-btn-primary.is-hover {
  border-color: var(--color-brand-hover);
  background: var(--color-brand-hover);
  color: var(--color-white);
}

.thiek-btn-primary:active {
  border-color: var(--color-brand-press);
  background: var(--color-brand-press);
}

.thiek-btn-secondary {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}

.thiek-btn-secondary:hover,
.thiek-btn-secondary.is-hover {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: var(--color-white);
}

.thiek-btn-ghost {
  border-color: var(--color-control-border);
  color: var(--color-text);
}

.thiek-btn-ghost:hover,
.thiek-btn-ghost.is-hover {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}

.thiek-btn-text {
  min-height: var(--target-size);
  padding-inline: 0;
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

.thiek-btn-text:hover,
.thiek-btn-text.is-hover {
  color: var(--color-accent-text);
}

.thiek-btn-sm {
  min-height: var(--target-size);
  padding-inline: var(--spacing-sm);
}

.thiek-btn-lg {
  min-height: 56px;
  padding-inline: var(--spacing-lg);
}

.thiek-btn-block {
  width: 100%;
}

.thiek-btn:disabled:not(.is-loading),
.thiek-btn[aria-disabled="true"]:not(.is-loading) {
  border-color: var(--color-disabled-bg);
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  cursor: not-allowed;
}

.thiek-btn-text:disabled:not(.is-loading),
.thiek-btn-text[aria-disabled="true"]:not(.is-loading) {
  border-color: transparent;
  background: transparent;
  text-decoration: none;
}

/* The label stays in the accessibility tree while the spinner shows. */
.thiek-btn.is-loading {
  color: transparent;
  cursor: progress;
}

.thiek-btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 2px solid var(--spinner-color, var(--color-white));
  border-right-color: transparent;
  border-radius: var(--radius-full);
  animation: thiek-spin 0.8s linear infinite;
}

.thiek-btn-ghost.is-loading,
.thiek-btn-text.is-loading {
  --spinner-color: var(--color-text);
}

.thiek-btn-secondary.is-loading {
  --spinner-color: var(--color-bg);
}

.thiek-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-size);
  min-height: var(--target-size);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}

.thiek-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thiek-icon-btn svg.thiek-icon--fill {
  fill: currentColor;
  stroke: none;
}

.thiek-icon-btn:hover,
.thiek-icon-btn.is-hover {
  color: var(--color-accent-text);
}

.thiek-icon-btn:disabled {
  color: var(--color-disabled-text);
  cursor: not-allowed;
}

/* Links ----------------------------------------------------------------- */

.thiek-link {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color var(--duration-fast) var(--ease);
}

.thiek-link:hover,
.thiek-link.is-hover {
  color: var(--color-accent-text);
  text-decoration-thickness: 2px;
}

.thiek-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-height: var(--target-size);
  font-size: var(--text-ui);
  font-weight: 500;
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.thiek-link-arrow::after {
  content: "→";
  transition: transform var(--duration-fast) var(--ease);
}

.thiek-link-arrow:hover,
.thiek-link-arrow.is-hover {
  color: var(--color-accent-text);
}

.thiek-link-arrow:hover::after,
.thiek-link-arrow.is-hover::after {
  transform: translateX(4px);
}

.thiek-link-muted {
  color: var(--color-muted);
}

.thiek-link.is-focus,
.thiek-link-arrow.is-focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Badges ---------------------------------------------------------------- */

.thiek-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px var(--spacing-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  white-space: nowrap;
}

.thiek-badge-brand {
  border-color: var(--color-accent-text);
  background: var(--color-accent-text);
  color: var(--color-bg);
}

.thiek-badge-neutral {
  border-color: var(--color-line);
  background: var(--color-surface);
  color: var(--color-text);
}

.thiek-badge-inverse {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}

.thiek-badge-outline {
  border-color: var(--color-control-border);
  color: var(--color-muted);
}

.thiek-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2xs);
}

/* Product card ---------------------------------------------------------- */

.thiek-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  /* 16 px between photo and name. */
  gap: var(--spacing-sm);
  height: 100%;
  color: var(--color-text);
}

.thiek-product-card-media {
  position: relative;
  overflow: hidden;
  /* Portrait 4:5 — logo Thiek never cropped (focus / contain per product). */
  aspect-ratio: 4 / 5;
  background: var(--color-surface);
}

.thiek-product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 72%;
  transition:
    transform var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
}

/* Logo-safe fallback when cover would crop the watermark. */
.thiek-product-card-media--contain img,
.thiek-product-card.is-contain .thiek-product-card-media img {
  object-fit: contain;
  object-position: center center;
}

.thiek-product-card-media .thiek-product-card-alt {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.thiek-product-card .thiek-badges {
  position: absolute;
  top: auto;
  bottom: var(--spacing-xs);
  left: var(--spacing-xs);
  z-index: 1;
}

/* Sale % — light pill on the image. */
.thiek-product-card-sale {
  border-color: transparent;
  background: var(--color-inverse-text);
  color: var(--color-inverse-bg);
}

.thiek-product-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0;
  align-content: start;
  min-height: 0;
}

/* Beat WooCommerce `.woocommerce ul.products li.product h3 { font-size: 1em }`. */
.woocommerce ul.products li.product .thiek-product-card-title,
.thiek-product-card .thiek-product-card-title,
h3.thiek-product-card-title,
h2.thiek-product-card-title,
h4.thiek-product-card-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-card);
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text);
}

/* The title link covers the card media + text, but not the image actions. */
.thiek-product-card-link {
  color: inherit;
  text-decoration: none;
}

.thiek-product-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Bag+ (top-left) + heart (top-right): header icon family, always visible. */
.thiek-product-card-quick,
.thiek-product-card-wish {
  position: absolute;
  top: var(--spacing-xs);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target-size);
  height: var(--target-size);
  min-width: var(--target-size);
  min-height: var(--target-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-ivory);
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
}

.thiek-product-card-quick {
  left: var(--spacing-xs);
}

.thiek-product-card-wish {
  right: var(--spacing-xs);
}

/* Sharp 36 px disc behind the glyph (no blur halo). Hit area stays 44×44. */
.thiek-product-card-quick::before,
.thiek-product-card-wish::before {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgb(17 17 17 / 45%);
  z-index: -1;
}

.thiek-product-card-quick-icon,
.thiek-product-card-wish-icon {
  position: relative;
  z-index: 1;
  display: flex;
  width: 20px;
  height: 20px;
  filter: none;
}

.thiek-product-card-quick-icon svg,
.thiek-product-card-wish-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thiek-product-card-wish-icon--fill {
  display: none;
}

.thiek-product-card-wish-icon--fill svg {
  fill: currentColor;
  stroke: currentColor;
}

.thiek-product-card-wish[aria-pressed="true"] .thiek-product-card-wish-icon--outline {
  display: none;
}

.thiek-product-card-wish[aria-pressed="true"] .thiek-product-card-wish-icon--fill {
  display: flex;
}

.thiek-product-card-wish[aria-pressed="true"] {
  color: var(--color-ivory);
}

.thiek-product-card-quick:hover,
.thiek-product-card-wish:hover,
.thiek-product-card-quick:focus-visible,
.thiek-product-card-wish:focus-visible {
  color: var(--color-ivory);
  outline: none;
}

.thiek-product-card-quick:focus-visible,
.thiek-product-card-wish:focus-visible {
  box-shadow: 0 0 0 2px rgb(17 17 17 / 50%), 0 0 0 4px var(--color-focus);
}

/* Mobile product carousels (home shop + related) — CSS scroll-snap, no JS. */
@media (max-width: 767px) {
  .thiek-product-carousel {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-sm);
    margin-inline: calc(var(--spacing-sm) * -1);
    padding-inline: var(--spacing-sm);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .thiek-product-carousel::-webkit-scrollbar {
    display: none;
  }

  .thiek-home-shop-products.thiek-product-carousel,
  .woocommerce .thiek-commerce ul.products.thiek-shop-grid.thiek-product-carousel,
  .thiek-shop-grid.thiek-product-carousel {
    display: flex;
    grid-template-columns: none;
  }

  .thiek-product-carousel > .thiek-product-carousel-item,
  .thiek-product-carousel > li.product,
  .woocommerce .thiek-commerce ul.products.thiek-shop-grid.thiek-product-carousel > li.product {
    flex: 0 0 calc(100% / 1.3);
    width: calc(100% / 1.3) !important;
    max-width: calc(100% / 1.3);
    margin: 0 !important;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  .thiek-product-carousel .thiek-product-card {
    height: 100%;
  }
}

.thiek-product-card-link:focus-visible {
  outline: none;
}

.thiek-product-card:has(.thiek-product-card-link:focus-visible),
.thiek-product-card.is-focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}

.thiek-product-card:hover .thiek-product-card-title,
.thiek-product-card.is-hover .thiek-product-card-title {
  color: var(--color-accent-text);
}

.thiek-product-card:hover .thiek-product-card-media img,
.thiek-product-card.is-hover .thiek-product-card-media img {
  transform: scale(1.03);
}

.thiek-product-card.is-contain:hover .thiek-product-card-media img,
.thiek-product-card.is-contain.is-hover .thiek-product-card-media img {
  transform: none;
}

.thiek-product-card:hover .thiek-product-card-alt,
.thiek-product-card.is-hover .thiek-product-card-alt {
  opacity: 1;
}

.thiek-product-card-meta {
  margin: var(--spacing-2xs) 0 0; /* 4 px under name */
  min-height: 0;
  font-size: var(--text-small, 14px);
  line-height: 1.3;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thiek-product-card-meta:empty {
  display: none;
}

.thiek-product-card-price {
  margin: var(--spacing-xs) 0 0; /* 8 px under meta or name */
  align-self: start;
  min-height: 0;
  font-family: var(--font-body);
  font-size: var(--text-card, 15px);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.3;
  color: var(--color-text);
}

/* Sale: new price first, struck regular after (muted). Never error colour. */
.thiek-price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--spacing-2xs);
}

.thiek-product-card-price.thiek-price {
  display: flex;
  width: 100%;
}

.thiek-price del {
  order: 2;
  color: var(--color-muted);
  text-decoration: line-through;
}

.thiek-price ins {
  order: 1;
  margin-left: 0;
  color: var(--color-text);
  text-decoration: none;
}

.thiek-price .woocommerce-Price-amount {
  color: inherit;
}

.thiek-product-card.is-out-of-stock .thiek-product-card-media img {
  filter: grayscale(1);
  opacity: 0.55;
}

/* Forms ----------------------------------------------------------------- */

.thiek-field {
  display: grid;
  gap: var(--spacing-xs);
}

.thiek-label {
  font-size: var(--text-small);
  font-weight: 500;
}

/* fieldset + grid décale le legend ; flex aligne comme un label. */
fieldset.thiek-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-xs);
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

fieldset.thiek-field > legend.thiek-label {
  display: block;
  float: none;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  margin-inline: 0;
  padding-inline: 0;
  text-indent: 0;
}

.thiek-required {
  color: var(--color-accent-text);
}

.thiek-input,
.thiek-select,
.thiek-textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 0 var(--spacing-sm);
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-body);
  transition: border-color var(--duration-fast) var(--ease);
}

.thiek-textarea {
  min-height: 144px;
  padding-block: var(--spacing-sm);
  resize: vertical;
}

.thiek-input::placeholder,
.thiek-textarea::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

.thiek-input:hover,
.thiek-select:hover,
.thiek-textarea:hover {
  border-color: var(--color-text);
}

.thiek-input:focus-visible,
.thiek-select:focus-visible,
.thiek-textarea:focus-visible,
.thiek-field.is-focus :is(.thiek-input, .thiek-select, .thiek-textarea) {
  border-color: var(--color-focus);
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

.thiek-select-wrap {
  position: relative;
}

.thiek-select {
  padding-right: var(--spacing-xl);
  appearance: none;
  cursor: pointer;
}

.thiek-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--spacing-sm);
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--color-text);
  border-bottom: 1.5px solid var(--color-text);
  transform: translateY(-75%) rotate(45deg);
  pointer-events: none;
}

.thiek-help {
  font-size: var(--text-small);
  color: var(--color-muted);
}

.thiek-error {
  display: flex;
  gap: var(--spacing-2xs);
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-error);
}

.thiek-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  color: var(--color-white);
  font-size: 12px;
  line-height: 1;
}

.thiek-field.is-error :is(.thiek-input, .thiek-select, .thiek-textarea) {
  border-color: var(--color-error);
  border-width: 2px;
}

.thiek-field.is-disabled .thiek-label {
  color: var(--color-disabled-text);
}

.thiek-input:disabled,
.thiek-select:disabled,
.thiek-textarea:disabled {
  border-color: var(--color-disabled-bg);
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  cursor: not-allowed;
}

.thiek-choices {
  display: grid;
  gap: var(--spacing-xs);
  margin: 0;
  padding: 0;
  border: 0;
}

.thiek-choices legend {
  margin-bottom: var(--spacing-xs);
  padding: 0;
  font-size: var(--text-small);
  font-weight: 500;
}

.thiek-check {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-height: var(--target-size);
  font-size: var(--text-body);
  cursor: pointer;
}

.thiek-check input,
input[type="checkbox"].input-checkbox,
.woocommerce-form__input-checkbox {
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  accent-color: var(--color-brand);
  cursor: inherit;
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
}

.thiek-check input:checked,
input[type="checkbox"].input-checkbox:checked,
.woocommerce-form__input-checkbox:checked {
  border-color: var(--color-brand);
  background: var(--color-brand);
}

.thiek-check input:checked::after,
input[type="checkbox"].input-checkbox:checked::after,
.woocommerce-form__input-checkbox:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border: solid var(--color-white);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px);
}

.thiek-check input:focus-visible,
input[type="checkbox"].input-checkbox:focus-visible,
.woocommerce-form__input-checkbox:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.thiek-check:has(input:disabled) {
  color: var(--color-disabled-text);
  cursor: not-allowed;
}

.thiek-form {
  display: grid;
  gap: var(--spacing-md);
}

.thiek-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-md);
}

/* Accordion ------------------------------------------------------------- */

.thiek-accordion {
  border-top: 1px solid var(--color-line);
}

.thiek-accordion-item {
  border-bottom: 1px solid var(--color-line);
}

.thiek-accordion-heading {
  margin: 0;
  font-size: inherit;
}

.thiek-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  width: 100%;
  min-height: 64px;
  padding: var(--spacing-sm) 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: var(--font-display-weight);
  line-height: 1.25;
  text-align: left;
}

.thiek-accordion-trigger:hover,
.thiek-accordion-trigger.is-hover {
  color: var(--color-accent-text);
}

.thiek-accordion-trigger:focus-visible,
.thiek-accordion-trigger.is-focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.thiek-accordion-icon {
  position: relative;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.thiek-accordion-icon::before,
.thiek-accordion-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--duration-fast) var(--ease);
}

.thiek-accordion-icon::after {
  transform: rotate(90deg);
}

.thiek-accordion-trigger[aria-expanded="true"] .thiek-accordion-icon::after {
  transform: rotate(0deg);
}

.thiek-accordion-panel {
  padding-bottom: var(--spacing-md);
  color: var(--color-muted);
}

.thiek-accordion-panel > * + * {
  margin-top: var(--spacing-sm);
}

.thiek-accordion-trigger:disabled {
  color: var(--color-disabled-text);
  cursor: not-allowed;
}

/* Modal ----------------------------------------------------------------- */

.thiek-modal {
  width: min(560px, calc(100% - var(--spacing-md) * 2));
  max-width: none;
  max-height: calc(100dvh - var(--spacing-md) * 2);
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  color: var(--color-text);
}

.thiek-modal::backdrop {
  background: var(--overlay);
}

.thiek-modal[open] {
  animation: thiek-modal-in var(--duration) var(--ease);
}

.thiek-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-md) 0;
}

.thiek-modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--font-display-weight);
  line-height: var(--leading-heading);
}

.thiek-modal-close {
  margin: calc(var(--spacing-xs) * -1) calc(var(--spacing-xs) * -1) 0 0;
}

.thiek-modal-body {
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  color: var(--color-muted);
}

.thiek-modal-body > * + * {
  margin-top: var(--spacing-sm);
}

.thiek-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
  border-top: 1px solid var(--color-line);
}

.thiek-modal-drawer {
  width: min(440px, 100%);
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
}

.thiek-modal-drawer[open] {
  display: flex;
  flex-direction: column;
  animation-name: thiek-drawer-in;
}

.thiek-modal-drawer .thiek-modal-body {
  flex: 1;
  overflow-y: auto;
}

html.thiek-is-locked {
  overflow: hidden;
}

@keyframes thiek-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes thiek-drawer-in {
  from {
    transform: translateX(100%);
  }
}

/* Notifications --------------------------------------------------------- */

.thiek-notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--notice-accent, var(--color-control-border));
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-small);
}

.thiek-notice-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.thiek-notice-title {
  display: block;
  font-weight: 500;
}

.thiek-notice-text > * + * {
  margin-top: var(--spacing-2xs);
}

.thiek-notice-success {
  --notice-accent: var(--color-text);
}

.thiek-notice-warning {
  --notice-accent: var(--color-accent-text);
}

.thiek-notice-error {
  --notice-accent: var(--color-brand);
  border-color: var(--color-brand);
}

.thiek-notice-error .thiek-notice-icon {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: var(--color-white);
}

.thiek-notice-dismiss {
  margin: calc(var(--spacing-sm) * -1) calc(var(--spacing-sm) * -1) calc(var(--spacing-sm) * -1) 0;
}

.thiek-notice-dismiss svg {
  width: 18px;
  height: 18px;
}

.thiek-toasts {
  position: fixed;
  right: var(--spacing-md);
  bottom: var(--spacing-md);
  z-index: var(--z-toast);
  display: grid;
  gap: var(--spacing-xs);
  width: min(400px, calc(100% - var(--spacing-md) * 2));
  pointer-events: none;
}

.thiek-toasts .thiek-notice {
  pointer-events: auto;
  box-shadow: 0 12px 32px rgb(0 0 0 / 28%);
  animation: thiek-modal-in var(--duration) var(--ease);
}

/* Loaders --------------------------------------------------------------- */

.thiek-loader {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--text-small);
  color: var(--color-muted);
}

.thiek-spinner {
  display: inline-block;
  flex-shrink: 0;
  width: var(--spinner-size, 24px);
  height: var(--spinner-size, 24px);
  border: 2px solid var(--color-line);
  border-top-color: var(--color-accent-text);
  border-radius: var(--radius-full);
  animation: thiek-spin 0.8s linear infinite;
}

.thiek-spinner-sm {
  --spinner-size: 16px;
}

.thiek-spinner-lg {
  --spinner-size: 40px;
}

.thiek-skeleton {
  display: block;
  height: 1em;
  background: linear-gradient(90deg, var(--color-skeleton) 0%, var(--color-surface) 50%, var(--color-skeleton) 100%);
  background-size: 200% 100%;
  animation: thiek-shimmer 1.4s ease-in-out infinite;
}

.thiek-skeleton-media {
  height: auto;
  aspect-ratio: 1;
}

.thiek-skeleton-title {
  width: 70%;
  height: 22px;
}

.thiek-skeleton-text {
  width: 35%;
}

.thiek-skeleton-card {
  display: grid;
  gap: var(--spacing-xs);
}

.thiek-skeleton-card .thiek-skeleton-media {
  margin-bottom: var(--spacing-xs);
}

@keyframes thiek-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes thiek-shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

/* reset.css stops animations under reduced motion: the spinner then reads as
   a ring beside its text, and skeletons drop the frozen gradient. */
@media (prefers-reduced-motion: reduce) {
  .thiek-skeleton {
    background: var(--color-skeleton);
  }
}

/* Empty state ----------------------------------------------------------- */

.thiek-empty {
  display: grid;
  justify-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
}

.thiek-empty-icon {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--color-muted);
  stroke-width: 1.25;
}

.thiek-empty-title {
  font-size: var(--text-h3);
}

.thiek-empty-text {
  max-width: 46ch;
  color: var(--color-muted);
}

.thiek-empty .thiek-actions {
  justify-content: center;
  margin-top: var(--spacing-xs);
}

.thiek-empty-bordered {
  border: 1px dashed var(--color-control-border);
}

.thiek-empty-compact {
  padding: var(--spacing-md);
}

.thiek-empty-compact .thiek-empty-title {
  font-size: 22px;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1279px) {
  .thiek-grid {
    --grid-columns: 3;
  }

  .thiek-grid-2 {
    --grid-columns: 2;
  }
}

@media (max-width: 1023px) {
  .thiek-section {
    padding-block: var(--spacing-xl);
  }

  .thiek-section-tight {
    padding-block: var(--spacing-lg);
  }
}

@media (max-width: 799px) {
  .thiek-grid,
  .thiek-grid-3 {
    --grid-columns: 2;
  }

  .thiek-section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .thiek-section-heading-center {
    align-items: center;
  }
}

@media (max-width: 599px) {
  .thiek-grid {
    gap: var(--spacing-md) var(--spacing-sm);
  }

  .thiek-grid-2.thiek-grid-stack-mobile {
    --grid-columns: 1;
  }

  .thiek-form-row {
    grid-template-columns: 1fr;
  }

  .thiek-actions > .thiek-btn {
    flex: 1 1 100%;
  }

  .thiek-modal {
    width: calc(100% - var(--spacing-sm) * 2);
  }

  .thiek-modal-drawer {
    width: 100%;
    border-left: 0;
  }

  .thiek-modal-actions .thiek-btn {
    flex: 1 1 100%;
  }

  .thiek-toasts {
    right: var(--spacing-sm);
    bottom: var(--spacing-sm);
    width: calc(100% - var(--spacing-sm) * 2);
  }
}
