/* Mjölbyliberalerna – Mobile-first stylesheet */

/* ── Variables ── */
:root {
    --blue:        #1d4db7;
    --blue-light:  #6c91e0;
    --blue-kornblomma: #698bd4;
    --blue-dark:   #153885;
    --bg:          #F8F9FA;
    --bg-section:  #FFFFFF;
    --text:        #1A1A2E;
    --text-muted:  #5A6474;
    --border:      #DDE3EC;
    --white:       #FFFFFF;
    --radius:      10px;
    --shadow:      0 2px 16px rgba(29,77,183,0.08);
    --nav-height:  64px;
    --transition:  0.2s ease;
}

/* ── Skip link ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--blue);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: 600;
    z-index: 9999;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ── */
h1 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { margin-bottom: 1rem; }

/* ── Layout helpers ── */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 4rem 0; }
.section--alt { background: var(--bg); }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header p { color: var(--text-muted); margin-top: 0.5rem; }

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-align: center;
    white-space: nowrap;
}
.btn-primary   { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; }
.btn-outline   { background: transparent; color: var(--white); border-color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--blue); text-decoration: none; }
.btn-blue-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-blue-outline:hover { background: var(--blue); color: var(--white); text-decoration: none; }

/* ── Navigation ── */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--blue);
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.nav-logo { display: flex; align-items: center; gap: 0.75rem; }
.nav-logo img { height: 36px; width: auto; }
.nav-logo span { color: var(--white); font-weight: 700; font-size: 1.05rem; }

.nav-links {
    display: none;
    list-style: none;
    gap: 0.25rem;
}
.nav-links a {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: background var(--transition);
}
.nav-links a:hover { background: rgba(255,255,255,0.15); text-decoration: none; color: #fff; }

.nav-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Mobile menu open */
.nav-mobile-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--blue-dark);
    padding: 1rem;
    gap: 0.25rem;
}
.nav-mobile-open .nav-links a { padding: 0.6rem 1rem; display: block; }

body { padding-top: var(--nav-height); }

/* ── Hero ── */
#hero {
    position: relative;
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--blue-dark) center/cover no-repeat;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,40,80,0.82) 0%, rgba(0,91,153,0.65) 100%);
}
.hero-content {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
    max-width: 700px;
}
.hero-content h1 { color: var(--white); margin-bottom: 1rem; }
.hero-content p  { color: rgba(255,255,255,0.88); font-size: 1.2rem; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    border-radius: 50px;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(4px);
}

/* ── About ── */
#om-oss { background: var(--bg-section); }
.about-inner { display: grid; gap: 2rem; }
.about-inner > * { min-width: 0; }
.about-text p:last-child { margin-bottom: 0; }

/* ── Key issues ── */
#fragor { background: var(--bg); }
.issues-grid {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.issue-card {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    transition: background var(--transition);
}
.issue-card:last-child { border-bottom: none; }
.issue-card--expandable { cursor: pointer; }
.issue-card--expandable:hover { background: var(--bg); }
.issue-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}
.issue-row h3 { flex: 1; margin: 0; }
.issue-icon { font-size: 1.75rem; flex-shrink: 0; }
.issue-toggle {
    color: var(--blue);
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.issue-card.open .issue-toggle { transform: rotate(180deg); }
.issue-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0 1.5rem 0 calc(1.5rem + 1.75rem + 1rem);
    font-size: .95rem;
    color: var(--text);
    line-height: 1.6;
}
.issue-card.open .issue-body {
    padding-bottom: 1.25rem;
}
.issue-card--expandable:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: -3px;
}

/* ── Social feed ── */
#social-feed { background: var(--bg-section); }
.social-feed-inner { display: flex; justify-content: center; }

/* ── Video promo ── */
#video-promo { background: var(--bg-section); }
.video-promo-inner { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ── Politics ── */
#politik { background: var(--bg-section); }
.politik-body { max-width: 760px; margin: 0 auto; }
.politik-body p:last-child { margin-bottom: 0; }

/* ── Geographic sections ── */
#orter { background: var(--bg); }
.orter-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.orter-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition);
    font-size: 0.95rem;
}
.orter-tab:hover, .orter-tab.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}
.orter-panel { display: none; }
.orter-panel.active {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;
}
.orter-panel h3 { margin-bottom: 1rem; color: var(--blue); }
.orter-panel-img {
    width: calc(100% + 3.5rem);
    margin: -1.75rem -1.75rem 1.5rem;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}
