@tailwind base;
@tailwind components;
@tailwind utilities;

/*
Blog Featured Snippet / Info Box Component
This styling creates a Google Featured Snippet-style information box
Optimized for SEO and readability with proper semantic HTML
*/
@layer components {
  /* Main container for the featured snippet box */
  .featured-snippet-box {
    background-color: #f9fbfd; /* Very light blue/grey background */
    border: 1px solid #d1d5db; /* Subtle border (Tailwind gray-300) */
    border-left: 5px solid #0077b5; /* LinkedIn Blue accent line */
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
    margin-top: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); /* Subtle shadow */
  }

  /* Mobile responsive padding */
  @media (max-width: 640px) {
    .featured-snippet-box {
      padding: 16px;
      margin-bottom: 24px;
      margin-top: 16px;
    }
  }

  /* Title styling */
  .snippet-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    color: #111827; /* Tailwind gray-900 */
    line-height: 1.5;
    display: flex;
    align-items: center;
  }

  /* Mobile title adjustments */
  @media (max-width: 640px) {
    .snippet-title {
      font-size: 1.125rem; /* 18px */
      margin-bottom: 12px;
    }
  }

  /* Content area styling */
  .snippet-content {
    color: #374151; /* Tailwind gray-700 */
    line-height: 1.7;
  }

  /* Paragraph spacing inside snippet */
  .snippet-content p {
    margin-bottom: 12px;
  }

  .snippet-content p:last-child {
    margin-bottom: 0;
  }

  /* List styling for clean, scannable content */
  .snippet-content ul,
  .snippet-content ol {
    margin: 12px 0;
    padding-left: 24px;
  }

  .snippet-content ul {
    list-style-type: disc;
  }

  .snippet-content ol {
    list-style-type: decimal;
  }

  .snippet-content li {
    margin-bottom: 8px;
    line-height: 1.7;
  }

  .snippet-content li:last-child {
    margin-bottom: 0;
  }

  /* Nested lists */
  .snippet-content ul ul,
  .snippet-content ol ol,
  .snippet-content ul ol,
  .snippet-content ol ul {
    margin-top: 8px;
    margin-bottom: 8px;
  }

  /* Link styling inside snippet */
  .snippet-content a {
    color: #0077b5; /* LinkedIn Blue */
    text-decoration: underline;
    transition: color 0.2s;
  }

  .snippet-content a:hover {
    color: #005885; /* Darker blue on hover */
  }

  /* Bold and emphasis text */
  .snippet-content strong {
    font-weight: 600;
    color: #111827;
  }

  .snippet-content em {
    font-style: italic;
  }

  /* Code blocks inside snippet */
  .snippet-content code {
    background-color: #e5e7eb; /* Tailwind gray-200 */
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  /* Blockquotes inside snippet */
  .snippet-content blockquote {
    border-left: 3px solid #d1d5db;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #6b7280; /* Tailwind gray-500 */
  }

  /* Ensure proper spacing with prose content when snippet is in a blog post */
  .prose .featured-snippet-box {
    max-width: none; /* Override prose max-width */
  }

  /*
  Contentful Rich Text Table Styling
  Mobile-responsive tables with horizontal scrolling for SEO
  Includes sticky headers for improved long-table readability
  */
  .table-container {
    width: 100%;
    overflow-x: auto; /* Critical for mobile usability & SEO */
    margin: 24px 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  }

  /* Ensure tables in prose content get full width */
  .prose .table-container {
    max-width: none;
  }

  .table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Forces horizontal scroll on small screens */
    background-color: #ffffff;
  }

  /* Table caption styling */
  .table-container caption {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    color: #111827; /* Tailwind gray-900 */
    background-color: #f9fafb; /* Tailwind gray-50 */
    border-bottom: 2px solid #d1d5db;
  }

  .table-container th,
  .table-container td {
    border: 1px solid #d1d5db; /* Tailwind gray-300 */
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
  }

  .table-container th {
    background-color: #f3f4f6; /* Tailwind gray-100 */
    font-weight: 600;
    color: #111827; /* Tailwind gray-900 */
    font-size: 0.95rem;
    /* Sticky header for long tables */
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 0 #d1d5db; /* Subtle shadow when scrolling */
  }

  .table-container td {
    color: #374151; /* Tailwind gray-700 */
    line-height: 1.6;
  }

  /* Handle empty cells */
  .table-container td:empty::before {
    content: '\00a0'; /* Non-breaking space for empty cells */
    visibility: hidden;
  }

  /* Striped rows for better readability */
  .table-container tbody tr:nth-child(even) {
    background-color: #f9fafb; /* Tailwind gray-50 */
  }

  /* Hover effect for better UX (desktop only) */
  @media (hover: hover) {
    .table-container tbody tr:hover {
      background-color: #f3f4f6; /* Tailwind gray-100 */
    }
  }

  /* Mobile adjustments */
  @media (max-width: 640px) {
    .table-container {
      margin: 16px -16px; /* Extend to edge on mobile for full width */
      border-radius: 0; /* Remove border radius on mobile */
    }

    .table-container th,
    .table-container td {
      padding: 10px 12px;
      font-size: 0.9rem;
    }

    .table-container caption {
      padding: 10px 12px;
      font-size: 0.9rem;
    }
  }

  /* Responsive text wrapping for narrow cells */
  .table-container td,
  .table-container th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Links inside table cells */
  .table-container a {
    color: #0077b5; /* LinkedIn Blue */
    text-decoration: underline;
    transition: color 0.2s;
  }

  .table-container a:hover {
    color: #005885; /* Darker blue on hover */
  }

  /* Code blocks inside table cells */
  .table-container code {
    background-color: #e5e7eb; /* Tailwind gray-200 */
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  /* Bold and emphasis text inside tables */
  .table-container strong {
    font-weight: 600;
    color: #111827;
  }

  .table-container em {
    font-style: italic;
  }
}

/*
Additional custom components can be added below
@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}
*/
/* This CSS file is used for stimulus-scroll-reveal controller */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: 1s cubic-bezier(0.5, 0, 0, 1);
  transition-property: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}
input:checked~.toggle-bg {
  background-color: #EA580C;
}

input:checked~.toggle-dot {
  transform: translateX(100%);
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

@import "javascript/reveal.css";
@import "toggle.css";
