/*
 * coffriend.com legal site. Brand tokens = lib/core/theme/app_colors.dart (AppPalette). Amber is used only on ink
 * (8.7:1); on cream it is 1.8:1, so never for text or small details there (docs/brand/logo/README.md).
 * Headings: Archivo SemiBold, self-hosted (SIL OFL 1.1, license: /assets/fonts-license.1bcab6ac0f.txt). Body: the system UI font.
 */
@font-face {
  font-family: 'Archivo';
  src: url('/assets/archivo-semibold.d658c976db.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0e1317;
  --cream: #f4e8cf;
  --white: #ffffff;
  --accent: #e3a547;
  --ink-muted: #6e6752; /* 4.6:1 on cream, only 4.3:1 on --sunken */
  --ink-muted-sunken: #68614d; /* muted text on --sunken (guide measure box): 4.7:1 */
  --line: #d5cbb5;
  --divider: #ddd3bc;
  --sunken: #eadfc6;
  --dark-surface: #1c2124;
  --dark-text-muted: #8c949b; /* on ink 6.1:1 */
  --radius: 14px;
  --measure: 46rem;
  --heading: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- links and focus ---------- */
a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--accent);
}

main:focus {
  outline: none;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  border-radius: 8px;
}

.skip:focus {
  top: 1rem;
}

/* ---------- draft banner ---------- */
.draft {
  background: var(--accent);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.55rem 0;
  text-align: center;
}

/* ---------- header ---------- */
.site-header {
  background: var(--ink);
  color: var(--cream);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  padding: 0.25rem 0;
}

.brand img {
  display: block;
  height: 32px;
  width: auto;
}

.lang a {
  color: var(--cream);
  font-size: 0.9375rem;
  padding: 0.5rem 0.25rem;
}

/* ---------- sections (404) ---------- */
.section {
  padding-top: 2.5rem;
  padding-bottom: 0.5rem;
}

/* ---------- documents ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.doc {
  padding-top: 1.75rem;
  padding-bottom: 1rem;
}

.crumbs {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.crumbs a {
  color: var(--ink-muted);
}

.doc h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin: 0 0 0.6rem;
}

.meta {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin: 0 0 1.25rem;
}

.lead {
  font-size: 1.0625rem;
  border-left: 3px solid var(--ink);
  padding-left: 1rem;
  margin: 0 0 1.5rem;
}

.toc {
  background: var(--sunken);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.5rem;
  margin: 0 0 2rem;
}

.toc-title {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2 18rem;
  column-gap: 2rem;
}

.toc ul.toc-numbered {
  margin: 0;
  padding-left: 0;
  list-style: none;
  columns: 2 18rem;
  column-gap: 2rem;
}

.toc li {
  margin-bottom: 0.4rem;
  break-inside: avoid;
}

.doc-body h2 {
  font-size: 1.4rem;
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--divider);
  scroll-margin-top: 1rem;
}

.doc-body h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  max-width: var(--measure);
  margin: 0 0 1rem;
}

.doc-body li {
  margin-bottom: 0.35rem;
}

.rule-tag {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  margin-top: -0.25rem;
}

.rule-tag-label {
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--sunken);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

/* Owner placeholders: visible on purpose until filled in docs/legal. */
mark.ph {
  background: var(--sunken);
  color: var(--ink);
  border-bottom: 2px dashed var(--ink-muted);
  padding: 0 0.15em;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
  line-height: 1.45;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--divider);
  min-width: 8rem;
}

th:first-child,
td:first-child {
  min-width: 2.5rem;
}

thead th {
  background: var(--sunken);
  font-weight: 600;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tbody th {
  font-weight: 600;
}

/* ---------- 404 ---------- */
.notfound {
  padding-bottom: 2rem;
}

.notfound h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

/* ---------- coffee guide (lib/guide.mjs; app: lib/core/theme/guide_tokens.dart, mockup docs/mockups/guide) ---------- */
.guide {
  padding-top: 1.75rem;
  padding-bottom: 1rem;
}

.gpiece {
  max-width: calc(38rem + 3rem); /* reading measure */
}

/* "Okuma köşesi + menü panosu": ink board, cream title, crema second line. */
.board {
  background: var(--ink);
  color: var(--cream);
  border-radius: 24px;
  padding: 1.4rem 1.4rem 1.25rem;
  box-shadow: inset 0 1px 0 rgba(244, 232, 207, 0.08);
}

.board h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.1;
}

.board-1,
.board-2 {
  display: block;
}

.board-1 {
  color: var(--cream);
}

.board-2 {
  color: #e2c08a; /* GuidePalette.boardTitle2 (crema), 8.9:1 on ink */
}

.gintro {
  margin: 1rem 0 0.25rem;
  max-width: 38rem;
}

.lang-note {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin: 0.5rem 0 0;
}

