/* =============================================
   EA Addons - Widget Styles
   Apple/Tesla Aesthetic Design System
   ============================================= */

/* === Shared Foundation === */
.ea-list-post-container,
.ea-quick-content {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                 'SF Pro Text', 'Helvetica Neue', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ea-header,
.ea-header-nav {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                 'SF Pro Text', 'Helvetica Neue', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   Header Widget
   ============================================= */

.ea-header {
    --ea-header-breakpoint: 768px;
    --ea-header-sticky-top: 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 24px;
    width: 100%;
    padding: 12px 0;
    background: #ffffff;
}

.ea-header--sticky {
    position: sticky;
    top: var(--ea-header-sticky-top);
    z-index: 99;
}

.ea-header--no-logo {
    justify-content: flex-end;
}

.ea-header__brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

.ea-header__logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.ea-header__logo-image {
    display: block;
    max-width: 180px;
    height: auto;
}

.ea-header__notice {
    padding: 18px 20px;
    border: 1px dashed #c7ccd1;
    border-radius: 12px;
    color: #6e6e73;
    background: #fafafa;
}

.ea-header-nav {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    --ea-header-nav-color: #14213d;
    --ea-header-nav-surface: #ffffff;
    --ea-header-nav-border: rgba(20, 33, 61, 0.12);
}

.ea-header-nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--ea-header-nav-border);
    border-radius: 12px;
    background: var(--ea-header-nav-surface);
    cursor: pointer;
}

.ea-header-nav__toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ea-header-nav-color);
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ea-header-nav__panel {
    width: 100%;
}

.ea-header-nav__list,
.ea-header-nav__list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ea-header-nav__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
}

.ea-header-nav__list li {
    position: relative;
}

.ea-header-nav__list a {
    display: inline-flex;
    align-items: center;
    padding: 12px 0;
    color: var(--ea-header-nav-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ea-header-nav__list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding: 10px 16px;
    border: 1px solid var(--ea-header-nav-border);
    border-radius: 14px;
    background: var(--ea-header-nav-surface);
    box-shadow: 0 18px 40px rgba(20, 33, 61, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}

.ea-header-nav__list li:hover > .sub-menu,
.ea-header-nav__list li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ea-header-nav__list .sub-menu li {
    width: 100%;
}

.ea-header-nav__list .sub-menu a {
    width: 100%;
    padding: 8px 0;
}

.ea-header-nav.is-mobile {
    width: auto;
    flex: 0 0 auto;
}

.ea-header-nav.is-mobile .ea-header-nav__toggle {
    display: inline-flex;
    margin-left: auto;
}

.ea-header-nav.is-mobile .ea-header-nav__panel {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    margin-top: 0;
    padding: 16px 18px;
    border: 1px solid var(--ea-header-nav-border);
    border-radius: 18px;
    background: var(--ea-header-nav-surface);
    width: min(320px, calc(100vw - 32px));
    max-width: min(320px, calc(100vw - 32px));
    z-index: 30;
}

.ea-header-nav.is-mobile.is-open .ea-header-nav__panel {
    display: block;
}

.ea-header-nav.is-mobile.is-open .ea-header-nav__toggle-bar:nth-child(2) {
    transform: translateY(7px) rotate(45deg);
}

.ea-header-nav.is-mobile.is-open .ea-header-nav__toggle-bar:nth-child(3) {
    opacity: 0;
}

.ea-header-nav.is-mobile.is-open .ea-header-nav__toggle-bar:nth-child(4) {
    transform: translateY(-7px) rotate(-45deg);
}

.ea-header-nav.is-mobile .ea-header-nav__list {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
}

.ea-header-nav.is-mobile .ea-header-nav__list a {
    width: 100%;
    border-bottom: 1px solid var(--ea-header-nav-border);
}

.ea-header-nav.is-mobile .ea-header-nav__list li:last-child > a {
    border-bottom: 0;
}

.ea-header-nav.is-mobile .ea-header-nav__list .sub-menu {
    position: static;
    min-width: 0;
    padding: 0 0 0 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
}

.ea-header-nav.is-mobile .ea-header-nav__list .sub-menu a {
    padding: 10px 0;
    font-weight: 500;
}

@media (max-width: 640px) {
    .ea-header {
        gap: 14px;
    }

    .ea-header__logo-image {
        max-width: 140px;
    }

    .ea-header-nav.is-mobile .ea-header-nav__panel {
        width: min(280px, calc(100vw - 24px));
        max-width: min(280px, calc(100vw - 24px));
    }
}


/* =============================================
   List Post Widget
   ============================================= */

/* === Grid Layout === */
.ea-post-grid {
    display: grid;
    gap: 32px;
}

.ea-grid-cols-1 { grid-template-columns: 1fr; }
.ea-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ea-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ea-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .ea-grid-cols-3,
    .ea-grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .ea-grid-cols-2,
    .ea-grid-cols-3,
    .ea-grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* === List Layout === */
.ea-post-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.ea-post-card--list .ea-post-card__link {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 40px;
    align-items: center;
}

.ea-post-list--img-right .ea-post-card--list .ea-post-card__link {
    direction: rtl;
}

.ea-post-list--img-right .ea-post-card--list .ea-post-card__link > * {
    direction: ltr;
}

@media (max-width: 767px) {
    .ea-post-card--list .ea-post-card__link {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* === Card Base === */
.ea-post-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.ea-post-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ea-post-card--grid .ea-post-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* === Image === */
.ea-post-card__image {
    position: relative;
    overflow: hidden;
}

.ea-post-card__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ea-post-card:hover .ea-post-card__img {
    transform: scale(1.03);
}

/* Aspect Ratios */
.ea-aspect-16-9 .ea-post-card__image { aspect-ratio: 16 / 9; }
.ea-aspect-4-3 .ea-post-card__image  { aspect-ratio: 4 / 3; }
.ea-aspect-3-2 .ea-post-card__image  { aspect-ratio: 3 / 2; }
.ea-aspect-1-1 .ea-post-card__image  { aspect-ratio: 1 / 1; }

/* List layout image */
.ea-post-card--list .ea-post-card__image {
    border-radius: 12px;
    overflow: hidden;
}

/* === Category Badge === */
.ea-post-card__badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(245, 245, 247, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #0066cc;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 6px 14px;
    border-radius: 100px;
    text-transform: uppercase;
    z-index: 1;
}

.ea-post-card__badge--inline {
    position: static;
    display: inline-block;
    margin-bottom: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* === Content Area === */
.ea-post-card__content {
    padding: 28px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ea-post-card--list .ea-post-card__content {
    padding: 0;
}

/* === Meta === */
.ea-post-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 400;
    color: #86868b;
    letter-spacing: -0.01em;
}

.ea-post-card__meta time + .ea-post-card__author::before {
    content: '\00B7';
    margin-right: 12px;
    color: #d2d2d7;
}

/* === Title === */
.ea-post-card__title {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    transition: color 0.2s ease;
}

.ea-post-card:hover .ea-post-card__title {
    color: #0066cc;
}

/* List layout title */
.ea-post-card--list .ea-post-card__title {
    font-size: 24px;
}

/* === Excerpt === */
.ea-post-card__excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: #6e6e73;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
}

/* === Read More Button === */
.ea-post-card__button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #0066cc;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    margin-top: auto;
}

.ea-post-card__button::after {
    content: '\2192';
    transition: transform 0.2s ease;
}

.ea-post-card:hover .ea-post-card__button::after {
    transform: translateX(4px);
}

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

.ea-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 14px 32px;
    background: #1d1d1f;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    letter-spacing: -0.01em;
    font-family: inherit;
}

.ea-load-more:hover {
    background: #424245;
}

.ea-load-more:active {
    transform: scale(0.98);
}

.ea-load-more--loading {
    pointer-events: none;
    opacity: 0.7;
}

.ea-load-more--loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ea-spin 0.6s linear infinite;
    margin-left: 10px;
}

.ea-load-more--hidden {
    display: none;
}

@keyframes ea-spin {
    to { transform: rotate(360deg); }
}

/* Numbered Pagination */
.ea-pagination--numbers ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ea-pagination--numbers li a,
.ea-pagination--numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    color: #1d1d1f;
    background: transparent;
}

