/* ==========================================================================
   Team AI Showcase — Stylesheet
   Pure CSS3, no frameworks. Uses CSS variables for a clean design system.
   Aesthetic: dark blue + teal accent, soft shadows, modern AI/tech feel.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg:           #f4f7fb;
  --bg-elev:      #ffffff;
  --surface:      #ffffff;
  --surface-2:    #e9eef6;
  --border:       #d1d9e6;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --primary:      #0ea5b7;   /* teal */
  --primary-2:    #0891b2;
  --accent:       #3b82f6;   /* blue */
  --danger:       #ef4444;
  --success:      #10b981;
  --warning:      #f59e0b;
  --gray:         #94a3b8;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.3);
  --shadow-md:    0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:    0 20px 40px rgba(0,0,0,.45);

  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255, 0.9);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: .4rem 1.25rem;
}

.header-site-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-2) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-site-title:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.header-logo-link { display: flex; align-items: center; justify-content: flex-end; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: .2px;
}
.brand-mark {
  color: var(--primary-2);
  font-size: 1.3rem;
  filter: drop-shadow(0 0 8px rgba(34,211,238,.5));
}
.brand-text strong { color: var(--primary-2); }

.site-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-weight: 500;
  color: var(--text-muted);
}
.site-nav a:hover { color: var(--text); }
.nav-admin {
  padding: .45rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: all .2s ease;
}
.nav-admin:hover {
  border-color: var(--primary);
  background: rgba(14,165,183,.1);
}

/* ---------- Main / Footer ---------- */
.site-main { flex: 1; }
.section { padding: 2rem 1.25rem 4rem; }

/* ---------- Footer ---------- */
.footer-section {
  background: #151f30;
  color: #a0aec0;
  font-size: .95rem;
}

.footer-cta {
  border-bottom: 1px solid #2d3a50;
}
.pt-5 { padding-top: 1rem; }
.pb-5 { padding-bottom: 0.6rem; }

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}
.col-xl-4, .col-lg-4, .col-md-4, .col-md-6 {
  padding: 0 15px;
  flex: 0 0 33.333%;
  max-width: 33.333%;
}
.col-xl-12 { flex: 0 0 100%; max-width: 100%; }
.mb-30 { margin-bottom: 0.5rem; }
.mb-50 { margin-bottom: 0.75rem; }

.single-cta {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.single-cta i {
  font-size: 2rem;
  color: var(--primary);
  margin-top: .2rem;
  flex-shrink: 0;
}
.cta-text h4 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 .25rem;
  font-family: var(--font-display);
}
.cta-text span {
  color: #a0aec0;
  font-size: .9rem;
  line-height: 1.6;
}

.footer-content {
  border-bottom: 1px solid #2d3a50;
}

.footer-widget { padding-right: 1rem; }

.footer-logo {
  overflow: hidden;
  margin-bottom: 0.3rem;
}
.footer-logo::after { content: ''; display: table; clear: both; }

.footer-text p {
  color: #a0aec0;
  font-size: .88rem;
  line-height: 1.5;
  margin-bottom: 0.3rem;
}

