/* ==========================================================================
   INKWELL THEME — Inspired by Massively (HTML5 UP)
   Visual DNA: dark moody bg, white content panel, serif body + uppercase
   sans headings, border-divided grids, ghost buttons, editorial rhythm
   ========================================================================== */

/* --- CSS Variables --- */
:root {
  --bg-dark: #1c232b;
  --bg-darker: #151b22;
  --bg-panel: #ffffff;
  --bg-muted: #f4f5f6;
  --bg-faq: #f9fafb;
  --text-primary: #1f2933;
  --text-secondary: #616e7c;
  --text-muted: #9aa5b1;
  --text-on-dark: #cbd2d9;
  --text-white: #ffffff;
  --accent: #1ab5e3;
  --accent-hover: #0e9cc7;
  --border-light: #e4e7eb;
  --border-dark: #323f4b;
  --font-body: Georgia, "Times New Roman", "Noto Serif", serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max-content: 70rem;
  --panel-gap: 2rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.85;
  color: var(--text-primary);
  background-color: var(--bg-dark);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

h1 { font-size: 3.2rem; line-height: 1.08; margin-bottom: 1.5rem; }
h2 { font-size: 1.65rem; margin-bottom: 1.2rem; }
h3 { font-size: 1.2rem; margin-bottom: 1rem; }

p { margin-bottom: 1.5rem; text-align: justify; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-style: italic;
  margin: 0 0 2rem 0;
}

/* --- Links --- */
.content-area a {
  border-bottom: 1px dotted var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}
.content-area a:hover {
  color: var(--accent);
  border-bottom-color: transparent;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 2.2rem;
  border: 2px solid var(--text-primary);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background-color 0.25s;
  text-align: center;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--light {
  border-color: rgba(255,255,255,0.7);
  color: var(--text-white);
}
.btn--light:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--filled {
  background: var(--text-primary);
  color: var(--text-white);
  border-color: var(--text-primary);
}
.btn--filled:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-white);
}

/* ==========================================================================
   LAYOUT — Dark bg with floating white panel
   ========================================================================== */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-dark);
}

.site-header__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.site-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-white);
  transition: color 0.2s;
}
.site-logo:hover { color: var(--accent); }

.nav-main { display: flex; gap: 0.2rem; }
.nav-main a {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  padding: 0.5rem 0.9rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-main a:hover { color: var(--accent); }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-white);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s;
}
.hamburger span { top: 50%; transform: translate(-50%, -50%); }
.hamburger span::before { content: ''; top: -7px; left: 0; }
.hamburger span::after { content: ''; top: 7px; left: 0; }

.hamburger.is-active span { background: transparent; }
.hamburger.is-active span::before {
  top: 0; transform: rotate(45deg);
}
.hamburger.is-active span::after {
  top: 0; transform: rotate(-45deg);
}

.mobile-nav {
  display: none;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-dark);
  padding: 1rem 2rem 1.5rem;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-dark);
  transition: color 0.2s;
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .nav-main { display: none; }
}

/* ==========================================================================
   HERO — Full-viewport, dark background, centered editorial intro
   ========================================================================== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 8rem;
  color: var(--text-white);
  background: var(--bg-dark);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 80%, rgba(26,181,227,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 20%, rgba(26,181,227,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12rem;
  background: linear-gradient(to top, var(--bg-dark), transparent);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 48rem;
}

.hero__title {
  font-size: 4.2rem;
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-white);
  margin-bottom: 1.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.9;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2.5rem;
}
.hero__subtitle p { text-align: center; margin-bottom: 0.5rem; }

@media (max-width: 768px) {
  .hero {
    min-height: 70vh;
    padding: 4rem 1.5rem 5rem;
    align-items: center;
  }
  .hero__title { font-size: 2.6rem; }
  .hero__subtitle { font-size: 1rem; }
}
@media (max-width: 480px) {
  .hero__title { font-size: 2rem; }
}

/* ==========================================================================
   MAIN CONTENT PANEL — White, floating on dark background
   ========================================================================== */
.content-panel {
  background: var(--bg-panel);
  position: relative;
  z-index: 2;
  margin: -4rem auto 0;
  width: calc(100% - var(--panel-gap) * 2);
  max-width: var(--max-content);
}

/* Panel used on inner pages (no negative margin) */
.content-panel--inner {
  margin-top: 0;
  padding-top: 0;
}

@media (max-width: 480px) {
  .content-panel { width: 100%; }
}

/* ==========================================================================
   SECTION — Latest Posts (FEATURED + GRID)
   ========================================================================== */
.section-posts {
  padding: 4.5rem 4rem 3rem;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3rem;
  text-align: center;
}

.section-label::after {
  content: '';
  display: block;
  width: 3rem;
  height: 2px;
  background: var(--accent);
  margin: 0.8rem auto 0;
}

/* Featured Post */
.featured-post {
  text-align: center;
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 2px solid var(--border-light);
}

