/* ===== Reset some default styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Base HTML and Body styles ===== */
html, body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  background-color: #f9f9f9;
  color: #333;
  line-height: 1.6;
  /*overflow-x: hidden;*/ /* Prevent horizontal scrolling. Removed to enable sticky of .rightblock */
}

/* ===== Dividers ===== */
.divider {
  background-color: #000000;
  height: 5px;
  margin-top: 18px;
}

.divider2 {
  height: 2px;
  background-color: rgb(21, 96, 130);
}

.divider-CV { /* Assuming this is for CV specific dividers */
    height: 2px;
    background-color: #000000;
    margin-top: 5px;
    margin-bottom: 20px;
}

.subscribe {
display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start; /* Correct standard value to align to the start */
  flex-wrap: wrap;
}

.RSSfeed a {
  display: flex;
  align-items: center; /* This vertically centers the icon and text */
  justify-content: flex-start;
  gap: 10px; /* This adds some space between the icon and the text */
  margin: 0px 24px 0px 0px;
}

.RSSfeed img {
  height:auto;
}

.newsletter a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px; /* This adds some space between the icon and the text */
}

.newsletter img {
  height:auto;
  width: 42px;
}

.divider-card {
  height: 2px;
  background-color: rgb(0, 0, 0);
  margin-bottom: 12px;
  width: 100%;
  background-color: rgb(0, 0, 0); /* Black color */
  flex-shrink: 0; /* Prevent it from shrinking in a flex container */
}

/* ===== Overall Page Layout Container ===== */
/* This .layout class is the main wrapper for your entire page content. */
/* It ensures all content respects the 1600px max-width and is centered. */
.layout {
  max-width: 1400px; /* Max width for the entire page content */
  margin: 0 auto; /* Center the page content */
  padding: 0 20px; /* Horizontal padding for spacing from screen edges */
  text-align: left;
}

/* Specific layout for the top navigation (logo and buttons) */
/* IMPORTANT: Make sure your HTML div for the top navigation has this class: <div class="layout top-nav"> */
.layout.top-nav {
    display: flex; /* Use flexbox for horizontal alignment */
    flex-wrap: wrap; /* Allow items to wrap if screen is too narrow (before media query kicks in) */
    justify-content: space-between; /* Pushes logo to left, buttons to right */
    align-items: center; /* Vertically aligns logo and buttons */
    padding-top: 20px;
    padding-bottom: 10px;
}

/* Container for the navigation buttons to help with spacing and wrapping */
/* Add this to your HTML around your buttons: <div class="nav-buttons"> ... buttons ... </div> */
.navbar {
    display: flex; /* Make buttons a flex container */
    flex-wrap: wrap; /* Allow buttons to wrap to next line if needed */
    gap: 10px; /* Space between buttons */
    align-items: center; /* Vertically align buttons if they have different heights */
  justify-content: flex-start;
  gap: 10px; /* optional, adds spacing between buttons */
  margin: 10px 0;
}


/* ===== Main Content Section (Article area + Right Sidebar) ===== */
/* This mainsection now defines the side-by-side layout for desktop */
.mainsection {
  display: flex; /* Use flexbox for article and rightblock to sit side-by-side */
  gap: 20px; /* Space between article and rightblock */
  max-width: 1400px; /* Max width for the content area within the layout, can be same as .layout if desired */
  margin: 0 auto; /* Center within its container if it gets smaller than parent */
  padding: 20px 0; /* Vertical padding for the main content area */
  text-align: left;
  flex-wrap: nowrap; /* Prevent wrapping on desktop screens */
  align-items: flex-start; /* Align items to the top */
}

/* The Article Section - contains the article content or the article grid */
.article {
  flex-grow: 1; /* Allow article to grow and take available space */
  flex-shrink: 1; /* Allow it to shrink if needed */
  flex-basis: 0; /* Distribute space based on flex-grow */
  min-width: 60%; /* Ensure article doesn't shrink below a reasonable width on desktop */
}

/* ===== Images ===== */
/* General responsive image rule */
img {
  max-width: 100%; /* Images will not overflow their containers */
  height: auto;    /* Maintain aspect ratio */
  display: block;  /* Prevents extra space below images */
}

/* Default padded-img style (for desktop) */
.padded-img {
  padding-top: 20px;
  padding-right: 15px;
  padding-bottom: 0px;
  padding-left: 0px;
  height: 150px; /* Default height for desktop. IMPORTANT: Remove style="height: 150px;" from your HTML <img> tag. */
  vertical-align: middle; /* Retain alignment as specified */
  object-fit: contain; /* Prevents stretching if width changes too much */
}

