/*
 * Theme: Tidepool Editorial
 * Visual DNA: Xtra Blog (templatemo_553)
 * 
 * Preserved DNA:
 * - Fixed left sidebar navigation
 * - Teal/cyan primary palette (#0CC / #099)
 * - Clean sans-serif typography (Source Sans Pro feel)
 * - Thick accent top-borders as dividers
 * - Generous line-height and spacing
 * - Square/minimal component styling
 * - Lily-style image hover effects
 * - Offset border decorations on nav
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --c-primary: #0CC;
  --c-primary-dark: #099;
  --c-primary-hover: #09b6b6;
  --c-text: #999;
  --c-text-dark: #555;
  --c-heading: #333;
  --c-white: #fff;
  --c-off-white: #F0F0F0;
  --c-light-bg: #F3F4F5;
  --c-border: #CCC;
  --c-link: #099;
  --sidebar-width: 380px;
  --sidebar-width-narrow: 300px;
  --font-body: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --line-height: 1.9;
  --transition: all 0.3s ease;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: var(--line-height);
  color: var(--c-text);
  overflow-x: hidden;
  background: var(--c-white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--c-heading);
  line-height: 1.3;
  margin: 0 0 0.6em;
  font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.2em; color: var(--c-text); }
a { color: var(--c-link); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--c-primary-hover); text-decoration: none; }

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

ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }

hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 10px 0;
}

hr.accent {
  border-top: 5px solid var(--c-primary);
  margin: 0 0 20px;
}

/* ========================================
   SKIP LINK
   ======================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--c-primary);
  color: var(--c-white);
  padding: 8px 16px;
  z-index: 9999;
  font-size: 0.9rem;
}

.skip-link:focus {
  top: 0;
  color: var(--c-white);
}

/* ========================================
   SIDEBAR / HEADER
   ======================================== */
.site-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--c-primary);
  color: var(--c-white);
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.site-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-inner {
  padding: 35px 30px 50px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Brand */
.sidebar-brand {
  margin-top: 40px;
  margin-bottom: 80px;
  text-align: center;
}

.sidebar-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  overflow: hidden;
}

.sidebar-logo img {
  max-width: 50px;
  max-height: 50px;
}

.sidebar-logo-placeholder {
  width: 28px;
  height: 28px;
  border: 3px solid var(--c-primary);
  transform: rotate(45deg);
}

.sidebar-brand h1 {
  color: var(--c-white);
  font-size: 1.5rem;
  margin-bottom: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-brand .tagline {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  margin-top: 6px;
  line-height: 1.5;
}

/* Sidebar Nav */
.sidebar-nav {
  margin-bottom: 70px;
  margin-left: -30px;
}

.sidebar-nav ul {
  list-style: none;
  position: relative;
}

.sidebar-nav li {
  margin-bottom: 24px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  color: var(--c-white);
  font-size: 1.25rem;
  padding: 18px 28px;
  height: 65px;
  max-width: 280px;
  transition: var(--transition);
  position: relative;
}

.sidebar-nav li:hover a,
.sidebar-nav li.active a {
  background: var(--c-white);
  color: var(--c-primary);
}

/* Offset border decoration on hover/active — signature Xtra Blog effect */
.sidebar-nav li:hover::after,
.sidebar-nav li.active::after {
  content: '';
  display: block;
  width: 100%;
  max-width: 280px;
  height: 65px;
  border: 1px solid rgba(255,255,255,0.7);
  margin-left: 10px;
  margin-top: -56px;
  position: absolute;
  z-index: -1;
}

/* Sidebar footer / email */
.sidebar-contact {
  margin-top: auto;
  padding-top: 30px;
}

.sidebar-contact a {
  color: var(--c-white);
  font-size: 0.9rem;
  opacity: 0.85;
}

.sidebar-contact a:hover { opacity: 1; }

.sidebar-description {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 25px;
  padding-right: 15px;
}

/* Mobile hamburger */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  background: rgba(0,204,204,0.85);
  color: var(--c-white);
  border: none;
  padding: 10px 14px;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.hamburger-btn:focus {
  outline: 2px solid var(--c-white);
  outline-offset: 2px;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.site-main {
  margin-left: var(--sidebar-width);
  padding: 70px 80px 30px;
  min-height: 100vh;
}

.content-wrap {
  max-width: 1000px;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
  margin-bottom: 80px;
  padding-bottom: 50px;
  border-bottom: 1px solid var(--c-border);
}

.hero-section .accent {
  margin-bottom: 30px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--c-heading);
  margin-bottom: 18px;
  line-height: 1.25;
  max-width: 700px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--c-text);
  max-width: 600px;
  margin-bottom: 28px;
  line-height: var(--line-height);
}

.hero-subtitle p { margin-bottom: 0.6em; }
.hero-subtitle p:last-child { margin-bottom: 0; }

