/*
Theme Name: Min CV
Description: Ett minimalistiskt onepage-tema för CV och portfolio. Fyll i uppgifter under Utseende > Anpassa, och lägg till Projekt, Erfarenheter och Utbildningar i adminmenyn.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: min-cv
License: GPL-2.0-or-later
*/

@font-face { font-family: "Roboto"; font-weight: 400; font-style: normal; font-display: swap;
  src: local("Roboto"), local("Roboto-Regular"), url("fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-style: normal; font-display: swap;
  src: local("Roboto Medium"), local("Roboto-Medium"), url("fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-style: normal; font-display: swap;
  src: local("Roboto Bold"), local("Roboto-Bold"), url("fonts/roboto-700.woff2") format("woff2"); }

:root {
  --sand: #f2f0ea;
  --sand-deep: #e7e3d8;
  --ink: #23261f;
  --muted: #5f6356;
  --rule: #d9d5c8;
  --moss: #5e6b3f;
  --moss-dark: #4a5531;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--sand); color: var(--ink); font: 400 1.0625rem/1.65 var(--font); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--moss-dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; }
h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- Meny ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(242, 240, 234, .94); border-bottom: 1px solid var(--rule); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 3.75rem; }
.topbar .brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.topbar nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: .4rem 0; display: inline-block; }
.topbar nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; }
section[id] { scroll-margin-top: 4.5rem; }

/* ---------- Intro ---------- */
.hero { padding-block: clamp(3.5rem, 10vw, 7rem) clamp(3rem, 8vw, 5.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.75rem, 7vw, 5rem); letter-spacing: -.025em; margin-bottom: 1rem; }
.hero .role { font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--moss-dark); margin: 0 0 1.25rem; font-weight: 500; }
.hero .status { max-width: 56ch; color: var(--muted); font-size: 1.15rem; }
.hero .photo { width: clamp(150px, 20vw, 230px); aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn { display: inline-block; padding: .75rem 1.4rem; border-radius: 4px; border: 2px solid var(--moss); font: 500 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--moss); color: #fff; }
.btn-primary:hover { background: var(--moss-dark); border-color: var(--moss-dark); }
.btn-ghost { background: transparent; color: var(--moss-dark); }
.btn-ghost:hover { background: var(--sand-deep); }

/* ---------- Sektioner ---------- */
.block { padding-block: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--rule); }
.block > .wrap > h2 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); margin-bottom: .75rem; }
.lede { max-width: 62ch; color: var(--muted); margin-bottom: 2rem; font-size: 1.1rem; }
.sub { font-size: 1.2rem; margin: 3rem 0 1rem; }

/* ---------- Filter ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.filters[hidden] { display: none; }
.filters button { font: 500 .95rem/1 var(--font); padding: .6rem 1rem; border: 1px solid var(--rule); background: transparent; color: var(--ink); border-radius: 999px; cursor: pointer; }
.filters button:hover { border-color: var(--moss); }
.filters button[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: #fff; }

/* ---------- Projektkort ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card { all: unset; box-sizing: border-box; display: block; cursor: pointer; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: #f8f7f2; }
.card[hidden] { display: none; }
.card:hover { border-color: var(--moss); }
.card:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; }
.card-img { aspect-ratio: 4 / 3; background: var(--sand-deep); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem 1.15rem 1.2rem; }
.card-title { font-weight: 500; font-size: 1.15rem; line-height: 1.25; display: block; }
.card-meta { color: var(--muted); font-size: .92rem; margin-top: .3rem; display: block; }

/* ---------- Projektfönster ---------- */
dialog.project { width: min(860px, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 0; border: 0; border-radius: 8px; background: var(--sand); color: var(--ink); overflow: auto; }
dialog.project::backdrop { background: rgba(35, 38, 31, .6); }
.project-inner { padding: clamp(1.25rem, 3vw, 2.25rem); }
.project-media { margin-bottom: 1.5rem; border-radius: 6px; overflow: hidden; background: #000; }
.project-media img, .project-media video { width: 100%; }
.video-slot { aspect-ratio: 16 / 9; position: relative; }
.video-slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { all: unset; box-sizing: border-box; position: absolute; inset: 0; cursor: pointer; display: grid; place-items: center; background: #1f2219; }
.video-play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.video-play span { position: relative; background: var(--sand); color: var(--ink); padding: .75rem 1.4rem; border-radius: 4px; font-weight: 500; }
.video-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.project h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .5rem; }
.project .facts { color: var(--muted); margin-bottom: 1.25rem; }
.project .facts span + span::before { content: "|"; margin-inline: .6em; color: var(--rule); }
.project-text { max-width: 64ch; }
.project .close { float: right; margin: 0 0 1rem 1rem; }

/* ---------- Erfarenhet och utbildning ---------- */
.entry { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.5rem; padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry-period { color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; padding-top: .2rem; }
.entry-title { font-size: 1.15rem; font-weight: 500; }
.entry-org { margin: .1rem 0 .6rem; color: var(--moss-dark); font-weight: 500; }
.entry-body { max-width: 64ch; }
.entry-body > :first-child { margin-top: 0; }
.entry-body > :last-child { margin-bottom: 0; }

/* ---------- Kompetenser / kontakt ---------- */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2.5rem; }
.cols h3 { font-size: 1.2rem; margin-bottom: .75rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: .2rem 0; }
.contact li { overflow-wrap: anywhere; }
.contact span { display: block; color: var(--muted); font-size: .9rem; }
.site-foot { padding-block: 2rem 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .92rem; }

/* ---------- Vanliga sidor ---------- */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 3rem 1.25rem 4rem; }

/* ---------- Mobil ---------- */
@media (max-width: 720px) {
  .topbar { position: static; }
  .topbar .wrap { flex-direction: column; align-items: flex-start; gap: .25rem; padding-block: .75rem; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .photo { order: -1; }
  .entry { grid-template-columns: 1fr; gap: .2rem; }
}

/* ---------- Utskrift ---------- */
@media print {
  body { background: #fff; font-size: 10.5pt; }
  .topbar, .filters, .actions, dialog, .site-foot { display: none !important; }
  .block, .hero { padding-block: 1.2rem; }
  .card { break-inside: avoid; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}
