/* Layout & Base */
#top {
  margin: 0;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
li {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: #333;
}

/* Headings */
h1,
h2 {
  border-left: 4px solid #12923f;
  padding-left: 0.5rem;
}
.news-feed h2 {
  color: #12923f;
}
h1,
h2,
h3 {
  font-family: "Helvetica Neue", sans-serif;
  color: #333;
}

/* Header / hero */
.hero-header {
  text-align: center;
  background-color: #eee;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.hero-logo,
.trakominis-logo {
  max-width: 232px;
  max-height: 230px;
  width: 116px;
  height: 115px;
}
.trakominis-logo {
  max-width: 200px;
  max-height: 200px;
  width: 115px;
  height: 115px;
}

/* Main container */
main.container {
  padding: 2rem;
  width: calc(95% - 64px);
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Navigation container */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1rem;
}

/* Navbar (default small screens hidden) */
.navbar {
  display: none;
  width: 85%;
  flex-shrink: 2;
  flex-grow: 2;
}

/* Navbar list */
.navbar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}
.navbar ul li {
  margin: 0.5rem 0;
  padding: 0.3rem;
}

/* Navbar links */
.navbar li a,
.mobile-navbar li a,
.navbar a,
.mobile-navbar a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.2s ease;
  text-decoration: none !important;
  color: black;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  font-size: 1.5rem;
}

/* Hover / active states (club green #12923F) */
.navbar li a:hover,
.mobile-navbar li a:hover,
.navbar a:hover,
.mobile-navbar a:hover,
.navbar li.active a,
.mobile-navbar li.active a {
  border-bottom: 2px solid #12923f;
  color: #12923f;
  background-color: transparent;
}

.navbar ul li a:hover,
.mobile-navbar ul li a:hover,
.navbar a:hover,
.mobile-navbar a:hover {
  background-color: #ddd;
  color: #000;
}
/* active page */
.navbar ul li.active a,
.mobile-navbar ul li.active a {
  background-color: #ccc;
  color: #000;
  font-weight: bold;
  text-decoration: none !important;
}

/* Overriding style: menu hover & active page with club color */
.navbar a:hover,
.mobile-navbar a:hover,
.navbar li.active a,
.mobile-navbar li.active a {
  background-color: #12923f;
  color: white;
  border-radius: 4px;
}

/* Nav toggle (burger) */
.nav-toggle {
  color: black;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
.nav-toggle:hover {
  color: white;
}

/* Responsive navbar breakpoints */
@media (max-width: 1011px) {
  .navbar {
    display: none;
  }
  .navbar.open {
    display: block;
    width: 100%;
  }
  .navbar.open ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0;
    margin: 1rem 0 0 0;
  }
  .nav-toggle {
    display: block !important;
    margin-left: auto;
  }
}

@media (min-width: 1011px) {
  .navbar {
    display: flex;
  }
  .navbar ul {
    display: flex;
    gap: 1rem;
  }
  .navbar ul li {
    margin: 0;
    margin-left: 1rem;
    padding: 0;
  }
  .nav-toggle {
    display: none !important;
  }
}

/* Mobile-navbar (kept after navbar rules as requested) */
.mobile-navbar {
  display: none;
}
.mobile-navbar.open {
  display: block;

  ul {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    padding: 0;
    margin: 0;

    > li::marker {
      content: "";
    }
    > li {
      margin-right: 1rem;
    }
  }
}

@media (min-width: 1012px) {
  .mobile-navbar {
    display: none !important;
  }
}

/* News feed */
.news-feed {
  margin: 2rem 0;
  /* display: none; */
}
.news-feed h3 a {
  font-weight: 600;
  color: #222;
  text-decoration: none;
  transition: all 0.3s ease;
}
.news-feed h3 a:hover {
  color: #0055aa;
  text-decoration: underline;
}

/* News item */
.news-item {
  border-bottom: 1px solid #ccc;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.news-item .date {
  font-size: 0.9rem;
  color: #777;
}

/* News thumbnail */
.news-thumb {
  max-width: 100%;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  max-height: 300px;
}

/* News layout responsive */
.news-feed .news-item {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 3rem;
}
@media (min-width: 1200px) {
  .news-feed .news-item {
    flex-direction: row;
  }
  .news-feed .news-item.even {
    flex-direction: row-reverse;
  }
}

