/* ===========================================================
   Instytut Myśli Kornela Morawieckiego — system stylów
   Paleta C4: granat #1A2238 + burgund #5D1A26 + krem #F5F2EC
   Typografia: EB Garamond (display) + DM Sans (UI)
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --granat: #1a2238;
  --granat-light: #2a3454;
  --burgund: #5d1a26;
  --burgund-light: #7a2434;
  --krem: #f5f2ec;
  --krem-warm: #fefef9;
  --paper: #faf7f1;
  --line: #d8d2c4;
  --text: #1c1c1c;
  --text-muted: #5a5a5a;
  --gold: #a8884a;

  --serif: 'EB Garamond', 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;

  --max-content: 1200px;
  --max-narrow: 760px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--krem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ====== Typography ====== */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--granat); }
h1 { font-size: clamp(2.2rem, 4.5vw, 4rem); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); margin-bottom: 1.2rem; }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-bottom: 0.6rem; }
p  { margin-bottom: 1rem; }

a { color: var(--burgund); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--burgund-light); text-decoration: underline; text-underline-offset: 3px; }

.caps {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--burgund);
}

.eyebrow { color: var(--burgund); font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 500; margin-bottom: 1rem; display: block; }

blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--granat);
  border-left: 3px solid var(--burgund);
  padding: 0.4rem 0 0.4rem 1.6rem;
  margin: 1.6rem 0;
}
blockquote cite { display: block; font-size: 0.85rem; font-style: normal; color: var(--text-muted); margin-top: 0.6rem; font-family: var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }

/* ====== Layout primitives ====== */
.container { max-width: var(--max-content); margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: var(--max-narrow); margin: 0 auto; padding: 0 2rem; }

section { padding: 6rem 0; }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 auto 2.5rem;
  max-width: var(--max-narrow);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider span { color: var(--burgund); font-size: 0.7rem; letter-spacing: 0.4em; font-family: var(--sans); }

/* ====== Top bar ====== */
.topbar {
  background: var(--granat);
  color: var(--krem);
  padding: 0.5rem 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: var(--krem); opacity: 0.8; }
.topbar a:hover { color: var(--krem); opacity: 1; text-decoration: none; }
.lang-switch a { padding: 0 0.4rem; }
.lang-switch a.active { color: var(--krem); font-weight: 600; opacity: 1; }

/* ====== Header ====== */
header.site-header {
  background: var(--krem-warm);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(6px);
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; padding-top: 1.2rem; padding-bottom: 1.2rem; }
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 56px; height: 56px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { line-height: 1.1; }
.brand-name .name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--granat); display: block; }
.brand-name .sub { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.22em; color: var(--burgund); text-transform: uppercase; margin-top: 2px; display: block; }

nav.main-nav ul { list-style: none; display: flex; gap: 2rem; align-items: center; }
nav.main-nav a {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--granat);
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
nav.main-nav a:hover { color: var(--burgund); border-bottom-color: var(--burgund); text-decoration: none; }

/* ====== Hero ====== */
.hero {
  background: var(--granat);
  color: var(--krem);
  padding: 8rem 0 7rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(168, 136, 74, 0.08), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(93, 26, 38, 0.18), transparent 50%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow { color: var(--gold); font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase; margin-bottom: 2rem; display: block; }
.hero h1 { color: var(--krem); margin-bottom: 2rem; max-width: 18ch; }
.hero h1 .accent { color: var(--gold); font-style: italic; font-weight: 400; }
.hero-quote {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  font-style: italic;
  color: var(--krem);
  opacity: 0.92;
  border-left: 2px solid var(--gold);
  padding-left: 1.6rem;
  max-width: 56ch;
  margin: 2.5rem 0 0.8rem;
  line-height: 1.55;
}
.hero-quote-cite { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.25em; color: var(--gold); text-transform: uppercase; margin-left: 1.7rem; }

.hero-actions { margin-top: 3rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid currentColor;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary { background: var(--burgund); color: var(--krem); border-color: var(--burgund); }
.btn-primary:hover { background: var(--burgund-light); color: var(--krem); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--krem); border-color: rgba(245, 242, 236, 0.4); }
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); text-decoration: none; }

/* ====== Sections ====== */
.section-title-block { text-align: center; margin-bottom: 4rem; }
.section-title-block h2 { color: var(--granat); margin-bottom: 0.4rem; }
.section-title-block .lead { color: var(--text-muted); font-style: italic; max-width: 50ch; margin: 0.6rem auto 0; }

/* O Instytucie */
.about { background: var(--krem-warm); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.about-text p { margin-bottom: 1.2rem; }
.about-text p.lead { font-size: 1.25rem; line-height: 1.55; color: var(--granat); font-weight: 500; margin-bottom: 1.8rem; }

.values-list { list-style: none; }
.values-list li { padding: 1.5rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 1.5rem; }
.values-list li:last-child { border-bottom: none; }
.values-list .num { font-family: var(--serif); font-size: 1.8rem; font-style: italic; color: var(--burgund); flex-shrink: 0; line-height: 1; min-width: 2ch; }
.values-list h3 { color: var(--granat); margin-bottom: 0.3rem; font-size: 1.15rem; }
.values-list p { font-size: 0.95rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* Myśl Kornela */
.thought { background: var(--krem); }
.thought-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-top: 3rem; }
.thought-card { background: var(--krem-warm); border: 1px solid var(--line); padding: 2.5rem 2rem; transition: all 0.3s; }
.thought-card:hover { border-color: var(--burgund); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(26, 34, 56, 0.08); }
.thought-card .num { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--burgund); display: block; margin-bottom: 0.8rem; letter-spacing: 0.05em; }
.thought-card h3 { font-size: 1.25rem; margin-bottom: 0.8rem; }
.thought-card p { font-size: 0.95rem; line-height: 1.6; color: var(--text); }

