/* 
 * Styles for "Srpska Hronika" (Serbian Chronicle)
 * Visual Theme: 1880s Frontier Broadsheet Print Press
 */

@import url('https://fonts.googleapis.com/css2?family=IM+Fell+Double+Pica:ital@0;1&family=IM+Fell+English+SC&family=IM+Fell+English:ital@0;1&family=Special+Elite&display=swap');

/* Color Variables representing physical printing press carbon ink & organic paper */
:root {
  --paper-bg-base: #f5eed3;
  --paper-bg-gradient: radial-gradient(circle, #f8f3df 0%, #ecdfa9 100%);
  --ink-color: #1c1916;
  --ink-color-faded: #38322c;
  --accent-color: #721c1c; /* Crimson wax seal accent */
  --rule-color: rgba(28, 25, 22, 0.8);
  --border-bleed: 1.5px;
}

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

body {
  background-color: #12100e; /* Dark table background behind the paper */
  color: var(--ink-color);
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 19px;
  line-height: 1.5;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  overflow-x: hidden;
}

/* Base BroadSheet Paper Layout */
.broadsheet-paper {
  background-color: var(--paper-bg-base);
  background-image: var(--paper-bg-gradient);
  width: 100%;
  max-width: 1200px;
  padding: 50px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 5px 15px rgba(0, 0, 0, 0.4),
    inset 0 0 40px rgba(139, 115, 85, 0.15);
  border: 1px solid #c8b98f;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

/* Aged SVG Noise Overlay for physical paper fiber texture */
.broadsheet-paper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Subtle coffee/ink stains */
.stain-top {
  position: absolute;
  top: -10%;
  right: 15%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(139, 90, 43, 0.08) 0%, rgba(139, 90, 43, 0) 70%);
  pointer-events: none;
  z-index: 2;
}

.stain-bottom {
  position: absolute;
  bottom: 5%;
  left: 8%;
  width: 350px;
  height: 250px;
  background: radial-gradient(circle, rgba(139, 90, 43, 0.06) 0%, rgba(139, 90, 43, 0) 75%);
  pointer-events: none;
  z-index: 2;
}

/* Ornate Double Rules for structural division */
.double-rule {
  border-top: 3px double var(--rule-color);
  margin: 15px 0;
  height: 4px;
  clear: both;
}

.thin-rule {
  border-top: 1px solid var(--rule-color);
  margin: 12px 0;
  clear: both;
}

/* Header Sections */
header {
  text-align: center;
  position: relative;
  margin-bottom: 20px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 5px 0;
}

.issue-number {
  color: var(--ink-color-faded);
}

/* Antique Toggle Button for Language Switch */
.lang-toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brass-switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 30px;
  cursor: pointer;
}

.brass-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #3e372e;
  border: 2px solid #a38d62;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 1px 1px rgba(255,255,255,0.1);
  border-radius: 15px;
  transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: radial-gradient(circle, #e2cfa7 0%, #80683a 100%);
  border: 1px solid #5a4825;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  border-radius: 50%;
  transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.brass-switch input:checked + .switch-slider {
  background-color: #5c1818;
  border-color: #b88585;
}

.brass-switch input:checked + .switch-slider::before {
  transform: translateX(40px);
  background: radial-gradient(circle, #ffcccc 0%, #993333 100%);
  border-color: #660000;
}

.lang-label {
  font-family: 'Special Elite', monospace;
  font-size: 12px;
  font-weight: bold;
}

/* Publication Nameplate Banner */
.brand-nameplate {
  margin: 15px 0;
}

.brand-main {
  font-family: 'IM Fell English SC', 'Playfair Display', Georgia, serif;
  font-size: 72px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: -1px;
  line-height: 1;
  display: block;
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.3);
}

.brand-sub {
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 5px;
  word-spacing: 8px;
  display: block;
  margin-top: 10px;
  color: var(--ink-color-faded);
}

/* Date and Price Line */
.dateline-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-top: 4px solid var(--ink-color);
  border-bottom: 4px solid var(--ink-color);
  font-family: 'IM Fell English SC', serif;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meteorological-tidings {
  max-width: 320px;
  text-align: left;
  font-size: 11px;
  font-family: 'Special Elite', monospace;
  line-height: 1.3;
  padding-left: 10px;
  border-left: 2px solid var(--ink-color);
}

/* Main BroadSheet Multi-Column Layout Grid */
.broadsheet-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr; /* Two main columns (Left for Serbian event, Right for World/Ads) */
  gap: 30px;
  margin-top: 30px;
  position: relative;
}

