/* SJAF CMS — Blog Content Styling
   This file applies ONLY to the elements inside the .content wrapper.
   It uses CSS variables to ensure automatic Dark Mode compatibility. */

/* Base Content Styling */
.content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--ink);
    max-width: 100%;
    overflow-wrap: anywhere; /* Forces breaking of long URLs */
    word-break: break-word;
}

/* Headings */
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
    font-family: var(--font-serif);
    color: var(--brand);
    margin-top: 1.8em;
    margin-bottom: 0.6em;
    font-weight: 700;
    max-width: 100%;
    overflow-wrap: anywhere; /* Stops large unbroken heading words from stretching screen */
    word-wrap: break-word;
    hyphens: auto;
}
.content h1 { font-size: clamp(1.6rem, 2.5vw, 2.1rem); }
.content h2 { font-size: clamp(1.4rem, 2vw, 1.7rem); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.content h3 { font-size: 1.25rem; }

/* Paragraphs & Links */
.content p {
    margin-bottom: 1.4em;
}
.content a {
    color: var(--brand-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: color 0.2s ease;
}
.content a:hover {
    color: var(--accent);
}

/* Lists */
.content ul, .content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5rem;
}
.content li {
    margin-bottom: 0.5em;
}

/* Blockquotes (Quotes) */
.content blockquote {
    background: var(--surface);
    border-left: 4px solid var(--accent);
    padding: 1.2em 1.5em;
    margin: 1.5em 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--ink-soft);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.content blockquote p:last-child {
    margin-bottom: 0;
}

/* Images & Figures */
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em auto;
    display: block;
    box-shadow: var(--shadow);
}
.content figure {
    margin: 1.5em 0;
    text-align: center;
}
.content figcaption {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 0.5em;
    font-style: italic;
}

/* Tables */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
.content th, .content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
    min-width: 180px; /* Increased minimum width to give Hindi text more breathing room */
    vertical-align: top;
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: normal;
}
.content th {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* FAQ / Details & Summary Accordion */
.content details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 16px;
    margin-bottom: 1em;
    transition: all 0.2s ease;
}
.content details[open] {
    padding-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.content summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--brand);
    font-size: 1.1rem;
    padding: 16px 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* Hide default arrow and add custom plus/minus */
.content summary::-webkit-details-marker { display: none; }
.content summary::after {
    content: "+";
    font-size: 1.4rem;
    line-height: 1;
    color: var(--accent);
    transition: transform 0.3s ease;
}
.content details[open] summary::after {
    transform: rotate(45deg); /* Turns + into x */
}
.content details[open] summary {
    border-bottom: 1px dashed var(--border);
    margin-bottom: 12px;
}

/* Code & Preformatted text */
.content code {
    font-family: ui-monospace, monospace;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}
.content pre {
    background: var(--ink);
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.95rem;
    margin: 1.5em 0;
    max-width: 100%; /* Ensures pre block doesn't push the layout out */
}
.content pre code {
    background: transparent;
    border: none;
    color: inherit;
    padding: 0;
}

/* Horizontal Rule */
.content hr {
    border: 0;
    border-top: 2px dashed var(--border);
    margin: 2.5em 0;
}