/* Cytaty */
.quotes { background: var(--granat); color: var(--krem); position: relative; }
.quotes::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: radial-gradient(circle at 50% 50%, rgba(168, 136, 74, 0.05), transparent 70%); pointer-events: none; }
.quotes .container { position: relative; z-index: 1; }
.quotes h2 { color: var(--krem); }
.quotes .section-title-block .lead { color: rgba(245, 242, 236, 0.7); }
.quotes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3rem; }
.quote-card { padding: 0; }
.quote-card blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--krem);
  line-height: 1.55;
  border-left: 2px solid var(--gold);
  padding: 0.4rem 0 0.4rem 1.6rem;
  margin: 0;
}
.quote-card cite { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.22em; color: var(--gold); text-transform: uppercase; display: block; margin-top: 1rem; padding-left: 1.7rem; font-style: normal; }

.quote-feature { grid-column: 1 / -1; text-align: center; padding: 2rem 0 1rem; }
.quote-feature blockquote { font-size: clamp(1.4rem, 2.2vw, 2rem); border-left: none; padding: 0; max-width: 50ch; margin: 0 auto; line-height: 1.4; }
.quote-feature blockquote::before { content: '«'; font-size: 3.5rem; color: var(--gold); display: block; line-height: 0.5; margin-bottom: 0.4rem; }
.quote-feature cite { padding-left: 0; }

/* Aktualności */
.news { background: var(--krem-warm); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.news-item { background: var(--krem); border: 1px solid var(--line); padding: 2rem; transition: all 0.3s; cursor: pointer; }
.news-item:hover { border-color: var(--burgund); transform: translateY(-2px); }
.news-date { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.22em; color: var(--burgund); text-transform: uppercase; display: block; margin-bottom: 0.8rem; }
.news-item h3 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.news-item p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }
.news-item .read-more { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--burgund); }

.news-empty { text-align: center; padding: 3rem 2rem; background: var(--paper); border: 1px dashed var(--line); margin-top: 2rem; }
.news-empty p { color: var(--text-muted); font-style: italic; margin: 0; }

/* Publikacje / Biblioteka */
.library { background: var(--krem); }
.library-intro { max-width: 60ch; margin: 0 auto 3rem; text-align: center; color: var(--text-muted); }
.library-list { list-style: none; max-width: 800px; margin: 0 auto; }
.library-list li { padding: 1.8rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 80px 1fr auto; gap: 1.5rem; align-items: start; }
.library-list li:last-child { border-bottom: none; }
.library-list .year { font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--burgund); }
.library-list .meta { line-height: 1.5; }
.library-list .meta strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--granat); display: block; margin-bottom: 0.2rem; }
.library-list .meta .author { font-size: 0.95rem; color: var(--text); display: block; margin-bottom: 0.2rem; }
.library-list .meta .pub { font-size: 0.85rem; color: var(--text-muted); }
.library-list .links { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.library-list .links a { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; padding: 0.4rem 0.8rem; border: 1px solid var(--line); color: var(--burgund); white-space: nowrap; }
.library-list .links a:hover { border-color: var(--burgund); background: var(--burgund); color: var(--krem); text-decoration: none; }

/* Kontakt */
.contact { background: var(--granat); color: var(--krem); }
.contact h2 { color: var(--krem); }
.contact .section-title-block .lead { color: rgba(245, 242, 236, 0.7); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; max-width: 900px; margin: 3rem auto 0; }
.contact-block h3 { color: var(--gold); font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 500; margin-bottom: 1rem; }
.contact-block p { color: var(--krem); font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; }
.contact-block a { color: var(--krem); border-bottom: 1px solid rgba(168, 136, 74, 0.5); }
.contact-block a:hover { color: var(--gold); border-bottom-color: var(--gold); text-decoration: none; }

/* Footer */
footer.site-footer { background: #0d1426; color: rgba(245, 242, 236, 0.6); padding: 3rem 0 2rem; font-family: var(--sans); font-size: 0.82rem; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.site-footer a { color: rgba(245, 242, 236, 0.7); }
.site-footer a:hover { color: var(--gold); text-decoration: none; }
.site-footer-meta { letter-spacing: 0.1em; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  section { padding: 4rem 0; }
  .about-grid, .thought-grid, .quotes-grid, .news-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  nav.main-nav ul { gap: 1rem; }
  nav.main-nav a { font-size: 0.7rem; }
  .topbar { font-size: 0.65rem; }
}
@media (max-width: 640px) {
  .container, .narrow { padding: 0 1.2rem; }
  .topbar .container { flex-direction: column; gap: 0.4rem; }
  .site-header .container { flex-direction: column; gap: 1rem; align-items: flex-start; }
  nav.main-nav ul { flex-wrap: wrap; gap: 0.8rem 1.2rem; }
  .hero { padding: 5rem 0 4rem; }
  .library-list li { grid-template-columns: 1fr; gap: 0.8rem; }
  .library-list .links { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
}