/* Vertical dividing line between grid columns */
.broadsheet-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 68%; /* Divides columns */
  width: 1px;
  background-color: var(--rule-color);
  pointer-events: none;
}

/* Headline Styling */
.section-headline {
  text-align: center;
  font-family: 'IM Fell Double Pica', serif;
  font-size: 38px;
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.sub-headline {
  text-align: center;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 19px;
  font-style: italic;
  margin-bottom: 25px;
  color: var(--ink-color-faded);
}

/* Article Structure and Typography */
.article-lead-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr; /* Divide lead content: Text on left, woodcut on right */
  gap: 20px;
  margin-bottom: 20px;
}

.article-text-block {
  text-align: justify;
  text-justify: inter-word;
}

/* Classic Drop Cap */
.drop-cap {
  font-family: 'IM Fell Double Pica', serif;
  font-size: 78px;
  float: left;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 8px;
  color: var(--accent-color);
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.15);
}

.article-paragraph {
  margin-bottom: 15px;
  text-indent: 20px;
}

/* Woodcut Illustration Styling */
.woodcut-container {
  border: 3px double var(--ink-color);
  padding: 8px;
  background-color: #faf7ec;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.woodcut-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--ink-color);
  filter: contrast(1.15) brightness(0.95);
  mix-blend-mode: multiply;
}

.woodcut-caption {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
  padding: 0 5px;
  line-height: 1.3;
  color: var(--ink-color-faded);
  border-top: 1px dashed var(--ink-color);
  width: 100%;
  padding-top: 6px;
}

/* Right-Hand Column: World Dispatches & Ads */
.right-column-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-left: 10px;
}

.column-header {
  font-family: 'IM Fell English SC', serif;
  font-size: 22px;
  text-align: center;
  border-bottom: 2px solid var(--ink-color);
  padding-bottom: 5px;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

/* Expandable World News Dispatch Cards */
.world-dispatch-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dispatch-card {
  border: 1px solid rgba(28, 25, 22, 0.4);
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.dispatch-card:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.4);
  border-color: var(--ink-color);
  box-shadow: 0 5px 12px rgba(139, 115, 85, 0.15);
}

.dispatch-card::before {
  content: "☞";
  position: absolute;
  left: -20px;
  top: 15px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: var(--accent-color);
  transform: translateX(-5px);
}

.dispatch-card:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.dispatch-year {
  font-family: 'Special Elite', monospace;
  font-size: 12px;
  color: var(--accent-color);
  display: block;
  margin-bottom: 5px;
}

.dispatch-title {
  font-family: 'IM Fell Double Pica', serif;
  font-size: 18px;
  font-weight: normal;
  line-height: 1.3;
  margin-bottom: 8px;
}

.dispatch-summary {
  font-size: 14px;
  line-height: 1.4;
  text-align: justify;
  color: var(--ink-color-faded);
}

/* Mali Oglasi (Classified Ads) Section */
.classifieds-container {
  border: 2px solid var(--ink-color);
  background-color: rgba(28, 25, 22, 0.03);
  padding: 15px;
}

.classifieds-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.classified-item {
  border-bottom: 1px dashed rgba(28, 25, 22, 0.3);
  padding-bottom: 10px;
}

