/*
Theme Name: AI Research Paper
Template: ollie
Description: Academic whitepaper aesthetic for AI/ML editorial. EB Garamond serif, IBM Plex Mono code, paper-and-ink palette, single-column body, footnote-style sidebar.
Author: Doorway
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: doorway-ai-research-paper
*/

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

body {
  font-family: "EB Garamond", "Crimson Pro", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
  color: #1B1B1B;
  background-color: #FAFAF7;
  background-image:
    linear-gradient(to right, #EAE7DD 1px, transparent 1px),
    linear-gradient(to right, transparent calc(100% - 1px), #EAE7DD calc(100% - 1px));
  background-size: 100% 100%;
}

h1, h2, h3, h4 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  color: #1B1B1B;
  letter-spacing: -0.005em;
}

h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 700;
  margin-bottom: 0.4em;
}

h2 {
  font-size: clamp(1.625rem, 2.75vw, 2.125rem);
  font-style: italic;
  font-weight: 500;
  margin-top: 2.5rem;
  border-bottom: 1px solid #EAE7DD;
  padding-bottom: 0.4rem;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
  margin-top: 2rem;
}

p {
  margin-bottom: 1.5em;
}

/* Drop cap scoped strictly to article body — not site title, not footer, not nav */
.entry-content > p:first-of-type::first-letter,
.wp-block-post-content > p:first-of-type::first-letter,
.single .wp-block-post-content p:first-of-type::first-letter {
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  padding: 0.1em 0.1em 0 0;
  font-weight: 600;
  color: #B91C1C;
}

/* Single post body justification */
.wp-block-post-content p {
  text-align: justify;
  hyphens: auto;
}

a {
  color: #1E3A8A;
  text-decoration: none;
  border-bottom: 1px solid #1E3A8A;
  transition: all 0.15s;
}

a:hover, a:focus {
  color: #B91C1C;
  border-bottom-color: #B91C1C;
}

code, pre, .wp-block-code {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.875em;
}

