/**
 * TenMinuteAI Newspaper Styles
 * =============================
 * Shared styles for the entire site.
 */

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

:root {
  --newsprint: #F4E8D3;
  --newsprint-light: #FAF4E8;
  --ink: #1C1915;
  --ink-light: #3D372F;
  --rule: #1C1915;
}

html { font-size: 19px; }

body {
  font-family: 'Libre Baskerville', Georgia, serif;
  background: 
    linear-gradient(90deg, rgba(139,90,43,0.08) 1px, transparent 1px),
    linear-gradient(rgba(139,90,43,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.03) 100%),
    linear-gradient(180deg, #D4A574 0%, #C9956A 25%, #D4A574 50%, #C9956A 75%, #D4A574 100%);
  background-size: 120px 120px, 120px 120px, 100% 100%, 100% 100%;
  background-color: #C9956A;
  color: var(--ink);
  line-height: 1.6;
  display: flex;
  justify-content: center;
  padding: 1rem;
  min-height: 100vh;
}

/* Newspaper Container */
.newspaper {
  background: var(--newsprint);
  max-width: 950px;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 30px rgba(0,0,0,0.3);
  position: relative;
}

.newspaper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

/* Masthead */
.masthead {
  text-align: center;
  padding: 0.75rem 1.5rem 1rem;
  border-bottom: 3px solid var(--rule);
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-btn {
  background: transparent;
  border: 1.5px solid var(--ink);
  padding: 0.3rem 0.6rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--ink);
  text-decoration: none;
}

.toolbar-btn:hover {
  background: var(--ink);
  color: var(--newsprint);
}

.font-controls {
  display: flex;
  gap: 0.2rem;
}

.font-controls .toolbar-btn {
  padding: 0.3rem 0.5rem;
  min-width: 2rem;
}

/* Paper Name / Logo */
.paper-name {
  font-family: 'Playfair Display', serif;
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  border-top: 5px solid var(--rule);
  border-bottom: 5px solid var(--rule);
  padding: 0.5rem 0;
  margin: 0;
  text-decoration: none;
  color: var(--ink);
  display: block;
}

.paper-name:hover {
  opacity: 0.8;
}

.masthead-subtitle {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-light);
  margin-top: 0.6rem;
}

/* Main Navigation */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}

.main-nav a {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}

.main-nav a:hover {
  border-color: var(--ink);
}

.main-nav a.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--newsprint);
}

/* Content Area */
.content { padding: 0.75rem 1.5rem; }

/* Two Column Layout */
.columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

.sidebar {
  border-left: 1px solid var(--rule);
  padding-left: 1.5rem;
}

/* Articles */
.article { margin-bottom: 1.5rem; }

.article-headline {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
}

.article-headline a {
  color: var(--ink);
  text-decoration: none;
}

.article-headline a:hover {
  text-decoration: underline;
}

.article-byline {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
}

.article-text {
  font-size: 0.95rem;
  text-align: justify;
  hyphens: auto;
}

.article-text p {
  margin-bottom: 0.75rem;
  text-indent: 1.5em;
}

.article-text p:first-of-type { text-indent: 0; }

.article-text p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  float: left;
  line-height: 1;
  padding-right: 0.5rem;
  margin-top: 0.1rem;
}

.continued {
  font-size: 0.85rem;
  font-style: italic;
  text-align: right;
  margin-top: 0.5rem;
}

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

/* Page Title (for index pages) */
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--rule);
}

/* Lead Story / Comic Container */
.lead-story { margin-bottom: 1rem; }

.comic-container {
  border: 3px solid var(--ink);
  background: #FFFDF7;
}

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

