/* ============================================================
   Medical Institute Theme — style.css
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-primary:    #1a3a5c;
  --color-teal:       #0d9488;
  --color-teal-dark:  #0a7a70;
  --color-bg:         #ffffff;
  --color-bg-light:   #f4f6f9;
  --color-text:       #2d3748;
  --color-text-muted: #718096;
  --color-border:     #e2e8f0;
  --color-white:      #ffffff;
  --font-body:        'Inter', sans-serif;
  --font-heading:     'Merriweather', serif;
  --radius:           8px;
  --shadow:           0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover:     0 6px 24px rgba(0, 0, 0, 0.14);
  --transition:       0.25s ease;
  --max-width:        1200px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-teal-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.3;
  font-weight: 700;
}

p { margin-bottom: 1rem; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--color-primary);
  padding: 1.5rem 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.site-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-header__brand { padding-bottom: 0.75rem; }

.site-header__name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--color-white);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-header__name a { color: inherit; }
.site-header__name a:hover { color: #a8d8ea; }

.site-header__tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* ---------- Navigation ---------- */
.site-nav {
  background: rgba(0,0,0,0.18);
  width: 100%;
  margin-top: 0.5rem;
}

.site-nav__list {
  list-style: none;
  display: flex;
  gap: 0;
  padding: 0;
  margin: 0;
}

.site-nav__list li a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.site-nav__list li a:hover,
.site-nav__list li a.active {
  color: var(--color-white);
  border-bottom-color: var(--color-teal);
  background: rgba(255,255,255,0.06);
}

/* Hamburger (CSS-only, mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-white);
  margin: 4px 0;
  transition: var(--transition);
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-teal) 100%);
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero__content { position: relative; z-index: 1; }

.hero__headline {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--color-white);
  margin-bottom: 1.25rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero__sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

.btn--primary:hover {
  background: transparent;
  color: var(--color-white);
}

.btn--outline {
  background: transparent;
  color: var(--color-teal);
  border-color: var(--color-teal);
}

.btn--outline:hover {
  background: var(--color-teal);
  color: var(--color-white);
}

/* ---------- Section Shared ---------- */
.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--color-bg-light);
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.75rem;
}

.section__subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto;
}

.section__divider {
  width: 60px;
  height: 4px;
  background: var(--color-teal);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

/* ---------- Article Cards Grid ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

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

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-bg-light);
}

.card__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.card__meta-date::before { content: '📅 '; }
.card__meta-author::before { content: '👤 '; }

.card__title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
  line-height: 1.4;
}

.card__excerpt {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  flex: 1;
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-teal);
  margin-top: auto;
}

.card__link::after { content: ' →'; }
.card__link:hover { color: var(--color-teal-dark); }

/* ---------- About Section ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h2 {
  font-size: 1.9rem;
  margin-bottom: 1.25rem;
}

.about-text p {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.about-image img,
.about-image svg {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

/* ---------- Research Areas ---------- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.research-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--color-teal);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.research-card__icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  display: block;
}

.research-card__title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}

.research-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ---------- Articles List Page ---------- */
.page-header {
  background: var(--color-primary);
  padding: 3.5rem 0;
  text-align: center;
  color: var(--color-white);
}

.page-header h1 {
  color: var(--color-white);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ---------- Single Article ---------- */
.article-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.article-featured-image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.article-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.article-meta span { display: flex; align-items: center; gap: 0.3rem; }

.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--color-text);
}

.article-body h2, .article-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body p { margin-bottom: 1.25rem; }

.article-body ul, .article-body ol {
  margin: 0 0 1.25rem 1.5rem;
}

.article-body blockquote {
  border-left: 4px solid var(--color-teal);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-bg-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.75);
  padding: 3rem 0 1.5rem;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.site-footer__brand-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.site-footer__brand-desc {
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 340px;
}

.site-footer__links-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.75rem;
}

.site-footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.site-footer__links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.site-footer__links a:hover { color: var(--color-teal); }

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.25rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .research-grid { grid-template-columns: 1fr 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .hero { padding: 4rem 0; }
  .section { padding: 3.5rem 0; }
  .research-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }

  .site-header__inner { flex-direction: column; align-items: flex-start; }

  .nav-toggle { display: block; }

  .site-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  /* CSS-only toggle trick using :focus-within */
  .site-header:focus-within .site-nav,
  .nav-toggle:focus + .site-nav {
    max-height: 300px;
  }

  .site-nav__list { flex-direction: column; }
  .site-nav__list li a { padding: 0.75rem 1rem; border-bottom: none; border-left: 3px solid transparent; }
  .site-nav__list li a:hover,
  .site-nav__list li a.active {
    border-bottom-color: transparent;
    border-left-color: var(--color-teal);
  }

  .article-meta { flex-direction: column; gap: 0.5rem; }
}
