/* css/style-historical_entry.css
   Historical entry page — clean + single source of truth
   ✅ Desktop: inline floated image, text wraps, first paragraph min-height = image height
   ✅ Mobile: hero image only (no duplicate), meta becomes 2 lines with Display next to date
*/

:root{
  --bg:#0b0d14;
  --panel:#111425;
  --row:#14182e;
  --line:#262b52;
  --ink:#eef0ff;
  --muted:#9aa0d4;
  --accent:#6f7cff;
  --sans: system-ui,-apple-system,"Segoe UI",Inter,Roboto,Arial;

  --maxw: 1100px;

  /* desktop inline image sizing */
  --inline-img-w: 420px;
  --inline-img-h: 260px;

  --shadow: 0 14px 36px rgba(0,0,0,0.38);
}

*{ box-sizing:border-box; }

html,body{
  height:100%;
  margin:0;
  background: radial-gradient(circle at top,#14183a 0%,#070912 60%,#04050c 100%);
  color: var(--ink);
  font-family: var(--sans);

  scrollbar-width:none;
  -ms-overflow-style:none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar{ width:0; height:0; }

/* =========================================================
   LAYOUT
   ========================================================= */

.news-shell{
  width: min(var(--maxw), 96vw);
  margin: 0 auto;
  padding: 12px 10px 24px;
}
.news-main{ width:100%; }

/* =========================================================
   CARD
   ========================================================= */

.card.news-card.news-entry-card{
  background: linear-gradient(180deg, var(--row), #0f1328);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 12px;
  overflow: hidden;
}

/* =========================================================
   HEADER
   ========================================================= */

.news-card-header{
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(7,9,18,.55);
  backdrop-filter: blur(8px);
}

.news-back-link{
  display:inline-block;
  margin-bottom: 6px;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent);
  text-decoration: none;
}
.news-back-link:hover{ text-decoration: underline; }

.news-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.news-title{
  width:100%;
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.news-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .10em;
  text-transform: uppercase;
  border: 1px solid rgba(255,214,130,.35);
  background: rgba(255,198,93,.14);
  color: rgba(255,235,200,.95);
  white-space: nowrap;
}

/* =========================================================
   META (historical_entry.php uses: .news-meta-row--hist + .meta-*)
   Desktop: single line: date · tradition · category · source · Display
   Mobile: line1: date · Display  / line2: tradition · category · source
   ========================================================= */

.news-meta-row--hist{
  display:flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: .82rem;
  color: var(--muted);
}

.news-meta-row--hist .meta-item{
  display:inline-block;
  line-height: 1.2;
}

/* separators: add dot BEFORE every item except the first visible item on a line */
.news-meta-row--hist .meta-item + .meta-item::before{
  content:"•";
  margin: 0 8px 0 0;
  color: rgba(255,255,255,.25);
}

/* Display looks like a simple link (NOT a button) */
.news-meta-row--hist .btn-display{
  appearance:none;
  border:0;
  background:none;
  padding:0;
  margin:0;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  vertical-align: baseline;
}
.news-meta-row--hist .btn-display:hover{ text-decoration: underline; }

/* helper element in markup (we use it to force a new line on mobile) */
.news-meta-row--hist .meta-break{
  display:none;
  flex-basis: 100%;
  height: 0;
}

/* =========================================================
   FEATURE TEXT (comment)
   ========================================================= */

.news-feature-text{
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink);
}

/* =========================================================
   IMAGES
   ========================================================= */

/* Mobile hero only */
.news-hero{
  margin:0;
  display:none;
  border-bottom: 1px solid var(--line);
}
.news-hero img{
  width:100%;
  height: clamp(220px, 34vw, 420px);
  object-fit: cover;
  display:block;
}

/* Desktop inline floated image */
.news-inline-media{
  float:left;
  width: var(--inline-img-w);
  max-width: 45%;
  margin: 4px 18px 12px 0;
  border: 1px solid var(--line);
  background: #050715;
  border-radius: 10px;
  overflow:hidden;
}
.news-inline-media img{
  width:100%;
  height: var(--inline-img-h);
  object-fit: cover;
  display:block;
}

/* =========================================================
   BODY
   ========================================================= */

.news-body{
  padding: 16px 18px 18px;
}

.news-body p{
  margin: 0 0 12px;
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(238,240,255,.92);
}

/* Remaining paragraphs full-width under floated image */
.news-body-rest{
  clear: both;
  padding-top: 6px;
}

/* Desktop only: make first paragraph at least as tall as inline image */
@media (min-width: 861px){
  .news-body > p:first-of-type{
    min-height: var(--inline-img-h);
  }
}

/* =========================================================
   FOOTER
   ========================================================= */

.news-footer-actions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--line);
  background: rgba(7,9,18,.45);
}

.btn-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  text-decoration:none;
  font-weight: 650;
  font-size: .85rem;
  border-radius: 8px;
  transition: .15s ease;
}
.btn-pill:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(111,124,255,.45);
}

.btn-secondary{
  appearance:none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--ink);
  font: inherit;
  font-size: .85rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  transition: .15s ease;
}
.btn-secondary:hover{ background: rgba(255,255,255,.10); }

/* Empty text */
.news-empty{
  padding: 0 18px 18px;
  color: var(--muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 860px){
  .news-shell{
    width:min(var(--maxw), 97vw);
    padding: 10px 10px 22px;
  }

  .news-card-header,
  .news-body,
  .news-footer-actions{
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Mobile: hero image visible, inline hidden */
  .news-hero{ display:block; }
  .news-inline-media{ display:none; }

  /* Mobile meta: date + display line1; rest line2 */
  .news-meta-row--hist{
    flex-wrap: wrap;
  }
  .news-meta-row--hist .meta-date{ order: 1; }
  .news-meta-row--hist .meta-display{ order: 2; }

  .news-meta-row--hist .meta-break{
    display:block;
    order: 3;
  }

  .news-meta-row--hist .meta-trad{ order: 4; }
  .news-meta-row--hist .meta-cat{ order: 5; }
  .news-meta-row--hist .meta-src{ order: 6; }
}

@media (min-width: 861px){
  /* Desktop meta: single line */
  .news-meta-row--hist{
    flex-wrap: nowrap;
  }
  .news-meta-row--hist .meta-break{
    display:none;
  }
}


@media (max-width: 860px){
  /* Remove dot before first item on second row */
  .news-meta-row--hist .meta-break + span::before{
    content: none !important;
    margin: 0 !important;
  }

    .news-meta-row--hist{
    row-gap: 2px;
  }

}


@media (max-width: 860px){
  /* Remove dot before first item on 2nd row (the item right after the break) */
  .news-meta-row--hist .meta-break + .meta-item::before{
    content: none !important;
    margin: 0 !important;
  }

  /* (Optional hard-stop) If tradition is always first on row 2, this guarantees it */
  .news-meta-row--hist .meta-trad::before{
    content: none !important;
    margin: 0 !important;
  }
}
