/* RESET */

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

/* FONTS */
@font-face {
  font-family: "G.I.";
  src: url("/assets/fonts/GI/G.I.-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "G.I.";
  src: url("/assets/fonts/GI/G.I.-530.ttf") format("truetype");
  font-weight: 530;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "G.I.";
  src: url("/assets/fonts/GI/G.I.-750.ttf") format("truetype");
  font-weight: 750;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "G.I.";
  src: url("/assets/fonts/GI/G.I.-400Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "G.I.";
  src: url("/assets/fonts/GI/G.I.-530Italic.ttf") format("truetype");
  font-weight: 530;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "G.I.";
  src: url("/assets/fonts/GI/G.I.-750Italic.ttf") format("truetype");
  font-weight: 750;
  font-style: italic;
  font-display: swap;
}

/* VARIABLES */

:root {
  --color-bg: #241e1e;
  --color-text: #f4f2f3;
  --color-primary: #f7b61e;
  --color-muted: #7f7777;
  --color-border: #c3bbbb;
  --color-accent: #f7b61e;
  --color-link-hover: #4b3d3d;

  --font-body: "G.I.", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: "G.I.", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

  --max-width: 1100px;
  --spacing: 1rem;
  --radius: 8px;
  --hero-image-width: 350px;
}

/* === BASE === */

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

body {
  flex: 1;
}

img {
  height: auto;
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style-position: inside;
}

ol {
  list-style: none;
  counter-reset: item;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

ol li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 2em 1fr;
  font-size: 16px;
}

ol li::before {
  content: counter(item) ".";
  text-align: left;
}

/* TYPOGRAPHY */

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: calc(var(--spacing) * 0.75);
}

h1 {
  font-size: 1.25rem;
  font-weight: 530;
  border-bottom: 1px solid var(--color-border);
  width: 48%;
}

.no-hero h1 {
  width: 100%;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  font-size: 1rem;
  text-align: left;
  margin-bottom: 1rem;
}

/* LAYOUT */

header,
main,
footer {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 0;
}

main {
  min-height: 60vh;
  padding-block: calc(var(--spacing));
}

/* HEADER/NAV */

.wordmark {
  height: auto;
  max-width: 160px;
  display: block;
}

header {
  display: flex;
  justify-content: space-between;
  padding-block: calc(var(--spacing));
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  font-size: 18px;
  display: block;
}

/* === NAV === */

.main-nav {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  width: max-content;
  align-items: center;
}

.main-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  text-decoration: none;
  padding: 0 16px;
  align-items: center;
  color: var(--color-text);
}

.main-nav a:hover {
  background-color: var(--color-link-hover);
}

.main-nav a.active {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

.main-nav a:nth-child(2) {
  border-right: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}

.nav-alt {
  display: none;
}

/* === HAMBURGER === */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #ddd;
  font-size: 28px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .hamburger {
    display: block;
  }

  .main-nav {
    display: none;
  }

  /*.nav-alt {
    display: none;
    flex-direction: column;
    background-color: var(--color-bg);
  }

  .nav-alt.open {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    align-items: center;
  }*/

  .nav-alt {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    align-items: center;

    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
      max-height 0.4s ease,
      opacity 0.1s ease;
  }

  .nav-alt.open {
    max-height: 100px;
    opacity: 1;
  }

  .nav-alt a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    text-decoration: none;
    padding: 0 16px;
    align-items: center;
    color: var(--color-text);
  }

  .nav-alt a:hover {
    background-color: var(--color-link-hover);
  }

  .nav-alt a.active {
    background-color: var(--color-accent);
    color: var(--color-bg);
  }

  .nav-alt a:nth-child(2) {
    border-right: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
  }
}

/* FOOTER */
footer {
  padding-block: calc(var(--spacing));
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: auto;
  background-color: var(--color-bg);
}

footer a {
  color: var(--color-link-alt);
  text-decoration: underline;
}

/* === ARTICLE GRID === */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.article-card {
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-bg);

  text-decoration: none;
  color: inherit;
  display: block;
}

.article-card:hover {
  background: var(--color-link-hover);
}

.article-card p {
  margin-bottom: 0;
}

.article-card a,
a:hover {
  text-decoration: none;
}

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.article-card-content {
  padding: 0.5rem;
}

.article-card h2 {
  margin-top: 0;
}

.article-date {
  font-size: 0.85rem;
  color: var(--color-accent);
}

.article-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* CUSTOM */
/*.nav-button {
  color: var(--color-text);
}

.nav-button.active {
  color: var(--color-bg);
  background-color: var(--color-accent);
  padding: 5px 10px;
}*/

.join-link {
  margin-top: auto;
  font-size: 1.1rem;
}

.hero-carousel {
  float: right;
  width: 48%;
  margin: 0 0 var(--spacing) calc(var(--spacing) * 2);
}

.carousel-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  height: 1.25rem;
  margin: 0 0 0.2rem 0;
  line-height: 1;
}

.carousel-prev {
  justify-self: start;
}

.carousel-next {
  justify-self: end;
}

.carousel-dots {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.carousel-prev,
.carousel-next {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  line-height: 1;

  font: inherit;
  cursor: pointer;
  color: var(--color-text);
}

.carousel-prev:hover,
.carousel-next:hover {
  text-decoration: underline;
}

.carousel-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.carousel-image {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center center;

  opacity: 0;
  transition: opacity 0.4s ease;
}

.carousel-image.active {
  opacity: 1;
}

.carousel-dot {
  background: none;
  border: none;
  padding: 0;

  font-size: 1rem;
  line-height: 1;

  color: var(--color-text);
  opacity: 0.5;
  cursor: pointer;
}

.carousel-dot.active {
  opacity: 1;
}

.carousel-dot:hover {
  opacity: 1;
}

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero .container {
  min-width: 0;
}

.hero-image {
  float: right;
  width: 48%;
  height: auto;
  margin: 0 0 var(--spacing) calc(var(--spacing) * 2);
  display: block;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

ol li {
  margin-bottom: 4px;
}

@media (max-width: 800px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column */
@media (max-width: 500px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 1000px) {
  .site-title {
    display: none;
  }
  .wordmark {
    max-width: 200px;
  }
  nav {
    font-size: 1.1rem;
  }
}

@media only screen and (max-width: 1214px) {
  body {
    padding-inline: calc(var(--spacing) * 2);
  }
}

@media only screen and (max-width: 700px) {
  body {
    font-size: 14px;
  }

  p {
    text-align: justify;
  }

  footer {
    font-size: 0.7rem;
    text-align: center;
  }
}

@media (max-width: 700px) {
  .hero-image {
    float: none;
    width: 100%;
    height: 200px;
    margin: 0 0 var(--spacing) 0;
    object-fit: cover;
    object-position: center;
  }
  .hero-carousel {
    float: none;
    width: 100%;
    margin: 0 0 var(--spacing) 0;
  }

  .carousel-image-container {
    width: 100%;
    height: 200px;
    aspect-ratio: auto;
  }

  .hero-carousel .carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }

  h1 {
    width: 100%;
  }

  .carousel-controls {
    font-size: 15px;
  }
}

.news-item1 {
  width: 100px;
  height: 100px;
  background-color: var(--color-text);
}
