/* Kiesl companion pages — Light Palette (washi-clay) */

@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/Newsreader-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/Newsreader-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/Newsreader-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-canvas: #F7F2E8;
  --bg-surface: #EEE6D9;
  --bg-elevated: #FBF8F2;
  --bg-recessed: #E4DBCD;

  --text-primary: #282520;
  --text-secondary: #655E54;
  --text-on-accent: #F7F3EC;

  --accent-primary: #C86D51;
  --accent-primary-hover: #B45C41;
  --accent-primary-subtle: #EED3C7;
  --accent-secondary: #6B7F6E;
  --accent-secondary-subtle: #D1DFD1;

  --border-subtle: #DAD1C4;
  --border-strong: #B7AC9C;
  --border-control: #867C6C;

  --state-success: #48664C;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --prose-max: 680px;
  --font-editorial: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Skip link for keyboard & screen-reader users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background: var(--text-primary);
  color: var(--text-on-accent);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Focus outlines (WCAG 2.2 AA >= 3:1) */
:focus-visible {
  outline: 2px solid var(--border-control);
  outline-offset: 2px;
}

/* Layout shell */
.container {
  width: 100%;
  max-width: calc(var(--prose-max) + 40px);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header */
.site-header {
  padding-top: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 4px 6px 4px 0;
}

.brand:hover .brand-name {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-editorial);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Sub-navigation */
.site-nav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}

.site-nav a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-strong);
}

.site-nav a[aria-current='page'] {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--text-primary);
}

/* Main content */
main {
  flex: 1;
  padding-top: 40px;
  padding-bottom: 64px;
}

.page-header {
  margin-bottom: 32px;
}

.badge {
  display: inline-block;
  background-color: var(--accent-secondary-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  margin-bottom: 14px;
}

h1 {
  font-family: var(--font-editorial);
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}

.lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.meta-line {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

h2 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 36px 0 12px 0;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 24px 0 8px 0;
  color: var(--text-primary);
}

p {
  margin: 0 0 16px 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
}

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

ul,
ol {
  margin: 0 0 18px 0;
  padding-left: 22px;
}

li {
  margin-bottom: 8px;
  line-height: 1.6;
}

li:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

/* Inline links — AAA contrast on #F7F2E8 and #EEE6D9 */
main a:not(.btn):not(.segment-link) {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 180ms ease, color 180ms ease;
  word-break: break-word;
}

main a:not(.btn):not(.segment-link):hover {
  color: var(--state-success);
  text-decoration-color: var(--state-success);
}

/* Cards (zero drop shadow, tonal layering) */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
}

@media (min-width: 840px) {
  .card {
    padding: 24px;
  }
}

.card h2:first-child,
.card h3:first-child,
.card-subtle h2:first-child,
.card-subtle h3:first-child {
  margin-top: 0;
}

.card-subtle {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--text-on-accent);
  border: 1px solid transparent;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-control);
}

.btn-secondary:hover {
  background-color: var(--bg-elevated);
}

/* Segmented navigation list (matching JapandiSegmentedList) */
.segmented-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 24px 0;
}

.segment-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 20px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: background-color 180ms ease;
}

.segment-link:first-child {
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.segment-link:last-child {
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.segment-link:hover {
  background-color: rgba(251, 248, 242, 0.75);
}

.segment-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.segment-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.segment-arrow {
  font-size: 1.125rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* FAQ Accordion (semantic details/summary) */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 20px 0 32px 0;
}

.faq-item {
  background-color: var(--bg-surface);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.faq-item:first-child {
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.faq-item:last-child {
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: background-color 180ms ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  background-color: rgba(251, 248, 242, 0.65);
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
  flex-shrink: 0;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '\2212';
}

.faq-body {
  padding: 0 20px 18px 20px;
  color: var(--text-primary);
}

.faq-body p {
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Key-value address / metadata blocks */
.address-block {
  font-style: normal;
  line-height: 1.7;
  margin: 12px 0 0 0;
}

/* Divider */
hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 32px 0;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0 36px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  body {
    background: #FFFFFF;
    color: #000000;
  }

  .site-nav,
  .skip-link {
    display: none;
  }

  .card,
  .card-subtle {
    background: #FFFFFF;
    border-color: #CCCCCC;
  }
}
