/* ==========================================================================
   ARTICLE TEMPLATE STYLES
   Marinova Consultants - Professional Article Formatting
   
   Design System Alignment:
   - Consistent with article_hub.css colors and typography
   - Clean, readable layout for long-form content
   - Professional minimalism with strategic accent
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (Consistent with main site)
   ========================================================================== */
:root {
    --base-navyblue: #0f172a;
    --accent-red: #dc2626;
    --text-blue: #334155;
    --clr-white: #ffffff;
    --clr-offwhite: #f8fafc;
    --clr-highlight-bg: #4f5f7f;
    --clr-border: rgba(15, 23, 42, 0.08);
    --clr-shadow: rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   BASE LAYOUT & TYPOGRAPHY - MOBILE FIRST
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", "Lato", sans-serif;
    background: var(--clr-offwhite);
    color: var(--text-blue);
    margin: 0;
    padding: 0;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.article-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    background: var(--clr-white);
    position: relative;
}

/* ==========================================================================
   ARTICLE HEADER
   ========================================================================== */
.article-header {
    text-align: center;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--clr-border);
    position: relative;
}

.article-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-red);
    border-radius: 2px;
}

.article-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--base-navyblue);
    line-height: 1.3;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-subtitle {
    font-size: 1.125rem;
    color: var(--clr-highlight-bg);
    font-family: "Lato", sans-serif;
    font-weight: 400;
    line-height: 1.5;
    width: 100%;
    margin: 0 auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ==========================================================================
   SUMMARY BOX (Key Takeaways)
   ========================================================================== */
.summary-box {
    background: var(--clr-offwhite);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    border: 1px solid var(--clr-border);
    position: relative;
    overflow: hidden;
}

.summary-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-red);
}

.summary-box h2 {
    font-size: 1.25rem;
    color: var(--base-navyblue);
    margin: 0 0 1.25rem;
    font-weight: 600;
    position: relative;
    padding-left: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.summary-box h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
}

.summary-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-box li {
    padding-left: 1.75rem;
    position: relative;
    font-family: "Lato", sans-serif;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.summary-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.4em;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

/* ==========================================================================
   ARTICLE SECTIONS
   ========================================================================== */
.article-section {
    margin: 2.5rem 0;
    width: 100%;
    overflow: hidden; /* Prevent content overflow */
}

.article-section h2 {
    font-size: 1.35rem;
    color: var(--base-navyblue);
    margin: 0 0 1.25rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-red);
    border-radius: 1px;
}

.article-section p {
    font-family: "Lato", sans-serif;
    margin: 1.25rem 0;
    line-height: 1.7;
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-section ul {
    font-family: "Lato", sans-serif;
    padding-left: 0;
    margin: 1.25rem 0;
    list-style: none;
}

.article-section ul li {
    margin: 0.75rem 0;
    line-height: 1.6;
    padding-left: 1.5rem;
    position: relative;
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--accent-red);
    border-radius: 50%;
}

.article-section ol {
    font-family: "Lato", sans-serif;
    padding-left: 0;
    margin: 1.25rem 0;
    list-style: none;
    counter-reset: step-counter;
}

.article-section ol li {
    counter-increment: step-counter;
    margin: 1rem 0;
    line-height: 1.6;
    padding-left: 2.5rem;
    position: relative;
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-section ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    color: var(--clr-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: "Inter", sans-serif;
}

/* ==========================================================================
   INFORMATION TABLE - FIXED RESPONSIVENESS
   ========================================================================== */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: "Lato", sans-serif;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    table-layout: fixed; /* Fixed layout for better control */
}

/* Desktop Table */
.info-table thead {
    background: var(--base-navyblue);
}

.info-table th {
    padding: 1rem;
    text-align: left;
    color: var(--clr-white);
    font-weight: 600;
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    word-break: break-word;
}

.info-table tbody tr {
    border-bottom: 1px solid var(--clr-border);
    transition: background 0.2s ease;
}

.info-table tbody tr:hover {
    background: var(--clr-offwhite);
}

.info-table td {
    padding: 1rem;
    border-right: 1px solid var(--clr-border);
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.info-table td:last-child {
    border-right: none;
}

/* Mobile Table - Stack into cards */
@media screen and (max-width: 767px) {
    .info-table {
        display: block;
        border: none;
        box-shadow: none;
        border-radius: 0;
        background: transparent;
        table-layout: auto;
    }
    
    .info-table thead {
        display: none;
    }
    
    .info-table tbody,
    .info-table tr {
        display: block;
    }
    
    .info-table tbody {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .info-table tr {
        background: var(--clr-white);
        border: 1px solid var(--clr-border);
        border-radius: 8px;
        padding: 1.25rem;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
        width: 100%;
    }
    
    .info-table td {
        display: block;
        padding: 0.75rem 0;
        border: none;
        border-bottom: 1px solid var(--clr-border);
        width: 100%;
        text-align: left;
    }
    
    .info-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .info-table td:first-child {
        padding-top: 0;
        font-weight: 600;
        color: var(--base-navyblue);
        font-family: "Inter", sans-serif;
    }
    
    /* Remove borders between stacked items */
    .info-table td {
        border-right: none;
    }
}

/* ==========================================================================
   CTA LINK - FIXED RESPONSIVENESS
   ========================================================================== */
.cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--accent-red);
    color: var(--clr-white);
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
    font-size: 1rem;
    text-align: center;
    border: 2px solid transparent;
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.cta-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cta-link::after {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.cta-link:hover,
.cta-link:focus {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.2);
    outline: none;
    border-color: var(--accent-red);
}

.cta-link:hover::before,
.cta-link:focus::before {
    opacity: 1;
}

.cta-link:hover::after,
.cta-link:focus::after {
    transform: translateX(4px);
}

/* ==========================================================================
   BACK LINK - FIXED RESPONSIVENESS
   ========================================================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--base-navyblue);
    font-weight: 500;
    text-decoration: none;
    font-family: "Inter", sans-serif;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--clr-border);
    background: var(--clr-white);
    font-size: 1rem;
    text-align: center;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 1rem;
    word-break: break-word;
}

.back-link::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f172a'%3E%3Cpath d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.back-link:hover,
.back-link:focus {
    background: var(--clr-offwhite);
    transform: translateX(-4px);
    border-color: var(--accent-red);
    color: var(--accent-red);
    outline: none;
}

.back-link:hover::before,
.back-link:focus::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/%3E%3C/svg%3E");
    transform: translateX(-2px);
}

/* ==========================================================================
   ARTICLE FOOTER
   ========================================================================== */
.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--clr-border);
    text-align: center;
    width: 100%;
}

