/* ============================================================
   Cricone Theme — Custom CSS
   Mirrors exactly what BaseLayout.astro, NavStrip.astro,
   ScoreStrip.astro emitted as scoped / global styles.
   Tailwind CDN resolves all utility classes; this file only
   adds things that need explicit declaration.
   ============================================================ */

/* --- Google Fonts (Inter & Noto Sans) ---------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+Display:wght@400;500;600;700;800;900&display=swap');

/* --- CSS Custom Properties --------------------------------- */
:root {
    --primary-blue: #007aff;
    --primary-red: #ef4444;
    --text-main: #23272E;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --bg-page: #f6f8fb;
    --border-soft: #f1f5f9;
    --font-editorial: "Noto Sans Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --bg-editorial: #f6f7f9;
    --card-border: #e9edf3;
    --article-width: 856px;
}

/* --- Base Typography --------------------------------------- */
body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-editorial);
    letter-spacing: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Inter", sans-serif;
    letter-spacing: 0;
}

/* --- Scrollbar Hide (NavStrip + Score Strip) --------------- */
.nav-strip-scroll,
.scrollbar-hide {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE / Edge */
}

.nav-strip-scroll::-webkit-scrollbar,
.scrollbar-hide::-webkit-scrollbar {
    display: none;
    /* Chrome / Safari */
}

/* --- animate-ping (live score green dot) ------------------- */
@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* --- line-clamp polyfill ----------------------------------- */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* --- WordPress Image Alignment & Resets -------------------- */
.wp-block {
    max-width: unset;
}

img.aligncenter {
    display: block;
    margin: 0 auto;
}

img.alignleft {
    float: left;
    margin-right: 1rem;
}

img.alignright {
    float: right;
    margin-left: 1rem;
}

/* ============================================================
   MODULAR ARTICLE SYSTEM (.c-article)
   ============================================================ */

.c-article-main {
    background-color: var(--bg-page);
    min-height: 100vh;
}

/* --- Scroll Progress Bar --- */
.c-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--text-main);
    z-index: 60;
    transition: width 0.1s ease-out;
    width: 0;
}

/* --- Layout Wrappers --- */
.l-article-main {
    background-color: var(--bg-page);
    padding: 2rem 0;
    min-height: 100vh;
    font-family: var(--font-editorial);
}

.c-article-card {
    width: 100%;
    max-width: none;
    /* Reclaimed width on mobile */
    background: #FFFFFF;
    border-radius: 12px;
    padding: 1rem;
    /* 16px padding on mobile */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-soft);
}

@media (min-width: 768px) {
    .c-article-card {
        padding: 3rem;
        max-width: var(--article-width);
        border-radius: 16px;
    }
}

/* --- Action Bar (Sticky) --- */
.c-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 9999px;
    margin-bottom: 2.25rem;
    position: sticky;
    top: 20px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 40;
    box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (min-width: 768px) {
    .c-sticky-bar {
        padding: 0.6rem 1.75rem;
        top: 24px;
        margin-bottom: 2.5rem;
    }
}

.c-sticky-bar:hover {
    box-shadow: 0 12px 40px -4px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
}

/* Active Button States */
.is-liked svg {
    fill: #ef4444 !important;
    stroke: #ef4444 !important;
}

.is-liked span {
    color: #ef4444 !important;
}

.is-bookmarked svg {
    fill: #004795 !important;
    stroke: #004795 !important;
}

/* --- Article Content (Editorial Typography) --- */
.c-editorial-content {
    color: #1a1a1a !important;
    font-size: 16.2px !important;
    line-height: 1.7 !important;
    /* Increased for better mobile rhythm */
    font-weight: 400 !important;
    width: 100%;
    letter-spacing: -0.011em !important;
    /* Slightly tighter for premium look */
    word-break: normal;
    overflow-wrap: break-word;
    border-top: 1px solid #f1f5f9;
    /* Subtle separator from action bar */
    padding-top: 1.5rem;
    /* Space after action bar */
    -webkit-hyphens: none;
    hyphens: none;
}