.footer-social-icon {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.footer-social-icon span {
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
}
.footer-social-icon a { color: #a0aec0; font-size: 1.6rem; transition: color .2s; }
.footer-social-icon a:hover { color: var(--primary); }
.footer-social-icon .bg-gradient { color: #0077b5; }

.footer-widget-heading h3 {
  color: #fff;
  font-size: .95rem;
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  position: relative;
  padding-bottom: .3rem;
}
.footer-widget-heading h3::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background: var(--primary);
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 1rem;
}
.footer-widget ul li { margin-bottom: .5rem; }
.footer-widget ul li a {
  color: #a0aec0;
  font-size: .9rem;
  transition: color .2s, padding-left .2s;
}
.footer-widget ul li a:hover {
  color: var(--primary);
  padding-left: .4rem;
}

.subscribe-form .footer-form {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.subscribe-form input,
.subscribe-form textarea {
  background: #1e2d45;
  border: 1px solid #2d3a50;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .9rem;
  font-family: var(--font-body);
  width: 100%;
  resize: none;
}
.subscribe-form input::placeholder,
.subscribe-form textarea::placeholder { color: #64748b; }
.subscribe-form textarea { min-height: 80px; }
.subscribe-form input[type="submit"] {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .7rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.subscribe-form input[type="submit"]:hover { opacity: .88; }

.copyright-area {
  background: #0f1825;
  padding: 0.35rem 0;
  text-align: center;
}
.copyright-text p {
  color: #64748b;
  margin: 0;
  font-size: .88rem;
}

@media (max-width: 900px) {
  .col-xl-4, .col-lg-4, .col-md-4, .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .footer-widget ul { columns: 1; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 0.5rem 1.25rem 1.25rem;
  text-align: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 .75rem;
  color: var(--text);
  letter-spacing: -.02em;
}
.hero-subtitle {
  color: var(--text);
  max-width: 680px;
  margin: 0 auto 1.25rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.6;
}

/* ---------- Search ---------- */
.search {
  display: flex;
  gap: .6rem;
  max-width: 720px;
  margin: 0 auto;
  align-items: stretch;
}
.search-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.search input[type="search"] {
  width: 100%;
  padding: .9rem 2.4rem .9rem 2.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: all .2s ease;
}
.search input[type="search"]::placeholder { color: var(--text-muted); }
.search input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,183,.25);
  background: var(--surface-2);
}
.search-clear {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}
.search-clear:hover { background: var(--gray); }

.btn {
  border: none;
  padding: 0 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 18px rgba(14,165,183,.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(14,165,183,.45);
}

.search-meta {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ---------- Card grid (responsive) ---------- */
.card-grid {
  display: grid;
  gap: 1.5rem;
  /* Mobile: 1 column (default) */
  grid-template-columns: 1fr;
}
/* Tablet: 2 columns */
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Desktop: 3 columns */
@media (min-width: 960px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
/* Large desktop: 4 columns */
@media (min-width: 1280px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Project Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-media img { transform: scale(1.05); }

.card-media-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  background: #0f172a;

  text-align: center;
  padding: 1rem;
  line-height: 1.4;
}

.card-body {
  padding: 1rem 1.1rem .25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
  color: var(--text);
}
.card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: .92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-date {
  margin: 0;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 500;
}
.card-footer {
  padding: .75rem 1.1rem 1rem;
  color: var(--primary-2);
  font-size: .9rem;
  font-weight: 500;
}

/* ---------- Tag + Badge ---------- */
.tag {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  background: rgba(14,165,183,.10);
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(14,165,183,.25);
  align-self: flex-start;
}

/* ---------- Category navigation ---------- */
.category-nav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: .5rem 0;
}
.category-nav-list {
  display: flex;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: .25rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-nav-list::-webkit-scrollbar { display: none; }

.category-btn {
  display: inline-block;
  white-space: nowrap;
  padding: .45rem 1rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.category-btn:hover {
  color: var(--primary);
  background: rgba(14,165,183,.08);
  border-color: rgba(14,165,183,.25);
}
.category-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(14,165,183,.35);
}

@media (max-width: 640px) {
  .category-nav-list { gap: .35rem; }
  .category-btn { padding: .4rem .8rem; font-size: .82rem; }
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty h2 {
  font-family: var(--font-display);
  color: var(--text);
  margin-bottom: .5rem;
}
.empty a { color: var(--primary-2); }

/* ---------- Detail page ---------- */
.detail {
  padding: 2.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detail-main {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.detail-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (max-width: 959px) {
  .detail-main { flex-direction: column; }
  .detail-side { width: 100%; }
}

.back-link {
  color: var(--text-muted);
  font-weight: 500;
  width: fit-content;
}
.back-link:hover { color: var(--primary-2); }

.detail-header { display: flex; flex-direction: column; gap: .75rem; }
.detail-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0;
  letter-spacing: -.02em;
}
.detail-lede {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
  max-width: 70ch;
}

.detail-figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: #000;
}
.detail-figure img { width: 100%; height: auto; display: block; }

/* 16:9 responsive video embed */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.detail-body h2 {
  font-family: var(--font-display);
  margin-top: 0;
}

.detail-features h2 {
  font-family: var(--font-display);
  margin-top: 0;
}
.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.features-list li {
  padding: .9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: .97rem;
  line-height: 1.6;
  color: var(--text);
}
.features-list li strong {
  color: var(--primary-2);
}
.prose {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
}
.prose p { margin: 0 0 1em; }

.detail-side {
  width: 340px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  height: fit-content;
  position: sticky;
  top: 5rem;
}
.detail-side h3 {
  margin: 0 0 .8rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--primary-2);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.meta-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .5rem 1rem;
  margin: 0;
  font-size: .92rem;
}
.meta-list dt { color: var(--text-muted); }
.meta-list dd { margin: 0; color: var(--text); font-weight: 500; }

/* ---------- Public link section ---------- */
.detail-public-link {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(14,165,183,.08), rgba(59,130,246,.08));
  border: 1px solid rgba(14,165,183,.25);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}
.detail-public-link p {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
}
.external-link {
  color: var(--primary-2);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(14,165,183,.3);
  text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
}
.external-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
