/*
Theme Name:  Upsolution
Author:      Digital Footprint
Description: Az upsolution.hu hírportál-témája – fehér alap, sárga kiemelés, serif szöveg és vastag groteszk címek. Címlap-, rovat- és cikkoldal, kategóriablokkok, keresés.
Version:     1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License:     GNU General Public License v2 or later
Text Domain: upsolution
*/

/* ═══════════════════════════════════════════════════════════════
   1. Változók és alapok
   ═══════════════════════════════════════════════════════════════ */
:root {
    --ink:     #13181D;
    --text:    rgba(19, 24, 29, .9);
    --muted:   #5f656b;
    --soft:    #f6f6f4;
    --line:    #e4e4e1;
    --yellow:  #FFED00;
    --white:   #ffffff;

    --serif:   'IBM Plex Serif', Georgia, 'Times New Roman', serif;
    --grotesk: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;

    --wrap:    1200px;
    --gutter:  clamp(16px, 3vw, 30px);
    --header:  72px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }

body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font: 500 16px/1.6 var(--serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.no-scroll { overflow: hidden; }

img, svg, video, iframe { max-width: 100%; }
img { display: block; height: auto; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; color: var(--ink); }

p { margin: 0 0 1em; }

button { font: inherit; cursor: pointer; }

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 12px; top: -60px;
    z-index: 200;
    background: var(--ink);
    color: var(--white);
    padding: 10px 16px;
    font: 800 14px var(--grotesk);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Sárga „szövegkiemelő” – címekhez */
.hl {
    background-image: linear-gradient(transparent 62%, var(--yellow) 62%, var(--yellow) 92%, transparent 92%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0 .08em;
}

/* ═══════════════════════════════════════════════════════════════
   2. Fejléc
   ═══════════════════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .25s;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(19, 24, 29, .08); }

/* Sárga ferde sáv a bal szélen */
.site-header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: clamp(70px, 9vw, 150px);
    background: var(--yellow);
    clip-path: polygon(0 0, 100% 0, 72% 100%, 0 100%);
    pointer-events: none;
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
    height: var(--header);
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.brand__logo { max-height: 44px; width: auto; }
.brand__mark { width: 42px; height: 42px; flex-shrink: 0; }
.brand__mark-bg    { fill: var(--ink); }
.brand__mark-u     { stroke: var(--white); }
.brand__mark-arrow { fill: var(--yellow); transition: transform .3s ease; transform-origin: 33px 15px; }
.brand:hover .brand__mark-arrow { transform: translateY(-2px); }
.brand__name {
    font: 800 25px/1 var(--grotesk);
    letter-spacing: -.03em;
    color: var(--ink);
}
.brand__up {
    background-image: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 90%, transparent 90%);
    padding: 0 .04em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 26px);
    margin-left: auto;
    overflow: hidden;
    white-space: nowrap;
}
.nav-link {
    font: 900 13px/1 var(--grotesk);
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 6px 0;
    border-bottom: 3px solid transparent;
    transition: border-color .2s;
}
.nav-link:hover,
.nav-link[aria-current="page"] { border-bottom-color: var(--yellow); }

.header-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px; height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    transition: background .2s;
}
.icon-btn:hover { background: var(--soft); }

/* Kereső panel */
.search-panel {
    border-top: 1px solid var(--line);
    background: var(--white);
    padding: 18px var(--gutter);
}
.search-panel .search-form { max-width: 720px; margin: 0 auto; }

