/* ============================================
   Warigami Global Styles
   ============================================ */

:root {
	/* Primary */
	--primary: #d4af37;
	--primary-dark: #b8941f;

	/* Text */
	--text-dark: #2c3e50;
	--text-medium: #34495e;
	--text-light: #7f8c8d;

	/* Paper tones */
	--paper-white: #fefefe;
	--paper-cream: #f8f6f0;
	--paper-light: #f1ede6;
	--paper-shadow: #e8e2d6;

	/* Accent */
	--accent-red: #e74c3c;
}

/* ============================================
   Reset
   ============================================ */

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

html {
	scroll-behavior: smooth;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	background-color: var(--paper-white);
	color: var(--text-dark);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

ul,
ol {
	list-style: none;
}

/* ============================================
   Typography
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: Georgia, 'Times New Roman', Times, serif;
	color: var(--text-dark);
	line-height: 1.2;
	margin-bottom: 0.5em;
}

h1 {
	font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
	font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
	font-size: clamp(1.25rem, 3vw, 2rem);
}

h4 {
	font-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

h5 {
	font-size: clamp(1rem, 2vw, 1.25rem);
}

h6 {
	font-size: clamp(0.9rem, 1.5vw, 1.1rem);
}

p {
	margin-bottom: 1em;
}

/* ============================================
   Links
   ============================================ */

a {
	color: var(--primary-dark);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--primary);
	text-decoration: underline;
}

/* ============================================
   Container
   ============================================ */

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem;
	width: 100%;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.65rem 1.5rem;
	border: 2px solid transparent;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	line-height: 1.4;
}

