/* ============================================================
   PRINCE2 HOW2 — Modern Design System
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --color-primary:       #1e3a5f;
  --color-primary-dark:  #142840;
  --color-secondary:     #2563eb;
  --color-accent:        #0ea5e9;
  --color-accent-light:  #e0f2fe;
  --color-success:       #059669;
  --color-warning:       #d97706;

  --color-bg:            #f8fafc;
  --color-surface:       #ffffff;
  --color-surface-2:     #f1f5f9;

  --color-text:          #1e293b;
  --color-text-muted:    #64748b;
  --color-text-light:    #94a3b8;

  --color-border:        #e2e8f0;
  --color-border-strong: #cbd5e1;

  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Merriweather', Georgia, 'Times New Roman', serif;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  20px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.07);

  --transition: 200ms ease;

  --content-max:  1180px;
  --sidebar-w:    280px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: .35rem; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
  margin-bottom: .75rem;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
h4 { font-size: 1.05rem; font-weight: 600; }

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

blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-primary);
}
blockquote cite { display: block; margin-top: .5rem; font-size: .85rem; font-style: normal; color: var(--color-text-muted); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
}
table th {
  background: var(--color-primary);
  color: #fff;
  padding: .7rem 1rem;
  text-align: left;
  font-weight: 600;
}
table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
table tr:nth-child(even) td { background: var(--color-surface-2); }
table tr:hover td { background: var(--color-accent-light); }

/* ── Top Bar ─────────────────────────────────────────────────── */
.top-bar {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.7);
  font-size: .78rem;
  padding: .4rem 0;
  text-align: center;
  letter-spacing: .03em;
}

/* ── Header / Nav ────────────────────────────────────────────── */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 64px;
}
.site-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo span { color: var(--color-accent); }
.site-logo:hover { color: #fff; }

.main-nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
.main-nav a {
  color: rgba(255,255,255,.82);
  font-size: .87rem;
  font-weight: 500;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  color: #fff;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 4px 0;
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Hero (homepage) ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a4a80 50%, var(--color-secondary) 100%);
  color: #fff;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-banner { max-width: 380px; margin: 0 auto 1.5rem; border-radius: var(--radius-md); }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .75rem; }
.hero p { font-size: 1.1rem; opacity: .88; max-width: 560px; margin: 0 auto 1.75rem; line-height: 1.6; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover { background: #0284c7; border-color: #0284c7; color: #fff; }
.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.6);
}
.btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.btn-sm { padding: .45rem 1rem; font-size: .82rem; }

/* ── Page Wrap ───────────────────────────────────────────────── */
.page-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 2.5rem;
  align-items: start;
}
.page-wrap.no-sidebar {
  grid-template-columns: 1fr;
  max-width: 860px;
}

/* ── Page Hero (inner pages) ─────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a4a80 100%);
  color: #fff;
  padding: 2.5rem 1.5rem;
}
.page-hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.page-hero-img {
  width: 140px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.page-hero h1 { color: #fff; margin-bottom: .4rem; }
.page-hero p { opacity: .85; margin-bottom: 0; font-size: 1rem; }

/* ── Main Content ────────────────────────────────────────────── */
.content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.content > * + * { margin-top: 1.1rem; }
.content h2 { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.content img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 1.25rem 0;
}

/* ── Blog Post List (homepage) ───────────────────────────────── */
.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.post-card-img {
  aspect-ratio: 16/9;
  width: 100%;
  object-fit: cover;
  background: var(--color-surface-2);
}
.post-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.post-card-meta { font-size: .75rem; color: var(--color-text-muted); margin-bottom: .5rem; }
.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.35;
  margin-bottom: .6rem;
  flex: 1;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--color-secondary); }
.post-card-excerpt { font-size: .85rem; color: var(--color-text-muted); line-height: 1.5; }
.post-card-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-secondary);
  margin-top: .9rem;
}
.post-card-link::after { content: '→'; transition: transform var(--transition); }
.post-card:hover .post-card-link::after { transform: translateX(3px); }

