/* Define custom properties (CSS variables) */
:root {
  /* Light mode */
  --bg-color: #f5f5f5;
  --text-color: #333;
  --header-bg-color: #4CAF50;
  --footer-bg-color: #f3f3f3;
  --link-color: #1d70b8; /* Updated link color for light mode */
  --hover-link-color: #003078;
  --visited-link-color: #4c2c92;
  --hover-bg-color: #4CAF50;
  --card-bg-color: #ffffff;
  --card-shadow-color: rgba(0, 0, 0, 0.1);

  /* Dark mode */
  --bg-color-dark: #1c1c1c;
  --text-color-dark: #e0e0e0;
  --header-bg-color-dark: #fcfcfc;
  --footer-bg-color-dark: #1c1c1c;
  --link-color-dark: white;
  --hover-link-color-dark: #ccc; /* Slightly lighter shade for hover state */
  --visited-link-color-dark: #eeebeb; /* Adjust as needed to differentiate visited links */
  --hover-bg-color-dark: #4CAF50;
  --card-bg-color-dark: #2b2b2b;
  --card-shadow-color-dark: rgba(0, 0, 0, 0.3);
}

/* Menu Button Link Styles */
.menu-button a {
  color: white; /* Default link color */
}

.menu-button a:hover,
.menu-button a:focus {
  color: #ccc; /* Lighter color for hover and focus state */
  text-decoration: none; /* Remove underline */
}

.menu-button a:visited {
  color: #bbb; /* Visited link color */
}

/* General link styles */
a {
  color: var(--link-color);
  text-decoration: underline; /* Underlined to clearly indicate a link */
}

a:hover, a:focus {
  color: var(--hover-link-color); /* Darker blue for hover and focus states */
  text-decoration: none; /* Remove underline to indicate interaction */
}

a:visited {
  color: var(--visited-link-color); /* Purple for visited links */
}

/* Dark mode link styles */
.dark-mode a {
  color: var(--link-color-dark);
}

.dark-mode a:hover, .dark-mode a:focus {
  color: var(--hover-link-color-dark);
  text-decoration: none;
}

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

/* Header navigation link styles */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  list-style: none;
  background: rgba(0, 0, 0, 0.5); /* Dark transparent background */
  padding: 1rem;
  border-radius: 8px;
  max-width: fit-content;
  margin: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav a {
  color: white; /* Keep text color white for good contrast */
  text-decoration: none;
  padding: 0.75rem 1rem;
  transition: background 0.3s, color 0.3s, transform 0.3s;
  border-radius: 4px;
  display: inline-block;
  margin: 0.25rem;
}

.nav a:hover,
.nav a:focus {
  background: rgba(255, 255, 255, 0.2); /* Light transparent background for a hover effect */
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Footer link styles */
footer a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover,
footer a:focus {
  color: var(--text-color);
  text-decoration: underline;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.site-name {
  font-family: 'Open Sans', cursive;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: 'Open Sans', Arial, sans-serif;
  background-color: var(--bg-color);
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.title {
  display: flex;
  align-items: center;
  font-family: 'Pacifico', cursive;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
  white-space: nowrap; /* Prevent text wrapping */
  overflow: hidden;
  text-overflow: ellipsis; /* Add ellipsis if text is too long */
}

@media (max-width: 768px) {
  .title {
    font-size: 1.5em; /* Reduce font size further for smaller screens */
    line-height: 1.2; /* Adjust line height to fit better on mobile */
  }
}

header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background-image: url('/img/1500x350.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--header-bg-color);
  color: white;
  padding: 4rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 0;
  width: 100%;
  margin: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  header {
    padding: 2rem; /* Reduce padding for smaller screens */
  }
}

/* Wrapper for main content */
.wrapper {
  background-color: var(--card-bg-color);
  max-width: 1000px;
  width: 100%;
  box-shadow: 0 4px 8px var(--card-shadow-color);
  padding: 2rem;
  margin: 2rem auto;
  border-radius: 8px;
}

main {
  flex: 1;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
}

main h2 {
  font-weight: 600;
  border-bottom: 2px solid var(--background);
  padding-bottom: 0.5rem;
  font-size: 1.75em;
  line-height: 1.2;
}

main h1 {
  font-size: 2em;
  line-height: 1.2;
}

@media (max-width: 768px) {
  main h1 {
    font-size: 1.5em; /* Reduce the size of h1 on mobile to prevent wrapping */
  }
  main h2 {
    font-size: 1.5em; /* Reduce the size of h2 on mobile to prevent wrapping */
  }
  main h3 {
    font-size: 1.25em; /* Reduce the size of h3 on mobile to prevent wrapping */
  }
}

main h3 {
  font-size: 1.5em;
  line-height: 1.2;
}

.card {
  background-color: var(--card-bg-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--card-shadow-color);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 8px var(--card-shadow-color);
}

main img {
  max-width: 100%;
  display: block;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--card-shadow-color);
}

button {
  background-color: var(--header-bg-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

button:hover {
  background-color: var(--hover-bg-color);
  transform: translateY(-3px);
}

footer {
  padding: 0.5rem;
  position: sticky;
  bottom: 0;
  width: 100%;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
  background-color: var(--footer-bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.dark-mode {
  --bg-color: var(--bg-color-dark);
  --text-color: var(--text-color-dark);
  --header-bg-color: var(--header-bg-color-dark);
  --footer-bg-color: var(--footer-bg-color-dark);
  --link-color: var(--link-color-dark);
  --hover-link-color: var(--hover-link-color-dark);
  --visited-link-color: var(--visited-link-color-dark);
  --hover-bg-color: var(--hover-bg-color-dark);
  --card-bg-color: var(--card-bg-color-dark);
  --card-shadow-color: var(--card-shadow-color-dark);
}

/* Dark mode toggle button styles */
#dark-mode-toggle {
  margin-left: 1rem;
  width: 50px;
  height: 24px;
  background-color: #ccc;
  border-radius: 34px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  will-change: transform;
}

#dark-mode-toggle:hover {
  transform: translateY(0);
  background-color: var(--hover-bg-color);
}

#dark-mode-toggle::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}

.dark-mode #dark-mode-toggle {
  background-color: var(--hover-bg-color);
}

.dark-mode #dark-mode-toggle::before {
  transform: translateX(26px);
}

/* Icon Styles */
#dark-mode-toggle .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: fill 0.3s;
}

#dark-mode-toggle .icon-light {
  color: #ffd700; /* Sun icon color */
}