.btn:hover {
	text-decoration: none;
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn-primary {
	background-color: var(--primary);
	color: #fff;
	border-color: var(--primary);
}

.btn-primary:hover {
	background-color: var(--primary-dark);
	border-color: var(--primary-dark);
	color: #fff;
}

.btn-secondary {
	background-color: transparent;
	color: var(--primary-dark);
	border-color: var(--primary-dark);
}

.btn-secondary:hover {
	background-color: var(--primary);
	color: #fff;
	border-color: var(--primary);
}

.btn-outline {
	background-color: transparent;
	color: var(--text-dark);
	border-color: var(--paper-shadow);
}

.btn-outline:hover {
	border-color: var(--primary);
	color: var(--primary-dark);
}

/* ============================================
   Cards
   ============================================ */

.card {
	background-color: var(--paper-white);
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	padding: 1.5rem;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Grid Utilities
   ============================================ */

.grid {
	display: grid;
	gap: 1.5rem;
}

.grid-2 {
	grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
	grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
	grid-template-columns: repeat(4, 1fr);
}

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

@media (max-width: 768px) {
	.grid-2,
	.grid-3,
	.grid-4 {
		grid-template-columns: 1fr;
	}
}

/* ============================================
   Utility
   ============================================ */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.text-center {
	text-align: center;
}

/* ============================================
   Layout: Page content offset for fixed navbar
   ============================================ */
.page-content {
  min-height: calc(100vh - 70px);
  padding-top: 70px;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}
.navbar-inner { display: flex; align-items: center; height: 100%; gap: 2rem; }
.navbar-logo { flex-shrink: 0; }
.navbar-logo img { height: 50px; width: auto; }
.navbar-links { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }
.nav-link {
  font-weight: 500; color: var(--text-medium); text-decoration: none;
  padding: 0.25rem 0; border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover { color: var(--primary-dark); text-decoration: none; }
.nav-link.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.nav-search {
  display: flex; align-items: center; background: var(--paper-cream);
  border-radius: 6px; overflow: hidden; border: 1px solid var(--paper-shadow);
  transition: border-color 0.2s ease;
}
.nav-search:focus-within { border-color: var(--primary); }
.nav-search input {
  border: none; background: transparent; padding: 0.4rem 0.75rem;
  font-size: 0.875rem; color: var(--text-dark); width: 160px; outline: none;
}
.nav-search input::placeholder { color: var(--text-light); }
.search-btn {
  background: none; border: none; padding: 0.4rem 0.6rem; cursor: pointer;
  color: var(--text-light); display: flex; align-items: center;
  transition: color 0.2s ease;
}
.search-btn:hover { color: var(--primary-dark); }
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 0.5rem; margin-left: auto;
}
.hamburger span {
  display: block; width: 24px; height: 2px; background: var(--text-dark);
  border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar-links {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    flex-direction: column; background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px); padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); gap: 0.75rem;
  }
  .navbar-links.open { display: flex; }
  .nav-link { padding: 0.5rem 0; font-size: 1.1rem; }
  .nav-search { width: 100%; }
  .nav-search input { width: 100%; }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background-color: var(--text-dark); color: var(--paper-cream);
  border-top: 3px solid var(--primary); margin-top: auto;
}
.footer-main { padding: 3rem 1.5rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand h3 {
  font-family: Georgia, "Times New Roman", Times, serif;
  color: var(--primary); margin-bottom: 0.75rem; font-size: 1.5rem;
}
.footer-brand p { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; max-width: 280px; }
.footer-col h4 {
  font-family: Georgia, "Times New Roman", Times, serif;
  color: var(--paper-white); margin-bottom: 1rem; font-size: 1.1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.footer-col a { color: var(--text-light); font-size: 0.9rem; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 1rem 0; text-align: center; }
.footer-bottom p { color: var(--text-light); font-size: 0.85rem; margin: 0; }
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Wiki
   ============================================ */
.wiki-categories {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin: 2rem 0;
}
.wiki-category-card {
  display: block; padding: 1.5rem; background: var(--paper-white);
  border: 1px solid var(--paper-shadow); border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.wiki-category-card:hover {
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: var(--primary); text-decoration: none;
}
.wiki-category-icon { font-size: 1.75rem; display: block; margin-bottom: 0.5rem; }
.wiki-category-card h3 { color: var(--primary-dark); margin: 0 0 0.5rem; font-size: 1.25rem; }
.wiki-category-card p { color: var(--text-medium); font-size: 0.95rem; margin: 0 0 0.75rem; }
.wiki-category-count { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }

.wiki-page-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem; margin: 1.5rem 0;
}
.wiki-page-card {
  display: block; padding: 1.25rem; background: var(--paper-white);
  border: 1px solid var(--paper-shadow); border-radius: 6px;
  text-decoration: none; color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.wiki-page-card:hover { transform: translateY(-1px); border-color: var(--primary); text-decoration: none; }
.wiki-page-card .icon { font-size: 1.25rem; margin-right: 0.5rem; }
.wiki-page-card h4 { display: inline; color: var(--primary-dark); margin: 0; font-size: 1.05rem; }
.wiki-page-card .excerpt { color: var(--text-medium); font-size: 0.9rem; margin: 0.5rem 0 0; line-height: 1.5; }

.wiki-breadcrumb {
  font-size: 0.875rem; color: var(--text-light); margin-bottom: 1rem;
}
.wiki-breadcrumb a { color: var(--text-medium); }
.wiki-breadcrumb a:hover { color: var(--primary-dark); }

.wiki-prose { max-width: 760px; margin: 0 auto; }
.wiki-prose h1 { font-size: 2.25rem; color: var(--primary-dark); margin-bottom: 1rem; }
.wiki-prose h2 { font-size: 1.625rem; color: var(--primary-dark); margin: 2rem 0 0.75rem; padding-bottom: 0.25rem; border-bottom: 2px solid var(--paper-shadow); }
.wiki-prose h3 { font-size: 1.25rem; color: var(--primary-dark); margin: 1.5rem 0 0.5rem; }
.wiki-prose p { line-height: 1.75; margin: 0.75rem 0; }
.wiki-prose ul, .wiki-prose ol { margin: 0.75rem 0 0.75rem 1.5rem; line-height: 1.7; }
.wiki-prose li { margin: 0.25rem 0; }
.wiki-prose code { background: var(--paper-cream); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.9em; }
.wiki-prose pre { background: var(--paper-cream); padding: 1rem; border-radius: 6px; overflow-x: auto; }
.wiki-prose table {
  width: 100%; border-collapse: collapse; margin: 1rem 0;
  font-size: 0.95rem; background: var(--paper-white);
}
.wiki-prose th, .wiki-prose td {
  text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--paper-shadow);
}
.wiki-prose th { background: var(--paper-cream); color: var(--primary-dark); font-weight: 700; }
.wiki-prose blockquote {
  border-left: 3px solid var(--primary); padding-left: 1rem; margin: 1rem 0;
  color: var(--text-medium); font-style: italic;
}

.wiki-page-footer {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--paper-shadow);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.875rem; color: var(--text-light);
}
