/* ==========================================================
   CARTI NEWS NETWORK - stylesheet
   Hand-crafted in Notepad. Do not steal.
   ========================================================== */

body {
  background-color: #000080;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 8px, transparent 8px 16px);
  color: #ffff00;
  font-family: "Times New Roman", Times, serif;
  text-align: center;
  margin: 0;
  padding: 12px 8px 40px;
}

.frame {
  max-width: 760px;
  margin: 0 auto;
  border: 6px ridge #c0c0c0;
  background: #000000;
  padding: 18px 14px 26px;
}

/* ---------- masthead ---------- */

h1.masthead {
  font-size: 54px;
  margin: 4px 0 2px;
  color: #ff0000;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 #ffffff, 6px 6px 0 #808080;
  line-height: 1.05;
}

h1.masthead a { color: inherit; text-decoration: none; }

.tagline {
  color: #00ff00;
  font-size: 15px;
  font-style: italic;
  margin-bottom: 10px;
}

marquee {
  color: #ffffff;
  background: #ff0000;
  font-weight: bold;
  font-size: 16px;
  padding: 3px 0;
}

/* height:auto is required, not cosmetic. The templates emit real width and
   height attributes so the browser reserves space before the image loads (zero
   layout shift). max-width:90% then narrows it -- without height:auto the
   attribute height would be honoured literally and the picture would squash. */
img.hero {
  display: block;
  margin: 18px auto;
  max-width: 90%;
  height: auto;
  border: 5px outset #c0c0c0;
  padding: 4px;
  background: #ffffff;
}

img.hero.small { max-width: 200px; margin: 12px auto; }

/* ---------- navigation ---------- */

.nav { margin: 12px 0 4px; }

.nav a {
  display: inline-block;
  margin: 3px 2px;
  padding: 3px 9px;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #000080;
  background: #c0c0c0;
  border: 3px outset #ffffff;
  text-decoration: none;
}