#dark-mode-toggle .icon-dark {
  color: #ffffff; /* Moon icon color */
}

.dark-mode #dark-mode-toggle .icon-light {
  display: none;
}

.dark-mode #dark-mode-toggle .icon-dark {
  display: block;
}

#dark-mode-toggle .icon-light {
  display: block;
}

#dark-mode-toggle .icon-dark {
  display: none;
}

/* Responsive Typography */
body {
  font-size: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

p {
  font-size: 1rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  body {
    font-size: 1.125rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 2rem;
  }
}

/* Mobile-first Grid System */
.container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .container {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Responsive Navigation Adjustments */
@media (max-width: 768px) {
  .nav {
    flex-direction: column; /* Stack the menu items vertically */
    align-items: center;
  }

  .nav a {
    width: 100%; /* Make sure each link takes the full width on mobile */
    text-align: center; /* Center the text for better appearance */
    margin: 0.5rem 0; /* Add some spacing between links */
  }
}

* {
  box-sizing: border-box;
}

.tmpl-post {
  max-width: 800px; /* Set a wider max-width */
  margin: 0 auto; /* Center the content horizontally */
  padding: 0 2rem; /* Optional: Add some padding for better readability */
}

.two-column-layout {
  display: flex;
  gap: 20px;
  align-items: stretch; /* Make both columns the same height */
}

#current-data {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center content vertically */
  align-items: center; /* Center content horizontally */
}

.current-conditions {
  padding: 1rem !important;
  max-width: 350px !important; /* Remove max-width restriction */
  min-height: 468px !important;
  margin: 0px !important;
  border-radius:8px !important;
  border-width: 0;
  border-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 4px var(--card-shadow-color);
}

#tips {
  flex-direction: column;
  justify-content: center;
}

.tips-content {
  padding: 1rem;
  background-color: var(--card-bg-color);
  flex: 1; /* Ensure it stretches to fill the section */
  background-color: var(--card-bg-color);
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--card-shadow-color);
}

@media (max-width: 600px) {
  .two-column-layout {
    flex-direction: column;
  }
}

#tips ul li {
  margin-bottom: 10px; /* Add space between list items */
}

.tips-content ul {
  list-style: "✓  "; 
  padding-left: 20px; /* Add padding to align bullets */
  margin-top: 10px; /* Add space above the list */
}

.tips-content ul li {
  margin-bottom: 10px; /* Add space between list items */
  line-height: 1.6; /* Improve readability */
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}


.latest-news article {
  padding: 1rem;
  background-color: var(--card-bg-color);
  border: 1px solid #ccc;
  box-shadow: 0 2px 4px var(--card-shadow-color);
  border-radius: 8px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.latest-news article:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px var(--card-shadow-color);
}