/* ============================================================
   Finnish Sisu - Design System (tier-2)
   Visual reference: blog.history.ac.uk ("On History")
   Palette: white bg, #666 Open Sans body, Bree Serif headings,
            plum #44213b accent, red #e02b20 links.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bree+Serif&family=Open+Sans:wght@400;600;700&display=swap');

/* --- CSS Variables / Design Tokens --- */
:root {
  --white:      #ffffff;
  --off-white:  #fbfbf8;
  --plum:       #44213b;
  --plum-dark:  #33182d;
  --plum-soft:  #efeaf0;
  --red:        #e02b20;
  --red-dark:   #b61f16;
  --ink:        #666666;
  --ink-head:   #2d2d2d;
  --border:     #e5e1dc;
  --card-bg:    #ffffff;
  --footer-bg:  #33182d;
  --footer-text:#e8dee4;
  --max-w:      720px;
  --sidebar-w:  300px;
  --gutter:     32px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--white);
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--red-dark); }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: 'Bree Serif', Georgia, serif;
  line-height: 1.3;
  color: var(--ink-head);
  font-weight: 400;
}
h1 { font-size: 2.6rem; }
h2 { font-size: 1.8rem; margin: 42px 0 14px; color: var(--plum); }
h3 { font-size: 1.3rem; margin: 26px 0 10px; color: var(--ink-head); }
h4 { font-size: 1.05rem; }

p { margin-bottom: 1.25em; }
ul, ol { padding-left: 1.5em; margin-bottom: 1.25em; }
li { margin-bottom: .45em; }

/* ============================================================
   SITE HEADER (masthead + navy bar, On History style)
   ============================================================ */

.site-header { width: 100%; }

.header-top {
  background: var(--plum-dark);
  color: rgba(255,255,255,.85);
  text-align: center;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 7px 12px;
}

.masthead {
  background: var(--plum);
  border-bottom: 4px solid var(--red);
  padding: 26px 24px 22px;
}
.masthead-inner {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 120px);
  margin: 0 auto;
}
.logo a {
  display: block;
  color: #fff;
  text-decoration: none;
}
.logo-main {
  font-family: 'Bree Serif', Georgia, serif;
  font-size: 2.4rem;
  line-height: 1.1;
  color: #fff;
  letter-spacing: .2px;
}
.logo-main strong { color: var(--red); }
.logo .tagline {
  display: block;
  font-family: 'Open Sans', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.8);
  margin-top: 2px;
}

/* --- Navigation bar --- */
.nav-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 120px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  min-height: 50px;
}
.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav > a {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-head);
  text-decoration: none;
  padding: 10px 0;
  position: relative;
}
.main-nav > a:hover { color: var(--red); text-decoration: none; }
.main-nav > a.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 100%; height: 3px;
  background: var(--red);
}

.dropdown { position: relative; }
.dropdown-toggle {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-head);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.dropdown-toggle:hover { color: var(--red); }
.dropdown-toggle .arrow { font-size: .6rem; transition: transform 0.2s; }
.dropdown:hover .dropdown-toggle .arrow { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: 100%; left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  min-width: 260px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 999;
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; }
.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  font-size: .9rem;
  color: var(--ink);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.dropdown-menu a:hover {
  background: var(--off-white);
  color: var(--red-dark);
  border-left-color: var(--red);
  text-decoration: none;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mobile-toggle span {
  display: block;
  width: 26px; height: 2px;
  background: var(--ink-head);
  border-radius: 2px;
}

/* ============================================================
   PAGE HERO
   ============================================================ */

.page-hero {
  background: var(--off-white);
  border-bottom: 1px solid var(--border);
  padding: 40px 24px 26px;
}
.hero-inner {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 120px);
  margin: 0 auto;
}
.hero-category {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--red);
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(2rem, 4.6vw, 2.8rem);
  line-height: 1.15;
  color: var(--ink-head);
  max-width: 860px;
}
.hero-description {
  margin-top: 12px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  max-width: 800px;
}
.page-hero .hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  margin-top: 24px;
  border: 1px solid var(--border);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 120px);
  margin: 16px auto 0;
  padding: 0 40px;
  font-size: .8rem;
  color: var(--ink);
}
.breadcrumb a { color: var(--red); }
.breadcrumb a:hover { color: var(--red-dark); }
.breadcrumb span { margin: 0 6px; color: var(--border); }

/* ============================================================
   MAIN LAYOUT (two columns)
   ============================================================ */

.layout {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 120px);
  margin: 28px auto 80px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 48px;
  align-items: start;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.content-main { background: transparent; }

.content-main h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.content-main h2:first-child { margin-top: 0; }
.content-main strong { font-weight: 700; color: var(--ink-head); }

