/* ========================================
   inkpio - Main Stylesheet
   ======================================== */

/* CSS Variables */
:root {
  --ink: #1a1209;
  --paper: #f5f0e8;
  --cream: #ede8da;
  --accent: #c8391a;
  --accent2: #2a5fa5;
  --gold: #d4a017;
  --panel-border: 3px solid #1a1209;
  --shadow: 4px 4px 0 #1a1209;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif 4', serif;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, #1a120908 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   Header
   ======================================== */
header {
  position: relative;
  z-index: 10;
  border-bottom: var(--panel-border);
  background: var(--ink);
  padding: 0 2rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 4px;
}

.logo-img {
  height: 50px;
  width: auto;
  transition: transform 0.2s;
}

.logo:hover .logo-img {
  transform: scale(1.05);
}

.logo-text {
  font-family: 'Bangers', cursive;
  font-size: 2.0rem;
  color: var(--cream);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.logo-img--footer {
  height: 48px;
}

nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  font-family: 'Comic Neue', cursive;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  transition: color .2s;
}

nav a:hover { color: var(--gold); }

.search-form {
  display: flex;
  gap: 6px;
}

.search-form input {
  padding: 6px 12px;
  border: 2px solid var(--paper);
  background: transparent;
  color: var(--paper);
  font-family: 'Comic Neue', cursive;
  font-size: .8rem;
}

.search-form input::placeholder { color: #aaa; }

.search-form button {
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--paper);
  padding: 6px 12px;
  font-family: 'Bangers', cursive;
  font-size: .9rem;
  cursor: pointer;
  letter-spacing: 1px;
}

/* ========================================
   Main Content
   ======================================== */
main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ========================================
   Article Container (detail page)
   ======================================== */
.article-container {
  max-width: 760px;
  margin: 0 auto;
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
  font-family: 'Comic Neue', cursive;
  font-size: .8rem;
  color: #999;
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: #999;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
}

/* ========================================
   Article Title & Meta
   ======================================== */
.article-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  font-family: 'Comic Neue', cursive;
  font-size: .82rem;
  color: #888;
}

/* ========================================
   Comic Frame
   ======================================== */
.comic-frame {
  border: 3px solid #1a1209;
  box-shadow: 6px 6px 0 #1a1209;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.comic-frame img {
  width: 100%;
  display: block;
}

/* ========================================
   Article Body
   ======================================== */
.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #333;
}

.article-body p {
  margin-bottom: 1.2rem;
}

/* ========================================
   Tags
   ======================================== */
