/* Reset & base styles */
.my-widget * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto Condensed", sans-serif;
}

html, body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* My Widget wrapper */
.my-widget {
  position: relative;
  width: 100vw; /* full viewport width */
  margin-left: 50%;
  transform: translateX(-50%); /* centers the widget */
  overflow-x: hidden;
  box-sizing: border-box;
  background-color: #fff;
}

/* NAVBAR */
.my-widget .navbar {
  font-family: "Varta", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  padding: 10px;
  color: #a31d3e;
  font-size: 40px;
}

/* MAIN CONTAINER */
.my-widget .container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 100vw;
  padding: 5px;
  margin: 0;
  border-bottom: 1px solid black;
  height: 90vh;
  align-items: flex-start;
  box-sizing: border-box;
}

/* HEADLINE SECTION */
.my-widget .headline {
  font-family: 'Times New Roman', Times, serif;
  flex: 2.5;
  border-right: 1px solid black;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 5px 10px;
  box-sizing: border-box;
  height: 100%;
  overflow: hidden;
}

/* HERO IMAGE */
.my-widget .headline .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  margin: 10px 0;
}

/* HEADLINE TEXT */
.my-widget .headline .page-title {
  font-size: 60px;
  font-weight: 700;
  color: #a31d3e;
  text-align: center;
  margin-bottom: 15px;
  line-height: 1.1;
}

.my-widget .headline .hero-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 10px;
}

.my-widget .headline .hero-desc {
  width: 95%;
  max-height: 200px;
  overflow-y: auto;
  text-align: center;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  padding: 5px;
}

/* SIDEBAR */
.my-widget .sidestories {
  flex: 1;
  max-width: 350px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-left: 1px solid black;
  padding: 8px 10px;
  box-sizing: border-box;
  background-color: #fff;
}

.my-widget .sidestories h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.my-widget .story-list .story {
  border-bottom: 1px solid black;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.my-widget .sidestories .title a {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* GRID */
.my-widget .deadline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 15px;
  background: #fff;
}

.my-widget .deadline-grid .story {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.my-widget .deadline-grid .story img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 8px;
}

.my-widget .deadline-grid h3 {
  font-size: 1rem;
  margin: 6px 0;
}

.my-widget .deadline-grid .time {
  font-size: 0.8rem;
  color: gray;
}

/* LINKS */
.my-widget a {
  color: #a31d3e;
  font-family: "Spectral", sans-serif;
  font-weight: bold;
  text-decoration: none;
}

.my-widget a:hover {
  text-decoration: underline;
}

/* FIX BROKEN IMAGES */
.my-widget img[src=""],
.my-widget img:not([src]),
.my-widget img[src="null"],
.my-widget img[src="undefined"] {
  display: none !important;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .my-widget .container {
    height: 80vh;
  }
}

@media (max-width: 768px) {
  .my-widget .container {
    flex-direction: column;
    height: auto;
  }
  .my-widget .headline {
    border-right: none;
    border-bottom: 1px solid black;
  }
  .my-widget .headline .hero-img {
    height: auto;
    max-height: 50vh;
  }
  .my-widget .sidestories {
    max-width: 100%;
    height: auto;
    border-left: none;
  }
  .my-widget .deadline-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .my-widget .deadline-grid {
    grid-template-columns: 1fr;
  }
}

/* 🔹 Override WordPress container padding and margins */
.entry-content,
.wp-block-group,
.wp-block,
.wp-site-blocks,
.page-content,
.site-content,
#content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* 🔹 Ensure no horizontal shift */
body {
  overflow-x: hidden !important;
}
