/* ================================================================
   styles.css — shared across all pages
   ================================================================ */

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── CSS Variables ─────────────────────────────────── */
:root {
  --bg-page:       #b0b8c8;
  --bg-window:     #d4d0c8;
  --bg-titlebar:   #000080;
  --bg-nav:        #c8c4bc;
  --bg-section-a:  #e8e4dc;
  --bg-section-b:  #dcd8d0;
  --bg-sidebar:    #ccc8c0;
  --bg-footer:     #bab6ae;
  --border-raised: #ffffff #808080 #808080 #ffffff;
  --border-sunken: #808080 #ffffff #ffffff #808080;
  --text-main:     #1a1a1a;
  --text-muted:    #555;
  --accent:        #000080;
}

/* ── Page background ───────────────────────────────── */
body {
  min-height: 100vh;
  background-color: var(--bg-page);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.06) 0px, rgba(255,255,255,.06) 2px,
    transparent 2px, transparent 10px
  );
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
  font-family: "Courier New", Courier, monospace;
  color: var(--text-main);
}

/* ── Main window ───────────────────────────────────── */
#window {
  width: 100%;
  max-width: 860px;
  background: var(--bg-window);
  border-style: solid;
  border-width: 2px;
  border-color: var(--border-raised);
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
}

/* ── Title bar ─────────────────────────────────────── */
#titlebar {
  background: var(--bg-titlebar);
  color: #fff;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
#titlebar .window-title { display: flex; align-items: center; gap: 6px; }
#titlebar .window-title .icon {
  width: 14px; height: 14px;
  background: #c0c0c0; border: 1px solid #fff; display: inline-block;
}
#titlebar .win-buttons { display: flex; gap: 2px; }
#titlebar .win-btn {
  width: 16px; height: 14px;
  background: var(--bg-window);
  border-style: solid; border-width: 1px; border-color: var(--border-raised);
  font-size: 0.6rem; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: #000;
}

/* ── Menu bar ──────────────────────────────────────── */
#menubar {
  background: var(--bg-window);
  border-bottom: 1px solid #808080;
  padding: 2px 4px;
  display: flex; gap: 2px;
}
#menubar .menu-item { font-size: 0.7rem; padding: 2px 8px; cursor: pointer; }
#menubar .menu-item:hover { background: var(--bg-titlebar); color: #fff; }


/* ── Site header ───────────────────────────────────── */
header#site-header {
  background: #a8a4a0;
  border-bottom: 2px solid #808080;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}
header#site-header h1 {
  font-size: 1.6rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--accent);
  text-shadow: 1px 1px 0 #fff;
}
header#site-header .tagline {
  font-size: 0.72rem; color: var(--text-muted); margin-top: 4px;
}
header#site-header .header-text { display: flex; flex-direction: column; align-items: center; }


/* Football site header */
.football-page header#site-header {
  background-image: url('/data/pictures/foot-field.png');
  background-size: cover;
  height: 98px;
  
  border-style: solid;
  border-width: 3px;
  border-color: #808080 #ffffff #ffffff #808080; 
}

.football-page header#site-header h1 {
  font-family: "Serif", "Times New Roman", serif;
  color: #ffffff; /* Your main font color */
  text-shadow: 2px 2px 0px #000000;
}

.football-page header#site-header .tagline {
  color: #eeeeee;
  text-shadow: 1px 1px 0px #000000;
}

/* Home site header */
.home-page header#site-header {
  background-image: url('/data/pictures/home-background.png');
  background-size: cover;
  height: 98px;
  
  border-style: solid;
  border-width: 3px;
  border-color: #808080 #ffffff #ffffff #808080; 
}

/* ── 62x62 site button ─────────────────────────────── */
.site-button {
  width: 62px;
  height: 62px;
  image-rendering: pixelated;   /* keeps pixel art crisp */
  border-style: solid;
  border-width: 1px;
  border-color: var(--border-sunken);
  display: block;
  flex-shrink: 0;
}
/*.site-button:hover { opacity: 0.85; }*/

/* ── Content area ──────────────────────────────────── */
#content-area { display: flex; flex: 1; }