.classified-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.classified-tag {
  font-family: 'Special Elite', monospace;
  font-size: 10px;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 1px 4px;
  display: inline-block;
  margin-bottom: 5px;
}

.classified-text {
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-color-faded);
  text-align: justify;
}

/* Elegant Historical Interactive Modals for full stories */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(18, 16, 14, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-broadsheet {
  background-color: var(--paper-bg-base);
  background-image: var(--paper-bg-gradient);
  width: 90%;
  max-width: 650px;
  padding: 40px;
  border: 4px double var(--ink-color);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  position: relative;
  transform: scale(0.9) rotate(-1deg);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-broadsheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.modal-overlay.active .modal-broadsheet {
  transform: scale(1) rotate(0deg);
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-family: 'Special Elite', monospace;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-color);
  transition: transform 0.2s ease;
}

.modal-close-btn:hover {
  transform: scale(1.2) rotate(90deg);
}

.modal-year {
  font-family: 'Special Elite', monospace;
  font-size: 14px;
  color: var(--accent-color);
  display: block;
  margin-bottom: 10px;
}

.modal-headline {
  font-family: 'IM Fell Double Pica', serif;
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink-color);
  padding-bottom: 10px;
}

.modal-body {
  font-size: 18px;
  line-height: 1.5;
  text-align: justify;
}

/* Custom Scrollbar for Retro Broadsheet */
.modal-broadsheet::-webkit-scrollbar {
  width: 8px;
}

.modal-broadsheet::-webkit-scrollbar-track {
  background: rgba(28, 25, 22, 0.05);
}

.modal-broadsheet::-webkit-scrollbar-thumb {
  background: var(--ink-color-faded);
  border-radius: 4px;
}

/* Sources Bar */
.sources-bar {
  margin-top: 20px;
  padding: 6px 0;
  border-top: 1px dashed rgba(28, 25, 22, 0.3);
  font-size: 11px;
  font-style: italic;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  color: var(--ink-color-faded);
}

.sources-list {
  display: flex;
  gap: 8px;
}

.sources-list a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-weight: bold;
}

.sources-list a:hover {
  border-bottom: 1px solid var(--accent-color);
}

