/* =========================
   GLOBAL
========================= */

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  line-height: 1.6;
  background-color: #f4f4f4;
  color: #333;
}

/* =========================
   HEADER
========================= */

header {
  background: #2c3e50;
  color: white;
  padding: 1.5rem;
  text-align: center;
}

header h1 {
  margin: 0;
}

header p {
  margin-top: 0.5rem;
  opacity: 0.9;
}

/* =========================
   NAVIGATION
========================= */

nav {
  background: #34495e;
  padding: 0.75rem;
  text-align: center;
}

nav a {
  color: white;
  margin: 0 15px;
  text-decoration: none;
  font-weight: bold;
}

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

/* =========================
   MAIN CONTAINERS
========================= */

.container,
.gallery {
  max-width: 900px;
  margin: auto;
  padding: 20px;
  background: white;
}

/* =========================
   HEADINGS
========================= */

h2 {
  font-size: 1.7rem;
  margin-top: 30px;   /* slightly tighter */
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 3px solid #2c3e50;
  color: #2c3e50;
}

h3 {
  margin-top: 30px;
  padding-bottom: 5px;
  border-bottom: 2px solid #ddd;
}

/* =========================
   PROJECT BLOCKS
========================= */

.photo-block,
.video-block {
  margin-bottom: 40px;
}

figure {
  background: #fafafa;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  margin: 0;
}

figure img,
figure video {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  cursor: pointer;
}

figcaption {
  margin-top: 8px;
  font-size: 0.9rem;
  text-align: center;
  color: #555;
}

.description {
  margin-top: 12px;
}

/* =========================
   LIST LINKS (HOME PAGE)
========================= */

section {
  margin-bottom: 50px;   /* consistent separation between sections */
}

#trip-reports {
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e5;
}

#trip-reports .project-grid {
  gap: 14px;
}

section ul {
  list-style-type: none;
  padding-left: 0;
}

section li {
  margin-bottom: 10px;
}

section a {
  font-weight: bold;
  color: #2c3e50;
  text-decoration: none;
}

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

/* =========================
   SPEC TABLES
========================= */

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.95rem;
}

.spec-table th {
  text-align: left;
  width: 30%;
  background-color: #2c3e50;
  color: white;
  padding: 10px;
}

.spec-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  background-color: #fafafa;
}

.spec-table tr:nth-child(even) td {
  background-color: #f0f0f0;
}

/* =========================
   CODE BLOCKS
========================= */

.code-block pre {
  background: #1e1e1e;
  color: #dcdcdc;
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
}

/* =========================
   ROTATION
========================= */

.rotate-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rotate-270 {
  transform: rotate(270deg);
  transform-origin: center;
  width: auto;
  max-width: 100%;
  max-height: 100vh;   /* keeps it reasonable */
  object-fit: contain;
}

/* =========================
   LIGHTBOX
========================= */

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  padding: 20px;
}

#lightbox img,
#lightbox video {
  max-width: 95%;
  max-height: 80%;
  border-radius: 6px;
  display: none;
}

#lightbox-caption {
  color: white;
  margin-top: 15px;
  text-align: center;
}

#lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
}

/* =========================
   FORMS
========================= */

form input,
form textarea {
  width: 100%;
  max-width: 500px;
  padding: 8px;
  margin-top: 5px;
}

form button {
  padding: 10px 20px;
  background: #2c3e50;
  color: white;
  border: none;
  cursor: pointer;
}

form button:hover {
  background: #34495e;
}

/* =========================
   PROJECT CARDS (Homepage)
========================= */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;  /* ensure equal height */
}

.project-card {
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;

  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.project-card img {
  width: 100%;
  height: 160px;   /* was 180px */
  object-fit: cover;
}

.project-card h3 {
  margin: 4px 0 6px 0;
  font-size: 1.05rem;
  border: none;
}

.project-card p {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: #555;
}

.project-card a {
  display: block;
  padding: 10px;
  background: #2c3e50;
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.project-card a:hover {
  background: #34495e;
}

/* =========================
   PROJECT TAGS
========================= */

.card-content {
  padding: 10px 12px 8px 12px;
  flex-grow: 1;   /* KEY */
}

.project-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;

  padding: 4px 12px;
  border-radius: 999px;

  margin-bottom: 6px;
  min-height: 22px;

  color: white;
}

/* Category Colors */

.tag-pi {
  background: #c51a4a;   /* Raspberry Pi red */
}

.tag-kayak {
  background: #2c7a7b;   /* teal */
}

.tag-lego {
  background: #f2b705;   /* LEGO yellow */
  color: #333;
}

.tag-drums {
  background: #6c5ce7;   /* subtle purple */
}

.tag-moto {
  background: #d35400;   /* deep orange */
}

.tag-map {
  background: #2980b9;   /* clean medium blue */
}

.tag-moto { background: #c0392b; }
.tag-map { background: #2980b9; }
.tag-kayak { background: #2c7a7b; }
.tag-pi { background: #c51a4a; }
.tag-lego { background: #f2b705; color: #333; }
.tag-drums { background: #6c5ce7; }


/* =========================
   FOOTER
========================= */

footer {
  text-align: center;
  padding: 15px;
  background: #2c3e50;
  color: white;
  font-size: 0.9rem;
}
