/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Basic body styling */
body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

header {
  background: #333;
  color: #fff;
  padding: 1rem 0;
}

header .container {
  width: 80%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* header h1 styles were here, replaced by .site-logo */
header nav ul {
  padding: 0;
  list-style: none;
  margin: 0;
}

header nav ul li {
  display: inline-block;
  margin-left: 20px;
}

header nav ul li:first-child {
  margin-left: 0;
}

header nav ul li a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem;
}

header nav ul li a:hover,
header nav ul li a.active {
  text-decoration: underline;
}

footer {
  text-align: center;
  padding: 1.5rem 0;
  background: #333;
  color: #fff;
  margin-top: auto;
}

footer p {
  margin: 0;
}

footer a {
  color: #add8e6;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.container {
  width: 80%;
  margin: 2rem auto;
  overflow: hidden;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Card view basic styling */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-around;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 1rem;
  width: calc(33.333% - 2rem);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.card img {
  max-width: 100%;
  height: auto;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card a {
  text-decoration: none;
  color: #337ab7;
}

/* Responsive Styles & Hamburger Menu */
.hamburger-button {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-icon {
  display: block;
  width: 24px;
  height: 18px;
  position: relative;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #fff;
  border-radius: 1px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
  top: 0;
}

.hamburger-icon span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-icon span:nth-child(3) {
  bottom: 0;
}

.hamburger-button[aria-expanded=true] .hamburger-icon span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.hamburger-button[aria-expanded=true] .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.hamburger-button[aria-expanded=true] .hamburger-icon span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* === New Responsive Styles & Slide-in Hamburger Menu (max-width: 1023px) === */
@media (max-width: 1023px) {
  header .container {
    align-items: center;
  }
  .hamburger-button {
    display: block;
    position: relative;
    z-index: 1002;
  }
  header nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: #2c2c2c;
    padding: 60px 0 20px 0;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  header nav[aria-hidden=false] {
    transform: translateX(0%);
  }
  header nav ul#main-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-top: 1rem;
  }
  header nav ul#main-nav li {
    display: block;
    margin: 0;
    width: 100%;
  }
  header nav ul#main-nav li a {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #444;
    color: #f0f0f0;
    text-decoration: none;
    font-size: 1rem;
  }
  header nav ul#main-nav li:last-child a {
    border-bottom: none;
  }
  header nav ul#main-nav li a:hover {
    background-color: #383838;
  }
}
/* Header Logo Styles */
.site-logo {
  display: flex;
  align-items: center;
}

.site-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* Responsive adjustments for .card elements on smartphones */
@media (max-width: 767px) {
  .card {
    width: 100%; /* Card takes full width */
    max-width: 400px; /* Optional: prevent card from becoming excessively wide on wide 'mobile' screens if parent is very wide */
    /* This max-width might be better applied to a wrapper around card-container for overall page width control */
    margin-left: auto; /* Centering the card if it's narrower than container due to max-width */
    margin-right: auto; /* Centering the card */
    /* flex-basis: 100%; // Alternative to width */
    /* margin-bottom is already 1rem on .card, which should provide vertical spacing */
  }
}