.orter-panel-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Candidates ── */
#kandidater { background: var(--bg-section); }
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.candidate-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.candidate-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,91,153,0.12); }
.candidate-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--border);
}
.candidate-photo-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--blue-kornblomma), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,0.7);
}
.candidate-info { padding: 1rem; }
.candidate-info h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.candidate-role { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.candidate-area-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    background: rgba(0,91,153,0.1);
    color: var(--blue);
    font-weight: 500;
}
.candidate-bio { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; display: none; }

/* ── Q&A ── */
#fraga-oss { background: var(--bg); }
.qa-box {
    max-width: 680px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.qa-form { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.qa-input {
    flex: 1;
    min-width: 200px;
    padding: 0.85rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
}
.qa-input:focus { border-color: var(--blue); }
.qa-answer {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(0,91,153,0.06);
    border-radius: var(--radius);
    border-left: 3px solid var(--blue);
    display: none;
    font-size: 0.97rem;
}
.qa-answer.visible { display: block; animation: fadeIn 0.3s ease; }
.qa-loading { color: var(--text-muted); font-style: italic; }
.qa-rating { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.9rem; font-size: 0.85rem; color: var(--text-muted); }
.qa-rating button { background: none; border: 1px solid var(--border); border-radius: 50px; padding: 0.2rem 0.65rem; font-size: 1rem; cursor: pointer; transition: background var(--transition); }
.qa-rating button:hover { background: var(--bg); }

/* ── Membership ── */
#medlemskap { background: var(--blue); }
#medlemskap .section-header h2, #medlemskap .section-header p { color: var(--white); }
.membership-inner {
    display: grid;
    gap: 2rem;
    align-items: center;
}
.membership-text { color: rgba(255,255,255,0.9); }
.membership-text p:last-child { margin-bottom: 0; }

/* ── Contact ── */
#kontakt { background: var(--bg-section); }
.kontakt-inner { max-width: 620px; margin: 0 auto; }
.kontakt-inner p:last-child { margin-bottom: 0; }

/* ── Footer ── */
footer {
    background: var(--blue-dark);
    color: rgba(255,255,255,0.75);
    padding: 2.5rem 0 1.5rem;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
}
.footer-logo { display: flex; align-items: center; gap: 0.75rem; }
.footer-logo img { height: 32px; }
.footer-logo span { color: var(--white); font-weight: 700; }
.footer-center { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-links a:hover { color: var(--white); }
.footer-copy { font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.footer-lib { display: flex; align-items: center; transform: translateY(-18px); }
.footer-lib img { height: 28px; opacity: 0.85; transition: opacity var(--transition); }
.footer-lib img:hover { opacity: 1; }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Tablet+ ── */
@media (min-width: 640px) {
    .nav-hamburger { display: none; }
    .nav-links { display: flex !important; position: static !important; background: none !important; flex-direction: row !important; }
    .issues-grid { grid-template-columns: repeat(2, 1fr); }
    .about-inner { grid-template-columns: 1fr 1fr; }
    .membership-inner { grid-template-columns: 1fr auto; }
    .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (min-width: 900px) {
    .issues-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Rich text content ── */
.rich-text { overflow-wrap: break-word; }
.rich-text img { max-width: 100%; height: auto; }
.rich-text p { margin: 0 0 .9em; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text strong { font-weight: 700; }
.rich-text em { font-style: italic; }
.rich-text u { text-decoration: underline; }
.rich-text a { color: var(--primary); text-decoration: underline; }
.rich-text a:hover { color: var(--primary-dark); }
.rich-text h2 { font-size: 1.4rem; font-weight: 700; margin: 1.2em 0 .5em; }
.rich-text h3 { font-size: 1.15rem; font-weight: 700; margin: 1em 0 .4em; }
.rich-text ul, .rich-text ol { margin: .5em 0 .9em 1.4em; }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li { margin-bottom: .25em; }