.search-form { display: flex; gap: 0; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 2px solid var(--ink);
    border-right: 0;
    border-radius: 0;
    padding: 12px 16px;
    font: 500 16px var(--serif);
    color: var(--ink);
    background: var(--white);
    outline: none;
}
.search-form input[type="search"]:focus { background: #fffde0; }
.search-form button {
    border: 2px solid var(--ink);
    background: var(--ink);
    color: var(--white);
    padding: 0 22px;
    font: 900 13px var(--grotesk);
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background .2s, color .2s;
}
.search-form button:hover { background: var(--yellow); color: var(--ink); }

/* Oldalsó menü */
.drawer {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(19, 24, 29, .45);
}
.drawer__panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: min(380px, 88vw);
    background: var(--white);
    padding: 70px 30px 30px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .3s ease;
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__close { position: absolute; top: 14px; right: 14px; }
.drawer__title {
    font: 800 28px/1 var(--grotesk);
    color: var(--ink);
    margin: 0 0 18px;
}
.drawer__nav { display: flex; flex-direction: column; margin-bottom: 28px; }
.drawer__nav a {
    font: 900 15px var(--grotesk);
    text-transform: uppercase;
    color: var(--ink);
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.drawer__nav a:hover { background: linear-gradient(transparent 60%, var(--yellow) 60%); }

/* ═══════════════════════════════════════════════════════════════
   3. Blokkok, szakaszcímek, rácsok
   ═══════════════════════════════════════════════════════════════ */
.site-main { min-height: 50vh; }

.block { padding: clamp(36px, 6vw, 64px) 0 0; }
.block:last-child { padding-bottom: clamp(48px, 7vw, 80px); }
.page-block { padding-top: clamp(30px, 5vw, 50px); padding-bottom: clamp(48px, 7vw, 80px); }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: clamp(20px, 3vw, 30px);
}
.section-title {
    font: 700 clamp(24px, 3vw, 32px)/1.25 var(--serif);
    color: var(--ink);
}
.section-more {
    font: 900 13px var(--grotesk);
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--ink);
    white-space: nowrap;
    border-bottom: 3px solid var(--yellow);
}
.section-more:hover { background: var(--yellow); }

.grid { display: grid; gap: clamp(24px, 3vw, 30px); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Címlap rács: bal oldalt nagy cikk + 2 szöveges, jobb oldalt 2×2 kártya */
.cover-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 30px);
    align-items: start;
}
.cover-grid__main { display: flex; flex-direction: column; gap: 22px; }
.cover-grid__side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(22px, 3vw, 30px);
}

/* ═══════════════════════════════════════════════════════════════
   4. Kártyák
   ═══════════════════════════════════════════════════════════════ */
.card { display: flex; flex-direction: column; min-width: 0; }

.card__img {
    display: block;
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--soft);
    margin-bottom: 14px;
}
.card__img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.card:hover .card__img img { transform: scale(1.04); }

.thumb-placeholder {
    display: block;
    width: 100%; height: 100%;
    background:
        repeating-linear-gradient(135deg, transparent 0 14px, rgba(19,24,29,.05) 14px 28px),
        var(--soft);
}

.card__cat {
    display: inline-block;
    font: 900 11px/1 var(--grotesk);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: 8px;
}
.card__cat:hover { color: var(--ink); }

.card__title {
    font: 800 20px/1.3 var(--grotesk);
    letter-spacing: -.01em;
    color: var(--ink);
    margin-bottom: 8px;
}
.card__title a {
    background-image: linear-gradient(var(--yellow), var(--yellow));
    background-size: 0% 35%;
    background-position: 0 88%;
    background-repeat: no-repeat;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background-size .35s ease;
}
.card:hover .card__title a,
.card__title a:focus-visible { background-size: 100% 35%; }

.card__lead {
    font: 500 14px/1.6 var(--serif);
    color: var(--muted);
    margin: 0;
}

.card--big .card__title { font-size: clamp(22px, 2.4vw, 28px); font-weight: 900; line-height: 1.2; }
.card--big .card__lead  { font-size: 15px; }
.card--big .card__img   { aspect-ratio: 16 / 9; }

.card--text { padding-top: 18px; border-top: 1px solid var(--line); }

/* ═══════════════════════════════════════════════════════════════
   5. Kiemelt cikk (fekete címdobozok a kép tetején)
   ═══════════════════════════════════════════════════════════════ */