/* Footer Credits */
footer {
  text-align: center;
  font-family: 'Special Elite', monospace;
  font-size: 11px;
  margin-top: 40px;
  color: #665b50;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* -------------------------------------------------------------
 * BILINGUAL TRANSITION LOGIC
 * Dynamic switching controlled entirely via JavaScript body-class modification.
 * ------------------------------------------------------------- */
body.lang-en .sr-text {
  display: none !important;
}

body.lang-sr .en-text {
  display: none !important;
}

/* Inline flex alignment preservation */
body.lang-en span.en-text, 
body.lang-en div.en-text, 
body.lang-en p.en-text {
  display: inline;
}

body.lang-sr span.sr-text, 
body.lang-sr div.sr-text, 
body.lang-sr p.sr-text {
  display: inline;
}

/* Paragraph structures display grid/block overrides */
body.lang-en p.en-text.article-paragraph,
body.lang-en div.en-text.woodcut-caption,
body.lang-en p.en-text.classified-text {
  display: block;
}

body.lang-sr p.sr-text.article-paragraph,
body.lang-sr div.sr-text.woodcut-caption,
body.lang-sr p.sr-text.classified-text {
  display: block;
}

/* Responsive Columns Reflow for Small Tablets and Mobile Devices */
@media (max-width: 950px) {
  .broadsheet-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .broadsheet-grid::after {
    display: none; /* Hide vertical rules on mobile stack */
  }
  
  .article-lead-container {
    grid-template-columns: 1fr;
  }
  
  .right-column-container {
    padding-left: 0;
    border-top: 4px double var(--rule-color);
    padding-top: 30px;
  }
  
  .brand-main {
    font-size: 48px;
  }
  
  .broadsheet-paper {
    padding: 20px;
  }
}

/* -------------------------------------------------------------
 * FULL STORY SWAPPING & TRANSITION STYLES
 * ------------------------------------------------------------- */
.back-to-main-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  color: var(--accent-color);
  background: rgba(114, 28, 28, 0.05);
  border: 1px solid var(--accent-color);
  padding: 6px 12px;
  cursor: pointer;
  margin-bottom: 25px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.back-to-main-btn:hover {
  background: var(--accent-color);
  color: #faf7ec;
  transform: translateX(-3px);
  box-shadow: 2px 2px 0px var(--ink-color);
}

.article-fade-content {
  opacity: 1;
  transition: opacity 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-fade-content.fading {
  opacity: 0;
}

.article-meta-header {
  text-align: center;
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--accent-color);
  margin-bottom: 15px;
  text-transform: uppercase;
  border-bottom: 1px dashed rgba(28, 25, 22, 0.2);
  padding-bottom: 8px;
}

/* =============================================================
   VINTAGE PRINT CLASS ARCHIVE NAV RIBBON & LEDGER BOX
   ============================================================= */

/* Archive/Past Editions Navigation Ribbon */
.archive-ribbon {
  border-top: 1px solid var(--rule-color);
  border-bottom: 3px double var(--rule-color);
  padding: 8px 0;
  margin-top: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-family: 'Special Elite', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.archive-ribbon-title {
  font-weight: bold;
  text-transform: uppercase;
  color: var(--accent-color);
}

.archive-tabs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.archive-tab {
  color: var(--ink-color-faded);
  text-decoration: none;
  background-color: rgba(28, 25, 22, 0.05);
  border: 1px solid var(--rule-color);
  padding: 3px 8px;
  border-radius: 2px;
  transition: all 0.2s ease;
  font-size: 12px;
  display: inline-block;
}

.archive-tab:hover {
  background-color: var(--accent-color);
  color: #fff !important;
  border-color: var(--accent-color);
}

.archive-tab.active-edition {
  background-color: var(--ink-color);
  color: var(--paper-bg-base) !important;
  border-color: var(--ink-color);
  pointer-events: none;
  font-weight: bold;
}

/* Historical Ledger Citations Box (Rendered in subtle secondary minority styling) */
.ledger-box {
  background-color: rgba(114, 28, 28, 0.015);
  border: 1px dashed rgba(114, 28, 28, 0.4);
  padding: 12px 18px;
  margin-top: 25px;
  margin-bottom: 15px;
  border-radius: 3px;
  position: relative;
  font-family: 'IM Fell English', Georgia, serif;
}

.ledger-box::after {
  content: "★";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f5eed3; /* matches exact --paper-bg-base */
  padding: 0 8px;
  color: var(--accent-color);
  font-size: 14px;
}

.ledger-header {
  text-align: center;
  font-family: 'IM Fell English SC', serif;
  color: var(--accent-color);
  font-size: 13px;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(114, 28, 28, 0.12);
  padding-bottom: 4px;
  text-transform: uppercase;
}

.ledger-item {
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.35;
  border-bottom: 1px dotted rgba(28, 25, 22, 0.1);
  padding-bottom: 8px;
}

.ledger-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.ledger-fact {
  margin-bottom: 3px;
  color: var(--ink-color-faded);
}

.ledger-meta {
  font-family: 'Special Elite', monospace;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #665b50;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.ledger-citation-link {
  color: var(--accent-color);
  text-decoration: underline;
  font-weight: bold;
}

.ledger-citation-link:hover {
  color: var(--ink-color);
}

.ledger-tier {
  background-color: rgba(28, 25, 22, 0.05);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 9px;
  text-transform: uppercase;
}

/* =============================================================
   GLOBAL RED ACCENT ANCHOR OVERRIDE (Replaces default blue links)
   ============================================================= */
a, a:visited {
  color: var(--accent-color) !important;
  text-decoration: underline;
  transition: color 0.15s ease;
}

a:hover, a:active, a:focus {
  color: var(--ink-color) !important;
  text-decoration: none;
}

