:root {
  --ink: #333333;
  --gray-700: #666666;
  --gray-300: #e6e6e6;
  --bg: #f2f2f2;
  --white: #ffffff;
  --steel-blue: #446e9d;
  --steel-blue-light: #4a75a8;
  --steel-blue-footer: #5589c5;
  --accent: #dd6420;
  --accent-dark: #b6501a;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: linear-gradient(135deg, var(--steel-blue), var(--steel-blue-light));
  flex-wrap: wrap;
  gap: 12px;
}

.site-header .brand {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
}

.site-header nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--white);
  font-weight: 600;
  opacity: 0.9;
}

.site-header nav a:hover {
  opacity: 1;
  color: var(--white);
  text-decoration: underline;
}

.post-list, .post {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.post-list-inner {
  display: grid;
  gap: 20px;
}

.page-title {
  margin: 0;
  font-size: 1.8rem;
  color: var(--ink);
}

.page-intro {
  margin: 0 0 8px;
  color: var(--gray-700);
}

.post-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  color: inherit;
}

.post-card.no-thumb {
  grid-template-columns: 1fr;
}

.post-card:hover { text-decoration: none; box-shadow: 0 16px 36px rgba(27, 37, 55, 0.14); }

.post-card-thumb {
  width: 180px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--gray-300);
}

.post-card-body h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--ink);
}

.post-date {
  color: var(--gray-700);
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.post-excerpt {
  color: var(--gray-700);
  font-size: 0.95rem;
  margin: 0;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  font-weight: 600;
}

.post-inner h1 {
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.about-inner { text-align: center; }

.about-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.about-inner p {
  text-align: left;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.post-body {
  margin-top: 24px;
  font-size: 1.05rem;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 16px 0;
}

.post-video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.post-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.share-row {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-label { color: var(--gray-700); font-weight: 600; }

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-300);
}

.project-nav-link {
  flex: 1;
  color: var(--steel-blue);
  font-weight: 600;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
}

.project-nav-next { text-align: right; }

.project-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  color: var(--steel-blue);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 50;
  text-decoration: none;
}

.project-arrow:hover {
  background: var(--steel-blue);
  color: var(--white);
  text-decoration: none;
}

.project-arrow-left { left: 16px; }
.project-arrow-right { right: 16px; }

@media (max-width: 900px) {
  .project-arrow { width: 40px; height: 40px; font-size: 1rem; }
}

.share-btn {
  background: var(--white);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.share-btn:hover {
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
}

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--white);
  background: var(--steel-blue-footer);
  font-size: 0.85rem;
}

.video-section {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
}

.video-section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.video-section-page .video-section-inner {
  max-width: 650px;
}

.video-section-page .video-featured-title {
  font-size: 1.2rem;
}

.video-section-page .video-play-badge {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
}

.video-section-inner h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 1.3rem;
}

.video-featured {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
}

.video-featured img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.video-featured:hover img { opacity: 1; }

.video-featured iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-featured-caption {
  margin-top: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.video-featured-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.video-featured-title {
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  max-width: 80%;
}

.video-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  background: rgba(200, 0, 0, 0.85);
  color: var(--white);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.video-watch-badge {
  align-self: flex-end;
  background: rgba(0, 0, 0, 0.6);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
}

.video-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.video-card {
  color: var(--ink);
}

.video-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.video-card-title {
  display: block;
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.video-card:hover .video-card-title { color: var(--steel-blue); text-decoration: underline; }

.video-channel-link {
  margin-top: 20px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .post-card { grid-template-columns: 1fr; }
  .post-card-thumb { width: 100%; height: 200px; }
}

/* Admin */

.admin-wrap {
  max-width: 420px;
  margin: 5rem auto;
  padding: 0 1.5rem;
}

.admin-wrap-wide {
  max-width: 960px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.admin-card h2, .admin-wrap-wide > h2 {
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.admin-error {
  background: #f8d7da;
  color: #842029;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-topbar .btn { margin-right: 0.75rem; }
.admin-topbar a.admin-link + a.admin-link { margin-left: 1rem; }

.admin-link {
  color: var(--steel-blue);
  font-weight: 600;
  text-decoration: none;
}

.admin-link:hover { color: var(--steel-blue-light); text-decoration: underline; }

.admin-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--steel-blue);
  font-weight: 600;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.admin-link-btn:hover { color: var(--steel-blue-light); }

.admin-card label,
.admin-form label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.admin-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow);
}

.admin-hint {
  font-weight: 400;
  color: var(--gray-700);
  font-size: 0.8rem;
}

.admin-form label.admin-checkbox-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-featured-badge {
  color: var(--steel-blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  align-self: center;
}

.admin-card input,
.admin-form input,
.admin-form textarea,
.admin-form select {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
}

.admin-form textarea { resize: vertical; line-height: 1.5; }

.admin-field-title input { font-size: 1.4rem; }

.admin-divider {
  border: none;
  border-top: 1px solid var(--gray-300);
  margin: 0 0 1.5rem;
}

.ql-toolbar.ql-snow {
  border-color: var(--gray-300);
  border-radius: 10px 10px 0 0;
  background: var(--white);
  margin: 0;
}

.admin-card input:focus,
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--steel-blue);
  background: var(--white);
}

.admin-card button.btn,
.admin-form button.btn {
  width: 100%;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.admin-wrap-wide .admin-form button.btn { width: auto; }

.btn {
  display: inline-block;
  background: var(--steel-blue);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.btn:hover { background: var(--steel-blue-light); color: var(--white); text-decoration: none; }

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

.admin-table tr { border-bottom: 1px solid var(--gray-300); }
.admin-table tr:last-child { border-bottom: none; }
.admin-table td { padding: 1rem 1.25rem; font-size: 0.95rem; }

.admin-table-date { color: var(--gray-700); white-space: nowrap; }