/* Force all child elements to inherit article typography */
.c-editorial-content p,
.c-editorial-content div,
.c-editorial-content span,
.c-editorial-content li,
.c-editorial-content td,
.c-editorial-content th {
    font-size: 16.2px !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
}

@media (min-width: 640px) {

    .c-editorial-content,
    .c-editorial-content p,
    .c-editorial-content div,
    .c-editorial-content span {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }
}

@media (min-width: 768px) {

    .c-editorial-content,
    .c-editorial-content p,
    .c-editorial-content div,
    .c-editorial-content span {
        font-size: 17px !important;
        line-height: 1.7 !important;
    }
}

@media (min-width: 1024px) {

    .c-editorial-content,
    .c-editorial-content p,
    .c-editorial-content div,
    .c-editorial-content span {
        font-size: 18px !important;
        line-height: 1.75 !important;
    }
}

.c-editorial-content p {
    margin-bottom: 0.75rem !important;
    line-height: 1.7 !important;
}

@media (min-width: 768px) {
    .c-editorial-content p {
        margin-bottom: 1.5rem !important;
        line-height: 1.8 !important;
    }
}

.c-editorial-content h2 {
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    color: #1a1a1a !important;
    margin: 1.5rem 0 0.75rem !important;
    line-height: 1.3 !important;
}

@media (min-width: 768px) {
    .c-editorial-content h2 {
        font-size: 24px !important;
        margin: 2.5rem 0 1rem !important;
    }
}

@media (min-width: 1024px) {
    .c-editorial-content h2 {
        font-size: 28px !important;
        margin: 3rem 0 1.25rem !important;
    }
}

.c-editorial-content strong {
    font-weight: 850 !important;
    color: #000 !important;
    letter-spacing: -0.01em;
}

.c-editorial-content ul,
.c-editorial-content ol {
    margin: 1rem 0;
    padding-left: 1.25rem;
}

@media (min-width: 768px) {

    .c-editorial-content ul,
    .c-editorial-content ol {
        margin: 1.5rem 0;
        padding-left: 1.5rem;
    }
}

.c-editorial-content li {
    line-height: 1.55 !important;
    margin-bottom: 0.4rem;
}

.c-editorial-content em,
.c-editorial-content i {
    font-style: italic;
}

/* Drop Cap: Desktop only — disabled on mobile for clean reading */
.c-editorial-content p:first-of-type::first-letter {
    /* No drop cap on mobile — normal text flow */
    float: none;
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
    margin: 0;
    color: inherit;
    text-shadow: none;
}

@media (min-width: 768px) {
    .c-editorial-content p:first-of-type::first-letter {
        font-size: 4.5rem;
        line-height: 0.82;
        font-weight: 900;
        margin: 0.1rem 0.75rem 0 0;
        float: left;
        color: var(--primary-blue);
        font-family: var(--font-editorial);
        text-shadow: 3px 3px 0px #ebf5ff;
    }
}

/* --- Blockquote Soft Design (Latest Ref) --- */
.c-editorial-content blockquote {
    position: relative;
    background: #f0f7ff !important;
    padding: 3rem 1.5rem 1.5rem 1.75rem !important;
    margin: 2.5rem 0 !important;
    border-radius: 12px !important;
    border: none !important;
    overflow: hidden;
}

@media (min-width: 768px) {
    .c-editorial-content blockquote {
        padding: 4.5rem 2.5rem 2.5rem 3.5rem !important;
        margin: 3.5rem 0 !important;
    }
}

