/* The Speaker News Journal — static overlay on GeneratePress */

*,
*::before,
*::after { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  background-color: #f7f8f9;
  color: #222;
  font-family: Lato, "Segoe UI", Helvetica, Arial, sans-serif;
}

a { color: #1e73be; }
a:hover, a:focus { color: #000; }

img, video, iframe, svg { max-width: 100%; height: auto; }

.grid-container { max-width: 1400px; width: 100%; }

/* Header: title + News / Sci Tech Health */
#masthead {
  background-color: #bebebe;
  background-image: url("../img/worldmap-white-transparent.png");
  background-repeat: no-repeat;
  background-size: 70% auto;
  background-position: center -25px;
  border: none;
  margin-bottom: 1px;
}

.inside-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 12px 20px;
  text-align: left;
  flex-direction: row;
}

.site-branding {
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
}

.main-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
}

.main-title a, .main-title a:hover { color: #222; }

.nav-float-right #site-navigation {
  margin-left: 0;
}

.main-navigation {
  background: transparent;
  z-index: 20;
  flex: 0 1 auto;
}

.main-navigation .inside-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 0;
}

.main-navigation .main-nav { order: 1; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  order: 2;
}

.header-tools .lang-switch,
a.lang-switch {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0 !important;
  border: 2px solid #222;
  background: #fff;
  color: #222;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1 !important;
  text-decoration: none;
  box-sizing: border-box;
}
.header-tools .lang-switch:hover,
.header-tools .lang-switch:focus,
a.lang-switch:hover,
a.lang-switch:focus {
  color: #000;
  background: #f3f3f3;
}

.menu-toggle {
  display: none;
  cursor: pointer;
}

