/**
 * Arc Publishing Blocks - Frontend Styles
 * 
 * Styles for Arc blocks on the frontend
 * Matches existing frontend styles and Arc output
 */

/* Arc CTA Card */
.arc-cta-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin: 20px 0;
    text-align: center;
    max-width: 100%;
}

.arc-cta-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin-bottom: 20px;
    object-fit: cover;
}

.arc-cta-card .cta-content {
    text-align: center;
}

.arc-cta-card .cta-content h3 {
    margin: 0 0 12px 0;
    color: #1e1e1e;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.3;
}

.arc-cta-card .cta-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

.arc-cta-card .cta-button,
.arc-cta-card-button {
    display: inline-block;
    background: #0073aa;
    color: #ffffff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 16px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.arc-cta-card .cta-button:hover,
.arc-cta-card-button:hover {
    background: #005a87;
    color: #ffffff;
    text-decoration: none;
}

/* Arc Social URL - Uses existing oembed styles */
.oembed-container {
    margin: 20px 0;
    max-width: 100%;
}

.oembed-container.oembed-twitter {
    max-width: 550px;
    width: 100%;
    margin: 20px auto;
}

.oembed-container.oembed-instagram {
    width: 100%;
    margin: 20px auto;
}

/* Instagram embed iframe - using high specificity to override Instagram's inline styles */
body .oembed-container.oembed-instagram iframe,
body .oembed-container.oembed-instagram iframe[src*="instagram.com"],
.oembed-container.oembed-instagram iframe[width],
.oembed-container.oembed-instagram iframe[height],
body .instagram-media-rendered,
.instagram-media-rendered[style],
.instagram-media-rendered iframe {
    max-width: 100%;
    width: 100%;
}

.oembed-container iframe {
    max-width: 100%;
}

/* Arc Interstitial Link - Matches existing styles */
.interstitial-link {
    border: 3px solid #dc2626;
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.interstitial-link a {
    color: #1e1e1e;
    text-decoration: none;
    font-weight: 500;
}

.interstitial-link a:hover {
    text-decoration: underline;
}

.inq-p.type-interstitial,
.type-interstitial {
    font-family: 'Grot10', 'Arial', sans-serif;
    line-height: 1.75rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.article-body-light .inq-p.type-interstitial,
.article-body-light .type-interstitial {
    font-family: 'Grot10', 'Arial', sans-serif;
    line-height: 1.75rem;
}

.inq-p.type-interstitial a[data-link-type="interstitial"],
.type-interstitial a[data-link-type="interstitial"] {
    font-family: 'Grot10', 'Arial', sans-serif;
    line-height: 2rem;
    font-weight: 700;
}

.article-body-light .inq-p.type-interstitial a[data-link-type="interstitial"],
.article-body-light .type-interstitial a[data-link-type="interstitial"] {
    font-family: 'Grot10', 'Arial', sans-serif;
    line-height: 2rem;
    font-weight: 700;
}

/* Arc Image - Uses WordPress block styles */
.wp-block-image {
    margin: 0 auto;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.wp-block-image figcaption {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
    margin-top: 10px;
    text-align: center;
}

/* Arc Gallery - Legacy */
.arc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.arc-gallery-item {
    margin: 0;
}

.arc-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.arc-gallery-item figcaption {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    margin-top: 8px;
    text-align: center;
}

/* Arc Gallery - Flickity Carousel */
.inq-card-carousel-wrapper {
    position: relative;
    margin: 30px 0;
}

.inq-card-carousel--gallery {
    position: relative;
}

.inq-card-carousel--gallery .carousel {
    position: relative;
    width: 100%;
}

.inq-card-carousel--gallery .flickity-viewport {
    position: relative;
}

.inq-card-carousel--gallery .flickity-viewport {
    overflow: hidden;
    position: relative;
    height: 100%;
}

.inq-card-carousel--gallery .flickity-slider {
    position: absolute;
    width: 100%;
    height: 100%;
}

.inq-card-carousel--gallery .carousel-cell {
    width: 100%;
    margin-right: 0;
    position: absolute;
    left: 0;
}

.inq-card-carousel--gallery .carousel-cell.is-selected {
    position: relative;
}

.inq-card-carousel--gallery .carousel-cell figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.inq-card-carousel--gallery .carousel-cell img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.inq-card-carousel--gallery .carousel-cell figcaption {
    margin-top: 1rem;
    padding: 0;
}

.inq-card-carousel--gallery .inq-fig--caption {
    position: relative;
    display: block;
}

.inq-card-carousel--gallery .inq-fig--caption.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 5rem; /* Add padding to make room for button */
}

.inq-card-carousel--gallery figcaption {
    position: relative; /* Ensure button positions relative to figcaption */
}

.inq-card-carousel--gallery .inq-fig--expend-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 0.25rem 0.5rem;
    margin-top: 0;
    z-index: 10;
    background-color: white;
    display: inline-block;
    white-space: nowrap;
}

/* Increase specificity so utility classes do not override */
.inq-card-carousel--gallery figcaption .inq-fig--expend-btn,
figcaption .inq-fig--expend-btn {
    font-family: 'Grot10', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgb(34, 34, 34);
    text-decoration: none;
}

.inq-card-carousel--gallery figcaption .inq-fig--expend-btn:hover,
figcaption .inq-fig--expend-btn:hover {
    color: rgb(34, 34, 34);
    text-decoration: none;
}

.inq-card-carousel--gallery .inq-fig--credit {
    display: block;
    margin-top: 1rem;
}

/* Navigation Buttons */
.inq-btn-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    padding: 0;
}

.inq-btn-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.inq-btn-arrow.prev {
    left: 10px;
}

.inq-btn-arrow.next {
    right: 10px;
}

.inq-btn-arrow svg {
    display: block;
}

.inq-btn-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Page Dots */
.inq-card-carousel--gallery .flickity-page-dots,
.inq-card-carousel--gallery ol.flickity-page-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    text-align: center;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.inq-card-carousel--gallery .flickity-page-dots .dot,
.inq-card-carousel--gallery .flickity-page-dots > li,
.inq-card-carousel--gallery ol.flickity-page-dots > li {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    flex-shrink: 0;
    list-style: none;
    list-style-type: none;
}

.inq-card-carousel--gallery .flickity-page-dots .dot:hover,
.inq-card-carousel--gallery .flickity-page-dots > li:hover {
    background: rgba(0, 0, 0, 0.5);
}

.inq-card-carousel--gallery .flickity-page-dots .dot.is-selected,
.inq-card-carousel--gallery .flickity-page-dots > li.is-selected {
    background: rgba(0, 0, 0, 1);
    width: 6px;
    height: 6px;
}

/* Override any Tailwind classes that might interfere */
.inq-card-carousel--gallery .flickity-page-dots.list-disc,
.inq-card-carousel--gallery ol.flickity-page-dots.list-disc {
    list-style: none !important;
    list-style-type: none !important;
}

.inq-card-carousel--gallery .flickity-page-dots.ml-5,
.inq-card-carousel--gallery ol.flickity-page-dots.ml-5 {
    margin-left: 0 !important;
}

.inq-card-carousel--gallery .flickity-page-dots .dot.ml-5,
.inq-card-carousel--gallery .flickity-page-dots > li.ml-5 {
    margin-left: 0 !important;
}

.inq-card-carousel--gallery .flickity-page-dots .dot.mb-3,
.inq-card-carousel--gallery .flickity-page-dots > li.mb-3 {
    margin-bottom: 0 !important;
}

.inq-card-carousel--gallery .flickity-page-dots .dot p,
.inq-card-carousel--gallery .flickity-page-dots > li p {
    display: none !important;
}

/* Arc Video */
.arc-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 30px 0;
    max-width: 100%;
}

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

