:root {
  --primary-color: #003333;
  --secondary-color: #2a99aa;
  --accent-color: #2a99aa;
  --text-color: #333;
  --bg-color: #fff;
  --font-main: 'Outfit', 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--bg-color);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Nav */
header {
  background-color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 99999 !important;
  width: 100%;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
}

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

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 25px;
}

nav ul li a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

nav ul li a:hover {
  color: var(--accent-color);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1100;
}

.hamburger {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--primary-color);
  position: relative;
  transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  bottom: -8px;
}

.menu-open .hamburger {
  background: transparent;
}

.menu-open .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.menu-open .hamburger::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* Homepage Hero */
.hero-home {
  height: 60vh;
  background: url('/assets/img/hero-bg.jpg') no-repeat center center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 1;
  /* Keep below header */
}

.hero-home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: white;
}

.hero-content h1 {
  font-size: 3.5rem;
  letter-spacing: 3px;
  font-weight: 800;
  max-width: 900px;
  line-height: 1.2;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  nav .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    padding-top: 100px;
    z-index: 1050;
  }

  .menu-open .nav-links {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  nav ul li {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .hero-content h1 {
    font-size: 2.2rem;
    letter-spacing: 1px;
    padding: 0 20px;
  }

  .hero-home {
    height: 50vh;
  }

  .team-content h2 {
    font-size: 1.8rem;
    word-break: break-word;
  }
}

/* Grid Sections */
.home-categories {
  padding: 100px 0;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.cat-block {
  text-align: center;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 20px;
  border-radius: 12px;
}

.cat-block:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
  background: #fff;
}

.cat-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.cat-block h3 {
  font-size: 1.1rem;
  margin-bottom: 25px;
  height: 3em;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-min {
  display: inline-block;
  padding: 10px 25px;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.btn-min:hover {
  background: var(--accent-color);
  color: #fff;
}

/* Opt-in Section */
.home-optin {
  background: #f8fbfa;
  padding: 80px 0;
}

.optin-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.optin-book img {
  max-width: 250px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  border-radius: 5px;
}

.optin-form-wrapper {
  max-width: 450px;
}

.optin-form-wrapper h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.inline-form input {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.inline-form button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.inline-form button:hover {
  opacity: 0.9;
}

/* Latest Articles */
.latest-articles {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.small-title {
  color: var(--accent-color);
  text-transform: uppercase;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.post-card {
  background: #fff;
  transition: transform 0.3s;
}

.post-card .thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 4px;
}

.post-card .thumbnail img,
.post-card .thumbnail picture,
.post-card .thumbnail picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card .content {
  padding: 20px 0;
}

.post-card h3 a {
  text-decoration: none;
  color: var(--primary-color);
  font-size: 1.3rem;
  line-height: 1.4;
}

.post-card p {
  color: #666;
  font-size: 0.95rem;
  margin: 15px 0;
}

.read-more {
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--accent-color);
}

/* Footer */
footer {
  background: #f4f4f4;
  padding: 60px 0;
  text-align: center;
}

footer p {
  margin-bottom: 20px;
  color: #888;
}

footer ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

footer ul li a {
  text-decoration: none;
  color: #666;
  font-size: 0.85rem;
}

/* Post Content Styling */
.post {
  max-width: 800px;
  margin: 60px auto;
  padding: 0 20px;
}

.post header h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 30px;
}

.page {
  padding: 60px 0;
}

.page h1 {
  margin-bottom: 40px;
  font-size: 2.5rem;
  color: var(--primary-color);
}

.page .content ul {
  margin-left: 20px;
  margin-bottom: 30px;
  list-style-type: none;
  /* Cleaner look for sitemap */
  padding-left: 0;
}

.page .content li {
  margin-bottom: 12px;
}

.page .content li a {
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: 500;
  transition: color 0.2s;
}

.page .content li a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.page h2 {
  margin-top: 50px;
  margin-bottom: 25px;
  font-size: 1.8rem;
  color: var(--primary-color);
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.post .meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 40px;
}

/* Team Section */
.home-team {
  padding: 100px 0;
  background: #fff;
}

.team-flex {
  display: flex;
  align-items: center;
  gap: 60px;
}

.team-image {
  flex: 1;
}

.team-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.team-content {
  flex: 1.5;
}

.team-content h2 {
  font-size: 2.2rem;
  margin-bottom: 25px;
  color: var(--primary-color);
}

.team-content p {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #555;
  line-height: 1.7;
}

.team-content a {
  color: var(--accent-color);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .team-flex {
    flex-direction: column;
  }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: #fff;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10000;
  border: 1px solid #eee;
  max-width: 1000px;
  margin: 0 auto;
}

.cookie-banner p {
  font-size: 0.95rem;
  color: #444;
  margin: 0;
  padding-right: 20px;
}

.cookie-banner .actions {
  display: flex;
  gap: 10px;
}

.cookie-banner button {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

#accept-cookies {
  background: var(--accent-color);
  color: white;
  border: none;
}

#refuse-cookies {
  background: #f4f4f4;
  color: #666;
  border: 1px solid #ddd;
}

.cookie-banner.hidden {
  display: none;
}

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
}

.post .content {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #333;
  text-align: justify;
}

.post .content h2 {
  margin: 60px 0 30px;
  font-size: 2rem;
}

.post .content h3 {
  margin: 40px 0 20px;
  font-size: 1.5rem;
}

.post .content p {
  margin-bottom: 25px;
}

.post .content img {
  width: 100%;
  height: auto;
  margin: 40px 0;
}

/* Personalized CTA */
.personalized-cta {
  background: #fdf6e3;
  border-left: 5px solid var(--accent-color);
  padding: 40px;
  margin: 40px 0;
}

/* Category Page Layout (Two Columns) */
.layout-category {
  padding: 60px 0;
}

.category-grid {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 60px;
}

.category-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-card {
  background: #fdf6e3;
  padding: 30px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  margin-bottom: 30px;
}

.sidebar-card h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.sidebar-card p {
  font-size: 0.95rem;
  margin-bottom: 20px;
  color: #555;
}

.toc {
  background: #f9f9f9;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 40px;
}

.toc h4 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc ul {
  list-style: none;
}

.toc ul li {
  margin-bottom: 10px;
}

.toc ul li a {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.2s;
}

.toc ul li a:hover {
  color: var(--accent-color);
}

@media (max-width: 992px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* Page Header & Cover Images */
.page-header {
  margin-bottom: 40px;
}

.page-cover {
  width: 100%;
  max-height: 350px;
  overflow: hidden;
  border-radius: 8px;
  margin-top: 20px;
}

.page-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-image {
  margin-bottom: 30px;
  max-height: 400px;
  overflow: hidden;
  border-radius: 8px;
}

.featured-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Modal Stylings */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 40px;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close-modal {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #000;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
  text-align: center;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-form input {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.modal-form button {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
}

.modal-form button:hover {
  opacity: 0.9;
}

.hidden {
  display: none !important;
}

/* Video Container Fix */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  /* 16:9 */
  height: 0;
  overflow: hidden;
  margin: 20px 0;
}

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

.cover-image-sidebar img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Category Page Specific Typography */
.layout-category .content {
  text-align: justify;
  hyphens: auto;
}

.layout-category .content h2 {
  margin-top: 50px;
  margin-bottom: 25px;
}

.layout-category .content p {
  margin-bottom: 25px;
}

/* Service Cards */
.service-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}

.service-card {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border-top: 5px solid var(--accent-color);
  display: flex;
  flex-direction: column;
}

.service-card h3 {
  margin-top: 0 !important;
  color: var(--primary-color);
}

.service-card ul {
  margin-bottom: 30px;
}

.service-card .btn-min {
  margin-top: auto;
  text-align: center;
}

@media (max-width: 768px) {
  .service-cards {
    grid-template-columns: 1fr;
  }
}

/* Post Related Posts & CTA Styles */
.related-posts {
  padding: 80px 0;
  border-top: 1px solid #eee;
}

.related-posts h3 {
  text-align: center;
  margin-bottom: 50px;
  font-size: 1.8rem;
  color: var(--primary-color);
}

.post-opt-in {
  padding: 60px 0 100px;
}

.personalized-cta {
  background: #fdf6e3;
  padding: 50px;
  border-radius: 15px;
  border-left: 8px solid var(--accent-color);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
}

.cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.cta-text {
  flex: 1;
}

.cta-hook {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px !important;
}

.cta-intent {
  font-style: italic;
  margin-bottom: 20px !important;
  color: #666;
}

.cta-invitation {
  font-size: 1.1rem;
  color: #333;
}

.cta-action {
  text-align: center;
  min-width: 250px;
}

.cta-action p {
  font-size: 0.9rem;
  margin-bottom: 15px !important;
  color: #555;
  font-weight: 600;
}

.basic-opt-in {
  background: #f8fbfa;
  padding: 60px;
  text-align: center;
  border-radius: 15px;
}

.basic-opt-in h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.basic-opt-in p {
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .cta-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Enhanced Modal Styling */
.modal-content {
  background: linear-gradient(to bottom right, #ffffff, #f9fbfb);
  border: none;
  overflow: hidden;
}

.modal-content h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-top: 10px;
}

.modal-content .close-modal {
  top: 20px;
  right: 25px;
  background: #eee;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-content .close-modal:hover {
  background: #ddd;
}

.modal-form input:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.1);
}

.modal-form button {
  box-shadow: 0 4px 15px rgba(38, 166, 154, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.modal-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(38, 166, 154, 0.4);
}

.section-title h2,
.section-title h3 {
  margin-top: 10px;
  font-size: 2.2rem;
  color: var(--primary-color);
}

/* Global Image Fix to prevent distortion from width/height attributes */
img {
  height: auto;
  max-width: 100%;
}

/* Specific Home Fixes for distorted images */
.cat-image img,
.optin-book img,
.category-card img,
.hero-image img {
  height: auto !important;
  object-fit: cover;
}

/* Ensure the book image maintains its square aspect if needed, or just normal ratio */
.optin-book img {
  max-width: 250px;
  margin: 0 auto;
  display: block;
}

/* Modal Enhancements with Flex Layout */
.modal-content {
  max-width: 800px;
  padding: 0;
}

.modal-body-flex {
  display: flex;
  align-items: stretch;
}

.modal-image {
  flex: 1;
  background: #f4f7f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.modal-image img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.modal-form-content {
  flex: 1.5;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-form-content h2 {
  margin-bottom: 10px;
  text-align: left;
}

.modal-form-content p {
  margin-bottom: 25px;
  color: #666;
}

.gdpr-text {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
  margin: 15px 0 !important;
  text-align: justify;
}

.gdpr-text a {
  color: var(--accent-color);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .modal-body-flex {
    flex-direction: column;
  }

  .modal-image {
    display: none;
    /* Hide image on small mobile for space */
  }
}

/* Fixing persistent image distortion */
img[width][height] {
  height: auto !important;
}

/* Specific post card image fix */
.post-card .thumbnail picture img,
.post-card .thumbnail img {
  height: 100% !important;
  object-fit: cover !important;
}

/* Final distortion killer */
.cat-image img,
.optin-book img,
.category-card img,
.hero-image img,
.thumbnail img {
  height: auto !important;
}

.thumbnail img {
  height: 100% !important;
  /* Post thumbnails need to fill the 16/9 box */
}

/* Contact Page Styles */
.contact-form-container {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  margin: 30px 0;
}

.standard-form .form-group {
  margin-bottom: 20px;
}

.standard-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.standard-form input,
.standard-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font-main);
}

.standard-form input:focus,
.standard-form textarea:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.1);
}

.contact-info-box {
  background: #f8fbfb;
  padding: 30px;
  border-radius: 12px;
  margin-top: 40px;
}

.contact-info-box h4 {
  margin-bottom: 15px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

.contact-info-box p {
  margin-bottom: 10px;
}

/* Clickable Category Block Styles */
.cat-block {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.3s ease;
}

.cat-block:hover {
  transform: translateY(-5px);
}

.cat-block:hover .cat-image img {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.cat-block:hover .btn-min {
  background-color: var(--accent-color);
  color: #fff;
}