.content-main blockquote {
  border-left: 3px solid var(--red);
  margin: 1.7rem 0;
  padding: .9rem 1.5rem;
  background: var(--off-white);
  color: var(--ink-head);
  font-family: 'Bree Serif', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.5;
}

.study-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--plum);
  padding: 22px 24px;
  margin: 22px 0;
}
.study-card h3 { margin: 0 0 8px; color: var(--ink-head); }
.study-card h3 a { color: var(--ink-head); }
.study-card h3 a:hover { color: var(--red); text-decoration: none; }
.study-card p { margin-bottom: 0; font-size: .95rem; }

.takeaways {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--plum);
  padding: 20px 24px;
  margin: 24px 0;
}
.takeaways h3 { margin: 0 0 10px; }
.takeaways li { margin-bottom: .4em; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin: 22px 0;
}
.topic-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: var(--ink-head);
  display: block;
}
.topic-card:hover { box-shadow: 0 5px 18px rgba(0,0,0,.1); text-decoration: none; }
.topic-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.topic-card-body { padding: 14px 16px; }
.topic-card-body h3 { font-size: 1.02rem; margin: 0 0 6px; color: var(--ink-head); }
.topic-card-body p { font-size: .85rem; color: var(--ink); margin: 0; line-height: 1.55; }

.note-box {
  background: var(--off-white);
  border-left: 4px solid var(--red);
  padding: 14px 18px;
  margin: 22px 0;
  font-size: .94rem;
}

.featured-image {
  width: 100%;
  margin: 20px 0;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--border);
}
.image-caption {
  font-size: .8rem;
  color: var(--ink);
  font-style: italic;
  text-align: center;
  margin-top: -14px;
  margin-bottom: 18px;
}

/* --- CTA Box --- */
.cta-box {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--red);
  padding: 26px 30px;
  margin: 30px 0;
  text-align: center;
}
.cta-box h3 { font-size: 1.35rem; margin: 0 0 10px; }
.cta-box p { font-size: .95rem; margin-bottom: 16px; }

.cta-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--plum);
  color: #fff;
  border: none;
  font-family: 'Open Sans', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background 0.2s;
}
.cta-btn:hover { background: var(--red); color: #fff; text-decoration: none; }

/* --- Video embed --- */
.video-embed { margin: 26px 0; }
.video-embed iframe { width: 100%; border: 1px solid var(--border); }

/* --- Social embed (sidebar) --- */
.social-embed { margin: 4px 0 10px; }
.social-embed iframe { width: 100%; border: 0; border-radius: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--plum);
  padding: 18px 20px;
  margin: 0 0 22px;
}
.sidebar-card h4 {
  font-size: .98rem;
  color: var(--plum);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--plum-soft);
}

.category-list { list-style: none; padding-left: 0; }
.category-list li { margin-bottom: .5rem; }
.category-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: .9rem;
}
.category-list a:hover { color: var(--red); text-decoration: none; }
.category-list .count {
  font-size: .68rem;
  color: var(--ink);
  background: var(--off-white);
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-mini-links { display: flex; flex-direction: column; gap: 5px; }
.sidebar-mini-links a { font-size: .88rem; color: var(--ink); }
.sidebar-mini-links a:hover { color: var(--red); }

/* ============================================================
   FOOTER (dark plum, no social icons)
   ============================================================ */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 48px 24px 26px;
}
.footer-grid {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 120px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-col h4 {
  font-family: 'Bree Serif', Georgia, serif;
  font-size: 1.05rem;
  color: #fff;
  margin: 0 0 14px;
}
.footer-col p { font-size: .9rem; line-height: 1.6; margin-bottom: 14px; color: var(--footer-text); }
.footer-col ul { list-style: none; padding-left: 0; }
.footer-col ul li { margin-bottom: .45rem; }
.footer-col ul a {
  color: var(--footer-text);
  font-size: .9rem;
  text-decoration: none;
}
.footer-col ul a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 120px);
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.14);
  text-align: center;
  font-size: .84rem;
}
.footer-bottom p { margin-bottom: 0; }
.footer-bottom .footer-location { margin-top: 6px; font-size: .78rem; opacity: .85; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 992px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }
  .nav-inner { flex-wrap: wrap; padding: 8px 16px; }
  .main-nav {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 8px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav > a { width: 100%; }
  .dropdown { width: 100%; }
  .dropdown-toggle { width: 100%; justify-content: space-between; }
  .dropdown-menu { position: static; width: 100%; min-width: 0; opacity: 1; visibility: hidden; box-shadow: none; }
  .dropdown.active .dropdown-menu { visibility: visible; }

  .layout { grid-template-columns: 1fr; gap: 30px; padding: 0 16px; }
  .breadcrumb { padding: 0 16px; }
  .topic-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .masthead { padding: 20px 16px; }
}