* {
  box-sizing: border-box;
}

:root {
  --bg-image: url('../img/bluey.jpg');
  --bg-color: #add8e6;
  --text-color: #ff00ff;
  --heading-color: #0000ff;
  --link-color: #0000ff;
  --link-visited-color: #a020f0;
  --link-hover-bg: #ffff00;
  --link-hover-text: #000;
  --main-content-bg: rgba(255, 255, 255, 0.8);
  --border-color: #0000ff;
  --shadow-color: #ff00ff;

  --wr-bg: #ffffff;
  --wr-text: #1e293b;
  --wr-border: #dce4ea;
  --wr-border-width: 1px;
  --wr-radius: 8px;
  --wr-header-bg: #334155;
  --wr-header-text: #ffffff;
  --wr-align: left;
  --wr-show-desc: block;
  --wr-btn-bg: #f1f5f9;
  --wr-btn-border: #cbd5e1;
  --wr-btn-text: #1e293b;
}

body.theme-yleista {
  --bg-image: url('../img/Pine_.jpg');
  --bg-color: #2d5a27;
  --text-color: #ffffff;
  --heading-color: #ffff00;
  --border-color: #ffff00;
  --shadow-color: #000000;
  --main-content-bg: rgba(0, 0, 0, 0.6);
}

body.theme-horses {
  --bg-image: url('../img/fondo_purplestars.gif');
  --bg-color: #2b0040;
  --text-color: #ffffff;
  --heading-color: #e0b0ff;
  --border-color: #e0b0ff;
  --shadow-color: #4b0082;
  --main-content-bg: rgba(43, 0, 64, 0.7);
}

body.theme-horses a {
  background-color: #e6e6fa;
  /* Lavender */
  color: #2b0040;
  /* Dark purple text for contrast on light background */
  padding: 0 2px;
  border-radius: 3px;
}

body.theme-horse-profile {
  --bg-image: url('../img/pastelstarz.gif');
  --bg-color: #fce4ff;
  --text-color: #8a2be2;
  --heading-color: #8a2be2;
  --border-color: #ffb6c1;
  --shadow-color: #ff69b4;
  --main-content-bg: rgba(255, 255, 255, 0.85);
}

body.theme-toiminta {
  --bg-image: url('../img/bg_prettyinpink.gif');
  --bg-color: #ffc0cb;
  --text-color: #d10074;
  --heading-color: #ff1493;
  --border-color: #ff69b4;
  --shadow-color: #ffb6c1;
  --main-content-bg: rgba(255, 255, 255, 0.85);
}

body.theme-hoitajat {
  --bg-image: url('../img/stars5.gif');
  --bg-color: #000022;
  --text-color: #ffffff;
  --heading-color: #00ffff;
  --border-color: #00ffff;
  --shadow-color: #000080;
  --main-content-bg: rgba(0, 0, 34, 0.75);
}

body.theme-muuta {
  --bg-image: url('../img/apple.gif');
  --bg-color: #e8f5e9;
  --text-color: #2e7d32;
  --heading-color: #c62828;
  --border-color: #43a047;
  --shadow-color: #a5d6a7;
  --main-content-bg: rgba(255, 255, 255, 0.9);
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-image);
  background-repeat: repeat;
  color: var(--text-color);
  font-family: "Times New Roman", Times, serif;
  margin: 0;
  padding: 20px;
  text-align: center;
}

h1 {
  color: var(--heading-color);
  font-weight: bold;
  font-size: 2.5em;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

h2,
h3 {
  color: var(--heading-color);
  font-weight: bold;
}

a {
  color: var(--link-color);
  font-weight: bold;
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited-color);
}

a:hover {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-text);
}

p {
  font-size: 1.1em;
  line-height: 1.4;
  margin: 15px 0;
}

hr {
  border: 0;
  height: 2px;
  background-color: #808080;
  width: 60%;
  margin: 20px auto;
}

body.theme-yleista hr {
  background-image: url('../img/vine11.gif');
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: 0;
  height: 60px;
  width: 100%;
  margin: 40px auto;
  background-size: contain;
}

body.theme-horses hr {
  background-image: url('../img/rainbowhearts2.png');
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: 0;
  height: 15px;
  width: 100%;
  margin: 15px auto;
  background-size: contain;
}

body.theme-horse-profile hr {
  background-image: url('../img/pinkstars.png');
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: 0;
  height: 25px;
  width: 100%;
  margin: 15px auto;
  background-size: contain;
}

body.theme-toiminta hr {
  background-image: url('../img/glitterpink.gif');
  background-repeat: repeat-x;
  background-position: center;
  background-color: transparent;
  border: 0;
  height: 30px;
  width: 100%;
  margin: 20px auto;
  background-size: contain;
}

body.theme-hoitajat hr {
  background-image: url('../img/bluegrass.gif');
  background-repeat: repeat-x;
  background-position: center;
  background-color: transparent;
  border: 0;
  height: 40px;
  width: 100%;
  margin: 30px auto;
  background-size: contain;
}

body.theme-muuta hr {
  background-image: url('../img/gummybears.png');
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: 0;
  height: 40px;
  width: 100%;
  margin: 20px auto;
  background-size: contain;
}

.main-content {
  background-color: var(--main-content-bg);
  padding: 30px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  box-shadow: 5px 5px 0px var(--shadow-color);
  margin-top: 20px;
  margin-bottom: 20px;
}

body.theme-hoitajat .main-content {
  border: 4px double var(--border-color);
}

body.theme-horses .main-content {
  background-color: var(--main-content-bg);
  background-clip: padding-box;
  border: 22px solid transparent;
  border-image-source: url('../img/heart-border.png');
  border-image-slice: 33;
  border-image-width: 22px;
  border-image-repeat: round;
  border-radius: 0;
  box-shadow: none;
  position: relative;
}

