/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --deep-ocean: #0c2d48;
  --medium-blue: #145da0;
  --light-blue: #2e8bc0;
  --sky-blue: #b1d4e0;
  --sand: #d4a574;
  --sand-light: #e8d5b7;
  --bg: #f0f4f8;
  --white: #ffffff;
  --text: #1a1a2e;
  --text-light: #4a5568;
  --card-shadow: 0 2px 12px rgba(12, 45, 72, 0.1);
  --card-shadow-hover: 0 6px 24px rgba(12, 45, 72, 0.18);
  --radius: 12px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, var(--deep-ocean), var(--medium-blue));
  color: var(--white);
  padding: 1.25rem 2rem;
  text-align: center;
}

.site-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-header .tagline {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

/* ===== Main Content ===== */
main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== Featured / Hero Section ===== */
#featured {
  margin-bottom: 3rem;
}

.featured-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.featured-image-wrap {
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-info {
  padding: 2rem 2rem 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-block;
  background: var(--sand);
  color: var(--deep-ocean);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  width: fit-content;
  margin-bottom: 0.75rem;
}

.featured-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--deep-ocean);
  margin-bottom: 0.5rem;
}

.featured-meta {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.featured-meta .sep {
  margin: 0 0.4rem;
}

.featured-desc {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.countdown {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--light-blue);
  font-weight: 600;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--medium-blue), var(--light-blue));
  color: var(--white);
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity var(--transition), transform var(--transition);
  width: fit-content;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  border: 2px solid var(--medium-blue);
  color: var(--medium-blue);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background var(--transition), color var(--transition);
}

.btn-secondary:hover {
  background: var(--medium-blue);
  color: var(--white);
}

/* ===== Section Headings ===== */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--deep-ocean);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--sand);
  display: inline-block;
}

/* ===== Units Grid ===== */
.grid-section {
  margin-bottom: 3rem;
}

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

.unit-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.unit-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-3px);
}

.card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.unit-card:hover .card-image {
  transform: scale(1.03);
}

.card-body {
  padding: 1.25rem;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--deep-ocean);
  margin-bottom: 0.35rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.card-meta .sep {
  margin: 0 0.3rem;
}

/* ===== Fade Animation ===== */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--deep-ocean);
  color: var(--sky-blue);
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.85rem;
}

/* ===== Error ===== */
.error {
  color: #c0392b;
  text-align: center;
  padding: 2rem;
  font-size: 1.1rem;
}

/* ===== Log Page ===== */
.log-controls {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.log-controls label {
  font-weight: 600;
  color: var(--deep-ocean);
}

.log-controls input[type="date"] {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--sky-blue);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.log-controls input[type="date"]:focus {
  border-color: var(--medium-blue);
}

.unit-count {
  font-size: 0.85rem;
  color: var(--text-light);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.schedule-table thead {
  background: linear-gradient(135deg, var(--deep-ocean), var(--medium-blue));
  color: var(--white);
}

.schedule-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.schedule-table td {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #edf2f7;
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.schedule-table tr:hover {
  background: #f7fafc;
}

.schedule-table tr.hour-start td {
  border-top: 2px solid var(--sand);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  #units-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .featured-content {
    grid-template-columns: 1fr;
  }

  .featured-info {
    padding: 1.5rem;
  }

  .featured-image-wrap {
    min-height: 220px;
  }

  .site-header h1 {
    font-size: 1.35rem;
  }

  main {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 600px) {
  #units-grid {
    grid-template-columns: 1fr;
  }

  .featured-name {
    font-size: 1.35rem;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
  }
}