/* ── Feature Cards (hub pages) ──────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.card:hover {
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-num {
  width: 36px;
  height: 36px;
  background: var(--color-accent-light);
  color: var(--color-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .85rem;
}
.card h4 { font-size: .95rem; color: var(--color-primary); margin-bottom: .4rem; }
.card p { font-size: .83rem; color: var(--color-text-muted); margin: 0; line-height: 1.5; }
.card a.card-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
  font-weight: 600;
  margin-top: .65rem;
  color: var(--color-secondary);
}

/* ── Step list (Implementation) ─────────────────────────────── */
.step-list { list-style: none; padding: 0; counter-reset: step; }
.step-list li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.step-list li:hover { border-color: var(--color-secondary); box-shadow: var(--shadow-sm); }
.step-list li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
}
.step-list a { font-weight: 600; color: var(--color-primary); display: block; }
.step-list a:hover { color: var(--color-secondary); }
.step-list small { color: var(--color-text-muted); font-size: .82rem; }

/* ── Download list ───────────────────────────────────────────── */
.download-list { list-style: none; padding: 0; }
.download-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: .6rem;
  transition: all var(--transition);
  background: var(--color-surface);
}
.download-list li:hover { border-color: var(--color-secondary); background: var(--color-accent-light); }
.download-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
  font-size: 1.1rem;
}
.download-list a { font-weight: 500; color: var(--color-primary); flex: 1; }
.download-list a:hover { color: var(--color-secondary); }
.download-ext { font-size: .7rem; background: var(--color-surface-2); color: var(--color-text-muted); padding: .1rem .4rem; border-radius: var(--radius-sm); font-weight: 600; text-transform: uppercase; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}
.sidebar-widget-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--color-border);
}
.sidebar-widget ul { list-style: none; padding: 0; }
.sidebar-widget li { border-bottom: 1px solid var(--color-border); }
.sidebar-widget li:last-child { border-bottom: none; }
.sidebar-widget a {
  display: block;
  padding: .5rem 0;
  color: var(--color-text);
  font-size: .88rem;
  transition: color var(--transition), padding-left var(--transition);
}
.sidebar-widget a:hover { color: var(--color-secondary); padding-left: .35rem; }

.sidebar-widget .step-links { counter-reset: step-s; }
.sidebar-widget .step-links li { display: flex; align-items: center; gap: .6rem; }
.sidebar-widget .step-links li::before {
  counter-increment: step-s;
  content: counter(step-s);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
}

/* ── Article Nav (prev/next) ─────────────────────────────────── */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.article-nav-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: .85rem 1.1rem;
  flex: 1;
  min-width: 200px;
  transition: all var(--transition);
}
.article-nav-item:hover { border-color: var(--color-secondary); box-shadow: var(--shadow-sm); }
.article-nav-item small { display: block; font-size: .72rem; color: var(--color-text-muted); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .06em; }
.article-nav-item a { font-weight: 600; font-size: .9rem; color: var(--color-primary); }
.article-nav-item.next { text-align: right; }

/* ── Inline info box ─────────────────────────────────────────── */
.info-box {
  background: var(--color-accent-light);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  margin: 1.5rem 0;
}
.info-box p { margin: 0; font-size: .9rem; color: var(--color-primary); }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  padding: .65rem 1.5rem;
  font-size: .8rem;
  color: var(--color-text-muted);
}
.breadcrumb-inner { max-width: var(--content-max); margin: 0 auto; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-secondary); }
.breadcrumb span { margin: 0 .4rem; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.7);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-brand .site-logo { font-size: 1.2rem; margin-bottom: .75rem; }
.footer-brand p { font-size: .85rem; line-height: 1.6; opacity: .75; }
.footer-col h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: rgba(255,255,255,.65); font-size: .85rem; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--content-max);
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  opacity: .55;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ── Utility ─────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-secondary);
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.post-date { color: var(--color-text-muted); font-size: .8rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-wrap {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .header-inner { gap: 0; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    padding: 1rem;
    flex-direction: column;
    gap: .25rem;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .6rem .9rem; }
  .nav-toggle { display: block; }
  .site-header { position: relative; }

  .page-hero-inner { flex-direction: column; text-align: center; }
  .page-hero-img { width: 100px; }

  .content { padding: 1.25rem; }
  .post-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .article-nav { flex-direction: column; }

  .hero { padding: 2.5rem 1rem 2rem; }
}
