/* INCooked — consent banner, preference centre and policy page bits.
   Colours are custom properties; override them on :root in the theme. */

:root {
  --inc-accent: #5fc4ed;
  --inc-accent-ink: #10303d; /* text on accent; white on #5fc4ed fails contrast */
  --inc-ink: #212121;
  --inc-muted: #707070;
  --inc-bg: #fff;
  --inc-line: #e6e6e6;
  --inc-soft: #f4f4f4;
  --inc-radius: 6px;
}

.inc {
  font-family: inherit;
  color: var(--inc-ink);
  font-size: 14px;
  line-height: 1.6;
}

.inc [hidden],
.inc[hidden] {
  display: none !important;
}

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

.inc p {
  margin: 0 0 .75em;
}

.inc p:last-child {
  margin-bottom: 0;
}

.inc button {
  font: inherit;
  margin: 0;
}

.inc button:focus-visible,
.inc a:focus-visible,
.inc input:focus-visible + span {
  outline: 2px solid var(--inc-accent-ink);
  outline-offset: 2px;
}

.inc-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px !important;
}

.inc-link,
.inc-more-btn {
  color: var(--inc-accent-ink);
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Banner (box, bottom left) */

.inc-banner {
  position: fixed;
  left: 40px;
  bottom: 40px;
  z-index: 2147483000;
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 20px 26px;
  background: var(--inc-bg);
  border: 1px solid var(--inc-soft);
  border-radius: var(--inc-radius);
  box-shadow: 0 -1px 10px rgba(172, 171, 171, .3);
}

/* Buttons */

.inc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.inc-btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 8px 12px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--inc-accent-ink);
  background: var(--inc-accent);
  border: 2px solid var(--inc-accent);
  border-radius: 2px;
  cursor: pointer;
}

.inc-btn:hover {
  filter: brightness(.93);
}

.inc-btn-outline {
  background: transparent;
}

/* Preference centre */

.inc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  background: rgba(0, 0, 0, .4);
}

.inc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2147483002;
  display: flex;
  flex-direction: column;
  width: 845px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  background: var(--inc-bg);
  border-radius: var(--inc-radius);
  box-shadow: 0 32px 68px rgba(0, 0, 0, .3);
  transform: translate(-50%, -50%);
}

.inc-modal:focus {
  outline: 0;
}

.inc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--inc-line);
}

.inc-modal-head .inc-title {
  margin: 0 !important;
}

.inc-close {
  display: flex;
  padding: 6px;
  color: var(--inc-ink);
  background: none;
  border: 0;
  cursor: pointer;
}

.inc-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 24px;
}

.inc-modal-foot {
  margin: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--inc-line);
}

.inc-more-btn {
  margin-top: 4px;
}

.inc-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--inc-line);
}

.inc-cat:first-of-type {
  margin-top: 16px;
  border-top: 1px solid var(--inc-line);
}

.inc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inc-cat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--inc-ink);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.inc-cat-btn::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s;
}

.inc-cat-btn[aria-expanded="true"]::before {
  transform: rotate(45deg);
}

.inc-always {
  font-weight: 600;
  color: #008000;
  white-space: nowrap;
}

.inc-cat-desc {
  margin-top: 6px;
  padding-left: 17px;
  color: var(--inc-muted);
}

.inc-cat-body {
  margin-top: 12px;
  padding-left: 17px;
}

.inc-cookie {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 16px;
  margin: 0 0 8px;
  padding: 12px 16px;
  background: var(--inc-soft);
  border-radius: 4px;
}

.inc-cookie dt {
  font-weight: 600;
}

.inc-cookie dd {
  margin: 0;
  word-break: break-word;
}

.inc-empty {
  padding: 12px 16px;
  background: var(--inc-soft);
  border-radius: 4px;
}

/* Switch */

.inc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.inc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.inc-switch span {
  position: absolute;
  inset: 0;
  background: #d0d5d2;
  border-radius: 12px;
  transition: background .2s;
  pointer-events: none;
}

.inc-switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}

.inc-switch input:checked + span {
  background: var(--inc-accent-ink);
}

.inc-switch input:checked + span::after {
  transform: translateX(20px);
}

/* Revisit button */

.inc-revisit {
  position: fixed;
  left: 15px;
  bottom: 15px;
  z-index: 2147482999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  padding: 0;
  color: var(--inc-accent);
  background: var(--inc-accent);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.inc-revisit:hover::after,
.inc-revisit:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  padding: 4px 8px;
  font-size: 12px;
  line-height: 16px;
  color: #fff;
  white-space: nowrap;
  background: #4e4b66;
  border-radius: 4px;
}

html.inc-locked {
  overflow: hidden;
}

/* Policy page table ([incooked_table]) */

.inc-policy-cat {
  margin-bottom: 2em;
}

.inc-table-wrap {
  overflow-x: auto;
}

.inc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9em;
}

.inc-table th,
.inc-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--inc-line);
}

.inc-table th {
  background: var(--inc-soft);
}

/* "Cookie settings" button on the policy page (and anywhere else it's placed) */

.incooked-settings,
.cky-banner-element {
  display: inline-block;
  min-height: 44px;
  margin: .25em 0 1em;
  padding: 8px 20px;
  font: inherit;
  font-weight: 500;
  line-height: 1.5;
  color: var(--inc-accent-ink);
  text-decoration: none;
  background: var(--inc-accent);
  border: 2px solid var(--inc-accent);
  border-radius: 2px;
  cursor: pointer;
}

.incooked-settings:hover,
.cky-banner-element:hover {
  filter: brightness(.93);
}

.incooked-settings:focus-visible,
.cky-banner-element:focus-visible {
  outline: 2px solid var(--inc-accent-ink);
  outline-offset: 2px;
}

/* Small screens: banner becomes a bottom sheet, modal goes full height */

@media (max-width: 576px) {
  .inc-banner {
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    padding: 16px;
    border-radius: var(--inc-radius) var(--inc-radius) 0 0;
  }

  .inc-actions .inc-btn {
    flex-basis: 100%;
  }

  .inc-modal {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--inc-radius) var(--inc-radius) 0 0;
    transform: none;
  }

  .inc-modal-head,
  .inc-modal-body,
  .inc-modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .inc-cookie {
    grid-template-columns: 1fr;
  }

  .inc-cookie dd + dt {
    margin-top: 6px;
  }
}