.main-navigation, .main-navigation ul ul { background: #fff; }

.main-navigation .main-nav > ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.main-navigation .main-nav ul li a {
  color: #515151;
  font-weight: 600;
  line-height: 1.25;
  padding: 10px 16px;
}

.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li:focus-within > a { color: #7a8896; }

.main-navigation ul ul { background: #eaeaea; }

/* Content + links column */
.site { padding: 0; }

.site-content {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 16px 20px 36px;
}

.left-sidebar .content-area,
.container .site-content .content-area {
  width: auto;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
}

.left-sidebar .is-left-sidebar,
.left-sidebar .sidebar {
  width: auto;
  min-width: 0;
  order: unset;
  grid-column: 1;
  grid-row: 1;
}

.sidebar .widget {
  background: #fff;
  padding: 16px;
  margin-bottom: 16px;
}

.separate-containers .inside-article,
.separate-containers .page-header,
.separate-containers .comments-area {
  padding: clamp(16px, 3vw, 32px);
}

.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #ccc;
  background: #fafafa;
  color: #666;
  font: inherit;
}
.search-form button {
  padding: 8px 12px;
  border: 1px solid #ccc;
  background: #eee;
  cursor: pointer;
  white-space: nowrap;
}

.follow-buttons-div { text-align: center; }
.follow-buttons-div img { height: 25px; padding: 5px; }
.follow-buttons-div img:hover { opacity: 0.5; }
.our-links-div, .section-links { text-align: center; }
.our-links-div a, .section-links a { display: block; font-size: 16px; margin: 4px 0; }
.section-links p.head { margin: 15px 0 5px; font-size: 18px; color: #222; }

.entry-title {
  font-weight: 700;
  color: #222;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.entry-title a { color: #020202; }
.entry-title a:hover { color: #55555e; }
.entry-meta, .entry-footer { color: #595959; font-size: 14px; }
.entry-meta a, .entry-footer a { color: #595959; }
.entry-meta a:hover { color: #222; }

div.entry-content {
  max-width: 800px;
  color: #000;
  background-image: url("../img/backgroundblockgrey.jpg");
  background-repeat: repeat-y;
  background-size: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-content p { font-size: clamp(1rem, 1.6vw, 1.25rem); }

.home .featured-image img,
.single .featured-image img,
.post-image img,
.featured-posts-div img,
.entry-content img,
.wp-caption img {
  width: auto !important;
  height: auto !important;
  max-width: 100%;
}
.home .featured-image img,
.single .featured-image img,
.post-image img {
  float: left;
  margin: 0 16px 16px 0;
}
.entry-content { clear: both; }

/* Posts: all photos on the left, text beside them — never centered */
article.post .entry-content :is(p, div, figure, h1, h2, h3, h4, h5, h6):has(img) {
  text-align: left !important;
}
article.post .entry-content .wp-caption,
article.post .entry-content a:has(> img) {
  float: left !important;
  display: block;
  margin: 0 12px 8px 0 !important;
}
article.post .entry-content img,
article.post .entry-content .alignleft,
article.post .entry-content .alignright,
article.post .entry-content .aligncenter,
article.post .entry-content .alignnone {
  float: left !important;
  margin: 0 12px 8px 0 !important;
}
article.post .entry-content a:has(> img) img {
  float: none !important;
  margin: 0 !important;
}

.size-full { width: auto; max-width: 100%; }
.entry-content iframe { width: 100%; max-width: 854px; height: auto; aspect-ratio: 16 / 9; }

.featured-posts-div {
  float: none;
  max-width: none;
  border-bottom: 3px solid #bebebe;
  padding: 12px 0 20px;
  margin-bottom: 24px;
  overflow: visible;
}
.featured-post-container-1,
.featured-post-container-2,
.featured-post-container-3 { min-width: 0; }
.featured-posts-div a { color: #222; }
.featured-posts-div a:hover { color: #55555e; }
.featured-top {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 15px;
}
.featured-posts-div h2 { overflow-wrap: anywhere; }
.featured-post-container-1 h2 { font-size: clamp(1.25rem, 2.5vw, 2rem); font-weight: 600; line-height: 1.2; margin: 0 0 8px; }
.featured-post-container-2 h2 { font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 600; line-height: 1.2; margin: 0 0 8px; }
.featured-post-container-3 h2 { font-size: clamp(1rem, 1.6vw, 1.35rem); font-weight: 600; line-height: 1.2; margin: 0 0 8px; }
.featured-post-container-1 img { float: right; padding: 0 8px 8px 12px; }
.featured-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.featured-meta { color: #595959; font-size: 14px; clear: both; }

.paging { display: flex; gap: 16px; flex-wrap: wrap; margin: 24px 0; font-weight: 600; }
.archive-title { margin: 0 0 18px; font-size: clamp(1.3rem, 2vw, 1.6rem); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.more-link { font-weight: 700; }

.comments-accordion {
  max-width: 830px;
  margin: 36px 0 10px;
  border-top: 5px solid grey;
  padding-top: 18px;
}
.comments-accordion > summary {
  display: block;
  background: #eee;
  padding: 14px;
  color: #424242;
  cursor: pointer;
  border: 1px solid #bdbdbd;
  font-weight: 700;
  letter-spacing: 0.04em;
  list-style: none;
}
.comments-accordion > summary::-webkit-details-marker { display: none; }
.comments-list { padding: 10px 14px 18px; }
.comment { border-bottom: 1px solid #e4e4e4; padding: 12px 0; }
.comment:last-child { border-bottom: 0; }
.comment-meta { color: #595959; font-size: 14px; margin-bottom: 6px; }
.comment-body { color: #424242; white-space: pre-wrap; }

.site-info { color: #fff; background: #55555e; text-align: center; padding: 20px; font-size: 14px; }
.inside-site-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 22px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-info a { color: #fff; }
.site-info a:hover { color: #d3d3d3; }

/* Mid-width: keep the links column, shrink featured grid */
@media (max-width: 1100px) {
  .featured-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .site-content {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 14px 28px;
  }
  .left-sidebar .content-area,
  .container .site-content .content-area {
    grid-column: 1;
    grid-row: 1;
  }
  .left-sidebar .is-left-sidebar,
  .left-sidebar .sidebar {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .inside-header {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 10px 14px;
    position: relative;
  }

  .site-branding {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 8px;
  }

  .main-navigation,
  .header-tools {
    flex: 0 0 auto;
    flex-shrink: 0;
    background: transparent;
    position: relative;
  }

  .main-navigation .inside-navigation,
  .main-navigation .inside-navigation.grid-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    width: auto;
    max-width: none;
    padding: 0;
    position: relative;
    gap: 8px;
  }

  button.menu-toggle,
  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    max-width: 44px;
    flex-grow: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent;
    background: #fff !important;
    border: 2px solid #222 !important;
    border-radius: 0;
    box-shadow: none;
  }

  button.menu-toggle:active,
  button.menu-toggle:focus,
  button.menu-toggle:hover {
    background: #fff !important;
  }

  .menu-toggle::before {
    content: "";
    width: 20px;
    height: 2px;
    background: #222;
    box-shadow: 0 -6px 0 #222, 0 6px 0 #222;
  }

  .main-navigation.toggled .menu-toggle::before {
    box-shadow: none;
    transform: rotate(45deg);
  }

  .main-navigation.toggled .menu-toggle::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    background: #222;
    transform: rotate(-45deg);
  }

  .main-navigation .main-nav,
  .main-navigation.toggled .main-nav {
    display: none !important;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    width: min(260px, calc(100vw - 28px)) !important;
    flex-basis: auto !important;
    order: 0 !important;
    z-index: 40;
    background: #fff;
    border: 1px solid #bbb;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  }
  .main-navigation.toggled .main-nav { display: block !important; }

  .main-navigation.toggled .main-nav > ul {
    display: block;
    width: 100%;
    border: 0;
  }
  .main-navigation.toggled .main-nav > ul > li { display: block; width: 100%; }
  .main-navigation.toggled .main-nav ul ul,
  .main-navigation.toggled .main-nav ul ul.sub-menu {
    position: static !important;
    left: auto !important;
    right: auto !important;
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: 100% !important;
    float: none;
    box-shadow: none;
    background: #f3f3f3;
  }
  .main-navigation.toggled .main-nav ul li a {
    line-height: 1.3 !important;
    padding: 10px 14px !important;
  }
  .main-navigation.toggled .main-nav ul ul li a { padding-left: 22px !important; }

  .featured-top { grid-template-columns: 1fr; }
  .featured-post-container-1 img { float: none; padding: 0 0 10px; }
  .home .featured-image img,
  .single .featured-image img,
  .post-image img {
    float: none;
    margin: 0 0 12px;
  }

  .section-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    text-align: left;
  }
  .section-links p.head {
    grid-column: 1 / -1;
    text-align: center;
  }

  #masthead {
    background-size: 90% auto;
    background-position: center 0;
  }
}

@media (max-width: 600px) {
  .featured-row { grid-template-columns: 1fr; }
  .separate-containers .inside-article { padding: 16px; }
  .our-links-div, .section-links, .follow-buttons-div { text-align: center; }
  .section-links { text-align: left; }
}
