
/* ============================================
   Article Text Styling - Professional & Sleek
   ============================================ */

.articleText {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 3rem;
    border-radius: 16px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    margin: 2rem auto;
    line-height: 1.8;
    color: #333;
    position: relative;
    overflow: hidden;
    max-width: 1000px;
}

/* Subtle background pattern */
.articleText::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.articleText > * {
    position: relative;
    z-index: 1;
}

/* Headings */
.articleText h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a202c;
    margin: 2.5rem 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 3px solid #19666e;
    background: linear-gradient(90deg, #1a4d52 0%, #19666e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.articleText h2:first-child {
    margin-top: 0;
}

.articleText h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
    margin: 2rem 0 1rem 0;
    padding-left: 1rem;
    border-left: 4px solid #3b82f6;
    line-height: 1.4;
}

.articleText h4 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #4a5568;
    margin: 1.5rem 0 0.75rem 0;
}

/* Paragraphs */
.articleText p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    color: #4a5568;
    text-align: justify;
}

.articleText p:last-child {
    margin-bottom: 0;
}

/* Strong/Bold text */
.articleText strong {
    color: #2d3748;
    font-weight: 600;
}

/* Links */
.articleText a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.articleText a:hover {
    color: #2563eb;
    border-bottom-color: #3b82f6;
}

/* Tables */
.articleText table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

.articleText table th {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.articleText table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    color: #4a5568;
    font-size: 1rem;
}

.articleText table tr:last-child td {
    border-bottom: none;
}

.articleText table tbody tr {
    transition: background-color 0.2s ease;
}

.articleText table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.articleText table tbody tr:hover {
    background-color: #f0f9ff;
}

/* Lists */
.articleText ul,
.articleText ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.articleText li {
    margin-bottom: 0.75rem;
    color: #4a5568;
    font-size: 1.05rem;
    line-height: 1.7;
}

.articleText ul li {
    list-style-type: none;
    position: relative;
    padding-left: 1.5rem;
}

.articleText ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Blockquotes */
.articleText blockquote {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 5px solid #3b82f6;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* Code blocks */
.articleText code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #dc2626;
}

.articleText pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.articleText pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Images */
.articleText img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.articleText img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Image captions - built from the image alt text in blog-single.php */
.articleText .articleFigure {
    margin: 2rem 0;
}

.articleText .articleFigure img {
    margin: 0;
    display: block;
}

.articleText .articleFigure figcaption {
    margin-top: 0.75rem;
    padding-left: 1rem;
    border-left: 3px solid #3b82f6;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #718096;
}

/* Horizontal Rule */
.articleText hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #3b82f6 50%, transparent 100%);
    margin: 3rem 0;
}