.featured-post__date {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.featured-post__title {
  font-size: 2.8rem;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.featured-post__title a {
  color: var(--text-primary);
  transition: color 0.2s;
}
.featured-post__title a:hover { color: var(--accent); }

.featured-post__excerpt {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 36rem;
  margin: 0 auto 2rem;
  text-align: center;
}
.featured-post__excerpt p { text-align: center; }

.featured-post__image {
  margin: 2rem 0;
  overflow: hidden;
}
.featured-post__image img {
  width: 100%;
  transition: transform 0.5s ease;
}
.featured-post__image:hover img {
  transform: scale(1.02);
}

/* Posts Grid — 2-column with borders like Massively */
.posts-grid {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.posts-grid__item {
  width: 50%;
  padding: 2.8rem;
  border-style: solid;
  border-color: var(--border-light);
  border-left-width: 2px;
  border-top-width: 2px;
  text-align: center;
}

.posts-grid__item:nth-child(2n - 1) { border-left-width: 0; }
.posts-grid__item:nth-child(-n + 2) { border-top-width: 0; }

.posts-grid__date {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.posts-grid__title {
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 0.9rem;
}

.posts-grid__title a {
  color: var(--text-primary);
  transition: color 0.2s;
}
.posts-grid__title a:hover { color: var(--accent); }

.posts-grid__image {
  margin-bottom: 1.2rem;
  overflow: hidden;
}
.posts-grid__image img {
  width: 100%;
  transition: transform 0.4s ease;
}
.posts-grid__image:hover img {
  transform: scale(1.03);
}

.posts-grid__excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.75;
}
.posts-grid__excerpt p { text-align: center; font-size: inherit; }

@media (max-width: 768px) {
  .section-posts { padding: 3rem 2rem 2rem; }
  .featured-post__title { font-size: 2rem; }
  .posts-grid__item {
    width: 100%;
    border-left-width: 0 !important;
    border-top-width: 2px !important;
  }
  .posts-grid__item:first-child { border-top-width: 0 !important; }
}

@media (max-width: 480px) {
  .section-posts { padding: 2rem 1.5rem 1rem; }
  .posts-grid__item { padding: 2rem 0.5rem; }
}

/* ==========================================================================
   SECTION — Topics
   ========================================================================== */
.section-topics {
  padding: 4.5rem 4rem 3.5rem;
  border-top: 2px solid var(--border-light);
  background: var(--bg-muted);
}

.section-topics .section-label { margin-bottom: 2.5rem; }

.topics-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.topic-item {
  padding: 2.5rem 2.2rem;
  border: 1px solid var(--border-light);
  margin-top: -1px;
  margin-left: -1px;
  transition: background-color 0.3s;
}
.topic-item:hover {
  background: var(--bg-panel);
}

.topic-item__name {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  letter-spacing: 0.1em;
}

.topic-item__desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
}
.topic-item__desc p { text-align: left; margin-bottom: 0.5rem; }

@media (max-width: 768px) {
  .section-topics { padding: 3rem 2rem 2.5rem; }
  .topics-list { grid-template-columns: 1fr; }
  .topic-item { padding: 2rem 1.5rem; }
}

/* ==========================================================================
   SECTION — FAQ
   ========================================================================== */
.section-faq {
  padding: 4.5rem 4rem 4rem;
  border-top: 2px solid var(--border-light);
}

.section-faq .section-label { margin-bottom: 2.5rem; }

.faq-list {
  max-width: 52rem;
  margin: 0 auto;
}

.faq-entry {
  border-bottom: 1px solid var(--border-light);
  padding: 1.8rem 0;
}
.faq-entry:first-child { padding-top: 0; }
.faq-entry:last-child { border-bottom: 0; }

.faq-question {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  color: var(--text-primary);
  transition: color 0.2s;
  user-select: none;
}
.faq-question:hover { color: var(--accent); }

.faq-question::before {
  content: '+';
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.4;
  flex-shrink: 0;
  width: 1.2rem;
  text-align: center;
  transition: transform 0.3s;
}

.faq-entry.is-open .faq-question::before {
  content: '−';
}

.faq-answer {
  display: none;
  padding: 1rem 0 0.5rem 2.2rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.85;
}
.faq-answer p { text-align: left; }

.faq-entry.is-open .faq-answer {
  display: block;
}

@media (max-width: 768px) {
  .section-faq { padding: 3rem 2rem; }
}

/* ==========================================================================
   BLOG INDEX
   ========================================================================== */
.blog-header {
  text-align: center;
  padding: 5rem 4rem 3rem;
}

.blog-header__title {
  font-size: 3rem;
  margin-bottom: 0;
}

.blog-list {
  display: flex;
  flex-wrap: wrap;
}

.blog-list__item {
  width: 50%;
  padding: 2.8rem;
  border-style: solid;
  border-color: var(--border-light);
  border-left-width: 2px;
  border-top-width: 2px;
  text-align: center;
}
.blog-list__item:nth-child(2n - 1) { border-left-width: 0; }
.blog-list__item:nth-child(-n + 2) { border-top-width: 0; }

.blog-list__date {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.blog-list__title {
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 0.9rem;
}
.blog-list__title a {
  color: var(--text-primary);
  transition: color 0.2s;
}
.blog-list__title a:hover { color: var(--accent); }

.blog-list__image {
  margin-bottom: 1.2rem;
  overflow: hidden;
}
.blog-list__image img {
  width: 100%;
  transition: transform 0.4s ease;
}
.blog-list__image:hover img { transform: scale(1.03); }

.blog-list__excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.75;
}
.blog-list__excerpt p { text-align: center; font-size: inherit; }

@media (max-width: 768px) {
  .blog-header { padding: 3rem 2rem 2rem; }
  .blog-header__title { font-size: 2.2rem; }
  .blog-list__item {
    width: 100%;
    border-left-width: 0 !important;
    border-top-width: 2px !important;
  }
  .blog-list__item:first-child { border-top-width: 0 !important; }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  padding: 3rem 2rem;
  text-align: center;
  border-top: 2px solid var(--border-light);
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.8rem;
  height: 2.8rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 2px solid var(--border-light);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination a.active {
  background: var(--border-light);
  color: var(--text-primary);
}

.pagination .pag-prev,
.pagination .pag-next {
  padding: 0 1.2rem;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   SINGLE POST
   ========================================================================== */
.post-single {
  padding: 5rem 6rem 4rem;
}

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

.post-single__date {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post-single__title {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.post-single__excerpt {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 38rem;
  margin: 0 auto;
  text-align: center;
}
.post-single__excerpt p { text-align: center; }

.post-single__cover {
  margin: 0 -2rem 3rem;
  overflow: hidden;
}
.post-single__cover img { width: 100%; }

.post-single__body {
  max-width: 42rem;
  margin: 0 auto;
}
.post-single__body h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.post-single__body h3 { font-size: 1.15rem; margin-top: 2rem; }
.post-single__body img { margin: 2rem auto; }
.post-single__body ul, .post-single__body ol {
  margin: 0 0 1.5rem 1.5rem;
}
.post-single__body li {
  list-style: disc;
  margin-bottom: 0.4rem;
  line-height: 1.8;
}
.post-single__body ol li { list-style: decimal; }

@media (max-width: 1280px) {
  .post-single { padding: 4rem 4rem 3rem; }
}
@media (max-width: 768px) {
  .post-single { padding: 3rem 2rem 2rem; }
  .post-single__title { font-size: 2.2rem; }
  .post-single__cover { margin: 0 -0.5rem 2rem; }
}

/* ==========================================================================
   STATIC PAGE
   ========================================================================== */
.page-single {
  padding: 5rem 6rem 4rem;
}

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

.page-single__title {
  font-size: 3rem;
  line-height: 1.1;
}

.page-single__body {
  max-width: 42rem;
  margin: 0 auto;
}
.page-single__body h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.page-single__body h3 { font-size: 1.15rem; margin-top: 2rem; }
.page-single__body img { margin: 2rem auto; }
.page-single__body ul, .page-single__body ol {
  margin: 0 0 1.5rem 1.5rem;
}
.page-single__body li {
  list-style: disc;
  margin-bottom: 0.4rem;
  line-height: 1.8;
}
.page-single__body ol li { list-style: decimal; }

@media (max-width: 1280px) {
  .page-single { padding: 4rem 4rem 3rem; }
}
@media (max-width: 768px) {
  .page-single { padding: 3rem 2rem 2rem; }
  .page-single__title { font-size: 2.2rem; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--bg-muted);
  margin: 0 auto;
  width: calc(100% - var(--panel-gap) * 2);
  max-width: var(--max-content);
  position: relative;
  z-index: 2;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  padding: 3.5rem 4rem 2rem;
  gap: 3rem;
}

.footer-col {
  flex: 1;
  min-width: 14rem;
}

.footer-col__heading {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.footer-col a {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }

.footer-col p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: left;
}

.site-footer__bottom {
  border-top: 1px solid var(--border-light);
  padding: 1.5rem 4rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .site-footer { width: 100%; }
  .site-footer__inner {
    padding: 2.5rem 2rem 1.5rem;
    flex-direction: column;
    gap: 2rem;
  }
  .site-footer__bottom { padding: 1.2rem 2rem; }
}

/* Copyright bar beneath footer */
.copyright-bar {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Focus styles */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Fade-in animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(1.5rem); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeInUp 0.8s ease forwards;
}
.fade-up--d1 { animation-delay: 0.1s; opacity: 0; }
.fade-up--d2 { animation-delay: 0.25s; opacity: 0; }
.fade-up--d3 { animation-delay: 0.4s; opacity: 0; }