.c-editorial-content blockquote::before {
    content: "";
    position: absolute;
    top: 1rem;
    left: 1.25rem;
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2360a5fa'%3E%3Cpath d='M14.017 21L14.017 18C14.017 16.8954 14.9124 16 16.017 16H19.017C19.5693 16 20.017 15.5523 20.017 15V9C20.017 8.44772 19.5693 8 19.017 8H16.017C15.4647 8 15.017 8.44772 15.017 9V12C15.017 12.5523 14.5693 13 14.017 13H11.017C10.4647 13 10.017 12.5523 10.017 12V9C10.017 7.34315 11.3601 6 13.017 6H19.017C20.6739 6 22.017 7.34315 22.017 9V15C22.017 16.6569 20.6739 18 19.017 18H16.017C15.4647 18 15.017 18.4477 15.017 19V21H14.017ZM3.017 21L3.017 18C3.017 16.8954 3.91243 16 5.017 16H8.017C8.56928 16 9.017 15.5523 9.017 15V9C9.017 8.44772 8.56928 8 8.017 8H5.017C4.46472 8 4.017 8.44772 4.017 9V12C4.017 12.5523 3.56928 13 3.017 13H0.017C-0.53528 13 -1.017 12.5523 -1.017 12V9C-1.017 7.34315 0.32614 6 1.983 6H8.017C9.67386 6 11.017 7.34315 11.017 9V15C11.017 16.6569 9.67386 18 8.017 18H5.017C4.46472 18 4.017 18.4477 4.017 19V21H3.017Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.4;
}

@media (min-width: 768px) {
    .c-editorial-content blockquote::before {
        top: 1.5rem;
        left: 2rem;
        width: 42px;
        height: 42px;
    }
}

.c-editorial-content blockquote p {
    font-size: 19px !important;
    font-weight: 600 !important;
    line-height: 1.6 !important;
    color: #003a70 !important;
    font-style: italic !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin-bottom: 0 !important;
}

@media (min-width: 768px) {
    .c-editorial-content blockquote p {
        font-size: 23px !important;
    }
}

.c-editorial-content blockquote cite {
    display: block;
    margin-top: 1.25rem;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: #4b5563 !important;
    font-style: normal !important;
}

.c-editorial-content blockquote a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 700;
}

/* --- Article Title (Desktop vs Mobile) --- */
@media (min-width: 1024px) {
    .c-article__title {
        font-size: 3.5rem;
        line-height: 1.05;
        letter-spacing: -0.035em;
        font-weight: 1000;
        color: #0f172a;
        margin-bottom: 2rem;
    }
}

.c-article__title {
    font-size: 1.85rem;
    line-height: 1.15;
    font-weight: 950;
    letter-spacing: -0.02em;
    color: #1e293b;
    margin-bottom: 1.25rem;
}

.c-article__summary {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-weight: 500;
    border-left: 4px solid var(--border-soft);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.c-article__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.c-article__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border-soft);
}

.c-article__author-name {
    font-size: 0.875rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-main);
}

.c-article__pub-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.c-article__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 2.5rem;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.c-article__action-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.c-article__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.c-article__btn:hover {
    background: var(--border-soft);
    color: var(--text-main);
    transform: translateY(-2px);
}

.c-article__hero-wrapper {
    margin-bottom: 2rem;
    /* Optimized space on mobile: was 1.5rem */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
    .c-article__hero-wrapper {
        margin-bottom: 3rem;
        border-radius: 1.5rem;
        box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.08);
    }
}

.c-article__hero-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* --- CricTracker-Style Also Read --- */
.c-article__also-read {
    background: #f8fafc;
    border: 1px solid var(--border-soft);
    padding: 0;
    margin: 2.5rem 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none !important;
    flex-direction: column;
}

@media (min-width: 640px) {
    .c-article__also-read {
        flex-direction: row;
    }
}

.c-article__also-read:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.c-article__also-read-thumb {
    width: 100%;
    height: 200px;
    flex-shrink: 0;
    object-fit: cover;
}

@media (min-width: 640px) {
    .c-article__also-read-thumb {
        width: 120px;
        height: 80px;
    }
}

