/*
Theme Name: Substack Clone
Theme URI: https://example.com/substack-clone
Author: Antigravity
Description: A minimalist, premium WordPress theme cloning the Substack design.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: substack-clone
*/

:root {
    /* Colors */
    --sc-white: #ffffff;
    --sc-black: #000000;
    --sc-charcoal: #363737;
    --sc-grey-medium: rgba(54, 55, 55, 0.7);
    --sc-grey-light: #e6e6e6;
    --sc-orange: #FF6719;
    --sc-orange-hover: #e55c16;
    --sc-bg-input: #f9f9ea;
}

[data-theme="dark"] {
    --sc-white: #111111;
    --sc-black: #ffffff;
    --sc-charcoal: #e5e5e5;
    --sc-grey-medium: rgba(255, 255, 255, 0.7);
    --sc-grey-light: #333333;
    --sc-bg-input: #222222;
}

:root {
    /* Typography */
    --sc-font-serif: 'Spectral', Georgia, serif;
    --sc-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    /* Spacing */
    --sc-container-width: 1100px;
    --sc-content-width: 720px;
    --sc-spacing-unit: 20px;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--sc-white);
    color: var(--sc-charcoal);
    font-family: var(--sc-font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Explicit Spectral Application */
.sc-serif-content,
.sc-post-content,
.sc-post-subtitle,
.sc-hero-title a,
.sc-list-title a,
.sc-post-title {
    font-family: var(--sc-font-serif) !important;
}

.sc-post-content p {
    margin-bottom: 1.6em;
    font-size: 19px;
    line-height: 1.6;
}

a {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
}

.sc-list-item:hover .sc-list-title a,
.sc-hero-title a:hover {
    color: var(--sc-orange);
}

.sc-list-item img,
.sc-hero-image img {
    transition: transform 0.5s ease;
}

.sc-list-item:hover img,
.sc-hero-post:hover img {
    transform: scale(1.02);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--sc-font-sans);
    font-weight: 700;
    line-height: 1.2;
    color: var(--sc-black);
}

.sc-serif-content {
    font-family: var(--sc-font-serif);
    font-size: 19px;
    line-height: 1.6;
}

/* Layout Classes */
.container {
    max-width: var(--sc-container-width);
    margin: 0 auto;
    padding: 0 var(--sc-spacing-unit);
}

.content-narrow {
    max-width: var(--sc-content-width);
    margin: 0 auto;
    width: 100%;
}

article.post {
    max-width: var(--sc-content-width);
    margin-left: auto;
    margin-right: auto;
}

/* Engagement Bar Enhancements */
.sc-engagement-bar i {
    font-size: 20px;
    vertical-align: middle;
}

.sc-engagement-bar span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.sc-engagement-bar span:hover {
    color: var(--sc-orange);
}

/* UI Components */
.sc-button {
    display: inline-block;
    background-color: var(--sc-orange);
    color: var(--sc-white);
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.sc-button:hover {
    background-color: var(--sc-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sc-divider {
    height: 1px;
    background-color: var(--sc-grey-light);
    border: none;
    margin: var(--sc-spacing-unit) 0;
}

/* Comments Styling */
.sc-comment-list {
    margin-bottom: 40px;
}

.sc-comment-item {
    margin-bottom: 24px;
}

.sc-comment-item.parent {
    margin-bottom: 0px;
}

.sc-comment-item .children {
    list-style: none;
    padding-left: 20px;
    margin-left: 20px;
    border-left: 2px solid var(--sc-border);
    margin-top: 10px;
}

.sc-comment-reply-link {
    color: var(--sc-orange);
    text-decoration: none;
    font-weight: 600;
}

.sc-comment-reply-link:hover {
    text-decoration: underline;
}

/* Gutenberg Block Styling: Substack Parity */
.wp-block-quote,
blockquote {
    border-left: 4px solid var(--sc-orange) !important;
    padding-left: 20px !important;
    margin: 30px 0 !important;
    font-size: 20px !important;
    font-style: italic;
    color: var(--sc-grey-dark) !important;
    background: transparent !important;
}

.wp-block-separator,
hr {
    border: none;
    border-top: 1px solid var(--sc-border);
    margin: 40px auto;
    width: 60%;
}

.wp-block-separator.is-style-dots {
    border-top: none;
    text-align: center;
    line-height: 1;
}

.wp-block-separator.is-style-dots::before {
    content: "•••";
    color: var(--sc-grey-medium);
    font-size: 24px;
    letter-spacing: 12px;
}

.wp-block-image img,
.wp-block-gallery img {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.wp-block-image figcaption,
.wp-block-gallery figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--sc-grey-medium);
    font-family: var(--sc-font-sans);
    margin-top: 10px;
}

ul,
ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
}

/* Global Forms & Inputs */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--sc-grey-light);
    border-radius: 4px;
    font-size: 16px;
    font-family: var(--sc-font-sans);
    color: var(--sc-charcoal);
    background-color: var(--sc-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 16px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--sc-orange);
    box-shadow: 0 0 0 2px rgba(255, 103, 25, 0.1);
}

button[type="submit"],
.search-submit,
input[type="submit"] {
    display: inline-block;
    background-color: var(--sc-orange);
    color: var(--sc-white);
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

button[type="submit"]:hover,
.search-submit:hover,
input[type="submit"]:hover {
    background-color: var(--sc-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Sidebar & Widgets Styling */
.widget {
    margin-bottom: 40px;
    font-family: var(--sc-font-sans);
}

.widget-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sc-grey-medium);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--sc-grey-light);
    padding-bottom: 8px;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sc-grey-light);
}

.widget ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget ul li a {
    color: var(--sc-charcoal);
    font-weight: 500;
}

.widget ul li a:hover {
    color: var(--sc-orange);
}

/* Modal Styles */
.sc-modal {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.sc-modal-content {
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sc-modal[aria-hidden="false"] .sc-modal-content {
    transform: translateY(0);
}

/* Audio Player & Progress */
audio {
    width: 100%;
    border-radius: 8px;
    background: var(--sc-bg-input);
}

audio::-webkit-media-controls-panel {
    background: var(--sc-bg-input);
}

#sc-sticky-audio {
    z-index: 99999 !important;
}

#sc-reading-progress {
    z-index: 999998 !important;
}

/* Responsive Styles for Mobile */
@media screen and (max-width: 768px) {
    .sc-header-inner {
        flex-direction: column;
        gap: 16px;
    }

    .sc-nav ul {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }

    .sc-post-title {
        font-size: 32px !important;
    }

    .sc-post-subtitle {
        font-size: 18px !important;
    }

    .sc-engagement-bar {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start !important;
    }

    .sc-engagement-bar>div {
        width: 100%;
        justify-content: space-between;
    }

    .sc-newsletter-box {
        padding: 24px !important;
    }

    .sc-author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #sc-sticky-audio {
        flex-direction: column;
        padding: 15px;
        gap: 10px !important;
    }

    #sc-sticky-audio>div {
        max-width: 100% !important;
        justify-content: center;
    }

    .sc-modal-content form {
        width: 100%;
    }
}