body.theme-horse-profile .main-content {
  background-color: var(--main-content-bg);
  border: 6px dotted var(--border-color);
  border-radius: 10px;
  padding: 30px;
  margin-top: 20px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: none;
}

.main-content img {
  max-width: 100%;
  height: auto;
}

body.theme-muuta .main-content img:not(.divider-icon) {
  max-height: 100px;
  width: auto;
}

body.theme-yleista .main-content img {
  border: 3px double var(--border-color);
  padding: 4px;
  background-color: #fff;
  margin: 15px auto 5px auto;
  display: block;
}

.main-content small {
  display: block;
  margin-bottom: 20px;
  font-size: 0.8em;
  opacity: 0.8;
}

body.theme-yleista .main-content ul {
  list-style: none;
  /* Hide default bullets */
  padding-left: 0;
}

body.theme-yleista .main-content li {
  position: relative;
  padding-left: 25px;
  list-style: none;
}

body.theme-yleista .main-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  /* Reduced size */
  height: 14px;
  /* Reduced size */
  background-image: url('../img/yellow1.gif');
  background-size: contain;
  background-repeat: no-repeat;
}

body.theme-toiminta .main-content ul {
  list-style: none;
  padding-left: 0;
}

body.theme-toiminta .main-content li {
  position: relative;
  padding-left: 25px;
  list-style: none;
}

body.theme-toiminta .main-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  background-image: url('../img/pink.png');
  background-size: contain;
  background-repeat: no-repeat;
}

body.theme-hoitajat .main-content ul {
  list-style: none;
  padding-left: 0;
}

body.theme-hoitajat .main-content li {
  position: relative;
  padding-left: 25px;
  list-style: none;
}

body.theme-hoitajat .main-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  background-image: url('../img/star72.gif');
  background-size: contain;
  background-repeat: no-repeat;
}

body.theme-horse-profile .main-content ul {
  list-style: none;
  padding-left: 0;
}

body.theme-horse-profile .main-content li {
  position: relative;
  padding-left: 25px;
  list-style: none;
}

body.theme-horse-profile .main-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  background-image: url('../img/pink20.gif');
  background-size: contain;
  background-repeat: no-repeat;
}

.main-content ul,
.main-content ol {
  text-align: left;
  display: inline-block;
  margin: 10px auto;
}

.main-content ol {
  padding-left: 40px;
  /* Keep standard padding for ordered lists */
}

.main-content li {
  margin-bottom: 8px;
}

/* Retro Table Styling */
.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border: 2px solid var(--border-color);
  background-color: transparent;
  table-layout: fixed; /* Ensures equal column distribution */
}

body.theme-hoitajat .main-content th {
  color: #000022;
  text-shadow: none;
}

/* Time column (first) */
.main-content th:first-child,
.main-content td:first-child {
  width: 12%; 
  /* The remaining 88% is divided equally among the 7 days (~12.5% each) */
}

.main-content th {
  background-color: var(--border-color);
  color: #fff;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  padding: 10px 4px; /* Reduced side padding slightly for narrower columns */
  font-weight: bold;
  border: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9em;
}

.main-content td {
  padding: 8px;
  border: 1px dotted var(--border-color);
  text-align: center;
  font-size: 0.95em;
}

.main-content tr:nth-child(even) td {
  background-color: rgba(128, 128, 128, 0.15);
}

.main-content tr:hover td {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-text);
  cursor: default;
}

.divider-icon {
  display: block;
  margin: 10px auto;
  max-width: 100%;
}

.nav-section {
  text-align: left;
  display: inline-block;
  width: 300px;
  margin: 10px;
}

.nav-title {
  font-weight: bold;
  color: var(--text-color);
  display: block;
  margin-bottom: 5px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.nav-item img {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.nav-item a {
  color: var(--link-color);
  text-decoration: underline;
  margin-left: 5px;
}

.footer-info {
  font-size: 0.8em;
  font-style: italic;
  color: var(--text-color);
  margin-top: 30px;
}

/* Mobile responsive styles */
@media screen and (max-width: 600px) {
  body {
    padding: 10px;
  }

  h1 {
    font-size: 1.8em;
    letter-spacing: 1px;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }

  h2,
  h3 {
    font-size: 1.4em;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .main-content {
    padding: 15px;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .nav-section {
    width: 100%;
    margin: 10px 0;
  }

  hr {
    width: 90%;
  }

  body.theme-horses .main-content {
    border-width: 12px;
    border-image-width: 12px;
  }

  .nav-item {
    font-size: 0.95em;
  }
}

/* 90s-00s Film Photo Effect */
.retro-film-container {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 0;
  background: #ffffff;
}

.retro-film-effect {
  filter: contrast(110%) saturate(110%) brightness(90%) sepia(5%);
  transition: filter 0.3s ease;
}

/* Tint Overlay (Pink multiply) */
.retro-film-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background-color: #fa00cc;
  mix-blend-mode: multiply;
  opacity: 0.10;
}

/* Grain texture - own element inside .retro-film-container */
.retro-film-grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  background-image: url("https://www.transparenttextures.com/patterns/dotnoise-light-grey.png");
  opacity: 0.4;
}

/* Vignette Blur (edges only) */
.retro-film-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;

  /* Backdrop blur blurs what's underneath (the image + tint) */
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);

  /* Mask reveals ONLY the blurred edges, keeping center sharp */
  mask-image: radial-gradient(circle, transparent 25%, black 95%);
  -webkit-mask-image: radial-gradient(circle, transparent 25%, black 95%);
}