/* Looks: optional colour themes for customer pages, chosen by the visitor.
 *
 * How it works: the Tailwind build reads every colour from a CSS variable
 * (--color-navy, --color-prism-blue, --color-blue-*, --color-gray-*), so a look
 * only has to redefine those variables. Nothing here applies unless <html> has a
 * data-look attribute, so the default "Classic" site is untouched.
 *
 * Looks, lightest to darkest: calm, blaze, walnut, pop, night.
 * Rules below are unlayered, so they win over Tailwind's layered utilities.
 */

/* ── Shared by the four warm looks ──────────────────────────────────────── */
html[data-look="calm"], html[data-look="blaze"], html[data-look="walnut"], html[data-look="pop"] {
  --look-link: #8D420F;
  --look-on-accent: #1C1917;
  --color-gray-50: #fafaf9; --color-gray-100: #f5f5f4; --color-gray-200: #e7e5e4; --color-gray-300: #d6d3d1;
  --color-gray-400: #a8a29e; --color-gray-500: #78716c; --color-gray-600: #57534e; --color-gray-700: #44403c;
  --color-gray-800: #292524; --color-gray-900: #1c1917;
  --color-blue-50: #FFF6E6; --color-blue-100: #FBE9CC; --color-blue-200: #F1D198; --color-blue-300: #E9B873;
  --color-blue-400: #E49034; --color-blue-500: #A8550B; --color-blue-600: #8D420F; --color-blue-700: #6E3410;
  --color-blue-800: #4F260E; --color-blue-900: #3B1A08;
  --color-sky-100: #FBE9CC; --color-sky-200: #F1D198;
  --shadow-card-hover: 0 4px 12px rgba(28,25,23,.08), 0 12px 32px -8px rgba(228,144,52,.28);
  --shadow-button: 0 2px 6px rgba(228,144,52,.3);
  --shadow-button-hover: 0 6px 16px rgba(228,144,52,.4);
}
html[data-look="calm"] { --color-navy: #2B2420; --color-navy-dk: #1C1917; --color-prism-blue: #E49034; --color-prism-blue-dk: #C97A22; }
html[data-look="blaze"] { --color-navy: #A8550B; --color-navy-dk: #6E3410; --color-prism-blue: #FFD27A; --color-prism-blue-dk: #F2B05C; --color-blue-900: #7A3A0C; }
html[data-look="walnut"] { --color-navy: #5C2A0E; --color-navy-dk: #3B1A08; --color-prism-blue: #F2B05C; --color-prism-blue-dk: #D9922F; }
html[data-look="pop"] { --color-navy: #0F0D0C; --color-navy-dk: #000000; --color-prism-blue: #E49034; --color-prism-blue-dk: #C97A22; }

html[data-look="calm"] body, html[data-look="blaze"] body, html[data-look="walnut"] body { background-color: #FAF7F2; }

/* ── Night: a dark page ─────────────────────────────────────────────────── */
html[data-look="night"] {
  color-scheme: dark;
  --look-link: #F2B05C;
  --look-on-accent: #1C1917;
  --color-navy: #0D0B0A; --color-navy-dk: #080706; --color-prism-blue: #E49034; --color-prism-blue-dk: #C97A22;
  --color-gray-50: #1A1613; --color-gray-100: #221D19; --color-gray-200: #2F2924; --color-gray-300: #3E3730;
  --color-gray-400: #8A8178; --color-gray-500: #A8A29E; --color-gray-600: #C9C3BA; --color-gray-700: #D9D3C9;
  --color-gray-800: #E9E3D9; --color-gray-900: #F5EFE6;
  --color-blue-50: #2A2016; --color-blue-100: #33261A; --color-blue-200: #4A3418; --color-blue-300: #7A5420;
  --color-blue-400: #E49034; --color-blue-500: #F2B05C; --color-blue-600: #F2B05C; --color-blue-700: #F7C985;
  --color-blue-800: #FBE9CC; --color-blue-900: #2A2016;
  --color-sky-100: #FBE9CC; --color-sky-200: #F1D198;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.35);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,.5), 0 12px 32px -8px rgba(228,144,52,.2);
  --shadow-elevated: 0 8px 24px rgba(0,0,0,.5), 0 24px 48px -12px rgba(0,0,0,.6);
  --shadow-button: 0 2px 6px rgba(228,144,52,.25);
  --shadow-button-hover: 0 6px 16px rgba(228,144,52,.35);
}
html[data-look="night"] body { background-color: #14110F; color: #F5EFE6; }
html[data-look="night"] .bg-white { background-color: #1F1B18; }
html[data-look="night"] [class*="bg-white/9"] { background-color: #2A2420; }
html[data-look="night"] .text-navy, html[data-look="night"] .text-black { color: #F5EFE6; }
html[data-look="night"] .text-navy\/50, html[data-look="night"] .text-navy\/60 { color: rgba(245,239,230,.6); }
html[data-look="night"] :is(.bg-blue-500, .bg-blue-600, .bg-blue-700).text-white { color: #1C1917; }
html[data-look="night"] .list-pager-label { color: #A8A29E; }
html[data-look="night"] .list-pager-item[aria-current="page"] { background: #E49034; border-color: #E49034; color: #1C1917; }

/* ── Every look (not Classic) ───────────────────────────────────────────── */
/* Text links: the accent colour is too light for white pages, so links use --look-link ... */
html[data-look] :is(.text-prism-blue, .hover\:text-prism-blue:hover, .focus\:text-prism-blue:focus, .group-hover\:text-prism-blue:is(:where(.group):hover *)) { color: var(--look-link); }
/* ... except on the dark shell (header, footer, dark bands), where the accent itself reads well */
html[data-look] :is(header, footer, .bg-navy, .bg-navy-dk, [class*="from-navy"]) :is(.text-prism-blue, .hover\:text-prism-blue:hover) { color: var(--color-prism-blue); }
/* Filled accent buttons: dark text, because white on amber or honey is too faint */
html[data-look] :is(.bg-prism-blue, .bg-prism-blue-dk).text-white { color: var(--look-on-accent); }
/* Hard-coded colours in the templates */
html[data-look] .bg-\[\#0b1829\] { background-color: var(--color-navy-dk); }
/* Global styles in base.html that hard-code the original blue */
html[data-look] ::selection { background-color: var(--color-prism-blue); color: #1c1917; }
html[data-look] ::-webkit-scrollbar-thumb { background: var(--color-prism-blue); }
html[data-look] ::-webkit-scrollbar-thumb:hover { background: var(--color-prism-blue-dk); }
html[data-look] :focus-visible, html[data-look] button:focus-visible, html[data-look] a:focus-visible { outline-color: var(--look-link); }
html[data-look] :is(header, footer, .bg-navy, [class*="from-navy"]) :focus-visible { outline-color: var(--color-prism-blue); }
html[data-look] #htmx-loading-bar { background-image: linear-gradient(90deg, var(--color-prism-blue), var(--color-prism-blue-dk), var(--color-prism-blue)); }
/* Light-blue labels written as inline colours (header tagline, footer subtitle) */
html[data-look] [style*="7dd3fc"] { color: var(--color-blue-200) !important; }
/* The logo always sits on white */
html[data-look] #brand-logo, html[data-look] .look-plate { background-color: #fff; }

/* ── Page links under a product list (own styles, follow the page colours) ── */
.list-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; padding: 1rem 0 .5rem; font-size: .875rem; }
.list-pager-label { color: #6b655f; margin-right: .25rem; }
.list-pager-item { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 .75rem; border: 1.5px solid #8a8178; border-radius: .75rem; color: inherit; text-decoration: none; font-weight: 700; }
a.list-pager-item:hover { background: rgba(140,130,120,.15); }
.list-pager-item[aria-current="page"] { background: #1c1917; border-color: #1c1917; color: #fff; }

/* ── The look switcher (own styles, no Tailwind needed) ─────────────────── */
.look-btn { width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .5rem; border: 0; background: transparent; color: rgba(255,255,255,.8); cursor: pointer; transition: background-color .15s, color .15s; }
.look-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.look-btn svg { width: 18px; height: 18px; }
/* Phone header: same size and tint as the heart and menu buttons beside it */
.look-btn-m { width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: .75rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: #fff; }
.look-btn-m svg { width: 20px; height: 20px; }
.look-link { background: none; border: 0; padding: 0; font: inherit; font-size: .875rem; color: rgba(255,255,255,.6); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.look-link:hover { color: #fff; }
.look-sheet { position: fixed; z-index: 10000; right: 1rem; top: 4.5rem; width: min(22rem, calc(100vw - 2rem)); max-height: calc(100vh - 6rem); overflow: auto; background: #fff; color: #1c1917; border: 2px solid #1c1917; border-radius: 1.25rem; box-shadow: 6px 6px 0 #1c1917; padding: 1rem; font-family: Inter, system-ui, sans-serif; }
.look-sheet[hidden] { display: none; }
.look-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; font-size: 1rem; }
.look-x { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #57534e; width: 2.75rem; height: 2.75rem; margin: -.5rem -.5rem -.5rem 0; }
.look-list { display: grid; gap: .25rem; }
.look-opt { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; border: 1.5px solid transparent; background: transparent; border-radius: .75rem; padding: .5rem .625rem; min-height: 2.75rem; font: inherit; font-size: .9375rem; color: inherit; cursor: pointer; }
.look-opt:hover { background: #fafaf9; }
.look-opt[aria-checked="true"] { border-color: #1c1917; background: #fff6e6; font-weight: 700; }
.look-opt small { display: block; font-size: .75rem; font-weight: 500; color: #57534e; }
.look-sw { display: inline-flex; flex: none; width: 2.5rem; height: 1.75rem; border-radius: .5rem; overflow: hidden; border: 1px solid rgba(0,0,0,.2); }
.look-sw i { flex: 1; }
.look-steps { display: flex; gap: .5rem; margin-top: .625rem; }
.look-steps button { flex: 1; min-height: 2.75rem; border-radius: .75rem; border: 2px solid #1c1917; background: #fff; font: inherit; font-weight: 800; font-size: .875rem; color: #1c1917; cursor: pointer; }
.look-steps button:disabled { opacity: .35; cursor: default; }
.look-fine { margin: .5rem 0 0; font-size: .75rem; color: #57534e; }
@media (max-width: 640px) {
  .look-sheet { left: .75rem; right: .75rem; top: auto; bottom: .75rem; width: auto; max-height: 80vh; }
}
@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color .25s ease; }
}