.feature { display: block; position: relative; }
.feature__title {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto -1.1em;
    padding: 0 20px;
    text-align: center;
    font: 900 clamp(24px, 3.6vw, 42px)/1.35 var(--grotesk);
    letter-spacing: -.01em;
}
.feature__title span {
    background: var(--ink);
    color: var(--white);
    padding: .08em .3em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background .25s, color .25s;
}
.feature:hover .feature__title span { background: var(--yellow); color: var(--ink); }
.feature__img {
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: var(--soft);
}
.feature__img img { width: 100%; height: 100%; object-fit: cover; }
.feature__lead {
    max-width: 760px;
    margin: 18px auto 0;
    text-align: center;
    font: 500 16px/1.6 var(--serif);
    color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════
   6. Rovatoldal / keresés fejléc
   ═══════════════════════════════════════════════════════════════ */
.archive-head {
    padding: clamp(36px, 6vw, 60px) 0 clamp(26px, 4vw, 40px);
    border-bottom: 1px solid var(--line);
    background: var(--soft);
}
.kicker {
    font: 900 12px/1 var(--grotesk);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 0 0 12px;
}
.archive-title { font: 700 clamp(30px, 5vw, 52px)/1.15 var(--serif); }
.archive-desc { margin-top: 14px; max-width: 680px; color: var(--muted); }
.archive-desc p:last-child { margin-bottom: 0; }
.search-form--page { max-width: 560px; margin-top: 22px; }

.empty { padding: 40px 0; color: var(--muted); }

/* Lapozás */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: clamp(36px, 5vw, 56px);
}
.pagination .page-numbers {
    min-width: 42px;
    padding: 10px 14px;
    text-align: center;
    border: 2px solid var(--ink);
    font: 900 13px/1 var(--grotesk);
    color: var(--ink);
}
.pagination a.page-numbers:hover { background: var(--yellow); }
.pagination .current { background: var(--ink); color: var(--white); }
.pagination .dots { border-color: transparent; }

/* ═══════════════════════════════════════════════════════════════
   7. Cikkoldal
   ═══════════════════════════════════════════════════════════════ */
.article { padding: clamp(30px, 5vw, 56px) var(--gutter) 0; }

.article__head { max-width: 760px; margin: 0 auto; }

.article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 18px;
}
.article__tags a {
    font: 900 11px/1.4 var(--grotesk);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}
.article__tags a:hover { color: var(--ink); background: var(--yellow); }

.article__title {
    font: 700 clamp(30px, 4.4vw, 46px)/1.25 var(--serif);
    letter-spacing: -.01em;
    margin-bottom: 24px;
}

.article__lead {
    font: 700 19px/1.6 var(--serif);
    color: var(--ink);
    margin: 0 0 30px;
}

.article__img {
    max-width: 960px;
    margin: 10px auto 36px;
}
.article__img img { width: 100%; }
.article__img figcaption {
    margin-top: 8px;
    font: 500 13px/1.5 var(--serif);
    color: var(--muted);
}