.nav a:hover { background: #ffff00; }
.nav a:active { border-style: inset; }

hr {
  border: 0;
  height: 4px;
  background: linear-gradient(90deg,#ff0000,#ffff00,#00ff00,#00ffff,#ff00ff);
  margin: 14px 0;
}

/* ---------- front page ---------- */

h2.breaking {
  font-size: 40px;
  color: #ffffff;
  background: #ff0000;
  display: inline-block;
  padding: 6px 22px;
  border: 3px outset #ffffff;
  margin: 6px 0 14px;
  letter-spacing: 4px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  h2.breaking { animation: none; }
}

h2.section {
  font-size: 22px;
  color: #00ffff;
  letter-spacing: 3px;
  text-decoration: underline;
  margin: 18px 0 10px;
}

h3.headline {
  font-size: 30px;
  margin: 8px auto 6px;
  max-width: 620px;
  line-height: 1.2;
}

h3.headline a { color: #ffff00; text-decoration: none; }
h3.headline a:hover { color: #ffffff; background: #ff0000; }

.byline {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #00ff00;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.dek {
  font-size: 19px;
  color: #ffffff;
  max-width: 560px;
  margin: 0 auto 12px;
  line-height: 1.4;
}

a.more {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #00ffff;
}

/* ---------- the wire (post list) ---------- */

table.wire {
  margin: 0 auto;
  border-collapse: collapse;
  width: 94%;
  text-align: left;
}

table.wire td {
  border-bottom: 1px dotted #808080;
  padding: 7px 6px;
  vertical-align: top;
  font-size: 17px;
}

table.wire td.date {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #00ff00;
  white-space: nowrap;
  width: 1%;
  padding-right: 14px;
}

table.wire a { color: #ffff00; text-decoration: none; }
table.wire a:hover { color: #ffffff; background: #ff0000; }

table.wire td.thumb {
  width: 1%;
  padding-right: 12px;
}

img.wire-thumb {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 3px outset #c0c0c0;
  padding: 2px;
  background: #ffffff;
}

table.wire a:hover img.wire-thumb { border-color: #ff0000; }

/* the empty slot where a photo would have gone. Outer size must match
   img.wire-thumb (72 + 2px padding + 3px border = 82px) or rows misalign. */
span.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  padding: 2px;
  border: 3px inset #808080;
  background: #c0c0c0;
  color: #000080;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  line-height: 1.25;
  text-align: center;
}

/* the dek under a wire headline. Deliberately quieter than .dek on the front
   page - it is a second line in a list, not the lead. */
.wire-dek {
  font-size: 14px;
  color: #c0c0c0;
  line-height: 1.35;
  margin-top: 4px;
}

/* ---------- article body ---------- */

article {
  text-align: left;
  max-width: 620px;
  margin: 0 auto;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.55;
}

article h1 {
  font-size: 34px;
  color: #ffff00;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 4px;
}

article h2 { font-size: 24px; color: #00ffff; margin-top: 26px; }
article h3 { font-size: 20px; color: #00ff00; }
article a { color: #00ffff; }
article img { max-width: 100%; border: 4px outset #c0c0c0; background: #fff; padding: 3px; }

article blockquote {
  border-left: 5px solid #ff0000;
  margin: 18px 0;
  padding: 2px 0 2px 16px;
  color: #ffff00;
  font-style: italic;
}

article code {
  font-family: "Courier New", monospace;
  background: #202020;
  color: #00ff00;
  padding: 1px 4px;
}

article hr { margin: 22px 0; }

/* ---------- share buttons ---------- */

.share { text-align: center; margin: 18px 0 22px; }

.share-label {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #00ff00;
  letter-spacing: 2px;
  margin-bottom: 9px;
}

/* One rule for both <a> and <button>. The bare class (0,1,0) still outranks
   article a (0,0,2), which would otherwise paint the links cyan. Buttons do
   not inherit font from their parent, so every text property is stated. */
.share-btn {
  display: inline-block;
  margin: 3px 2px;
  padding: 3px 9px;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 12px;
  font-weight: bold;
  line-height: normal;
  color: #000080;
  background: #c0c0c0;
  border: 3px outset #ffffff;
  text-decoration: none;
  cursor: pointer;
}

/* REQUIRED. display:inline-block above is an author style and therefore beats
   the browser's own [hidden] { display: none }. Without this line the two
   JS-only buttons render for everybody, including people with JS disabled who
   cannot use them. */
.share-btn[hidden] { display: none; }

.share-btn:hover { background: #ffff00; }
.share-btn:active { border-style: inset; }

/* ---------- footer furniture ---------- */

.footer { margin-top: 18px; font-size: 12px; color: #c0c0c0; }
.footer a { color: #00ffff; }

.badge {
  display: inline-block;
  margin: 8px 4px 0;
  font-size: 11px;
  font-family: Verdana, Geneva, sans-serif;
  background: #c0c0c0;
  color: #000080;
  border: 2px outset #ffffff;
  padding: 3px 7px;
}

.disclaimer {
  margin-top: 14px;
  font-size: 11px;
  color: #808080;
  font-family: Verdana, Geneva, sans-serif;
}

a { color: #00ffff; }

/* ---------- small screens (a concession to 2026) ---------- */

@media (max-width: 640px) {
  h1.masthead { font-size: 34px; }
  h2.breaking { font-size: 26px; letter-spacing: 2px; padding: 5px 12px; }
  h3.headline { font-size: 23px; }
  article { font-size: 17px; }
  .frame { padding: 12px 8px 20px; }
  .wire-dek { font-size: 14px; }

  /* Three table columns on a phone leave the headline about 90px to wrap in.
     Below 640px the row stops being a row: every cell becomes a block, so the
     date sits on its own line, the thumbnail floats out of the flow, and the
     headline and dek take the full width and wrap around the picture. */
  table.wire,
  table.wire tbody,
  table.wire tr,
  table.wire td {
    display: block;
    width: auto;
  }

  table.wire { width: 100%; }

  /* The border moves from the cell to the row, or it would draw three times.
     overflow:hidden contains the floated thumbnail so the rule lands beneath
     it instead of cutting through the picture. */
  table.wire tr {
    border-bottom: 1px dotted #808080;
    overflow: hidden;
    padding: 10px 0;
  }

  table.wire td {
    border-bottom: 0;
    padding: 0;
  }

  /* width:auto has to be restated on each of these. The grouped rule above is
     `table.wire td` (0,1,2); the base rules are `table.wire td.date` and
     `table.wire td.thumb` (0,2,2), which outrank it, so both cells would keep
     width:1%. A 1%-wide float is ~3px, and the headline would wrap against
     that instead of the picture -- i.e. straight over the top of it. */
  table.wire td.date {
    width: auto;
    padding-bottom: 6px;
  }

  table.wire td.thumb {
    width: auto;
    float: left;
    padding: 2px 12px 4px 0;
  }
}