.lang-note a {
  color: var(--ink-muted);
}

.gsoon {
  margin: 2rem 0;
}

.gsection {
  margin-top: 1.5rem;
}

.gsection-title,
.grelated h2 {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.25rem;
}

.glist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* min(): one column on a phone (320 px, or 375 px at 200 % text) without a horizontal scroll. */
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  column-gap: 1.5rem;
}

/* GuideCard: thumb 72 + title + meta, min 88 high. */
.gcard {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 88px;
  padding: 0.5rem 0;
  border-radius: 16px;
  text-decoration: none;
}

.gcard:hover .gcard-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.gcard-text {
  display: block;
  min-width: 0;
}

.gcard-title {
  display: block;
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.3;
}

.gcard-meta {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

/* GuideArt placeholder: sunken box with the type glyph (inkSubtle), no text; decorative. */
.art {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--sunken);
}

.art-thumb {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 14px;
}

.art-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 15rem; /* a wide screen gets a band, not a 24rem empty box (the art is cropped, object-fit) */
  border-radius: 20px;
  margin: 0 0 1.25rem;
}

.art img {
  display: block;
}

.art .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reading. */
.rmeta {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.gpiece h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  margin: 0.5rem 0 0;
}

.rsum {
  margin: 0.75rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.rbody {
  margin-top: 0.5rem;
}

.rbody > * {
  margin: 1rem 0 0;
}

.rbody h2,
.gpiece section > h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0;
}

.rbody p,
.rbody li {
  line-height: 1.55;
}

/* A glossary word: dotted underline (+ the term list at the end of the page). */
a.gl {
  text-decoration: underline dotted;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-color: var(--ink-muted);
}

a.gl:hover {
  text-decoration-color: var(--ink);
}

/* "Ne gerekir" measure box. */
.measure {
  background: var(--sunken);
  border-radius: 20px;
  padding: 0.875rem 1.125rem 0.375rem;
}

.mcap {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted-sunken);
}

.measure dl {
  margin: 0;
}

.mrow {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5625rem 0;
  border-bottom: 1px solid rgba(110, 103, 82, 0.18);
  font-size: 0.9375rem;
}

.mrow:last-child {
  border-bottom: 0;
}

.mrow dt {
  color: var(--ink-muted-sunken);
  max-width: 46%;
}

.mrow dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Numbered steps: ink 28 px disc with the cream number and the amber ring. */
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  min-height: max(28px, 1.75rem);
}

.steps li + li {
  margin-top: 0.875rem;
}

.steps li::before {
  content: counter(step);
  /* The list already says "1 of 6": the drawn number is not read a second time (ignored where unsupported). */
  content: counter(step) / "";
  position: absolute;
  left: 4px;
  top: 0;
  /* 28 px at the default size; grows with the text size so a larger number never spills out of the disc. */
  width: max(28px, 1.75rem);
  height: max(28px, 1.75rem);
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--accent);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: max(28px, 1.75rem);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.blist {
  padding-left: 1.25rem;
}

.blist li + li {
  margin-top: 0.5rem;
}

/* İpucu (amber rule) / Dikkat (ink rule). */
.callout {
  padding: 0.125rem 0 0.125rem 1rem;
  border-left: 3px solid var(--accent);
}

.callout-warning {
  border-left-color: var(--ink);
}

.callout p {
  margin: 0;
}

.callout .callout-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Glossary entries (the glossary piece and "Bu yazıdaki terimler"). */
.terms {
  margin: 0;
}

.term {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--divider);
  scroll-margin-top: 1rem;
}

.term dt {
  font-weight: 700;
  font-size: 1.0625rem;
}

.term dd {
  margin: 0.25rem 0 0;
  line-height: 1.5;
}

.term:target {
  background: var(--sunken);
  box-shadow: -0.5rem 0 0 var(--sunken), 0.5rem 0 0 var(--sunken);
}

.gterms-all {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

.gsources ul {
  padding-left: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.byline {
  margin: 1.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.app-note {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
}

.grelated {
  margin-top: 1.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.gpiece .grelated h2 {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3rem;
  background: var(--ink);
  color: var(--cream);
  padding: 2rem 0 2.5rem;
  font-size: 0.9375rem;
}

.site-footer a {
  color: var(--cream);
}

.footer-links {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer p {
  margin: 0 0 0.4rem;
  color: var(--cream);
}

.site-footer mark.ph {
  background: var(--dark-surface);
  color: var(--cream);
  border-bottom-color: var(--accent);
}

@media (max-width: 30rem) {
  body {
    font-size: 1rem;
  }

  .wrap {
    padding: 0 1.1rem;
  }

  .brand img {
    height: 28px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip,
  .toc {
    display: none;
  }

  body {
    background: #fff;
  }
}
