/* =========================================================
   Temia site footer + cookie preferences
   Load after css/styles.css. Uses the site's tokens (--navy, --on-navy, --amber …).

   1. Footer
   2. Cookie banner
   3. Cookie preferences dialog
   ========================================================= */

/* ---------- 1. Footer ---------- */
.site-footer { background: var(--navy); color: var(--on-navy); border-top: 1px solid rgba(255,255,255,.08); padding-top: clamp(48px, 6vw, 72px); padding-bottom: 28px; }
.site-footer a { color: inherit; text-decoration: none; }

.sf-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-bottom: clamp(28px, 3.4vw, 40px); }
.sf-brand { display: inline-flex; color: var(--white) !important; }
.sf-brand svg { width: 112px; height: 32px; display: block; }
.sf-by { margin: 0; padding-left: 20px; border-left: 1px solid rgba(255,255,255,.18); font-size: 13px; line-height: 1.4; color: var(--on-navy-2); }
.sf-by b { font-weight: 500; color: var(--on-navy); }

.sf-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px clamp(24px, 4vw, 56px); padding-bottom: clamp(36px, 4.4vw, 52px); }
.sf-col { min-width: 0; }
.sf-col h2, .sf-col h3 { margin: 0 0 14px; font-size: 14px; line-height: 1.4; font-weight: 600; letter-spacing: .01em; color: var(--white); }
.sf-col h3 { margin-top: 24px; margin-bottom: 12px; }
.sf-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sf-col li[hidden] { display: none; }
.sf-col ul a, .sf-linkbtn { font: inherit; font-size: 14.5px; line-height: 1.45; color: var(--on-navy); transition: color .15s; }
.sf-linkbtn { border: 0; padding: 0; background: none; cursor: pointer; text-align: left; }
.sf-col ul a:hover, .sf-linkbtn:hover, .sf-contact a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:focus-visible, .sf-linkbtn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
.site-footer a[aria-current="page"] { color: var(--white); }

.sf-contact { margin: 0; display: grid; gap: 14px; }
.sf-contact div { display: grid; gap: 2px; }
.sf-contact dt { font-size: 12px; line-height: 1.4; color: var(--on-navy-2); }
.sf-contact dd { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--on-navy); overflow-wrap: anywhere; }
.sf-contact a { color: var(--white); }

.sf-social { display: flex !important; flex-wrap: wrap; gap: 10px !important; }
.sf-social a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); color: var(--on-navy); transition: color .15s, border-color .15s, background-color .15s; }
.sf-social a:hover { color: var(--white); border-color: var(--white); background: rgba(255,255,255,.06); text-decoration: none; }
.sf-social svg { width: 17px; height: 17px; fill: currentColor; display: block; }

.sf-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; line-height: 1.5; color: var(--on-navy-2); }

@media (max-width: 960px) {
  .sf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .sf-cols { gap: 28px 20px; }
  .sf-col:last-child { grid-column: 1 / -1; }
  .sf-by { padding-left: 0; border-left: 0; flex-basis: 100%; }
}

/* ---------- 2. Cookie banner ---------- */
.ck-banner {
  position: fixed; z-index: 90; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  max-width: 760px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
  padding: 16px 18px; border-radius: var(--r); background: var(--white); color: var(--ink-2); border: 1px solid var(--line); box-shadow: 0 24px 48px -20px rgba(13,48,111,.35);
  font-size: 14px; line-height: 1.6;
}
.ck-banner[hidden] { display: none; }
.ck-banner p { margin: 0; flex: 1 1 320px; min-width: 0; }
.ck-banner a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.ck-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ck-btn { font: inherit; font-size: 14px; font-weight: 500; height: 40px; padding: 0 16px; border-radius: 4px; cursor: pointer; border: 1px solid var(--sh20); background: var(--white); color: var(--navy); transition: background-color .15s, border-color .15s; }
.ck-btn:hover { border-color: var(--navy); }
.ck-btn.is-primary { background: var(--btn, var(--navy)); border-color: var(--btn, var(--navy)); color: var(--white); }
.ck-btn.is-primary:hover { background: var(--navy); border-color: var(--navy); }
.ck-btn.is-text { border-color: transparent; text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; }
.ck-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 520px) { .ck-actions { width: 100%; } .ck-actions .ck-btn:not(.is-text) { flex: 1 1 auto; } }

/* ---------- 3. Cookie preferences dialog ---------- */
.ck-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 20, 45, .55); }
.ck-overlay[hidden] { display: none; }
.ck-dialog { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--white); color: var(--ink-2); border-radius: var(--r); box-shadow: 0 32px 64px -24px rgba(0,0,0,.45); padding: 24px; display: grid; gap: 16px; font-size: 14px; line-height: 1.6; }
.ck-dialog h2 { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 600; color: var(--navy); }
.ck-dialog p { margin: 0; }
.ck-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.ck-cat:last-of-type { border-bottom: 1px solid var(--line); }
.ck-cat b { color: var(--ink); font-weight: 600; }
.ck-cat span { grid-column: 1; font-size: 13px; color: var(--ink-3); }
.ck-cat .ck-switch { grid-column: 2; grid-row: 1 / span 2; }
.ck-switch { position: relative; width: 44px; height: 24px; flex: none; }
.ck-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.ck-switch input:disabled { cursor: not-allowed; }
.ck-switch i { position: absolute; inset: 0; border-radius: 12px; background: var(--sh20); transition: background-color .2s; }
.ck-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.ck-switch input:checked + i { background: var(--navy); }
.ck-switch input:checked + i::after { transform: translateX(20px); }
.ck-switch input:disabled + i { opacity: .55; }
.ck-switch input:focus-visible + i { outline: 2px solid var(--amber); outline-offset: 2px; }
.ck-dialog .ck-actions { justify-content: flex-end; }
.ck-saved { font-size: 13px; color: var(--green, #008368); min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { .ck-switch i, .ck-switch i::after { transition: none; } }
@media print { .site-footer, .ck-banner, .ck-overlay { display: none !important; } }