.c-article__also-read-content {
    padding: 0.75rem 1.25rem;
    flex: 1;
}

.c-article__also-read-label {
    display: block;
    font-size: 9px;
    font-weight: 900;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.c-article__also-read-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
}

/* ============================================================
   MODULAR BENTO SYSTEM (.c-bento)
   ============================================================ */
.c-bento {
    background: #FFFFFF;
    padding: 5rem 0;
    border-top: 1px solid var(--border-soft);
}

.c-bento__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .c-bento__grid {
        gap: 1.5rem;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 250px);
    }
}

.c-bento__tile {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.c-bento__tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

.c-bento__tile--featured {
    grid-column: span 1;
    grid-row: span 1;
}

@media (min-width: 1024px) {
    .c-bento__tile--featured {
        grid-column: span 2;
        grid-row: span 2;
    }
}

.c-bento__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.c-bento__tile:hover .c-bento__img {
    transform: scale(1.08);
}

.c-bento__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    color: #fff;
}

.c-bento__label {
    align-self: flex-start;
    background: var(--primary-blue);
    padding: 0.25rem 0.75rem;
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.c-bento__title {
    font-weight: 800;
    line-height: 1.3;
    font-size: 1.125rem;
    margin: 0;
    color: white;
}

.c-bento__tile--featured .c-bento__title {
    font-size: 1.75rem;
}

/* ============================================================
   LAYOUT UTILITIES (.l-)
   ============================================================ */
.l-editorial-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0;
    width: 100%;
}

.l-main-col {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .l-editorial-grid {
        display: grid;
        grid-template-columns: var(--article-width) 1fr;
        gap: 2.5rem;
        justify-content: center;
        align-items: start;
        max-width: 1240px;
        margin: 0 auto;
    }

    .l-main-col {
        width: var(--article-width);
    }

    .l-side-col {
        min-width: 300px;
        position: sticky;
        top: 2rem;
    }
}

/* ============================================================
   PREMIUM COMMENTS SYSTEM
   ============================================================ */
.premium-comments-wrapper {
    margin-top: 1rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.comment-list .comment:hover {
    border-color: #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.comment-body {
    position: relative;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.comment-author .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #f1f5f9;
}

.comment-author b {
    font-size: 15px;
    font-weight: 900;
    color: #1e293b;
}

.comment-metadata {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #475569;
    font-weight: 500;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-list .children {
    list-style: none;
    padding-left: 2rem;
    margin-top: 1.5rem;
    border-left: 2px solid #f1f5f9;
}

.reply a {
    display: inline-flex;
    margin-top: 1rem;
    padding: 6px 16px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    transition: all 0.2s ease;
}

.reply a:hover {
    background: #004795;
    color: #ffffff;
    border-color: #004795;
}

.comment-respond {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .comment-respond {
        padding: 2.5rem;
    }
}

#reply-title {
    display: block;
    margin-bottom: 2rem;
}

.comment-form p {
    margin-bottom: 0;
}

.logged-in-as {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 1.5rem !important;
    font-weight: 500;
}

.logged-in-as a {
    color: #004795;
    font-weight: 700;
}

.form-submit {
    text-align: right;
    margin-top: 1.5rem;
}

/* --- Modular Sidebar Widgets --- */
.c-widget {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.c-widget__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    color: #475569 !important;
}

.c-widget__title::before {
    content: "";
    display: block;
    width: 3px;
    height: 12px;
    background: #004795;
    border-radius: 2px;
}

.c-widget__item {
    display: block;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.c-widget__item:last-child {
    border-bottom: none;
}

.c-widget__item:hover {
    background: #f8fbff;
}

.c-widget__item h4 {
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
    color: #1e293b !important;
    text-transform: uppercase !important;
    letter-spacing: -0.01em !important;
    margin: 0 !important;
}

.c-widget__item .meta {
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: #94a3b8 !important;
    margin-top: 0.5rem;
}