.wp-block-code {
  background: #FAFAF7;
  border-left: 3px solid #1B1B1B;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

code {
  background: #EAE7DD;
  padding: 1px 6px;
}

blockquote, .wp-block-quote {
  border-left: 4px solid #B91C1C;
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-style: italic;
  font-size: 1.25rem;
  color: #404040;
}

/* ── Hero: title page of a paper (with image background) ────────── */

.wp-block-cover.hero-paper.paper-titlepage {
  border-top: 4px double #FAFAF7;
  border-bottom: 4px double #FAFAF7;
}

.wp-block-cover.hero-paper.paper-titlepage::before {
  display: none;
}

.hero-paper .wp-block-cover__inner-container {
  text-align: center;
  max-width: 760px;
  padding: 3rem 2rem;
}

.paper-meta {
  font-family: "DM Sans", sans-serif !important;
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #FAFAF7 !important;
  margin-bottom: 1.5rem !important;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.paper-headline,
.hero-paper h1.paper-headline {
  font-family: "EB Garamond", serif !important;
  font-size: clamp(3.5rem, 8vw, 6rem) !important;
  font-weight: 600 !important;
  font-style: italic !important;
  color: #FAFAF7 !important;
  line-height: 1 !important;
  margin: 0 0 1.25rem !important;
  letter-spacing: -0.015em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.7);
}

.paper-abstract,
.hero-paper p.paper-abstract {
  font-family: "EB Garamond", serif !important;
  font-size: 1.125rem !important;
  color: #FAFAF7 !important;
  max-width: 640px;
  margin: 0 auto !important;
  line-height: 1.55;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.paper-abstract::before,
.hero-paper p.paper-abstract::before {
  content: "ABSTRACT  ·  ";
  color: #FF6B6B;
  font-family: "DM Sans", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  vertical-align: middle;
  margin-right: 0.4em;
}

/* ── Single article layout ───────────────────────────────────────── */

.single-hero {
  background: #FAFAF7 !important;
  border-bottom: 1px solid #1B1B1B;
}

.paper-section-label {
  font-family: "DM Sans", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #B91C1C;
  font-weight: 700;
  margin: 0 0 0.5rem !important;
}

.paper-section-label a {
  color: #B91C1C !important;
  border: none;
  text-decoration: none;
}

h1.single-title,
.single-hero h1.wp-block-post-title {
  font-family: "EB Garamond", serif !important;
  color: #1B1B1B !important;
  font-size: clamp(2.25rem, 4.5vw, 3.5rem) !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  margin: 0 0 1.5rem !important;
  text-shadow: none !important;
}

.paper-byline {
  font-family: "DM Sans", sans-serif;
  font-size: 0.85rem;
  color: #404040;
  align-items: baseline;
  gap: 0.6rem !important;
}

.paper-byline a {
  color: #404040;
  border: none;
  text-decoration: none;
}

.paper-byline p {
  margin: 0;
  color: #B91C1C;
}

.single-featured {
  margin-bottom: 2rem;
}

.single-featured img {
  width: 100%;
  height: auto;
  border: 1px solid #1B1B1B;
}

.paper-body p,
.entry-content p {
  text-align: justify;
  hyphens: auto;
}

/* ── Article grid: 1-column citation list ───────────────────────── */

.ai-glass-grid .wp-block-post-template,
.paper-list .wp-block-post-template {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid #1B1B1B;
}

.ai-glass-grid .wp-block-post,
.paper-list .wp-block-post {
  padding: 2rem 0;
  border-bottom: 1px solid #EAE7DD;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  align-items: start;
  counter-increment: paper;
}

.ai-glass-grid .wp-block-post::before,
.paper-list .wp-block-post::before {
  content: "[" counter(paper) "]";
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.875rem;
  color: #B91C1C;
  font-weight: 600;
}

.ai-glass-grid .wp-block-post-template,
.paper-list .wp-block-post-template {
  counter-reset: paper;
}

.ai-glass-grid .wp-block-post-featured-image,
.paper-list .wp-block-post-featured-image {
  display: none;
}

.ai-glass-grid .wp-block-post-title,
.paper-list .wp-block-post-title {
  font-family: "EB Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  line-height: 1.25;
}

.ai-glass-grid .wp-block-post-title a,
.paper-list .wp-block-post-title a {
  color: #1B1B1B;
  border: none;
}

.ai-glass-grid .wp-block-post-title a:hover,
.paper-list .wp-block-post-title a:hover {
  color: #B91C1C;
  border-bottom: 1px dotted #B91C1C;
}

.ai-glass-grid .wp-block-post-excerpt,
.paper-list .wp-block-post-excerpt {
  font-size: 1rem;
  color: #404040;
  line-height: 1.55;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.ai-glass-grid .wp-block-post-date,
.paper-list .wp-block-post-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: #1E3A8A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Navigation: minimal academic header ─────────────────────────── */

.site-header {
  background: #FAFAF7;
  border-bottom: 1px solid #1B1B1B;
  padding: 1rem 0;
}

.site-header .wp-block-navigation a {
  color: #1B1B1B !important;
  padding: 8px 14px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-header .wp-block-navigation a:hover {
  color: #B91C1C !important;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-header .wp-block-site-title a {
  font-family: "EB Garamond", serif;
  font-size: 1.625rem;
  font-weight: 600;
  font-style: italic;
  color: #1B1B1B !important;
  border: none;
}

/* ── Inline article images ───────────────────────────────────────── */

.wp-block-image, .doorway-inline-img {
  margin: 2.5rem 0;
}

.wp-block-image figcaption, .doorway-inline-img figcaption {
  font-family: "DM Sans", sans-serif;
  font-size: 0.75rem;
  color: #404040;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  margin-top: 0.5rem;
}

.wp-block-image figcaption::before, .doorway-inline-img figcaption::before {
  content: "Fig. — ";
  color: #B91C1C;
  font-weight: 700;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.site-footer {
  background: #1B1B1B;
  color: #FAFAF7;
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.875rem;
}

.site-footer h2, .site-footer h3 {
  color: #FAFAF7;
  font-family: "EB Garamond", serif;
  font-style: italic;
}

.site-footer a {
  color: #FAFAF7;
  border-bottom-color: #FAFAF7;
}

.site-footer a:hover {
  color: #B91C1C;
}

@media (max-width: 640px) {
  .ai-glass-grid .wp-block-post,
  .paper-list .wp-block-post {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .ai-glass-grid .wp-block-post::before,
  .paper-list .wp-block-post::before {
    margin-bottom: 0;
  }
}
