/* styles/styles.css
   Styling for log entries.
   - Background border images are placed using a ::before pseudo-element, behind the content.
   - Modifier classes set a CSS variable (--log-border-image) so images are easy to swap.
   - Expose CSS variables for padding/height so non-devs can tweak spacing.
*/

/* --------------------------
   Layout tuning variables
   -------------------------- */
:root {
  --log-padding: 250px;           /* EDIT THIS LINE TO: change padding from image border -  inner padding inside the border */
  --log-min-height: 160px;       /* minimum height of each log entry */
  --log-bg-overlay: rgba(0, 0, 0, 0); /* dark slab under text to improve contrast */
  --log-border-image: url('../images/borders/commentary-border.jpg'); /* fallback */
}

/* general container - your index already has #log-container */
#log-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --------------------------
   Base log wrapper
   -------------------------- */
.log-entry {
  position: relative;           /* needed for ::before layering */
  overflow: hidden;             /* keep background inside bounds */
  min-height: var(--log-min-height);
  padding: var(--log-padding);
  border-radius: 8px;
  background-color: transparent;
  /* content should appear above pseudo-element */
  isolation: isolate;
}

/* Pseudo-element is placed behind content and sized to fill wrapper */
.log-entry::before {
  content: "";
  position: absolute;
  inset: 0;                     /* top:0; right:0; bottom:0; left:0; */
  z-index: 0;                   /* sit behind content */
  background-image: var(--log-border-image);
  background-size: cover;       /* cover to fill container — change to 'contain' if you prefer */
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  pointer-events: none;         /* don't interfere with clicks */
  transform-origin: center;
}

/* A semi-opaque overlay layer between border image and text to ensure readability */
.log-entry::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--log-bg-overlay);
  z-index: 1;
  pointer-events: none;
}

/*
 Inner content sits above the pseudo-element layers 
 Log #031 – Stickless in the Sandbox
 */
.log-content {
  position: relative;
  z-index: 2;
  color: #ffffff;
}

/* header layout */
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 10.0rem;
}

.log-title {
  font-size: 1.25rem;
  line-height: 1.1;
  margin: 0;
}

.log-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.log-date {
  font-size: 1rem;
  color: #cfcfcf;
}

.log-type {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* body text - keep line-breaks as in JSON */
.log-body p {
  white-space: pre-wrap; /* preserve newlines from JSON */
  margin: 1;
  color: #f3f3f3;
  line-height: 3.0;
}

/* timeline block */
.log-timeline {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #d7eefe;
}

/* footer placeholder */
.log-footer {
  margin-top: 1rem;
  display:flex;
  gap: 8px;
}

/* --------------------------
   TYPE MODIFIERS — set the border image via CSS variable
   (paths are relative to this CSS file location - /styles)
   -------------------------- */
.log-entry--report   { --log-border-image: url('../images/log-border-report.png'); }
.log-entry--commentary { --log-border-image: url('../images/borders/commentary-border.jpg'); }
.log-entry--intel    { --log-border-image: url('../images/log-border-intel.png'); }
.log-entry--default  { --log-border-image: url('../images/borders/commentary-border.jpg'); }

/* --------------------------
   Type badge colors (easy to modify)
   -------------------------- */
.log-type.report { background: rgba(0, 95, 115, 0.85); color: #fff; }
.log-type.commentary { background: rgba(155, 34, 38, 0.9); color: #fff; }
.log-type.intel { background: rgba(238, 155, 0, 0.9); color: #111; }

/* --------------------------
   Responsive adjustments
   -------------------------- */
@media (max-width: 768px) {
  :root {
    --log-padding: 12px;
    --log-min-height: 120px;
  }
  .log-title { font-size: 1.05rem; }
  .log-body p { font-size: 0.95rem; }
}
