:root {
  --op-container: 1200px;
  --op-font-size: 17px;
  --op-line-height: 1.7;
  --op-link: #1e73be;
  --op-accent: #1e73be;
  --op-bg: #f4f6f8;
  --op-surface: #ffffff;
  --op-border: #d9dee5;
  --op-text: #1f2937;
  --op-muted: #6b7280;
  --op-heading: #111827;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--op-bg);
  color: var(--op-text);
  font-size: var(--op-font-size);
  line-height: var(--op-line-height);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--op-link);
  text-decoration: none;
}

a:hover {
  opacity: 0.9;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--op-heading);
  margin: 0 0 0.75em;
  line-height: 1.3;
}

p {
  margin: 0 0 1em;
}

.container {
  width: min(var(--op-container), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--op-border);
}

.inside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand {
  color: var(--op-heading);
  font-size: 1.35rem;
  font-weight: 700;
}

.site-tagline {
  margin: 0;
  color: var(--op-muted);
  font-size: 0.92rem;
}

.main-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--op-border);
  background: #fff;
  color: var(--op-heading);
  border-radius: 4px;
  padding: 0.45rem 0.7rem;
}

.menu {
  flex: 1;
}

.menu-list,
.footer-menu,
.social-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.menu-list a,
.footer-menu a,
.social-menu a {
  display: inline-block;
  color: var(--op-heading);
  border-radius: 3px;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
}

.menu-list a:hover,
.footer-menu a:hover,
.social-menu a:hover {
  background: #f1f5f9;
}

.menu-list li {
  position: relative;
}

.menu-list .sub-menu {
  display: none;
  position: absolute;
  min-width: 220px;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--op-border);
  z-index: 30;
}

.menu-list li:hover > .sub-menu {
  display: block;
}

.site-main {
  padding: 1.5rem 0 2.5rem;
}

.site-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.site-content.left-sidebar {
  grid-template-columns: 300px 1fr;
}

.site-content.left-sidebar .content-area {
  order: 2;
}

.site-content.left-sidebar .sidebar {
  order: 1;
}

.site-content.no-sidebar {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--op-surface);
  border: 1px solid var(--op-border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--op-border);
  background: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-media,
.post-featured-media,
.podcast-thumbnail,
.tool-thumbnail {
  border: 1px solid var(--op-border);
  background: #f8fafc;
}

.card-media img,
.post-featured-media img,
.podcast-thumbnail img,
.tool-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card p,
.card-meta,
.podcast-meta,
.tool-affiliate-note {
  color: var(--op-muted);
}

.card a {
  margin-top: auto;
  font-weight: 600;
}

.pill {
  display: inline-block;
  border: 1px solid var(--op-border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  color: var(--op-heading);
}

.link-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.signup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.signup input {
  flex: 1 1 240px;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--op-border);
  background: #fff;
}

.sidebar {
  background: #fff;
  border: 1px solid var(--op-border);
  padding: 1rem;
}

.widget {
  margin-bottom: 1.2rem;
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.post-content,
.page-content,
.podcast-content,
.tool-content {
  color: #374151;
}

.tool-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.site-footer {
  background: #fff;
  border-top: 1px solid var(--op-border);
}

.footer-inner {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 1rem;
}

.footer-col {
  border: 1px solid var(--op-border);
  padding: 0.8rem;
}

.social-menu-wrap {
  padding-bottom: 1rem;
}

/* ========== Dark Mode ========== */
.dark-mode {
  --op-bg: #111827;
  --op-surface: #1f2937;
  --op-border: #374151;
  --op-text: #e5e7eb;
  --op-muted: #9ca3af;
  --op-heading: #f9fafb;
}

.dark-mode .site-header,
.dark-mode .site-footer,
.dark-mode .menu,
.dark-mode .sidebar,
.dark-mode .panel,
.dark-mode .card {
  background: var(--op-surface);
  color: var(--op-text);
}

.dark-mode .menu-list a:hover,
.dark-mode .footer-menu a:hover {
  background: #374151;
}

/* ========== Dark Mode Toggle Button ========== */
#dark-mode-toggle {
  border: 1px solid var(--op-border);
  background: var(--op-surface);
  color: var(--op-text);
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#dark-mode-toggle:hover {
  background: var(--op-border);
}

/* ========== Scroll to Top Button ========== */
#scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--op-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 999;
}

#scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scroll-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#scroll-to-top::before {
  content: '↑';
  font-size: 1.5rem;
  font-weight: bold;
}

/* ========== Reading Progress Bar ========== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--op-accent), var(--op-link));
  width: 0%;
  transition: width 0.1s ease;
  z-index: 9999;
}

/* ========== Scroll Animations ========== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Interactive Card Effects ========== */
.card,
.panel {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--op-accent);
}

.card-media,
.post-featured-media {
  overflow: hidden;
}

.card-media img,
.post-featured-media img {
  transition: transform 0.5s ease;
}

.card:hover .card-media img,
.card:hover .post-featured-media img {
  transform: scale(1.05);
}

/* ========== Button Animations ========== */
button,
.btn,
input[type="submit"],
input[type="button"] {
  transition: all 0.3s ease;
  cursor: pointer;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active,
.btn:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: translateY(0);
}

/* ========== Link Animations ========== */
a {
  transition: color 0.2s ease, opacity 0.2s ease;
}

.menu-list a,
.footer-menu a {
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}

.menu-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--op-accent);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.menu-list a:hover::after {
  width: 80%;
}

/* ========== Form Focus States ========== */
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--op-accent);
  outline-offset: 2px;
  transition: outline 0.2s ease;
}

.input-focused {
  transform: scale(1.01);
  transition: transform 0.2s ease;
}

/* ========== Loading Skeleton ========== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========== Mobile Menu Animation ========== */
.menu {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu.is-open {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Pulse Animation for CTAs ========== */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse-on-hover:hover {
  animation: pulse 0.6s ease-in-out;
}

/* ========== Accessibility Focus Styles ========== */
.user-is-tabbing *:focus {
  outline: 3px solid var(--op-accent);
  outline-offset: 2px;
}

/* ========== Smooth Transitions ========== */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  .inside-header {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .menu {
    width: 100%;
    display: none;
    border: 1px solid var(--op-border);
    background: #fff;
    padding: 0.45rem;
  }

  .menu.is-open {
    display: block;
  }

  .menu-list {
    flex-direction: column;
    gap: 0.25rem;
  }

  .menu-list .sub-menu {
    position: static;
    display: block;
    border: 0;
    padding: 0 0 0.2rem 0.8rem;
    background: transparent;
  }

  .site-content,
  .site-content.left-sidebar,
  .cards,
  .tool-grid-2,
  .footer-widgets {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 1rem;
  }

  #scroll-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
}