.emblem {
  width: 50%; /* Default width for emblem */
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Right Sidebar Block ===== */
.rightblock {
  flex-shrink: 0; /* Prevent rightblock from shrinking */
  width: 300px; /* Fixed width for desktop */
  background-color: #f5f5f5;
  border-top: 2px solid rgb(21, 96, 130);
  padding: 6px; /* Reduced padding for consistency */
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  background-color: rgb(209, 211, 212);
  color: #333;
  line-height: 1.2;
  position: sticky; /* Sticky for desktop */
  top: 20px;
  align-self: flex-start; /* Align to the start of the flex container */
}

/* ===== Article Grid (for index.html) ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); /* Adaptive columns */
  gap: 20px;
}

/* ===== Article Cards ===== */
.article-card,
.article-card-emblem {
  position: relative;
  flex-direction: column;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  color: white; /* Default for overlay text, overridden by specific text colors */
  display: flex;
  overflow: hidden; /* Hide overflowing content */
  border-radius: 6px;
  transition: transform 0.2s ease;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin: 0;
  text-align: left;
}

.article-card img {
  width: 80%;
  height: auto;
  display: block;
  object-fit: cover;
  align-items: center;
  padding-left: 4px; /* Cover the card area */
}

.article-card-emblem img {
  width: 30%; /* Specific width for emblem in card */
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain; /* Contain within the area */
}

/* Hover effects for cards */
.article-card:hover .card-title,
.article-card:hover .card-meta,
.article-card:hover .card-text,
.article-card:hover h3,
.article-card-emblem:hover .card-title,
.article-card-emblem:hover .card-meta,
.article-card-emblem:hover .card-text,
.article-card-emblem:hover h3 {
  transform: scale(1.02);
  text-decoration: underline;
}

/* ===== Typography ===== */
h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  padding-left: 0px;
  font-size: 36px;
  color: #000000;
}
h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 100;
  padding-left: 0px;
  padding-bottom: 20px;
  font-size: 16px;
  color: #000000;
}
h3 {
  font-size: 18px;
  color: #000000;
  font-weight: bold;
  padding: 12px 12px 12px 12px; /* Uniform padding */
  text-align: left;
}

.articletitle {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 24px;
  padding-bottom: 14px;
  text-align: left;
}

.introtext {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  border-color: #000000;
  font-size: 24px;
  color: #000000;
  font-weight: 500;
  padding-top: 24px;
  padding-bottom: 24px;
}

.card-title {
  font-size: 20px;
  font-weight: bold;
  padding: 12px;
  text-align: left;
}

.card-meta {
  font-size: 12px;
  color: #555;
  padding: 4px 12px 12px 12px;
}

.card-text {
  font-size: 14px;
  color: #000000;
  padding: 4px 12px 12px 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.asidetext {
  margin: 12px 0px 12px 0px;
}

.asidesubscribe {
  display: flex;
  align-items: center; /* This vertically centers the icon and text */
  justify-content: flex-start;
  gap: 10px; /* This adds some space between the icon and the text */
  margin: 12px 0px 12px 0px;
}

.asidesubscribe img {
  height:auto;
  width: 24px;
  margin-left: 4px;
}

.aside-newsletter {
  display: flex;
  align-items: center; /* This vertically centers the icon and text */
  justify-content: flex-start;
  gap: 10px; /* This adds some space between the icon and the text */
  margin: 12px 0px 12px 0px;
}

.aside-newsletter img {
  height:auto;
  width: 32px;
}
/* ===== Links ===== */
a {
  color: #3498db;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Buttons ===== */
.btn {
  background-color: #000000;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 500;
  white-space: nowrap; /* Prevent text wrapping inside buttons */
  padding: 10px 15px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

/* Button hover effect */
.btn:hover {
  background-color: #2980b9;
}

/* ===== Footer ===== */
footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 1em 0;
  margin-top: 2em;
}

/* Basic styling for the modal and overlay */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 999;
}

#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 16px;
  border-radius: 8px;
  display: none;
  z-index: 1000;
}

#modal-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.close-button {
  display: flex;
  justify-content: flex-end;
  margin: 0px 0px 0px 0px;
  font-size: 42px;
  cursor: pointer;
}

.form-label {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 500;
  color:#000000;
}

.form-text{
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color:#000000;
}

.text-input {
  font-family: Arial, Helvetica, sans-serif;
  width: 50%;
  height: 32px;
  font-size: 16px;
}

.subscribe-disclaimer {
  margin-top: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}

