/*
Theme Name: SubstackWP
Description: A clean, readable WordPress theme inspired by Substack's design aesthetic. Features beautiful typography, inline widgets, and a focus on content readability.
Version: 1.0.0
Author: Your Name
Text Domain: substackwp
License: GPL v2 or later
*/

/* ===========================================
   RESET AND BASE STYLES
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Charter', 'Georgia', serif;
    font-size: 18px;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #fefefe;
    -webkit-font-smoothing: antialiased;
}

.site-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===========================================
   HEADER STYLES
   =========================================== */
.site-header {
    padding: 40px 0;
    border-bottom: 1px solid #e6e6e6;
    margin-bottom: 40px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding h1.site-title {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.site-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.02em;
    color: #1a1a1a;
}

.site-title a {
    text-decoration: none;
    color: #1a1a1a;
}

.site-description {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-menu a {
    text-decoration: none;
    color: #666;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #1a1a1a;
}

.subscribe-btn {
    background: #ff6719;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.subscribe-btn:hover {
    background: #e55a16;
}

/* ===========================================
   BLOG POSTS STYLES - HORIZONTAL LAYOUT
   =========================================== */

/* Main posts container */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 800px;
    margin: 0 auto;
}

/* Individual post preview */
.post-preview {
    padding-bottom: 60px;
    border-bottom: 1px solid #f0f0f0;
    transition: transform 0.2s;
}

.post-preview:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-preview:hover {
    transform: translateY(-2px);
}

/* Horizontal layout container */
.post-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Post content area */
.post-preview .post-content {
    flex: 1;
    min-width: 0;
}

/* Post thumbnail - right side */
.post-preview .post-thumbnail {
    position: relative;
    overflow: hidden;
    width: 200px;
    height: 140px;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f8f9fa;
}

.post-preview .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.post-preview:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* Post title */
.post-preview .post-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.post-preview .post-title a {
    text-decoration: none;
    color: #1a1a1a;
    transition: color 0.2s;
}

.post-preview .post-title a:hover {
    color: #ff6719;
}

/* Post meta information - under the title */
.post-preview .post-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-preview .post-date {
    color: #999;
    font-weight: 500;
}

.post-preview .post-category {
    background: #ff6719;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

/* Post subtitle */
.post-preview .post-subtitle {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    color: #666;
    margin-bottom: 12px;
    font-style: italic;
}

/* Post excerpt */
.post-preview .post-excerpt {
    color: #404040;
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 16px;
}

/* Post actions */
.post-preview .post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-preview .read-more {
    color: #ff6719;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s;
}

.post-preview .read-more:hover {
    color: #e55a16;
}

.post-preview .post-engagement {
    display: flex;
    gap: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #999;
}

.post-engagement .heart-count,
.post-engagement .comment-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Posts without thumbnails - full width content */
.post-preview:not(:has(.post-thumbnail)) .post-layout {
    display: block;
}

.post-preview:not(:has(.post-thumbnail)) .post-content {
    max-width: 100%;
}

/* Pagination */
.pagination {
    margin-top: 60px;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.pagination .page-numbers {
    padding: 12px 16px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: #ff6719;
    color: white;
}

.pagination .prev,
.pagination .next {
    font-weight: 600;
}

/* No posts message */
.no-posts {
    text-align: center;
    padding: 80px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.no-posts h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.no-posts p {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
}

/* ===========================================
   SINGLE POST STYLES
   =========================================== */
.single-post-header {
    margin-bottom: 40px;
}

.single-post-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.single-post-subtitle {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.4;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.single-post-meta {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #666;
    margin-bottom: 0;
}

.hero-image {
    margin: 0 0 40px 0;
    text-align: center;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 12px;
}

.image-caption {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #999;
    font-style: italic;
}

.post-content {
    font-size: 20px;
    line-height: 1.8;
    color: #1a1a1a;
}

.post-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 40px 0 20px;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 32px 0 16px;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content blockquote {
    margin: 32px 0;
    padding-left: 24px;
    border-left: 4px solid #e6e6e6;
    font-style: italic;
    color: #666;
    font-size: 22px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 32px 0;
    border-radius: 4px;
}

/* ===========================================
   POST ACTIONS BAR STYLES
   =========================================== */
.post-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    margin: 40px 0 60px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.post-engagement-actions {
    display: flex;
    gap: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: #f8f9fa;
    color: #1a1a1a;
}

.heart-btn.liked {
    color: #ff6719;
}

.heart-btn:hover {
    color: #ff6719;
}

.comment-btn:hover {
    color: #ff6719;
}

.share-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #999;
    margin-right: 8px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f8f9fa;
    border: 1px solid #e6e6e6;
    border-radius: 50%;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #ff6719;
    color: white;
    border-color: #ff6719;
    transform: translateY(-1px);
}

.copy-link.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

/* ===========================================
   PAGE STYLES
   =========================================== */
.page-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 30px;
    color: #1a1a1a;
}

.page-content-text {
    font-size: 20px;
    line-height: 1.8;
    color: #1a1a1a;
}

.page-content-text h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 40px 0 20px;
}

.page-content-text p {
    margin-bottom: 24px;
}

.page-image {
    margin: 32px 0;
    text-align: center;
}

.page-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 12px;
}

.page-image .image-caption {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #999;
    font-style: italic;
    margin-top: 8px;
}

/* ===========================================
   INLINE WIDGETS
   =========================================== */
.inline-newsletter-widget,
.recent-posts-widget {
    margin: 40px 0;
    padding: 32px;
    background: linear-gradient(135deg, #fff5f1 0%, #fff8f5 100%);
    border: 1px solid #ffe4d6;
    border-radius: 12px;
    position: relative;
}

.inline-newsletter-widget::before,
.recent-posts-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6719, #ff8c42);
    border-radius: 12px 12px 0 0;
}

.widget-content h3 {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.widget-content p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.inline-newsletter-form {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.inline-newsletter-form input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: white;
}

.inline-newsletter-form input:focus {
    outline: none;
    border-color: #ff6719;
    box-shadow: 0 0 0 3px rgba(255, 103, 25, 0.1);
}

.inline-newsletter-form button {
    background: #ff6719;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.inline-newsletter-form button:hover {
    background: #e55a16;
}

.widget-disclaimer {
    font-size: 13px !important;
    color: #999 !important;
    margin-bottom: 0 !important;
    font-style: italic;
}

.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-posts-list li {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.recent-posts-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-posts-list a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: color 0.2s;
}

.recent-posts-list a:hover {
    color: #ff6719;
}

.recent-posts-list .post-date {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.recent-posts-list .post-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.recent-posts-list a:hover .post-title {
    color: #ff6719;
}

/* ===========================================
   SUBSCRIPTION WIDGET STYLES
   =========================================== */

.substackwp-subscription-form {
    margin: 30px 0;
}

.substackwp-subscription-form.inline-style {
    padding: 32px;
    background: linear-gradient(135deg, #fff5f1 0%, #fff8f5 100%);
    border: 1px solid #ffe4d6;
    border-radius: 12px;
    position: relative;
}

.substackwp-subscription-form.inline-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6719, #ff8c42);
    border-radius: 12px 12px 0 0;
}

.substackwp-subscription-form.sidebar-style {
    padding: 24px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
}

.substackwp-subscription-form.footer-style {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
}

.subscription-content .subscription-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.subscription-content .subscription-description {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.subscription-form .form-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.subscription-form .subscription-email {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.subscription-form .subscription-email:focus {
    outline: none;
    border-color: #ff6719;
    box-shadow: 0 0 0 3px rgba(255, 103, 25, 0.1);
}

.subscription-form .subscription-button {
    background: #ff6719;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.subscription-form .subscription-button:hover {
    background: #e55a16;
    transform: translateY(-1px);
}

.subscription-form .subscription-button:active {
    transform: translateY(0);
}

.subscription-disclaimer {
    font-size: 13px !important;
    color: #999 !important;
    margin-bottom: 0 !important;
    font-style: italic;
    text-align: center;
}

.subscription-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 20px 0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.subscription-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.subscription-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.subscription-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===========================================
   MAGAZINE PAGE STYLES
   =========================================== */

.magazine-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.magazine-hero {
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 60px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
}

.hero-description {
    font-size: 20px;
    line-height: 1.6;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
}

.section-subtitle {
    font-size: 16px;
    color: #999;
    font-family: 'Inter', sans-serif;
}

.magazine-featured {
    margin-bottom: 80px;
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 30px;
    height: 600px;
}

.featured-post {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.featured-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.main-feature {
    grid-row: 1 / -1;
}

.secondary-feature {
    grid-column: 2;
}

.featured-post .post-thumbnail {
    position: relative;
    overflow: hidden;
}

.main-feature .post-thumbnail {
    height: 300px;
}

.secondary-feature .post-thumbnail {
    height: 140px;
}

.featured-post .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.featured-post:hover .post-thumbnail img {
    transform: scale(1.05);
}

.featured-post .post-content {
    padding: 24px;
}

.secondary-feature .post-content {
    padding: 20px;
}

.featured-post .post-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-category {
    background: #ff6719;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.post-date {
    color: #999;
    font-weight: 500;
}

.featured-post .post-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.secondary-feature .post-title {
    font-size: 18px;
    margin-bottom: 8px;
}

.featured-post .post-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.featured-post .post-title a:hover {
    color: #ff6719;
}

.featured-post .post-excerpt {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.featured-post .post-author {
    color: #999;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.magazine-categories {
    margin-bottom: 80px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.category-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e6e6e6;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e6e6e6;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.category-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.category-title a:hover {
    color: #ff6719;
}

.category-count {
    font-size: 12px;
    color: #999;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.category-post {
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.category-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-post .post-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.category-post .post-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.category-post .post-title a:hover {
    color: #ff6719;
}

.category-post .post-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
    font-family: 'Inter', sans-serif;
}

.view-all-link {
    color: #ff6719;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #e55a16;
}

.magazine-recent {
    margin-bottom: 80px;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.recent-post {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.recent-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.recent-post .post-thumbnail {
    height: 160px;
    overflow: hidden;
}

.recent-post .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.recent-post:hover .post-thumbnail img {
    transform: scale(1.05);
}

.recent-post .post-content {
    padding: 20px;
}

.recent-post .post-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.recent-post .post-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.recent-post .post-title a:hover {
    color: #ff6719;
}

.recent-post .post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.recent-post .post-author {
    color: #999;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}

.magazine-newsletter {
    background: linear-gradient(135deg, #ff6719 0%, #ff8c42 100%);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 60px;
}

.newsletter-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.newsletter-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
}

.newsletter-widget .substackwp-subscription-form {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-fallback .newsletter-form {
    display: flex;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-fallback input[type="email"] {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}

.newsletter-fallback button {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.newsletter-fallback button:hover {
    background: #333;
}

/* ===========================================
   JAVASCRIPT ENHANCEMENT STYLES
   =========================================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.1);
    z-index: 9999;
}

.progress-fill {
    height: 100%;
    background: #ff6719;
    width: 0%;
    transition: width 0.3s;
}

.category-toggle {
    background: #ff6719;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background-color 0.2s;
}

.category-toggle:hover {
    background: #e55a16;
}

.newsletter-form.submitting .subscription-button {
    background: #999;
    cursor: not-allowed;
}

.newsletter-form input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.featured-post,
.recent-post,
.category-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animate-in .featured-post,
.animate-in .recent-post,
.animate-in .category-section {
    opacity: 1;
    transform: translateY(0);
}

.featured-grid.mobile-layout {
    grid-template-columns: 1fr;
    height: auto;
}

.categories-grid.single-column {
    grid-template-columns: 1fr;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

.search-results-list {
    padding: 16px;
}

.search-result-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.search-result-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* ===========================================
   FOOTER STYLES
   =========================================== */
.site-footer {
    background: #f8f9fa;
    border-top: 1px solid #e6e6e6;
    margin-top: 60px;
    padding: 40px 0 20px;
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-branding {
    flex: 1;
    max-width: 300px;
}

.footer-branding h3 {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.footer-branding p {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    flex: 2;
}

.footer-column h4 {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 8px;
}

.footer-column a {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: #ff6719;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e6e6e6;
}

.footer-social {
    display: flex;
    gap: 20px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.footer-social a:hover {
    background: #ff6719;
    color: white;
    border-color: #ff6719;
}

.footer-copyright {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #999;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */
@media (max-width: 768px) {
    .site-wrapper {
        padding: 0 16px;
    }
    
    .header-container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .main-navigation {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .single-post-title {
        font-size: 32px;
    }
    
    .page-title {
        font-size: 32px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .inline-newsletter-form {
        flex-direction: column;
    }
    
    .inline-newsletter-widget,
    .recent-posts-widget {
        padding: 24px;
        margin: 32px 0;
    }

    .post-actions-bar {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .share-tools {
        align-self: stretch;
        justify-content: center;
    }
    
    .substackwp-subscription-form.inline-style {
        padding: 24px;
        margin: 32px 0;
    }
    
    .subscription-form .form-group {
        flex-direction: column;
    }
    
    .subscription-form .subscription-email {
        margin-bottom: 8px;
    }
    
    .subscription-form .subscription-button {
        padding: 12px 20px;
    }
    
    .magazine-main {
        padding: 0 16px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-description {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
    }
    
    .main-feature {
        grid-row: auto;
    }
    
    .secondary-feature {
        grid-column: auto;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-grid {
        grid-template-columns: 1fr;
    }
    
    .magazine-newsletter {
        padding: 40px 20px;
    }
    
    .newsletter-title {
        font-size: 24px;
    }
    
    .newsletter-description {
        font-size: 16px;
    }
    
    .newsletter-fallback .newsletter-form {
        flex-direction: column;
    }
    
    /* Blog posts responsive */
    .posts-container {
        gap: 40px;
        padding: 0 16px;
    }
    
    .post-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .post-preview .post-thumbnail {
        width: 100%;
        height: 200px;
        order: -1;
    }
    
    .post-preview .post-title {
        font-size: 24px;
    }
    
    .post-preview .post-subtitle {
        font-size: 16px;
    }
    
    .post-preview .post-excerpt {
        font-size: 15px;
    }
    
    .post-preview .post-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .post-preview .post-meta {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .featured-post .post-content {
        padding: 16px;
    }
    
    .recent-post .post-content {
        padding: 16px;
    }
    
    .category-section {
        padding: 20px;
    }
    
    .post-preview .post-title {
        font-size: 22px;
    }
    
    .post-preview .post-subtitle {
        font-size: 15px;
    }
    
    .post-layout {
        gap: 16px;
    }
}

/* Widget-specific styling when used in WordPress widget areas */
.widget .substackwp-subscription-form {
    margin: 0;
}

.widget .substackwp-subscription-form.inline-style {
    background: #f8f9fa;
    border: 1px solid #e6e6e6;
}

.widget .substackwp-subscription-form.inline-style::before {
    background: #ff6719;
    height: 3px;
}

/* Animation for form submission */
.subscription-form.submitting .subscription-button {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

.subscription-form.submitting .subscription-button:hover {
    background: #999;
    transform: none;
}

/* Success state */
.subscription-form.success .subscription-email {
    border-color: #28a745;
    background: #f8fff9;
}

.subscription-form.success .subscription-button {
    background: #28a745;
}

.subscription-form.success .subscription-button:hover {
    background: #218838;
}

/* Loading animation for new posts */
.post-preview {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}