.article-footer p {
    font-family: "Lato", sans-serif;
    margin: 1rem 0;
    color: var(--clr-highlight-bg);
    font-size: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
}

/* ==========================================================================
   TABLET BREAKPOINT (768px to 1023px) - FIXED SCROLLING
   ========================================================================== */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .article-container {
        padding: 3rem 1.5rem 4rem;
        max-width: 95%; /* Slightly smaller max-width for tablets */
        width: 95%;
    }
    
    .article-header {
        padding-bottom: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .article-header h1 {
        font-size: 2rem; /* Slightly smaller for tablets */
    }
    
    .article-subtitle {
        font-size: 1.125rem;
        max-width: 90%;
    }
    
    .summary-box {
        padding: 1.75rem;
        margin: 2.5rem 0;
    }
    
    .summary-box h2 {
        font-size: 1.3rem;
        padding-left: 2.25rem;
    }
    
    .summary-box h2::before {
        width: 22px;
        height: 22px;
        background-size: 18px;
    }
    
    .summary-box li {
        padding-left: 1.875rem;
        font-size: 0.975rem;
    }
    
    .article-section {
        margin: 2.75rem 0;
    }
    
    .article-section h2 {
        font-size: 1.4rem;
    }
    
    .article-section p,
    .article-section ul li,
    .article-section ol li {
        font-size: 1.025rem;
    }
    
    .article-section ol li {
        padding-left: 2.75rem;
    }
    
    .article-section ol li::before {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
    
    /* Tablet table adjustments */
    .info-table th {
        padding: 0.875rem 1rem;
        font-size: 0.8rem;
    }
    
    .info-table td {
        padding: 0.875rem 1rem;
        font-size: 0.925rem;
    }
    
    /* Tablet button adjustments */
    .cta-link {
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    
    .back-link {
        width: 100%;
        max-width: 250px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}

/* ==========================================================================
   DESKTOP BREAKPOINT (1024px and up)
   ========================================================================== */
@media screen and (min-width: 1024px) {
    .article-container {
        padding: 4rem 2rem 5rem;
        max-width: 800px;
        width: 100%;
    }
    
    .article-header h1 {
        font-size: 2.5rem;
    }
    
    .summary-box {
        padding: 2.25rem;
    }
    
    .article-footer {
        margin-top: 4rem;
        padding-top: 2.5rem;
    }
    
    /* Desktop button adjustments */
    .cta-link {
        width: auto;
        display: inline-flex;
        max-width: none;
        margin: 1rem 0;
    }
    
    .back-link {
        width: auto;
        display: inline-flex;
        max-width: none;
        margin: 1rem 0;
    }
}

/* ==========================================================================
   EXTRA LARGE DESKTOP (1200px and up)
   ========================================================================== */
@media screen and (min-width: 1200px) {
    .article-container {
        max-width: 850px;
        padding: 5rem 2.5rem 6rem;
    }
    
    .article-header h1 {
        font-size: 2.75rem;
    }
}

/* ==========================================================================
   ACCESSIBILITY & UTILITIES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cta-link:hover,
    .back-link:hover {
        transform: none;
    }
}

:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
        overflow-x: visible !important;
    }
    
    .article-container {
        max-width: 100%;
        padding: 0;
        margin: 0;
        box-shadow: none;
        background: white;
        width: 100%;
    }
    
    .article-header {
        text-align: left;
        border-bottom: 2px solid #000;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .article-header::after {
        display: none;
    }
    
    .article-header h1 {
        font-size: 18pt;
        color: black;
    }
    
    .article-subtitle {
        font-size: 14pt;
        color: #666;
    }
    
    .summary-box {
        border: 1px solid #ddd;
        box-shadow: none;
        background: #f9f9f9;
        page-break-inside: avoid;
    }
    
    .summary-box::before {
        background: #999;
    }
    
    .cta-link,
    .back-link {
        display: none;
    }
    
    .article-footer {
        margin-top: 2rem;
        border-top: 1px solid #ddd;
    }
    
    .info-table {
        box-shadow: none;
        border: 1px solid #ddd;
        width: 100%;
        table-layout: auto;
    }
    
    .info-table thead {
        background: #f0f0f0;
    }
    
    .info-table th {
        color: black;
        border-bottom: 2px solid #000;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    @page {
        margin: 0.5in;
    }
}