/* Arc HTML */
/* HTML blocks render their own content, minimal styling needed */

/* Arc Table */
.arc-table-container {
    margin: 30px 0;
    overflow-x: auto;
}

.arc-table-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.arc-table-container table th,
.arc-table-container table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.arc-table-container table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #1e1e1e;
}

.arc-table-container table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Arc Table - wp-block-table class (matches editor exactly) */
.wp-block-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    border-bottom: 1px solid #ddd;
    margin: 20px 0;
}

.wp-block-table th {
    border: none;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    min-width: 100px;
    background-color: rgb(244, 244, 244);
    font-weight: bold;
}

.wp-block-table td {
    border: none;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    min-width: 100px;
}

/* First column shadow on right border */
.wp-block-table thead th:first-child,
.wp-block-table tbody td:first-child,
.wp-block-table tfoot td:first-child,
.wp-block-table th:first-child,
.wp-block-table td:first-child {
    box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.15) !important;
    position: relative;
    z-index: 1;
}

/* Legacy support for c-table class */
.c-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    margin: 20px 0;
}

.c-table th {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    min-width: 100px;
    background-color: #f5f5f5;
    font-weight: bold;
}

.c-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    min-width: 100px;
}

/* Arc Pull Quote */
.arc-pull-quote,
.c-pullquote {
    margin: 40px 0;
    padding: 0;
    background: #ffffff;
    border: none;
}