/* Olvasóhasáb */
.entry-content {
    max-width: 680px;
    margin: 0 auto;
    font: 500 18px/1.75 var(--serif);
    color: var(--text);
}
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: var(--grotesk);
    font-weight: 900;
    line-height: 1.25;
    margin: 1.8em 0 .6em;
}
.entry-content h2 { font-size: clamp(23px, 2.6vw, 28px); }
.entry-content h3 { font-size: clamp(20px, 2.2vw, 23px); }
.entry-content h4 { font-size: 19px; }
.entry-content ul,
.entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .45em; }
.entry-content blockquote {
    margin: 1.8em 0;
    padding: .2em 0 .2em 1.1em;
    border-left: 5px solid var(--yellow);
    font-style: italic;
    font-size: 1.1em;
    color: var(--ink);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content img { width: 100%; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption,
.entry-content .wp-element-caption {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.entry-content th,
.entry-content td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.entry-content th { font-family: var(--grotesk); font-weight: 900; color: var(--ink); }

/* Szövegközi hivatkozások: jól láthatók, de nem harsányak */
.entry-content a:not(.wp-block-button__link):not(:has(img)) {
    color: var(--ink);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--yellow);
    text-decoration-thickness: .22em;
    text-underline-offset: .12em;
    text-decoration-skip-ink: none;
    transition: background .2s;
}
.entry-content a:not(.wp-block-button__link):not(:has(img)):hover { background: var(--yellow); }

/* Beágyazott videók teljes hasábszélességben */
.entry-content .wp-block-embed,
.entry-content .wp-block-video { width: 100%; max-width: 100%; }
.entry-content .wp-block-embed__wrapper { width: 100%; }
.entry-content iframe[src*="youtube"],
.entry-content iframe[src*="youtu.be"],
.entry-content iframe[src*="vimeo"],
.entry-content .wp-block-embed.is-type-video iframe,
.entry-content video {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border: 0;
}

/* Gutenberg gomb */
.entry-content .wp-block-button__link {
    background: var(--ink);
    color: var(--white);
    border-radius: 0;
    font: 900 14px var(--grotesk);
    text-transform: uppercase;
    padding: 14px 24px;
}
.entry-content .wp-block-button__link:hover { background: var(--yellow); color: var(--ink); }

.page-links { font: 800 14px var(--grotesk); }

.article--page { padding-bottom: clamp(48px, 7vw, 80px); }

.block--related { margin-top: clamp(40px, 6vw, 70px); border-top: 1px solid var(--line); }

/* ═══════════════════════════════════════════════════════════════
   8. 404
   ═══════════════════════════════════════════════════════════════ */
.not-found {
    max-width: 680px;
    padding-top: clamp(50px, 8vw, 90px);
    padding-bottom: clamp(60px, 9vw, 100px);
    text-align: center;
}
.not-found__code {
    font: 900 clamp(90px, 16vw, 170px)/1 var(--grotesk);
    color: var(--ink);
    margin: 0 0 10px;
}
.not-found__title { font: 700 clamp(24px, 3.4vw, 34px)/1.3 var(--serif); margin-bottom: 14px; }
.not-found .search-form { max-width: 480px; margin: 26px auto; }
.btn {
    display: inline-block;
    border: 2px solid var(--ink);
    padding: 12px 22px;
    font: 900 13px var(--grotesk);
    text-transform: uppercase;
    color: var(--ink);
}
.btn:hover { background: var(--yellow); }

/* ═══════════════════════════════════════════════════════════════
   9. Lábléc
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
    margin-top: 0;
    background: var(--ink);
    color: rgba(255, 255, 255, .72);
    padding: clamp(44px, 6vw, 70px) 0 28px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: clamp(28px, 4vw, 60px);
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.brand--footer .brand__mark-bg    { fill: var(--yellow); }
.brand--footer .brand__mark-u     { stroke: var(--ink); }
.brand--footer .brand__mark-arrow { fill: var(--white); }
.brand--footer .brand__name { color: var(--white); }
.brand--footer .brand__up { background-image: linear-gradient(transparent 58%, rgba(255, 237, 0, .55) 58%, rgba(255, 237, 0, .55) 90%, transparent 90%); }
.footer-tagline { margin: 16px 0 0; max-width: 34ch; font-size: 14px; }
.footer-title {
    font: 800 20px/1.2 var(--grotesk);
    color: var(--white);
    margin-bottom: 14px;
}
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a { font: 700 14px var(--grotesk); color: rgba(255, 255, 255, .72); }
.footer-links a:hover { color: var(--yellow); }
.footer-bottom { padding-top: 22px; font-size: 13px; color: rgba(255, 255, 255, .5); }

/* ═══════════════════════════════════════════════════════════════
   10. Reszponzív
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .main-nav .nav-link:nth-child(n+5) { display: none; }
}

@media (max-width: 900px) {
    .main-nav { display: none; }
    .header-tools { margin-left: auto; }
    .cover-grid { grid-template-columns: 1fr; }
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3 > :nth-child(3):last-child { display: none; } /* 3 elemes sorban ne lógjon egy */
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .feature__img { aspect-ratio: 16 / 9; }
}

@media (max-width: 640px) {
    :root { --header: 62px; }
    .brand__mark { width: 36px; height: 36px; }
    .brand__name { font-size: 22px; }
    .grid--3,
    .cover-grid__side { grid-template-columns: 1fr; }
    .grid--3 > :nth-child(3):last-child { display: flex; }
    .card__title { font-size: 19px; }
    .feature__title { margin-bottom: -.9em; padding: 0 8px; }
    .entry-content { font-size: 17px; }
    .article__lead { font-size: 17px; }
    .footer-grid { grid-template-columns: 1fr; }
    .search-form button { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