.ea-pagination--numbers li a:hover {
    background: #f5f5f7;
}

.ea-pagination--numbers li .current {
    background: #1d1d1f;
    color: #ffffff;
}

/* Infinite Scroll Trigger */
.ea-infinite-scroll-trigger {
    height: 1px;
    width: 100%;
}

.ea-infinite-scroll-loading {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}

.ea-infinite-scroll-loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #e8e8ed;
    border-top-color: #1d1d1f;
    border-radius: 50%;
    animation: ea-spin 0.6s linear infinite;
}

/* === No Posts === */
.ea-no-posts {
    text-align: center;
    padding: 80px 20px;
    color: #86868b;
    font-size: 17px;
}

.ea-no-posts p {
    margin: 0;
}

/* === Fade-in Animation for Loaded Cards === */
.ea-post-card--new {
    animation: ea-fade-up 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes ea-fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =============================================
   Quick Content Widget
   ============================================= */

/* === Heading === */
.ea-qc__heading {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #1d1d1f;
    margin: 0 0 12px;
}

/* === Subheading === */
.ea-qc__subheading {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: #6e6e73;
    margin: 0 0 24px;
}

/* === Content === */
.ea-qc__content {
    font-size: 17px;
    line-height: 1.7;
    color: #1d1d1f;
    margin: 0 0 32px;
}

.ea-qc__content p:last-child {
    margin-bottom: 0;
}

.ea-qc__content a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.ea-qc__content a:hover {
    border-bottom-color: currentColor;
}
.ea-qc__content h3 {
    padding-top: 20px;
}
.ea-qc__content ul,
.ea-qc__content ol {
    padding-left: 1.5em;
}

.ea-qc__content li {
    margin-bottom: 0.1em;
    list-style: disc;
}

/* === Button === */
.ea-qc__button-wrap {
    text-align: left;
}

.ea-qc__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: #1d1d1f;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease,
                border-color 0.2s ease, transform 0.1s ease;
}

.ea-qc__button:hover {
    background: #424245;
    color: #ffffff;
}

.ea-qc__button:active {
    transform: scale(0.98);
}
