/* ===== MyGridGB — shared stylesheet ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #1a4d7a;
  --brand-dark:   #143d61;
  --brand-bg:     #d4e8f5;
  --green:        #2d7ab8;
  --green-light:  #4faadb;
  --green-bg:     #d4e8f5;
  --text:         #0F172A;
  --muted:        #64748B;
  --border:       #EBEBEB;
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --nav-bg:       #0d1f35;
  --sidebar-width: 260px;
  --nav-height:   60px;
  --radius:       10px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 1px 3px rgba(0,0,0,.04);
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ===== HEADER ===== */
#site-header {
  background: var(--nav-bg);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 24px;
  gap: 28px;
}

#site-header .logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
}

#site-header .logo:hover { text-decoration: none; color: #fff; }

.logo-accent { color: #4faadb; }

/* ===== NAV ===== */
nav { flex: 1; }

nav ul {
  list-style: none;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

nav > ul > li { position: relative; }

/* Bridge the gap between nav item and dropdown so hover isn't lost */
nav > ul > li::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  display: none;
}
nav > ul > li:hover::after { display: block; }

nav > ul > li > a {
  display: block;
  padding: 7px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

nav > ul > li > a:hover,
nav > ul > li > a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}

/* Dropdown */
nav ul ul {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #1E293B;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  min-width: 220px;
  z-index: 200;
  list-style: none;
  padding: 6px;
}

nav ul li:hover > ul { display: block; }

nav ul ul li a {
  display: block;
  padding: 9px 14px;
  font-size: 13.5px;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  border-radius: 5px;
  transition: background .12s, color .12s;
}

nav ul ul li a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}

/* Mobile hamburger */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
#nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: .2s;
}

/* ===== PAGE LAYOUT ===== */
.page-wrap {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-wrap > main {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 40px 44px;
  min-width: 0;
}

.page-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.page-title + .page-intro {
  margin-top: 10px;
}

.page-intro {
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.75;
}

/* ===== EMBED AREA ===== */
.embed-area {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}

.embed-area iframe {
  display: block;
  max-width: 100%;
}

/* ===== BOTTOM CARDS ===== */
.bottom-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.bottom-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.bottom-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  align-self: flex-start;
}

.bottom-card img { max-width: 100%; border-radius: 6px; }

.bottom-card p { font-size: 13px; color: var(--muted); line-height: 1.55; }

.follow-btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: opacity .15s;
}
.follow-btn:hover { opacity: .8; text-decoration: none; color: #fff; }

/* ===== HOME PAGE ===== */
.home-hero {
  background: linear-gradient(135deg, #2d7ab8 0%, #1a4d7a 100%);
  color: #fff;
  padding: 52px 36px;
  border-radius: 8px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

/* Decorative circle */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='600' height='300' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='520' cy='60' r='200' fill='rgba(255,255,255,0.05)'/%3E%3Ccircle cx='480' cy='240' r='120' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E") no-repeat right center;
  background-size: cover;
  pointer-events: none;
}

.home-hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -.03em;
  position: relative;
}

.home-hero p {
  font-size: 1.05rem;
  opacity: .88;
  line-height: 1.65;
  position: relative;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.blog-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  transition: border-color .2s, transform .15s;
}

.blog-card:hover {
  border-color: #C8C8C8;
  transform: translateY(-2px);
}

.blog-card .cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brand);
  margin-bottom: 7px;
}

.blog-card h3 { font-size: 1rem; margin-bottom: 8px; line-height: 1.45; font-weight: 600; }
.blog-card h3 a { color: var(--text); }
.blog-card h3 a:hover { color: var(--brand); text-decoration: none; }
.blog-card .meta { font-size: 12px; color: var(--muted); }
.blog-card .excerpt { font-size: 13.5px; margin-top: 8px; color: var(--muted); line-height: 1.6; }

/* ===== SHARE LINK BOX ===== */
.share-box {
  background: var(--brand-bg);
  border-left: 4px solid var(--brand);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0 24px;
  font-size: 13.5px;
  word-break: break-all;
  color: var(--text);
}

/* ===== FOOTER ===== */
#site-footer {
  background: var(--nav-bg);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 36px 16px;
  font-size: 13px;
  margin-top: 0;
  line-height: 1.9;
}

#site-footer a { color: rgba(255,255,255,.7); transition: color .15s; }
#site-footer a:hover { color: #fff; text-decoration: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .page-wrap { margin: 16px auto; }

  .page-wrap > main { padding: 28px 22px; }

  .bottom-cards { grid-template-columns: 1fr; }

  #nav-toggle { display: flex; }

  nav { display: none; }
  nav.open {
    display: block;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 8px 16px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
  }

  nav ul { flex-direction: column; gap: 0; }
  nav ul ul {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,.06);
    border-radius: 6px;
    margin: 4px 0 4px 12px;
    padding: 4px;
  }
  nav ul li:hover > ul { display: none; }
  nav ul li.open > ul { display: block; }
}