/* News text sizing */
.news-text p {
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Buttons */
button,
a.button {
  background-color: #12923f;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
}
button:hover,
a.button:hover {
  background-color: #0f7b34;
}

/* Footer */
.footer {
  text-align: center;
  display: flex;
  padding: 1rem;
  background-color: #eee;
  flex-direction: column;
  align-items: center;
}
.footer .footer-row {
  text-align: center;
  padding: 1rem;
  display: flex;
  flex-direction: row;
}

.blog-item {
  img {
    max-width: 90vw;
  }
}

/* Make Markdown tables show borders */
main.container table,
main.container table th,
main.container table td {
  border: 1px solid #ccc;
  border-collapse: collapse;
}

main.container table {
  width: 100%;
  border-collapse: collapse; /* avoid double borders */
}

main.container table th,
main.container table td {
  padding: 8px;
  text-align: left;
}

/* control overall sizing and box */
.fb-widget-wrap {
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden; /* constrain iframe */
  box-shadow: 0 6px 18px rgba(20, 20, 30, 0.06);
  background: #fff;
}

/* adjust spacing around plugin */
.fb-widget-wrap .fb-page,
.fb-widget-wrap iframe[title^="fb:page Facebook Social Plugin"] {
  display: block;
  width: 100% !important;
  height: auto !important;
  min-height: 300px;
}

/* hide header or make it compact (if using XFBML small header) */
.fb-widget-wrap.fb-style-compact .fb-page {
  /* use data-small-header="true" on embed for official small header */
}

/* style a fake header outside the iframe */
.fb-widget-wrap .fb-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #fff, #fafbfd);
}
.fb-widget-wrap .fb-header img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}
.fb-widget-wrap .fb-header .title {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.fb-widget-wrap {
  width: 100%;
  max-width: 420px;
}
@media (min-width: 900px) {
  .fb-widget-wrap {
    max-width: 600px;
  }
}

.fb-widget-wrap iframe[title^="fb:page Facebook Social Plugin"] {
  border: none;
  background: transparent;
}

#top > main > section > div > div.fb-page.fb_iframe_widget > span {
  width: 800px !important;
}

.fb--container {
  max-width: 60vw;

  > .fb--content:nth-child(odd) {
    background-color: white;
  }
  > .fb--content:nth-child(even) {
    background-color: #12923f22;
  }

  /* > .fb--content:not(:has(.fb--album)):not(:has(.fb--img.fb--img-feed)):nth-child(odd) {
    background-color: white;
  }
  > .fb--content:not(:has(.fb--album)):not(:has(.fb--img.fb--img-feed)):nth-child(even) {
    background-color: lightgray;
  } */

  > .fb--content:not(:has(.fb--album)):not(:has(.fb--img.fb--img-feed)) {
    display: none;
  }

  > .fb--content {
    display: flex;
    justify-items: center;

    .fb--content-inner {
      display: grid;
      grid-template-columns: 240px 1fr; /* left column width, right column flexible */
      grid-auto-rows: auto;
      gap: 12px 18px;
      align-items: start;
    }

    /* right column: put all non-album children into column 2 */
    .fb--content-date,
    .fb--content-message,
    .fb--content-url {
      grid-column: 2 / 3;
    }

    /* stack date, message, link in the right column */
    .fb--content-date {
      grid-row: 1 / 2;
      margin: 0;
    }

    .fb--content-message {
      grid-row: 2 / 3;
    }

    .fb--content-url {
      grid-row: 3 / 4;
      justify-self: start;
      pointer-events: auto;
      width: 20px;
      height: 20px;
      overflow: hidden;
    }

    .fb--content-url::before {
      font-family: "FontAwesome";
      font-weight: 900;
      content: "\f082";
      display: inline-block;
      width: 1em;
      height: 1em;
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
    }

    .fb--album,
    .fb--img.fb--img-feed {
      grid-column: 1 / 2;
      grid-row: auto;
      grid-row-end: span 4;
    }

    /* Responsive: stack columns on small screens */
    @media (max-width: 1011px) {
      .fb--content-inner {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
      }

      /* ensure album sits in its own cell and DOES NOT span multiple rows */
      .fb--album {
        grid-column: 1 / 2;
        grid-row: 1;
      }

      /* stack date/message/link in right column */
      .fb--content-date {
        grid-column: 2 / 3;
        grid-row: 1;
      }
      .fb--content-message {
        grid-column: 2 / 3;
        grid-row: 1;
      }
      .fb--content-url {
        grid-column: 2 / 3;
        grid-row: 3;
      }

      /* image sizing */
      .fb--img-album {
        width: 240px;
        height: 160px;
        overflow: hidden;
      }
      .fb--img-album img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: flex;
      }
    }

    > .fb--content-inner {
      > .fb--album > .fb--img.fb--img-album,
      > .fb--img.fb--img-feed {
        /* display: none; */
        /* width: 30vw; */

        grid-column: 1 / 2;
        /* grid-row: 1 / 4; */
        /* span the height so it stays alongside stacked right column items */
        display: flex;
        gap: 8px;
        flex-wrap: wrap;

        /* images */
        /* .fb--img-album { */
        width: 10vw;
        height: 10vw;
        overflow: hidden;
        /* } */
        /* .fb--img-album */
        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          display: flex;
        }

        /* > img {
          height: 50vh;
        } */
      }
      /* > .fb--img.fb--img-album:not(:nth-child(1)) { */
      > .fb--album > .fb--img.fb--img-album:not(:nth-child(1)) {
        /* display: block !important; */
        display: none !important;
      }
    }
  }
}