/* ── Sidebar ───────────────────────────────────────── */
aside#sidebar {
  width: 180px; min-width: 180px;
  background: var(--bg-sidebar);
  border-right: 2px solid #808080;
  display: flex; flex-direction: column;
}
aside#sidebar .sidebar-widget { border-bottom: 1px solid #808080; padding: 8px; }
aside#sidebar .sidebar-widget h3 {
  font-size: 0.65rem; background: var(--bg-titlebar); color: #fff;
  padding: 2px 6px; margin: -8px -8px 6px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
aside#sidebar .sidebar-widget ul { list-style: none; font-size: 0.68rem; line-height: 1.9; }
aside#sidebar .sidebar-widget ul li::before { content: "► "; color: var(--accent); }
aside#sidebar .sidebar-widget ul li a { color: var(--text-main); text-decoration: none; }
aside#sidebar .sidebar-widget ul li a:hover { text-decoration: underline; }
aside#sidebar .sidebar-widget p { font-size: 0.65rem; line-height: 1.5; color: var(--text-muted); }

/* ── Main column ───────────────────────────────────── */
#main-column { flex: 1; display: flex; flex-direction: column; }

/* ── Generic section ───────────────────────────────── */
section {
  padding: 14px 16px;
  border-bottom: 1px solid #9c9890;
}
section h2 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em;
  border-bottom: 1px solid #808080; margin-bottom: 10px;
  padding-bottom: 4px; color: var(--accent);
}
section p, section ul { font-size: 0.72rem; line-height: 1.8; color: var(--text-muted); }
section ul { list-style: disc; padding-left: 1rem; }

/* section bg alternation */
section:nth-child(odd)  { background: var(--bg-section-a); }
section:nth-child(even) { background: var(--bg-section-b); }

/* ── Blog index list ───────────────────────────────── */
.blog-index-list { display: flex; flex-direction: column; gap: 8px; }
.blog-card {
  background: #e0dcd4;
  border-style: solid;
  border-width: 1px;
  border-color: var(--border-sunken);
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.blog-card:hover { background: #cac6be; }

.blog-card .card-text {
  flex: 1;
  min-width: 0;  /* prevents text overflowing */
}

.blog-card .card-title   { font-weight: bold; color: var(--accent); font-size: 0.75rem; }
.blog-card .card-date    { font-size: 0.6rem; color: #888; margin-bottom: 4px; }
.blog-card .card-preview { font-size: 0.68rem; color: var(--text-muted); }

.blog-card .card-image {
  width: 90px;
  height: 55px;
  flex-shrink: 0;
  border-style: solid;
  border-width: 1px;
  border-color: var(--border-sunken);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #b0aca4;
}

.blog-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
/* ── Single post view ──────────────────────────────── */
.post-body {
  font-size: 0.74rem;
  line-height: 1.9;
  color: var(--text-muted);
  white-space: pre-wrap;   /* respects newlines in JSON content */
}
.post-header-meta {
  font-size: 0.62rem; color: #888;
  margin-bottom: 12px; display: block;
}
.back-link {
  display: inline-block;
  font-size: 0.68rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}
.back-link:hover { text-decoration: underline; }

/* ── Guestbook form ────────────────────────────────── */
.guestbook-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.guestbook-form input,
.guestbook-form textarea {
  background: #fff;
  border-style: solid; border-width: 1px; border-color: var(--border-sunken);
  padding: 4px 6px; font-family: inherit; font-size: 0.68rem; resize: vertical;
}
.guestbook-form button {
  align-self: flex-start; background: var(--bg-window);
  border-style: solid; border-width: 2px; border-color: var(--border-raised);
  padding: 3px 12px; font-family: inherit; font-size: 0.68rem; cursor: pointer;
}
.guestbook-form button:active { border-color: var(--border-sunken); }
.gb-entry {
  background: #e0dcd4;
  border-style: solid; border-width: 1px; border-color: var(--border-sunken);
  padding: 6px 10px; margin-bottom: 6px; font-size: 0.68rem;
}
.gb-entry .gb-entry-name { font-weight: bold; color: var(--accent); }
.gb-entry .gb-entry-date { font-size: 0.6rem; color: #888; }

/* ── Gallery grid ──────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.gallery-item {
  aspect-ratio: 1;
  background: #b0aca4;
  border-style: solid;
  border-width: 1px;
  border-color: var(--border-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  overflow: hidden;
}

.gallery-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
}

/* ── Footer ────────────────────────────────────────── */
footer#site-footer {
  background: var(--bg-footer); border-top: 1px solid #808080;
  padding: 10px 16px; text-align: center;
  font-size: 0.65rem; color: var(--text-muted);
}
footer#site-footer .footer-links {
  display: flex; justify-content: center; gap: 12px; margin-top: 4px;
}
footer#site-footer a { font-size: 0.65rem; color: var(--accent); }

/* ── Status bar ────────────────────────────────────── */
#statusbar {
  background: var(--bg-window); border-top: 2px solid #fff;
  padding: 2px 8px; display: flex;
  justify-content: space-between; align-items: center;
  font-size: 0.62rem; color: var(--text-muted);
}
#statusbar .status-panel {
  border-style: solid; border-width: 1px; border-color: var(--border-sunken);
  padding: 1px 6px;
}