.hero-cta {
  display: inline-block;
  background: var(--c-primary);
  color: var(--c-white);
  padding: 10px 38px;
  font-size: 1.15rem;
  border-radius: 4px;
  transition: var(--transition);
}

.hero-cta:hover {
  background: var(--c-primary-hover);
  color: var(--c-white);
}

/* ========================================
   LATEST POSTS (blog grid)
   ======================================== */
.section-heading {
  font-size: 1.6rem;
  color: var(--c-primary-dark);
  margin-bottom: 8px;
}

.section-intro {
  color: var(--c-text);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 50px;
  max-width: 980px;
}

.post-card {
  margin-bottom: 65px;
  max-width: 470px;
}

.post-card .accent { margin-bottom: 15px; }

/* Image hover — Lily effect from source template */
.post-image-wrap {
  overflow: hidden;
  background: #3085a3;
  display: block;
  position: relative;
  margin-top: 15px;
}

.post-image-wrap img {
  width: calc(100% + 50px);
  max-width: none;
  opacity: 0.75;
  transition: opacity 0.35s, transform 0.35s;
  transform: translate3d(-40px, 0, 0);
}

.post-image-wrap:hover img {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.post-card-title {
  padding-top: 22px;
  margin-bottom: 0;
}

.post-card-title a {
  color: var(--c-primary-dark);
  font-size: 1.5rem;
  font-weight: 600;
  transition: var(--transition);
}

.post-card-title a:hover {
  color: var(--c-primary);
}

.post-card-excerpt {
  padding-top: 14px;
  font-size: 0.95rem;
  line-height: 1.85;
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 28px;
  font-size: 0.88rem;
  color: var(--c-primary-dark);
}

.post-card-meta + hr {
  margin-top: 12px;
}

/* ========================================
   TOPICS SECTION
   ======================================== */
.topics-section {
  margin-bottom: 80px;
  padding-top: 20px;
}

.topics-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 50px;
  max-width: 980px;
}

.topic-item {
  padding: 28px 0;
  border-top: 5px solid var(--c-primary);
  position: relative;
}

.topic-item::after {
  content: '';
  position: absolute;
  top: 5px;
  right: -8px;
  width: 40px;
  height: 5px;
  background: var(--c-primary);
  opacity: 0.3;
}

.topic-name {
  font-size: 1.3rem;
  color: var(--c-primary-dark);
  margin-bottom: 10px;
  font-weight: 600;
}

.topic-desc {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--c-text);
}

.topic-desc p { margin-bottom: 0.5em; }
.topic-desc p:last-child { margin-bottom: 0; }

/* ========================================
   FAQ SECTION
   ======================================== */
.faq-section {
  margin-bottom: 80px;
  padding-top: 20px;
}

.faq-list {
  list-style: none;
  max-width: 700px;
}

.faq-item {
  margin-bottom: 35px;
  padding-bottom: 35px;
  border-bottom: 1px solid var(--c-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-primary-dark);
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.faq-question::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  background: var(--c-primary);
  transform: rotate(45deg);
  transition: var(--transition);
}

.faq-question:hover { color: var(--c-primary); }