.tag-list {
  margin-top: 2rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.tag-link {
  background: var(--cream);
  border: 2px solid #1a1209;
  padding: 4px 12px;
  font-family: 'Comic Neue', cursive;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

.tag-link:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ========================================
   Share Section
   ======================================== */
.share-section {
  border-top: 3px solid #1a1209;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.share-label {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 2px;
}

.share-btn {
  padding: 8px 16px;
  font-family: 'Bangers', cursive;
  font-size: .9rem;
  letter-spacing: 1px;
  text-decoration: none;
  border: 2px solid #1a1209;
  color: white;
}

.share-btn--twitter { background: #1DA1F2; }
.share-btn--reddit { background: #FF4500; }

.share-btn:hover {
  opacity: 0.9;
}

/* ========================================
   Featured Card (home page)
   ======================================== */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  border: 3px solid #1a1209;
  background: white;
  box-shadow: 6px 6px 0 #1a1209;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.featured-card__image {
  border-right: 3px solid #1a1209;
  overflow: hidden;
  min-height: 300px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.featured-card__image-placeholder {
  font-size: 4rem;
}

.featured-card__content {
  padding: 2.5rem;
}

.featured-card__badge {
  display: inline-block;
  background: var(--gold);
  border: 2px solid #1a1209;
  font-family: 'Bangers', cursive;
  font-size: .8rem;
  letter-spacing: 3px;
  padding: 4px 14px;
  margin-bottom: 1rem;
  box-shadow: 2px 2px 0 #1a1209;
}

.featured-card__title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.featured-card__excerpt {
  font-size: .95rem;
  line-height: 1.75;
  color: #555;
  margin-bottom: 1.5rem;
}

.featured-card__cta {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}

/* ========================================
   Mathematician Card
   ======================================== */
.mathematician-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
  border: 3px solid #1a1209;
  padding: 2rem;
  background: white;
  box-shadow: var(--shadow);
}

.mathematician-card__image {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border: 3px solid #1a1209;
}

.mathematician-card__image-placeholder {
  width: 160px;
  height: 160px;
  background: var(--cream);
  border: 3px solid #1a1209;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.mathematician-card__title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: .5rem;
}

.mathematician-card__meta {
  font-family: 'Comic Neue', cursive;
  font-size: .9rem;
  color: #888;
  margin-bottom: 1rem;
}

.mathematician-card__summary {
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
  max-width: 600px;
}

/* ========================================
   Search Form (large variant)
   ======================================== */
.search-form-large {
  margin-bottom: 2rem;
  display: flex;
  gap: .8rem;
}

.search-form-large input {
  flex: 1;
  padding: 12px 16px;
  border: 3px solid #1a1209;
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  background: white;
}

.search-form-large .btn {
  border: 3px solid #1a1209;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #999;
  font-family: 'Comic Neue', cursive;
}

/* ========================================
   Category Description
   ======================================== */
.category-description {
  font-size: 1rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 640px;
}

/* ========================================
   Search Results Info
   ======================================== */
.search-results-info {
  font-family: 'Comic Neue', cursive;
  font-size: .85rem;
  color: #888;
  margin-bottom: 1.5rem;
}

/* ========================================
   Featured Section Wrapper
   ======================================== */
.featured-section {
  margin-bottom: 2.5rem;
}

/* ========================================
   Related Section
   ======================================== */
.related-section {
  margin-top: 4rem;
}

/* ========================================
   Cards Grid
   ======================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.article-card {
  border: var(--panel-border);
  background: white;
  box-shadow: var(--shadow);
  transition: all .15s;
  text-decoration: none;
  color: inherit;
  display: block;
  overflow: hidden;
}

.article-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
}

.card-comic {
  border-bottom: var(--panel-border);
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--cream);
}

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

.card-comic-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--cream);
}

.card-body { padding: 1rem; }

.card-category {
  font-family: 'Bangers', cursive;
  font-size: .75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .6rem;
}

.card-excerpt {
  font-size: .82rem;
  color: #666;
  line-height: 1.5;
  margin-bottom: .8rem;
}

.card-meta {
  display: flex;
  gap: .8rem;
  font-family: 'Comic Neue', cursive;
  font-size: .72rem;
  color: #999;
  flex-wrap: wrap;
}

.card-tag {
  background: var(--cream);
  border: 1px solid #ddd;
  padding: 2px 8px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border: var(--panel-border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .15s;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ========================================
   Section Header
   ======================================== */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 3px;
  background: var(--ink);
}

.section-tag {
  background: var(--ink);
  color: var(--paper);
  font-family: 'Bangers', cursive;
  font-size: .75rem;
  letter-spacing: 2px;
  padding: 4px 12px;
  text-transform: uppercase;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 2rem;
  font-family: 'Comic Neue', cursive;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 2px solid var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.pagination .current {
  background: var(--ink);
  color: var(--paper);
}

/* ========================================
   Footer
   ======================================== */
footer {
  position: relative;
  z-index: 1;
  background: var(--ink);
  border-top: var(--panel-border);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand .logo {
  margin-bottom: .8rem;
  display: inline-block;
}

.footer-brand p {
  font-family: 'Source Serif 4', serif;
  font-size: .85rem;
  color: #aaa;
  line-height: 1.6;
}

.footer-col h4 {
  font-family: 'Bangers', cursive;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.footer-col ul li a {
  font-family: 'Comic Neue', cursive;
  font-size: .82rem;
  color: #999;
  text-decoration: none;
  transition: color .2s;
}

.footer-col ul li a:hover { color: var(--paper); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-family: 'Comic Neue', cursive;
  font-size: .75rem;
  color: #666;
}

.footer-logo-img {
  height: 32px;
  width: auto;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .articles-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-card__image { border-right: none; border-bottom: 3px solid #1a1209; }
  .mathematician-card { grid-template-columns: 1fr; }
  .mathematician-card__image,
  .mathematician-card__image-placeholder { width: 100%; }
}

@media (max-width: 600px) {
  .articles-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  nav { display: none; }
  .search-form-large { flex-direction: column; }
}