.comic-footer {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comic-footer em { color: var(--ink-light); }

.read-more {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  padding: 0.5rem 1rem;
  transition: all 0.2s;
}

.read-more:hover {
  background: var(--ink);
  color: var(--newsprint);
}

/* Hero Email Signup */
.hero-signup {
  background: var(--newsprint-light);
  border: 2px solid var(--ink);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  text-align: center;
}

.hero-signup-headline {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-signup-text {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

/* Sidebar Signup */
.sidebar-signup {
  background: #fdf6e8;
  border: 2px solid var(--ink);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.sidebar-signup-label {
  font-size: 0.7rem;
  text-align: center;
  letter-spacing: 2px;
  color: #666;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.sidebar-signup-headline {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.sidebar-signup-text {
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
}

/* Index Box */
.index-box {
  border: 1px solid var(--rule);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.index-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.index-list {
  list-style: none;
  font-size: 0.85rem;
}

.index-list li {
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--rule);
}

.index-list li:last-child { border-bottom: none; }

.index-list a { color: var(--ink); text-decoration: none; }
.index-list a:hover { text-decoration: underline; }

/* Quote Box */
.quote-box {
  border-top: 2px solid var(--rule);
  border-bottom: 2px solid var(--rule);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.quote-text {
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  margin-bottom: 0.5rem;
}

.quote-attr {
  font-size: 0.8rem;
  text-align: center;
  color: var(--ink-light);
}

/* Advertisement */
.advertisement {
  border: 1px solid var(--rule);
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}

.ad-headline {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ad-text {
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.ad-cta {
  display: inline-block;
  font-family: 'Playfair Display', serif;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--ink);
  padding: 0.4rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.ad-cta:hover {
  background: var(--ink);
  color: var(--newsprint);
}

/* Footer */
.paper-footer {
  border-top: 4px double var(--rule);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--ink-light);
}

.footer-links a {
  color: var(--ink-light);
  text-decoration: none;
  margin-left: 1rem;
}

.footer-links a:hover { text-decoration: underline; }

/* Kit Form Styling */
.formkit-form {
  width: 100%;
}

.formkit-form[data-format="inline"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.formkit-form .formkit-input {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
  padding: 0.6rem 0.75rem;
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.9rem;
  border: 1px solid #8b7355;
  background: white;
  color: var(--ink);
}

.formkit-form .formkit-input::placeholder {
  font-style: italic;
  color: #999;
}

.formkit-form .formkit-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(28, 25, 21, 0.1);
}

.formkit-form .formkit-submit {
  background: var(--ink);
  color: var(--newsprint);
  border: none;
  padding: 0.6rem 1.25rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.formkit-form .formkit-submit:hover {
  background: var(--ink-light);
}

.formkit-form .formkit-submit span {
  display: block;
}

.formkit-powered-by-convertkit-container {
  display: none !important;
}

.signup-privacy {
  font-size: 0.75rem;
  font-style: italic;
  color: #888;
  text-align: center;
  margin-top: 0.5rem;
  width: 100%;
}

/* Popup Overlay */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.popup-overlay.active {
  display: flex;
}

.popup-content {
  background: var(--newsprint);
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  animation: popupSlide 0.3s ease-out;
}

@keyframes popupSlide {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink-light);
  line-height: 1;
  padding: 0.25rem;
  z-index: 10;
}

.popup-close:hover {
  color: var(--ink);
}

.popup-header {
  background: var(--ink);
  color: var(--newsprint);
  padding: 0.75rem 1.5rem;
  text-align: center;
}

.popup-header-label {
  font-size: 0.65rem;
  letter-spacing: 2px;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.popup-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0;
}

.popup-body {
  padding: 1.5rem;
}

.popup-tagline {
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

.popup-benefits {
  background: var(--newsprint-light);
  border: 1px solid var(--rule);
  padding: 1rem;
  margin-bottom: 1rem;
}

.popup-benefits-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.popup-benefits ul {
  list-style: none;
  font-size: 0.9rem;
}

.popup-benefits li {
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.popup-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #2a7a2a;
  font-weight: bold;
}

.popup-form-container {
  margin-bottom: 0.75rem;
}

.popup-form-container .formkit-form[data-format="inline"] {
  flex-direction: column;
}

.popup-form-container .formkit-form .formkit-input {
  max-width: none;
  width: 100%;
}

.popup-form-container .formkit-form .formkit-submit {
  width: 100%;
}

/* Article Page Specific */
.article-page .article-headline {
  font-size: 2rem;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 0.75rem;
}

.article-page .article-byline {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.article-page .article-text {
  font-size: 1rem;
}

.article-page .article-text p {
  margin-bottom: 1rem;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  margin-top: 1.5rem;
  border-top: 2px solid var(--rule);
  font-size: 0.9rem;
}

.article-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.article-nav a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 700px) {
  html { font-size: 17px; }
  body { padding: 0.5rem; }
  .paper-name { font-size: 2.4rem; }
  .masthead-subtitle { font-size: 0.95rem; }
  .columns { grid-template-columns: 1fr; }
  .sidebar { 
    border-left: none; 
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 1.5rem;
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  .main-nav {
    gap: 0.25rem;
  }
  .main-nav a {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }
  .hero-signup {
    padding: 0.75rem 1rem;
  }
  .popup-content {
    max-width: 95%;
  }
  .popup-header h2 {
    font-size: 1.25rem;
  }
  .article-nav {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media print {
  .toolbar { display: none; }
  body { background: white; padding: 0; }
  .newspaper { box-shadow: none; max-width: 100%; }
  .popup-overlay { display: none !important; }
}