.submit {
  background-color: #000000;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 500;
  white-space: nowrap; /* Prevent text wrapping inside buttons */
  padding: 10px 15px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

/* ========================================================================== */
/* ======================== MEDIA QUERIES FOR RESPONSIVENESS ======================== */
/* ========================================================================== */

/* --- Tablets and Smaller Phones (max-width: 768px) --- */
@media (max-width: 768px) {
  html, body {
    font-size: 15px; /* Slightly smaller base font size */
  }

  /* Adjust padding for the overall layout container on smaller screens */
  .layout {
    padding: 0 15px;
    max-width:1600px;
  }

  /* Adjust top navigation layout (logo + buttons) */
  .layout.top-nav {
    flex-direction: column; /* Stack logo and buttons vertically */
    align-items: center; /* Center items for a cleaner mobile header */
    padding-top: 15px;
    padding-bottom: 5px;
  }

  /* Container for navigation buttons on mobile */
  .nav-buttons {
      width: 100%; /* Make button container full width */
      flex-direction: column; /* Stack buttons vertically */
      gap: 10px; /* Gap between stacked buttons */
      margin-bottom: 15px; /* Padding below the buttons when stacked */
      display: flex;
      flex-wrap: wrap;
  }

  /* Specific padded-img style for mobile */
  .padded-img {
    height: 100px; /* Smaller logo on mobile */
    padding: 0; /* Remove padding for mobile */
    margin-bottom: 10px; /* Add space below logo when stacked */
  }

  .btn {
    width: 100%; /* Make navigation buttons full width */
    text-align: center; /* Center button text */
    margin: 0; /* Remove horizontal margin for stacked buttons */
  }

  /* Adjust main content layout (article + rightblock) */
  .mainsection {
    flex-direction: column; /* Stack main section and sidebar vertically */
    padding: 10px 0; /* Adjust vertical padding for smaller screens */
    gap: 30px; /* Space between stacked sections */
  }

  .article,
  .rightblock {
    flex: none; /* Remove flex sizing */
    width: 100%; /* Take full width */
    padding: 0; /* Reset padding to be handled by individual content */
    position: static; /* Remove sticky behavior on mobile */
    top: auto; /* Reset top property */
  }

  .rightblock {
    padding: 15px; /* Add some padding back for the sidebar content */
    border-top: 2px solid rgb(21, 96, 130); /* Re-add top border for separation if desired */
    border-radius: 8px; /* Add border-radius for a card-like appearance */
  }

  /* Adjust article grid for smaller screens */
  .article-grid {
    grid-template-columns: 1fr; /* Single column layout for articles */
    gap: 15px; /* Adjust gap */
  }

  /* Adjust typography for better readability on mobile */
  h1 {
    font-size: 28px;
  }
  h2 {
    font-size: 14px;
    padding-bottom: 10px;
  }
  h3 {
    font-size: 16px;
    padding: 8px;
  }
  .articletitle {
    font-size: 20px;
    padding-bottom: 10px;
  }
  .introtext {
    font-size: 20px;
    padding-top: 15px;
    padding-bottom: 15px;
  }
  .card-title {
    font-size: 18px;
    padding: 8px;
  }
  .card-meta, .card-text, .asidetext {
    font-size: 0.9em; /* Slightly smaller body text */
    padding: 8px 12px; /* Adjust padding for text within cards/aside */
  }
  .asidetext {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  #modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 16px;
  border-radius: 8px;
  display: none;
  z-index: 1000;
}

  .form-label {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 500;
  color:#000000;
}

.form-text{
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color:#000000;
}

.text-input {
  font-family: Arial, Helvetica, sans-serif;
  width: 80%;
  height: 32px;
  font-size: 14px;
}

.subscribe-disclaimer {
  margin-top: 9px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
}
}

/* --- Smaller Phones (max-width: 480px) --- */
@media (max-width: 480px) {
  html, body {
    font-size: 14px; /* Even smaller base font size for tiny screens */
  }

  .layout {
    padding: 0 10px; /* Reduce overall horizontal padding */
  }

  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 12px;
  }
  h3 {
    font-size: 15px;
  }
  .articletitle {
    font-size: 18px;
  }
  .introtext {
    font-size: 18px;
  }
  .card-title {
    font-size: 16px;
  }
  .card-meta, .card-text, .asidetext {
    font-size: 0.85em;
  }

  .padded-img {
    height: 80px; /* Even smaller logo */
  }

  .form-label {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 500;
  color:#000000;
}

.form-text{
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color:#000000;
}

.text-input {
  font-family: Arial, Helvetica, sans-serif;
  width: 80%;
  height: 26px;
  font-size: 14px;
}

.subscribe-disclaimer {
  margin-top: 9px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
}

.subscribe {
display: flex;
  flex-direction: row;
  align-items: center;
  justify-content:flex-start; /* Correct standard value to align to the start */
  flex-wrap: wrap;
}

.RSSfeed a {
  display: flex;
  align-items: center; /* This vertically centers the icon and text */
  justify-content: flex-start;
  gap: 10px; /* This adds some space between the icon and the text */
  margin: 0px 12px 12px 0px;
}

.RSSfeed img {
  height:auto;
  margin: 0px 0px 0px 4px;
}

.newsletter a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px; /* This adds some space between the icon and the text */
}

.newsletter img {
  height:auto;
  width: 42px;
}

}