/* Melodica News - Global Styles
   Piano brand guidelines (type, text colors, surfaces, 8px spacing, sentence
   case) with the Melodica News brand colors on top. Inter stands in for
   Graphik, as on the Melodica Solutions hub. */

:root {
    /* Melodica News brand */
    --primary-color: #635BFF;
    --primary-dark: #4D45CC;
    --primary-darker: #3D35AA;
    --primary-light: #7A73FF;
    --primary-tint: #EFEEFF;
    --secondary-color: #FF6B9D;
    --secondary-dark: #FF5585;

    /* Piano text and surfaces */
    --pitch-black: #0A0E12;
    --text-color: var(--pitch-black);
    --muted-color: rgba(20, 27, 36, 0.7);
    --placeholder-color: rgba(20, 27, 36, 0.4);
    --surface-1: #FFFFFF;
    --surface-2: #FAFBFB;
    --surface-3: #F3F4F5;
    --surface-4: #EAEBED;
    --surface-5: #E0E2E5;
    --light-gray: var(--surface-3);
    --border-color: var(--surface-4);

    --font-sans: 'Inter', 'Graphik', 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.48;
    background-color: var(--surface-1);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--pitch-black);
    margin-bottom: 16px;
}

h1 { font-size: 40px; letter-spacing: -0.02em; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }

p {
    margin-bottom: 16px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Shared buttons. Header actions sit on the purple header, as on Academy
   and Experiences: the primary one is white, the others are outlined. */
.header-actions a,
.header-actions button {
    display: inline-block;
    color: var(--primary-color);
    background: #fff;
    border: 1px solid #fff;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.header-actions a:hover,
.header-actions button:hover {
    color: var(--primary-color);
    background: var(--primary-tint);
    transform: translateY(-2px);
}

.header-actions .btn-ghost {
    color: #fff;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
}

.header-actions .btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.ad-cta {
    display: inline-block;
    color: white;
    background: var(--secondary-color);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.ad-cta:hover {
    color: white;
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

.read-more,
.subscribe-btn {
    display: inline-block;
    color: white;
    background: var(--primary-color);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.read-more {
    padding: 12px 24px;
}

.subscribe-btn {
    padding: 16px 32px;
}

.read-more:hover,
.subscribe-btn:hover {
    color: white;
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ========================================
   HEADER
   ======================================== */

.header-swiss {
    background: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(10, 14, 18, 0.12);
}

.header-top-swiss {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 32px 0;
    font-size: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    transition: padding 0.3s ease, font-size 0.3s ease;
}

.hub-link {
    font-family: var(--font-sans);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.hub-link:hover {
    color: white;
}

.logo-container-swiss {
    padding: 16px 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    transition: padding 0.3s ease;
}

/* Wordmark: same two-line lockup as the brand cards on the hub */
.logo-swiss {
    font-family: var(--font-sans);
    font-size: 48px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
    display: block;
    transition: font-size 0.3s ease;
}

.logo-swiss span {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.7);
    transition: font-size 0.3s ease, margin 0.3s ease;
}

.logo-swiss:hover {
    color: #fff;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.header-actions a,
.header-actions button {
    padding: 8px 16px;
    font-size: 14px;
}

/* Navigation */
.nav-swiss {
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-swiss ul {
    list-style: none;
    display: flex;
    gap: 8px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.nav-swiss a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    padding: 16px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    box-shadow: inset 0 -2px 0 transparent;
    transition: color 0.2s ease, box-shadow 0.2s ease, padding 0.3s ease;
}

.nav-swiss a:hover,
.nav-swiss a.active {
    color: #fff;
    box-shadow: inset 0 -2px 0 #fff;
}

/* Minimized header (after scrolling) */
.header-minimized .header-top-swiss {
    padding: 8px 32px 0;
    font-size: 11px;
}

.header-minimized .logo-container-swiss {
    padding: 8px 32px 8px;
}

.header-minimized .logo-swiss {
    font-size: 28px;
}

.header-minimized .logo-swiss span {
    font-size: 12px;
    margin-bottom: 2px;
}

.header-minimized .header-actions a,
.header-minimized .header-actions button {
    padding: 6px 12px;
    font-size: 13px;
}

.header-minimized .nav-swiss a {
    padding: 8px 16px;
    font-size: 13px;
}

/* ========================================
   LAYOUT & LISTINGS
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
}

.page-header {
    text-align: center;
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.page-header h1 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.page-header p {
    font-size: 18px;
    color: var(--muted-color);
    margin-bottom: 0;
}

.section-title {
    position: relative;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 32px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 48px;
    height: 2px;
    background: var(--primary-color);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.article-card {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 16px 40px rgba(10, 14, 18, 0.08);
    transform: translateY(-4px);
}

.article-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.article-card-content {
    padding: 24px;
}

.article-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--pitch-black);
}

.article-card p {
    color: var(--muted-color);
    font-size: 16px;
    margin-bottom: 0;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--muted-color);
}

.article-section {
    font-weight: 600;
    color: var(--primary-color);
}

.article-date {
    color: var(--placeholder-color);
}

.plus-badge,
.premium-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    color: white;
    padding: 4px 12px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
}

.plus-badge { background: var(--secondary-color); }
.premium-badge { background: var(--primary-color); }

.badge-inline {
    position: relative;
    top: auto;
    right: auto;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

/* Featured article */
.featured-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 48px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.featured-article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-article-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-article-content .read-more {
    align-self: flex-start;
}

.featured-article-content h2 {
    font-size: 40px;
    letter-spacing: -0.02em;
}

.featured-article-content p {
    font-size: 18px;
    color: var(--muted-color);
    margin-bottom: 24px;
}

/* ========================================
   ARTICLE PAGE
   ======================================== */

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
}

.article-main {
    min-width: 0;
}

.article-header {
    max-width: 800px;
    margin: 0 auto 24px;
    text-align: center;
}

.article-header .article-meta {
    justify-content: center;
    gap: 16px;
}

.article-author {
    color: var(--muted-color);
    margin-bottom: 16px;
}

.article-author strong {
    font-weight: 600;
    color: var(--primary-color);
}

.article-featured-image {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 32px;
    display: block;
    border-radius: 16px;
}

.article-content {
    max-width: 700px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.6;
}

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

.article-content h2 {
    font-size: 26px;
    margin-top: 40px;
}

.article-inline-image {
    display: block;
    width: 100%;
    margin: 32px 0;
    border-radius: 8px;
}

/* Piano paywall gradient */
.template-shown {
    position: relative;
}

.template-shown::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 200px;
    background-image: linear-gradient(to top, #fff 0%, #fff 30%, rgba(255, 255, 255, 0) 100%);
}

/* Recommendations (Piano Content) */
#recommendations {
    margin-top: 48px;
    padding: 32px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

#recommendations::before {
    content: 'Read next';
    display: block;
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

/* Sidebar ads */
.article-sidebar {
    position: sticky;
    top: 152px; /* clears the minimized sticky header (119px) */
    align-self: start;
}

.ad-banner {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ad-banner:hover {
    box-shadow: 0 16px 40px rgba(10, 14, 18, 0.08);
    border-color: var(--primary-color);
}

.ad-banner p {
    font-size: 14px;
    color: var(--muted-color);
}

.ad-label {
    font-size: 12px;
    color: var(--placeholder-color);
    margin-bottom: 16px;
}

.ad-visual {
    padding: 32px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: white;
}

.ad-visual h3 {
    font-size: 20px;
    color: white;
    margin-bottom: 8px;
}

.ad-visual p {
    color: white;
    font-size: 14px;
    margin-bottom: 0;
}

.ad-visual-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.ad-visual--orange { background: linear-gradient(135deg, #ff6b35, #f7931e); }
.ad-visual--violet { background: linear-gradient(135deg, #667eea, #764ba2); }
.ad-visual--navy { background: linear-gradient(135deg, #0B162A, #C83803); }

.ad-cta {
    padding: 8px 24px;
    font-size: 14px;
}

/* ========================================
   SUBSCRIPTION & ACCOUNT PAGES
   ======================================== */

.account-container {
    max-width: 900px;
    margin: 0 auto;
}

/* The subscription landing template brings its own wide sections */
.subscribe-container {
    max-width: 1200px;
    margin: 0 auto;
}

.account-actions {
    margin-bottom: 32px;
    text-align: center;
}

.account-btn {
    margin: 0 8px;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: var(--primary-darker);
    color: rgba(255, 255, 255, 0.7);
    padding: 24px 16px;
    margin-top: 64px;
    text-align: center;
    font-size: 14px;
}

footer p {
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .header-top-swiss,
    .header-minimized .header-top-swiss {
        padding: 8px 16px 0;
    }

    .logo-container-swiss {
        flex-direction: column;
        gap: 16px;
        padding: 16px 16px 24px;
        text-align: center;
    }

    .header-minimized .logo-container-swiss {
        flex-direction: row;
        padding: 8px 16px;
        text-align: left;
    }

    .logo-swiss {
        font-size: 40px;
    }

    .header-minimized .logo-swiss {
        font-size: 24px;
    }

    /* Nav: one horizontally scrollable row */
    .nav-swiss ul {
        overflow-x: auto;
        scrollbar-width: none;
        gap: 0;
        padding: 0 8px;
    }

    .nav-swiss li {
        flex: 0 0 auto;
    }

    .nav-swiss a,
    .header-minimized .nav-swiss a {
        padding: 12px;
        font-size: 13px;
    }

    .article-grid,
    .featured-article,
    .article-layout {
        grid-template-columns: 1fr;
    }

    .page-header h1,
    .article-header h1,
    .featured-article-content h2 {
        font-size: 32px;
    }

    .featured-article {
        gap: 0;
    }

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

    .article-sidebar {
        position: static;
        margin-top: 32px;
    }

    #recommendations {
        padding: 24px;
        margin-top: 32px;
    }

    #recommendations::before {
        font-size: 20px;
        margin-bottom: 16px;
    }
}

/* Piano onboarding template on My account */
#piano-onboarding {
    margin-bottom: 32px;
}

#piano-onboarding:empty {
    display: none;
}

/* ========================================
   AGENT-READY SUBSCRIPTIONS
   ======================================== */

/* Right-aligned nav item, under the header buttons */
.nav-swiss .nav-right {
    margin-left: auto;
}

.agent-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    margin: 32px 0 64px;
}

.agent-hero h1 {
    font-size: 48px;
    letter-spacing: -0.02em;
}

.agent-lead {
    font-size: 20px;
    color: var(--muted-color);
}

.agent-works {
    margin: 24px 0 8px;
    font-size: 14px;
    color: var(--muted-color);
}

.agent-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.agent-chips li {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
}

/* Example conversation */
.agent-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.agent-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
}

.agent-msg span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.72;
}

.agent-msg.is-user {
    align-self: flex-end;
    color: #fff;
    background: var(--primary-ink, var(--primary-dark));
    border-bottom-right-radius: 4px;
}

.agent-msg.is-agent {
    align-self: flex-start;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.agent-approve {
    align-self: center;
    margin: 0;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-ink, var(--primary-dark));
    background: var(--primary-tint);
}

/* What your agent can do */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.agent-card {
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.agent-step {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-bottom: 16px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--primary-ink, var(--primary-dark));
}

.agent-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.agent-card p {
    color: var(--muted-color);
}

.agent-card ul {
    padding-left: 20px;
    font-size: 15px;
}

.agent-card li {
    margin-bottom: 8px;
}

/* Standards */
.agent-standards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 48px;
    margin-bottom: 48px;
}

.agent-standard {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.agent-standard h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.agent-standard p {
    margin: 0;
    color: var(--muted-color);
}

/* Control */
.agent-control {
    padding: 32px;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.agent-control h2 {
    font-size: 24px;
}

.agent-control ul {
    padding-left: 20px;
    margin-bottom: 24px;
}

.agent-control li {
    margin-bottom: 8px;
}

.agent-note {
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--muted-color);
}

@media (max-width: 768px) {
    .agent-hero,
    .agent-grid,
    .agent-standards {
        grid-template-columns: 1fr;
    }

    .agent-hero {
        gap: 32px;
        margin-top: 16px;
    }

    .agent-hero h1 {
        font-size: 32px;
    }

    .agent-control {
        padding: 24px;
    }
}