/* ── Loading / error states ────────────────────────── */
.state-loading, .state-error {
  font-size: 0.72rem; color: var(--text-muted);
  padding: 12px 0; text-align: center;
}
.state-error { color: #800000; }

/* Image in a post*/
.post-img {
  max-width: 100%;
  display: block;
  margin: 10px auto;
  border-style: solid;
  border-width: 4px;
  border-color: var(--border-sunken);
}

/* ── Popup ad ───────────────────────────────────────── */
#popup-ad {
  position: fixed;
  z-index: 9999;
  background: var(--bg-window);
  border-style: solid;
  border-width: 2px;
  border-color: var(--border-raised);
  box-shadow: 4px 4px 0 rgba(0,0,0,.5);
  display: none;
  flex-direction: column;
  user-select: none;
}

#popup-titlebar {
  background: var(--bg-titlebar);
  color: #fff;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
}

#popup-titlebar:active { cursor: grabbing; }

.popup-title {
  display: flex;
  align-items: center;
  gap: 5px;
}

#popup-close {
  width: 16px;
  height: 14px;
  background: var(--bg-window);
  border-style: solid;
  border-width: 1px;
  border-color: var(--border-raised);
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000;
  flex-shrink: 0;
  transition: transform 0.08s ease;
}

#popup-close:active {
  border-color: var(--border-sunken);
  transform: scale(0.85);
}

#popup-body {
  padding: 6px;
}

#popup-img {
  display: block;
  image-rendering: pixelated;
  margin: 0 auto;
}

/* ── Breaking news ticker ───────────────────────────── */
#ticker-wrap {
  background: var(--bg-titlebar);
  color: #fff;
  font-size: 0.72rem;
  overflow: hidden;
  white-space: nowrap;
  border-top: 2px solid #fff;
  height: 22px;
  display: flex;
  align-items: center;
}

#ticker-track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll 120s linear infinite;
}

#ticker-content {
  display: inline-block;
  padding-left: 0vw;
}

#ticker-content img.ticker-sep {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin: 0 20px;
  image-rendering: pixelated;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.btn-88x31 {
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
  display: block;
}


/* ── Buttons ticker ─────────────────────────────────── */
#buttons-ticker-wrap {
  overflow: hidden;
  width: 100%;
  background: var(--bg-sidebar);
  padding: 4px 0;
}

#buttons-ticker-track {
  display: inline-block;
  white-space: nowrap;
  animation: buttons-scroll 30s linear infinite;
}

#buttons-ticker-content img {
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
  margin: 0 4px;
  border-style: solid;
  border-width: 1px;
  border-color: var(--border-sunken);
  vertical-align: middle;
}

@keyframes buttons-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Add these to styles.css */
.highlight  { color: #000080; font-weight: bold; }
.blink      { animation: blink 1s step-end infinite; }
.glow       { text-shadow: 0 0 6px #000080; }