.arc-pull-quote blockquote,
.c-pullquote blockquote {
    margin: 0;
    padding: 0;
    border: none;
    color: #1e1e1e;
    font-style: normal;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: normal;
    font-size: 36px;
    line-height: 1.6;
    text-align: center;
}

.arc-pull-quote cite,
.c-pullquote cite {
    display: block;
    margin-top: 10px;
    font-size: 20px;
    color: #1e1e1e;
    font-style: normal;
    font-weight: normal;
    text-align: center;
    padding-right: 0;
}

/* Arc Blockquote */
.c-blockquote,
blockquote.c-blockquote {
    margin: 30px 0;
    padding: 0 0 0 20px;
    border-left: 1px solid #000000;
    background: transparent;
    font-style: italic;
    color: #1e1e1e;
    line-height: 1.6;
    font-family: Georgia, 'Times New Roman', Times, serif;
}

.c-blockquote p,
blockquote.c-blockquote p {
    margin: 0;
    padding: 0;
    font-style: italic;
    font-size: 20px;
}

.c-blockquote cite,
blockquote.c-blockquote cite {
    display: block;
    margin-top: 0;
    font-style: italic;
    font-size: inherit;
    color: #1e1e1e;
    font-size: 16px;
}

/* Arc Code */
pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    margin: 30px 0;
}

pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
    font-size: inherit;
}

code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #d63384;
}

/* Arc Correction */
.arc-correction {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 30px 0;
    border-radius: 4px;
}

.arc-correction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
    color: #856404;
    font-size: 1.1em;
}

.arc-correction-date {
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
}

.arc-correction-content {
    color: #856404;
    line-height: 1.6;
}

.arc-correction-content p {
    margin: 0;
}

/* Arc Divider */
hr {
    border: none;
    border-top: 2px solid #ddd;
    margin: 40px 0;
}

/* Arc Article Box */
.arc-article-box {
    background: white;
    border: 1px solid #ff6600;
    padding: 20px;
    margin: 30px 0;
    max-width: 600px;
    position: relative;
}

.arc-article-box__title {
    margin: 0 0 12px 0;
    padding: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: #000;
    text-align: left;
}

.arc-article-box__divider {
    margin: 0 0 16px 0;
    border: none;
    border-top: 1px solid #d3d3d3;
    width: 100%;
}

.arc-article-box__list {
    margin: 0 0 20px 0;
    padding: 0 0 0 20px;
    list-style: none;
}

.arc-article-box__list-item {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    font-size: 16px;
    line-height: 1.5;
}

.arc-article-box__bullet {
    position: absolute;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #0066cc;
    display: inline-block;
    top: 6px;
}

.arc-article-box__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
}

.arc-article-box__logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .arc-gallery {
        grid-template-columns: 1fr;
    }
    
    .arc-article-box {
        max-width: 100%;
    }
    
    .arc-pull-quote blockquote,
    .c-pullquote blockquote {
        font-size: 28px;
    }
    
    .arc-pull-quote cite,
    .c-pullquote cite {
        font-size: 18px;
    }
    
    .arc-table-container {
        font-size: 0.9em;
    }
    
    .arc-table-container table th,
    .arc-table-container table td {
        padding: 8px;
    }
    
    .arc-cta-card {
        padding: 20px;
        margin: 15px 0;
    }
    
    .arc-cta-card .cta-content h3 {
        font-size: 1.25em;
    }
    
    .arc-cta-card .cta-content p {
        font-size: 14px;
    }
    
    .arc-cta-card .cta-button,
    .arc-cta-card-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