/* Special content boxes */
.articleText .info-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 5px solid #3b82f6;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.articleText .warning-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid #f59e0b;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.articleText .success-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 5px solid #10b981;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .articleText {
        padding: 2.5rem;
    }
    
    .articleText h2 {
        font-size: 2rem;
    }
    
    .articleText h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .articleText {
        padding: 2rem;
        margin: 1rem 0;
    }
    
    .articleText h2 {
        font-size: 1.75rem;
    }
    
    .articleText h3 {
        font-size: 1.35rem;
    }
    
    .articleText p,
    .articleText li {
        font-size: 1rem;
        text-align: left;
    }
    
    .articleText table {
        font-size: 0.9rem;
    }
    
    .articleText table th,
    .articleText table td {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .articleText {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .articleText h2 {
        font-size: 1.5rem;
    }

    .articleText h3 {
        font-size: 1.25rem;
        padding-left: 0.75rem;
    }

    .articleText table {
        width: 100%;
        margin: 1.5rem 0;
        border-collapse: collapse;
        font-size: 0.85rem;
    }

    .articleText table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .articleText table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Print Styles */
@media print {
    .articleText {
        background: white;
        box-shadow: none;
        padding: 1rem;
    }
    
    .articleText::before {
        display: none;
    }
    
    .articleText h2,
    .articleText h3 {
        color: #000;
        page-break-after: avoid;
    }
    
    .articleText table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animation for fade-in effect */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.articleText {
    animation: fadeInUp 0.6s ease-out;
}

/* Selection styling */
.articleText ::selection {
    background-color: #bfdbfe;
    color: #1e40af;
}

.articleText ::-moz-selection {
    background-color: #bfdbfe;
    color: #1e40af;
}

/* ============================================
   Related Areas Section - Modern Card Design
   ============================================ */

.relatedAreasSection {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #e5e7eb;
}

.relatedAreasTitle {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
    border-left: 5px solid #3b82f6;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.relatedAreasGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.75rem;
    margin-top: 2rem;
}

.areaCard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.areaCard::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.areaCard:hover::before {
    left: 100%;
}

.areaCard:hover {
    border-color: #3b82f6;
    box-shadow:
        0 12px 24px rgba(59, 130, 246, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.1);
    transform: translateY(-4px);
}

.areaCardContent {
    flex: 1;
    min-width: 0;
}

.areaCardTitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.areaCard:hover .areaCardTitle {
    color: #3b82f6;
}

.areaCardCount {
    font-size: 0.95rem;
    color: #718096;
    margin: 0;
}

.areaCard:hover .areaCardCount {
    color: #2563eb;
}

.areaCardArrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    margin-left: 1rem;
    flex-shrink: 0;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.areaCard:hover .areaCardArrow {
    transform: translateX(4px) scale(1.1);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

/* Responsive Design for Related Areas */
@media (max-width: 1024px) {
    .relatedAreasGrid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }

    .relatedAreasTitle {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {

    .articleText {

        padding: 20px;

    }
    .relatedAreasSection {
        margin-top: 3rem;
        padding-top: 2rem;
    }

    .relatedAreasGrid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.25rem;
    }

    .relatedAreasTitle {
        font-size: 1.5rem;
        padding-left: 1rem;
    }

    .areaCard {
        padding: 1.25rem;
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
        align-items: center;
    }

    .areaCardContent {
        flex: 1;
    }

    .areaCardTitle {
        font-size: 1.1rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .areaCardArrow {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9rem;
        margin-left: 1rem;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .relatedAreasGrid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .relatedAreasTitle {
        font-size: 1.25rem;
    }

    .areaCard {
        padding: 1rem;
    }

    .areaCardTitle {
        font-size: 1rem;
    }

    .areaCardCount {
        font-size: 0.9rem;
    }

    .areaCardArrow {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }
}

/* Print Styles for Related Areas */
@media print {
    .relatedAreasSection {
        page-break-inside: avoid;
    }

    .areaCard {
        background: white;
        box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
        border-color: #ccc;
    }

    .areaCardArrow {
        background: #999;
    }
}

/* ============================================
   Article Hub (guides listing page) - from guides.php
   ============================================ */

.guidesList {
        display: flex;
        flex-direction: column;
        gap: 40px;
        margin: 40px 0;
    }
    .guideCard {
        background: white;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        text-decoration: none;
        color: inherit;
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }
    .guideCard:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    }
    .guideCardImageWrapper {
        flex-shrink: 0;
        width: 320px;
        position: relative;
        overflow: hidden;
        background: #f3f4f6;
    }
    .guideCardImage {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    .guideCard:hover .guideCardImage {
        transform: scale(1.05);
    }
    .guideCardContent {
        padding: 28px 32px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .guideCardMeta {
        color: #718096;
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    .guideCardTitle {
        font-size: 1.6rem;
        font-weight: 700;
        color: #1a202c;
        margin-bottom: 14px;
        line-height: 1.3;
    }
    .guideCardExcerpt {
        color: #4a5568;
        font-size: 1rem;
        line-height: 1.65;
        margin-bottom: 20px;
    }
    .guideReadMore {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        align-self: flex-end;
        padding: 10px 24px;
        background: #ff6b35;
        color: white !important;
        border-radius: 6px;
        font-weight: 600;
        font-size: 0.9rem;
        text-decoration: none !important;
    }
    .guideReadMore:hover {
        background: #e55a2b;
    }
    .guidesPagination {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 50px 0 40px;
    }
    .guidesPagination a, .guidesPagination span {
        padding: 10px 18px;
        border: 1px solid #e0e4ea;
        border-radius: 6px;
        text-decoration: none;
        color: #374151;
        font-weight: 500;
    }
    .guidesPagination a:hover { background: #f3f4f6; }
    .guidesPagination .current { background: #2563eb; color: white; border-color: #2563eb; }
    @media (max-width: 968px) {
        .guideCard { flex-direction: column; }
        .guideCardImageWrapper { width: 100%; height: 220px; }
        .guideCardContent { padding: 22px; }
        .guideCardTitle { font-size: 1.4rem; }
    }

/* Single guide page (blog-single.php) */

.guideArticle {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}
.guideArticle h1 {
    font-size: 2.4rem;
    line-height: 1.25;
    color: #1a202c;
    margin: 30px 0 12px;
}
.guideArticleMeta {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 28px;
}
.guideFeaturedImage {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 32px;
}

/* Related guides - reuses .relatedAreasSection/.areaCard from above
   for the same look as the rest of the site, but forced to one column
   and a compact row height rather than the wider card grid. */
.relatedAreasSection .relatedAreasGrid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.relatedAreasSection .areaCard {
    padding: 0.6rem 1rem;
}
.relatedGuideThumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
    margin-right: 14px;
}
.relatedGuideThumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.relatedGuidesHub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 1rem;
    color: #2563eb;
    text-decoration: none;
    margin-bottom: 20px;
}
.relatedGuidesHub:hover {
    text-decoration: underline;
}
@media (max-width: 700px) {
    .guideArticle h1 { font-size: 1.8rem; }
}

/* Mobile - article card and images run edge to edge */
@media (max-width: 768px) {
    .guideArticle {
        padding: 0;
    }

    .articleText {
        padding: 20px;
        margin: 0 0 1rem 0;
        border-radius: 0;
        /* the desktop rule clips overflow, which would cut off the
           full-bleed images below */
        overflow: visible;
    }

    /* sits directly on top of the article card, so no gap between them */
    .guideFeaturedImage {
        margin-bottom: 0;
        border-radius: 0;
    }

    /* Break the images out of the card padding so they span the full screen */
    .articleText .articleFigure,
    .articleText > img {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        max-width: none;
    }

    .articleText .articleFigure img,
    .articleText > img {
        width: 100%;
        border-radius: 0;
    }

    .articleText .articleFigure figcaption {
        padding-left: 20px;
        padding-right: 20px;
    }

    .guideArticle h1,
    .guideArticleMeta {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Lists - the 2rem ul indent plus the 1.5rem li bullet indent
       pushes text too far right on a narrow screen */
    .articleText ul,
    .articleText ol {
        padding-left: 0;
    }

    .articleText ul li {
        padding-left: 1.1rem;
    }

    .articleText ol {
        padding-left: 1.3rem;
    }
}


/* ============================================
   Alnwick palette - recolours the shared guide styles above to match
   theme.css (deep green + lime) instead of the Cornwall blues/orange.
   ============================================ */

/* background-image, not the background shorthand - the shorthand resets
   background-clip to border-box, so the gradient filled the whole heading box
   while the text stayed transparent, leaving an unreadable dark green bar. */
.articleText h2 { background-image: linear-gradient(90deg, #1F3326 0%, #2E4A36 100%); border-bottom-color: #A8C900; }
.articleText h3 { border-left-color: #A8C900; }
.articleText a { color: #2E4A36; }
.articleText a:hover { color: #1F3326; border-bottom-color: #A8C900; }
.articleText table th { background: #2E4A36; }
.articleText ul li::before { color: #8FAD00; }
.articleText blockquote { background: #F6F4EC; border-left-color: #A8C900; color: #1F3326; }
.articleText .articleFigure figcaption { border-left-color: #A8C900; }
.articleText hr { background: linear-gradient(90deg, transparent 0%, #A8C900 50%, transparent 100%); }

.relatedAreasTitle { border-left-color: #A8C900; background: none; -webkit-text-fill-color: #1F3326; color: #1F3326; }
.areaCard:hover { border-color: #A8C900; }
.areaCard:hover .areaCardTitle, .areaCard:hover .areaCardCount { color: #2E4A36; }
.areaCardArrow { background: #1F3326; }

.guideReadMore { background: #A8C900; color: #2B3300 !important; }
.guideReadMore:hover { background: #8FAD00; }
.guidesPagination .current { background: #1F3326; border-color: #1F3326; }
.relatedGuidesHub { color: #2E4A36; }