.faq-answer {
  padding-left: 20px;
  font-size: 0.94rem;
  line-height: 1.8;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.faq-item.open .faq-answer {
  max-height: 600px;
  opacity: 1;
}

.faq-item.open .faq-question::before {
  transform: rotate(0deg);
  background: var(--c-primary-hover);
}

.faq-answer p { margin-bottom: 0.5em; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ========================================
   BLOG INDEX PAGE
   ======================================== */
.page-header {
  margin-bottom: 50px;
}

.page-header .accent { margin-bottom: 25px; }

.page-title {
  font-size: 2rem;
  color: var(--c-heading);
  margin-bottom: 0;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 980px;
  margin-top: 40px;
  margin-bottom: 60px;
  flex-wrap: wrap;
  gap: 20px;
}

.pagination-nav-btns {
  display: flex;
  gap: 15px;
}

.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 36px;
  background: var(--c-primary);
  color: var(--c-white);
  border-radius: 4px;
  font-size: 1.1rem;
  transition: var(--transition);
}

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

.pag-btn.disabled {
  background: var(--c-off-white);
  color: var(--c-text);
  pointer-events: none;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-pages span {
  font-size: 1rem;
  color: var(--c-text);
}

.pag-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: var(--c-off-white);
  color: var(--c-text);
  font-size: 1.1rem;
  border-radius: 4px;
  transition: var(--transition);
}

.pag-number:hover,
.pag-number.active {
  background: var(--c-primary);
  color: var(--c-white);
}

/* ========================================
   SINGLE POST
   ======================================== */
.post-single {
  max-width: 720px;
}

.post-single-header {
  margin-bottom: 35px;
}

.post-single-title {
  font-size: 2rem;
  color: var(--c-primary-dark);
  margin-bottom: 10px;
}

.post-single-date {
  color: var(--c-text);
  font-size: 0.9rem;
}

.post-single-cover {
  margin-bottom: 35px;
  overflow: hidden;
}

.post-single-cover img {
  width: 100%;
}

.post-single-excerpt {
  font-size: 1.05rem;
  color: var(--c-text-dark);
  border-left: 4px solid var(--c-primary);
  padding-left: 20px;
  margin-bottom: 35px;
  line-height: 1.85;
  font-style: italic;
}

/* Content HTML styling */
.post-content h2 {
  color: var(--c-primary-dark);
  margin-top: 2em;
}

.post-content h3 {
  color: var(--c-heading);
  margin-top: 1.5em;
}

.post-content p {
  margin-bottom: 1.3em;
}

.post-content ul, .post-content ol {
  padding-left: 1.8em;
  margin-bottom: 1.3em;
}

.post-content li {
  margin-bottom: 0.4em;
}

.post-content img {
  margin: 1.5em 0;
  border-radius: 0;
}

.post-content a {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

.post-content a:hover {
  color: var(--c-primary);
}

.post-content blockquote {
  border-left: 4px solid var(--c-primary);
  margin: 1.5em 0;
  padding: 10px 20px;
  background: var(--c-light-bg);
}

/* Page content */
.page-content {
  max-width: 720px;
}

.page-content h2 { color: var(--c-primary-dark); margin-top: 2em; }
.page-content h3 { color: var(--c-heading); margin-top: 1.5em; }
.page-content p { margin-bottom: 1.3em; }
.page-content ul, .page-content ol { padding-left: 1.8em; margin-bottom: 1.3em; }
.page-content li { margin-bottom: 0.4em; }
.page-content a { color: var(--c-primary-dark); text-decoration: underline; }
.page-content a:hover { color: var(--c-primary); }
.page-content blockquote {
  border-left: 4px solid var(--c-primary);
  margin: 1.5em 0;
  padding: 10px 20px;
  background: var(--c-light-bg);
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 980px;
  padding-bottom: 30px;
}

.footer-brand {
  font-weight: 600;
  color: var(--c-heading);
  font-size: 1rem;
  margin-bottom: 6px;
}

.footer-nav {
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--c-text);
  font-size: 0.9rem;
}

.footer-nav a:hover { color: var(--c-primary); }

.footer-contact {
  font-size: 0.9rem;
}

.footer-contact a { color: var(--c-primary-dark); }
.footer-contact a:hover { color: var(--c-primary); }

.footer-copy {
  color: var(--c-text);
  font-size: 0.85rem;
  text-align: right;
}

/* ========================================
   RESPONSIVE: Narrower sidebar
   ======================================== */
@media (max-width: 1500px) {
  .site-sidebar { width: var(--sidebar-width-narrow); }
  .site-main {
    margin-left: var(--sidebar-width-narrow);
    padding: 60px 60px 30px;
  }
}

/* ========================================
   RESPONSIVE: Sidebar collapses
   ======================================== */
@media (max-width: 991px) {
  .site-sidebar {
    width: var(--sidebar-width-narrow);
    left: calc(-1 * var(--sidebar-width-narrow));
    transition: left 0.3s ease;
  }

  .site-sidebar.open {
    left: 0;
  }

  .hamburger-btn {
    display: block;
  }

  .site-sidebar.open ~ .hamburger-btn {
    left: calc(var(--sidebar-width-narrow) + 8px);
  }

  .site-main {
    margin-left: 0;
    padding: 55px 35px 25px;
    width: 100%;
  }
}

/* ========================================
   RESPONSIVE: Tablet
   ======================================== */
@media (max-width: 768px) {
  .site-main { padding: 55px 20px 20px; }

  .hero-title { font-size: 1.7rem; }

  .posts-grid { grid-template-columns: 1fr; gap: 0; }
  .post-card { max-width: 100%; }

  .topics-list { grid-template-columns: 1fr; gap: 20px; }

  .pagination-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner { flex-direction: column; }
  .footer-copy { text-align: left; }
}

/* ========================================
   RESPONSIVE: Small mobile
   ======================================== */
@media (max-width: 480px) {
  .hero-title { font-size: 1.45rem; }
  .hero-cta { padding: 10px 28px; font-size: 1rem; }
  .section-heading { font-size: 1.35rem; }
  .post-card-title a { font-size: 1.25rem; }
  .sidebar-brand { margin-top: 25px; margin-bottom: 50px; }
}

/* ========================================
   FOCUS STYLES
   ======================================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ========================================
   OVERLAY (for mobile sidebar backdrop)
   ======================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 90;
}

.sidebar-overlay.show { display: block; }
