/* Retro homestead components (task 6.2): banner, counter, badges, dividers,
   marquee, decorations. Webring widget styles are further down.
   Loaded only by homestead/base_homestead.html. Pure CSS: no images, no JS.
   Animations are slow (no flashing faster than 1 Hz) and disabled entirely
   under prefers-reduced-motion at the bottom of this file. */

/* ---------- 1. Under-construction banners ---------- */
.banner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px auto;
  padding: 8px 10px;
  max-width: 100%;
  border: 4px ridge #ffcc00;
  background: repeating-linear-gradient(45deg, #ffcc00 0 16px, #000000 16px 32px);
  color: #000000;
  font: bold 18px/1.2 Impact, "Arial Black", sans-serif;
  letter-spacing: 2px;
  text-align: center;
}
.banner-text {
  padding: 2px 10px;
  border: 2px solid #000000;
  background: #ffcc00;
  color: #000000;
  animation: banner-glow 3s ease-in-out infinite;
}
.banner-icon {
  font-size: 28px;
  display: inline-block;
  animation: banner-bob 2s ease-in-out infinite;
}
.banner-icon-right { animation-delay: 1s; }
.banner-permanent {
  background: repeating-linear-gradient(-45deg, #ffcc00 0 16px, #000000 16px 32px);
}
.banner-warning-sign {
  border-color: #ff0000;
  background: #ffff00;
  color: #ff0000;
  border-style: double;
}
.banner-warning-sign .banner-text { background: #ffff00; border-color: #ff0000; color: #ff0000; }
.banner-cones {
  background: repeating-linear-gradient(90deg, #ff6600 0 24px, #ffffff 24px 36px);
  border-color: #ff6600;
}
.banner-cones .banner-icon { color: #ff6600; text-shadow: 1px 1px 0 #000000; }
.banner-cones .banner-text { background: #ffffff; }

.banner-flashing-notice {
  border-color: #ff0000;
  background: repeating-linear-gradient(90deg, #ff0000 0 12px, #ffff00 12px 24px);
}
.banner-flashing-notice .banner-text {
  background: #ffff00;
  color: #ff0000;
  border-color: #ff0000;
  animation: banner-flash 2s steps(1, end) infinite; /* 0.5 flashes per second */
}
.banner-workers {
  background: repeating-linear-gradient(-45deg, #ff9900 0 16px, #333333 16px 32px);
  border-color: #ff9900;
}
.banner-workers .banner-text { background: #ff9900; }
.banner-workers .banner-icon { animation: banner-hammer 1.5s ease-in-out infinite; transform-origin: 50% 100%; }
.banner-workers .banner-icon-right { animation-delay: 0.75s; }
@keyframes banner-flash {
  0%, 100% { background: #ffff00; color: #ff0000; }
  50% { background: #ff0000; color: #ffff00; }
}
@keyframes banner-hammer {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}
@keyframes banner-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
@keyframes banner-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ---------- 2. Visitor counter ---------- */
.visitor-counter {
  margin: 14px auto;
  text-align: center;
}
.visitor-counter p { margin: 2px 0; }
.visitor-counter-label {
  font: bold 12px/1.2 "Courier New", Courier, monospace;
  letter-spacing: 2px;
  color: var(--text, #000000);
}
.visitor-counter-digits {
  display: inline-flex;
  padding: 3px;
  border: 3px inset #808080;
  background: #000000;
}
.visitor-digit {
  display: inline-block;
  min-width: 1ch;
  margin: 0 1px;
  padding: 2px 5px;
  border: 1px solid #333333;
  background: #111111;
  color: #ff2200;
  font: bold 24px/1.1 "Courier New", Courier, monospace;
  text-shadow: 0 0 4px #ff2200;
}
.visitor-counter-mechanical .visitor-digit {
  border: 2px outset #cccccc;
  background: linear-gradient(180deg, #f4f4f4 0%, #f4f4f4 48%, #bbbbbb 50%, #e8e8e8 52%, #e8e8e8 100%);
  color: #111111;
  font-family: Georgia, serif;
  text-shadow: none;
}
.visitor-counter-mechanical .visitor-counter-digits { background: #333333; border-style: ridge; }

/* ---------- 3. 88x31 badges (original, CSS-drawn) ---------- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.badge {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 31px;
  overflow: hidden;
  border: 2px outset #c0c0c0;
  background: #000080;
  color: #ffffff;
  font: bold 8px/1 Verdana, Geneva, sans-serif;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-top { font-size: 7px; letter-spacing: 0.5px; }
.badge-bottom { font-size: 9px; color: #ffff00; }
.badge-built-with-kiro { background: linear-gradient(180deg, #6600cc, #220066); }
.badge-best-viewed-800x600 { background: #008080; }
.badge-made-for-the-www { background: linear-gradient(90deg, #003399, #0099ff); }
.badge-best-viewed-in-a-web-browser { background: #c0c0c0; color: #000000; border-style: inset; }
.badge-best-viewed-in-a-web-browser .badge-bottom { color: #000080; }
.badge-ai-ready { background: #000000; color: #00ff00; }
.badge-ai-ready .badge-bottom { color: #00ff00; }
.badge-y2k-compliant { background: repeating-linear-gradient(90deg, #cc0000 0 8px, #880000 8px 16px); }
.badge-optimized-for-56k { background: #336600; }
.badge-valid-html-4 { background: #ffffff; color: #000000; border-color: #808080; }
.badge-valid-html-4 .badge-bottom { color: #cc0000; }
.badge-permanently-under-construction {
  background: repeating-linear-gradient(45deg, #ffcc00 0 6px, #000000 6px 12px);
  color: #000000;
}
.badge-permanently-under-construction .badge-top,
.badge-permanently-under-construction .badge-bottom {
  padding: 0 2px;
  background: #ffcc00;
  color: #000000;
  font-size: 6px;
}
.badge-artificially-intelligent { background: linear-gradient(135deg, #ff00cc, #3300ff); }
.badge-artificially-intelligent .badge-top,
.badge-artificially-intelligent .badge-bottom { font-size: 5px; color: #ffffff; }

/* ---------- 4. Dividers ---------- */
.divider {
  box-sizing: border-box;
  width: 100%;
  height: 8px;
  margin: 12px 0;
  padding: 0;
}
.divider-rainbow {
  height: 6px;
  background: linear-gradient(90deg, #ff0000, #ff9900, #ffff00, #33cc33, #0099ff, #6633cc, #ff00cc);
}
.divider-metallic {
  height: 8px;
  border-top: 1px solid #ffffff;
  border-bottom: 1px solid #555555;
  background: linear-gradient(180deg, #eeeeee, #888888 50%, #cccccc);
}
.divider-stars {
  height: 20px;
  overflow: hidden;
  color: var(--heading, #000000);
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
}
.divider-stars::before {
  content: "\2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606 \2605 \2606";
}
.divider-flames {
  height: 18px;
  background:
    radial-gradient(ellipse 8px 14px at 50% 100%, #ffcc00 0 60%, transparent 62%) 0 0 / 16px 18px repeat-x,
    radial-gradient(ellipse 12px 18px at 50% 100%, #ff3300 0 70%, transparent 72%) 8px 0 / 24px 18px repeat-x,
    linear-gradient(0deg, #cc0000, transparent 40%);
}
.divider-stripes {
  height: 12px;
  background: repeating-linear-gradient(45deg, #ffcc00 0 10px, #000000 10px 20px);
}
.divider-bevel {
  height: 0;
  border-top: 3px groove #808080;
  border-bottom: 0;
}

/* ---------- 5. Marquee (CSS animation; the <marquee> element is never used) ---------- */
.marquee {
  box-sizing: border-box;
  overflow: hidden;
  margin: 8px 0;
  padding: 3px 0;
  border-top: 2px solid var(--heading, #000000);
  border-bottom: 2px solid var(--heading, #000000);
  color: var(--heading, #000000);
  font-weight: bold;
  white-space: nowrap;
}
.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-scroll 14s linear infinite;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---------- 6. Animated decorations (CSS only; glyphs are decorative) ---------- */
.homestead-decorations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  min-height: 0;
}
.decoration {
  display: inline-block;
  width: 40px;
  height: 40px;
  font-size: 32px;
  line-height: 40px;
  text-align: center;
}
.decoration::before { display: block; }
.decoration-spinning-globe::before { content: "\1F310"; animation: deco-spin 6s linear infinite; }
.decoration-spinning-cd::before { content: "\1F4BF"; animation: deco-spin 3s linear infinite; }
.decoration-animated-envelope::before { content: "\2709"; animation: deco-bob 2s ease-in-out infinite; }
.decoration-dancing-baby-robot::before { content: "\1F916"; animation: deco-dance 2s ease-in-out infinite; }
.decoration-fire::before { content: "\1F525"; animation: deco-flicker 2s ease-in-out infinite; }
.decoration-flying-saucer::before { content: "\1F6F8"; animation: deco-fly 6s ease-in-out infinite; }
.decoration-rotating-computer::before { content: "\1F5A5"; animation: deco-spin 8s linear infinite; }
.decoration-sparkling-stars::before { content: "\2728"; animation: deco-sparkle 2s ease-in-out infinite; }
.decoration-animated-arrow::before { content: "\27A1"; animation: deco-nudge 1.5s ease-in-out infinite; }
.decoration-spinning-question-mark::before { content: "?"; font-weight: bold; color: var(--heading, #000000); animation: deco-spin 4s linear infinite; }

@keyframes deco-spin { to { transform: rotate(360deg); } }
@keyframes deco-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes deco-dance {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
}
@keyframes deco-flicker {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15, 0.9); opacity: 0.85; }
}
@keyframes deco-fly {
  0%, 100% { transform: translateX(-14px) rotate(-6deg); }
  50% { transform: translateX(14px) rotate(6deg); }
}
@keyframes deco-sparkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.8); opacity: 0.6; }
}
@keyframes deco-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .banner { font-size: 14px; gap: 6px; }
  .banner-icon { font-size: 20px; }
  .visitor-digit { padding: 2px 3px; font-size: 20px; }
}

/* ---------- Webring widgets + neighbour request (fixed colours, theme-proof) ---------- */
.webring-section { margin: 8px auto; }
.webring-widget {
  box-sizing: border-box;
  margin: 8px auto;
  padding: 6px 10px;
  background: #000066;
  color: #ffffff;
  border: 3px ridge #c0c0c0;
  font: bold 13px Verdana, Arial, sans-serif;
  text-align: center;
  text-shadow: none;
}
.webring-widget p { margin: 3px 0; color: #ffffff; }
.webring-heading { color: #ffff00 !important; text-transform: uppercase; letter-spacing: 1px; overflow-wrap: anywhere; }
.webring-description { font-weight: normal; font-size: 12px; overflow-wrap: anywhere; }
.webring-widget a:link, .webring-widget a:visited { color: #66ccff; text-decoration: underline; }
.webring-widget a:hover, .webring-widget a:focus { color: #ffff00; }
.webring-count, .webring-origin { font-weight: normal; font-size: 12px; }
/* Highlighted: the ring the visitor arrived from. Dashed border that marches. */
.webring-highlight {
  border: 3px dashed #ffff00;
  background: linear-gradient(90deg, #ffff00 50%, transparent 50%) 0 0 / 16px 3px repeat-x,
              #000066;
  animation: webring-march 1.2s linear infinite;
}
@keyframes webring-march { to { background-position: 16px 0; } }
/* Original pixel-style badge, drawn in CSS (static). */
.webring-ai-badge {
  display: inline-block; box-sizing: border-box; width: 88px; height: 31px; padding: 2px;
  font: bold 9px/12px Verdana, Arial, sans-serif; text-transform: uppercase;
  background: #003300; color: #00ff00 !important; border: 2px outset #66cc66;
  vertical-align: middle; text-align: center; letter-spacing: 0;
}
.neighbour-request { margin: 8px auto; text-align: center; }
.neighbour-request-button {
  padding: 3px 10px;
  background: #c0c0c0;
  color: #000000;
  border: 2px outset #ffffff;
  font: bold 12px Verdana, Arial, sans-serif;
  cursor: pointer;
}
.neighbour-request-button:active { border-style: inset; }

/* ---------- Guestbook (fixed colours, theme-proof) ---------- */
.guestbook {
  box-sizing: border-box;
  max-width: 560px;
  margin: 12px auto;
  padding: 8px 12px;
  background: #fffff0;
  color: #000000;
  border: 3px ridge #808080;
  font: 14px "Times New Roman", Times, serif;
  text-align: left;
  text-shadow: none;
}
.guestbook p, .guestbook label { color: #000000; margin: 4px 0; }
.guestbook-heading {
  margin: 0 0 6px;
  padding: 2px;
  background: #000080;
  color: #ffff00;
  font: bold 18px "Times New Roman", Times, serif;
  text-align: center;
  text-shadow: none;
}
.guestbook a:link, .guestbook a:visited { color: #0000ee; text-decoration: underline; }
.guestbook-form textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 3px 0;
  background: #ffffff;
  color: #000000;
  border: 2px inset #808080;
  font: 14px "Courier New", Courier, monospace;
}
.guestbook-button {
  padding: 2px 10px;
  background: #c0c0c0;
  color: #000000;
  border: 2px outset #ffffff;
  font: 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
}
.guestbook-button:active { border-style: inset; }
.guestbook-error { color: #cc0000 !important; font-weight: bold; }
.guestbook-entries { list-style: none; margin: 8px 0 0; padding: 0; }
.guestbook-entry { margin: 0 0 6px; padding: 4px 0; border-top: 1px dashed #808080; }
.guestbook-meta { font-size: 12px; color: #000080 !important; }
.guestbook-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.guestbook-delete { margin: 2px 0 0; }

/* ---------- Keyboard focus: visible on every themed control ---------- */
.homestead-page a:focus,
.homestead-page a:focus-visible {
  outline: 2px dashed currentColor;
  outline-offset: 2px;
}
.webring-widget a:focus,
.cyberstead-footer a:focus,
.guestbook a:focus,
.guestbook-button:focus,
.guestbook-form textarea:focus,
.neighbour-request-button:focus {
  outline: 2px solid #ff6600;
  outline-offset: 2px;
}
.webring-widget a:focus { outline-color: #ffff00; }
/* ---------- BannerSwap (468x60 banner exchange) ----------
   Colours, font and background come ONLY from --bs-bg / --bs-text / --bs-font
   set inline on the banner from the advertised site's own config. Nothing
   here reads the Host's body variables, so the Host theme cannot leak in. */
.bannerswap-wrap {
  box-sizing: border-box;
  max-width: 100%;
  margin: 14px auto;
  text-align: center;
}
.bannerswap-banner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(468px, 100%);
  aspect-ratio: 468 / 60;
  margin: 0 auto;
  padding: 2px 6px;
  overflow: hidden;
  text-align: left;
  text-decoration: none;
  border: 3px outset #c0c0c0;
  background-color: var(--bs-bg, #ffffff);
  color: var(--bs-text, #000000);
  font-family: var(--bs-font, "Times New Roman", Times, serif);
  line-height: 1.1;
}
.bannerswap-banner:visited { color: var(--bs-text, #000000); }
.bannerswap-banner:hover { border-style: groove; }
.bannerswap-banner:active { border-style: inset; }
.bannerswap-banner:focus { outline: 2px solid #ff6600; outline-offset: 2px; }
.bannerswap-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.bannerswap-title {
  font-size: clamp(11px, 3.6vw, 18px);
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bannerswap-tagline {
  font-size: clamp(9px, 2.8vw, 13px);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bannerswap-meta {
  font-size: clamp(8px, 2.2vw, 10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}
.bannerswap-icon {
  flex: 0 0 auto;
  font-size: clamp(16px, 5vw, 28px);
  line-height: 1;
}
.bannerswap-cta {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 2px outset #dddddd;
  background: #ffff00;
  color: #cc0000;
  font: bold clamp(9px, 2.6vw, 12px) Arial, Helvetica, sans-serif;
  white-space: nowrap;
  animation: bannerswap-blink 2s steps(1, end) infinite;
}
@keyframes bannerswap-blink {
  0%, 60% { background: #ffff00; }
  61%, 100% { background: #ffcc00; }
}

/* Layouts */
.bannerswap-layout-stacked { flex-direction: column; justify-content: center; text-align: center; gap: 0; }
.bannerswap-layout-stacked .bannerswap-icon,
.bannerswap-layout-stacked .bannerswap-meta { display: none; }
.bannerswap-layout-stacked .bannerswap-cta { position: static; padding: 0 5px; }
.bannerswap-layout-badge-left .bannerswap-icon {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-right: 6px;
  border-right: 2px ridge currentColor;
}

/* Background patterns (same tiles as the page backgrounds, scoped to the banner) */
.bannerswap-bg-solid { background-image: none; }
.bannerswap-bg-starfield { background-image: url("../images/backgrounds/starfield.svg"); background-size: 64px 64px; }
.bannerswap-bg-flames { background-image: url("../images/backgrounds/flames.svg"); background-size: 24px 32px; }
.bannerswap-bg-brick { background-image: url("../images/backgrounds/brick.svg"); background-size: 32px 16px; }
.bannerswap-bg-marble { background-image: url("../images/backgrounds/marble.svg"); background-size: 100px 100px; }
.bannerswap-bg-clouds { background-image: url("../images/backgrounds/clouds.svg"); background-size: 100px 60px; }
.bannerswap-bg-paw-prints { background-image: url("../images/backgrounds/paw-prints.svg"); background-size: 48px 48px; }
.bannerswap-bg-checkerboard {
  background-image: conic-gradient(
    rgba(0, 0, 0, 0.35) 0 25%, rgba(255, 255, 255, 0.4) 0 50%,
    rgba(0, 0, 0, 0.35) 0 75%, rgba(255, 255, 255, 0.4) 0);
  background-size: 24px 24px;
}
.bannerswap-bg-brushed-metal {
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 1px, rgba(0, 0, 0, 0.22) 1px 2px, transparent 2px 3px);
}
.bannerswap-bg-circuit-board {
  background-image:
    linear-gradient(90deg, rgba(0, 255, 120, 0.5) 1px, transparent 1px),
    linear-gradient(rgba(0, 255, 120, 0.5) 1px, transparent 1px);
  background-size: 25px 25px;
}
.bannerswap-bg-neon-geometry {
  background-image:
    linear-gradient(135deg, rgba(255, 0, 255, 0.5) 25%, transparent 25%),
    linear-gradient(225deg, rgba(0, 255, 255, 0.5) 25%, transparent 25%);
  background-size: 30px 30px;
}
.bannerswap-bg-rainbow-gradient {
  background-image: linear-gradient(90deg, #ff0000, #ff9900, #ffff00, #33cc33, #0099ff, #6633cc, #ff00cc);
}

/* Optional banner animations (slow, never faster than 1 Hz) */
.bannerswap-anim-blink .bannerswap-title { animation: bannerswap-title-blink 2s steps(1, end) infinite; }
@keyframes bannerswap-title-blink { 0%, 70% { opacity: 1; } 71%, 100% { opacity: 0.35; } }
.bannerswap-anim-pulse { animation: bannerswap-pulse 3s ease-in-out infinite; }
@keyframes bannerswap-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.3); } }
.bannerswap-anim-slide .bannerswap-tagline { animation: bannerswap-slide 6s ease-in-out infinite alternate; }
@keyframes bannerswap-slide { 0% { transform: translateX(0); } 100% { transform: translateX(6px); } }

/* House banner: fixed Cyberstead look, no per-site variables */
.bannerswap-house {
  background-color: #000080;
  background-image: url("../images/backgrounds/starfield.svg");
  background-size: 64px 64px;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  border-color: #6699ff;
}
.bannerswap-house:visited { color: #ffffff; }
.bannerswap-house .bannerswap-title { color: #ffff00; text-shadow: 1px 1px 0 #000000; }

.bannerswap-credit {
  margin: 2px 0 0;
  font: 9px Arial, Helvetica, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- Reduced motion: everything holds still ---------- */
@media (prefers-reduced-motion: reduce) {
  .bannerswap-cta,
  .bannerswap-anim-blink .bannerswap-title,
  .bannerswap-anim-pulse,
  .bannerswap-anim-slide .bannerswap-tagline { animation: none !important; }
  .banner-text,
  .banner-icon,
  .banner-flashing-notice .banner-text,
  .banner-workers .banner-icon,
  .decoration::before {
    animation: none !important;
  }
  .marquee { white-space: normal; }
  .marquee-text {
    display: block;
    padding-left: 0;
    text-align: center;
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .webring-highlight { animation: none; background: #000066; }
}
