/*
Theme Name: TOP7
Description: תבנית המגזין TOP7 בעברית.
Version: 1.1.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: top7
*/

@font-face {
  font-family: Assistant;
  src: url("assets/Assistant-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --paper: #f8f6ef;
  --ink: #181819;
  --dark: #171718;
  --muted: #655f55;
  --line: #d8d2c6;
  --gold: #ffbd5d;
  --white: #fffcf8;
  --surface: #fdfbf7;
  --radius-large: 26px;
  --radius-card: 18px;
  --radius-small: 11px;
  --masthead-height: 69px;
  --font-body: Assistant, "Segoe UI", Arial, sans-serif;
  --weight-title: 450;
  --weight-heading: 500;
  --weight-emphasis: 600;
  /* Geometry taken from the 7 in the TOP7 wordmark. */
  --seven: polygon(19% 0, 100% 0, 35% 100%, 0 100%, 53% 20%, 5% 20%);
  --seven-outline: polygon(evenodd, 19% 0, 100% 0, 35% 100%, 0 100%, 53% 20%, 5% 20%, 19% 0,
    21% 2%, 9% 18%, 57% 18%, 4% 98%, 33% 98%, 96% 2%, 21% 2%);
  --tag-cut: polygon(var(--tag-cut-size, 7px) 0, 100% 0, 100% 100%, 0 100%);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--masthead-height) + 14px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.48 var(--font-body); }
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, figure, ul { margin: 0; }
h1, h2, h3 { font-weight: var(--weight-heading); }
strong { font-weight: var(--weight-emphasis); }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid #985000; outline-offset: 4px; }
.masthead :focus-visible, .footer :focus-visible, .feature :focus-visible { outline-color: var(--gold); outline-offset: -4px; }
.skip { position: fixed; z-index: 10; inset: 6px 8px auto auto; padding: 9px 14px; background: var(--gold); transform: translateY(-150%); }
.skip:focus { transform: none; }
.wrap { width: min(1216px, calc(100% - 88px)); margin-inline: auto; }
.masthead { position: sticky; top: 0; z-index: 5; background: var(--dark); color: var(--white); border-bottom: 1px solid #383433; }
.masthead-inner { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); min-height: var(--masthead-height); gap: 16px; }
.brand { display: inline-flex; align-items: center; justify-self: start; }
.brand img { width: 111px; height: 54px; object-fit: contain; object-position: right center; }
.primary { display: flex; align-items: stretch; gap: clamp(18px,2.6vw,34px); }
.primary a { display: grid; place-items: center; position: relative; color: #e5e1db; font-size: 1.06rem; font-weight: var(--weight-emphasis); white-space: nowrap; }
.primary a[aria-current], .primary a:hover { color: var(--gold); }
.primary a[aria-current]::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--gold); border-radius: 3px 3px 0 0; }
.tools { display: flex; align-items: center; gap: 10px; justify-self: end; }
.masthead-date { display: grid; gap: 3px; padding-inline-end: 9px; text-align: start; white-space: nowrap; line-height: 1.18; }
.masthead-date time { display: block; color: #e3ddd3; font-size: .77rem; }
.masthead-date time:first-child { color: var(--gold); font-size: .86rem; font-weight: var(--weight-emphasis); }
.icon-button { display: inline-grid; place-items: center; width: 43px; height: 43px; padding: 0; border: 1px solid #535050; border-radius: 50%; background: transparent; color: inherit; }
.icon-button:hover { border-color: var(--gold); color: var(--gold); }
.icon { width: 20px; height: 20px; display: inline-block; }
.menu-toggle { display: none; }
.progress { position: absolute; inset: auto 0 0; height: 3px; background: var(--gold); transform: scaleX(0); transform-origin: right; pointer-events: none; }
main.page { min-height: 65vh; padding-block: clamp(20px,2.6vw,34px) 64px; }
main.page:focus { outline: none; }
.category-head h1 { font-size: clamp(2.55rem,5vw,4.4rem); font-weight: var(--weight-title); line-height: 1.06; }
.mark { display: inline-block; width: .29em; height: .41em; margin-inline-start: .15em; background: var(--gold); clip-path: var(--seven); vertical-align: .07em; }
.hero { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: clamp(11px,1.5vw,19px); }
.hero-side { display: grid; grid-auto-rows: 1fr; gap: clamp(11px,1.5vw,19px); min-width: 0; }
.feature { display: grid; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.feature a { display: grid; grid-template-columns: minmax(0,1.54fr) minmax(0,1fr); min-width: 0; border-radius: inherit; }
.feature-main { border: 0; border-radius: var(--radius-large); background: #231d25; color: var(--white); }
.feature-main a { grid-template-columns: minmax(0,1fr) minmax(0,1.13fr); min-height: clamp(325px,31vw,415px); }
.feature-media { position: relative; grid-column: 2; grid-row: 1; min-height: 130px; overflow: hidden; background: #33283c; }
.feature-main .feature-media { isolation: isolate; }
.feature-main .feature-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg,#231d2555,transparent 35%), linear-gradient(0deg,#231d253d,transparent 45%); pointer-events: none; }
.feature img { position: absolute; inset: 0; transition: transform .4s ease; }
.feature a:hover img { transform: scale(1.045); }
.cover-signature {
  position: absolute;
  inset-block-start: clamp(12px,1.7vw,24px);
  inset-inline-end: clamp(12px,1.8vw,26px);
  z-index: 1;
  height: clamp(114px,15vw,204px);
  aspect-ratio: 214 / 302;
  background: var(--gold);
  clip-path: var(--seven-outline);
  opacity: .84;
  pointer-events: none;
}
.feature-copy { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding: clamp(10px,1.5vw,19px); }
.feature-main .feature-copy { padding: clamp(18px,2.5vw,33px); }
.tag { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 9px 2px 15px; clip-path: var(--tag-cut); background: var(--tag); color: var(--tag-ink); font-size: .88rem; font-weight: var(--weight-emphasis); }
[data-category="entertainment"] { --tag: #ffbd5d; --tag-ink: #302007; }
[data-category="gaming"] { --tag: #decaff; --tag-ink: #34224c; }
[data-category="politics"] { --tag: #c9e6dc; --tag-ink: #15372f; }
.feature h2 { font-size: clamp(1.15rem,1.78vw,1.65rem); line-height: 1.17; margin-top: 8px; text-wrap: pretty; overflow-wrap: anywhere; }
.feature-main h2 { font-size: clamp(1.95rem,3.25vw,3.22rem); font-weight: var(--weight-title); line-height: 1.11; margin-top: 11px; }
.feature-copy p { max-width: 37ch; margin-top: 12px; color: #e2d9df; font-size: clamp(.98rem,1.3vw,1.1rem); line-height: 1.55; text-wrap: pretty; }
.feature-time { display: block; margin-top: 8px; color: var(--muted); font-size: .8rem; }
.feature-main .feature-time { margin-top: 12px; color: #d6cbd4; }
.digest { display: grid; grid-template-columns: minmax(0,1fr) minmax(225px,24%); gap: clamp(20px,2.6vw,32px); margin-top: clamp(24px,3.3vw,39px); align-items: start; }
.section-head, .category-grid { position: relative; }
:is(.section-head, .category-grid)::before {
  content: "";
  position: absolute;
  inset-block-start: -2px;
  inset-inline-start: 0;
  width: clamp(45px, 6.5vw, 90px);
  height: 3px;
  background: var(--gold);
  border-radius: 4px;
  pointer-events: none;
}
.section-head { border-top: 1px solid var(--line); padding: 11px 0 15px; }
.section-head h2 { font-size: clamp(1.55rem,2.3vw,2.1rem); line-height: 1.12; }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px 17px; }
.tile { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); min-width: 0; }
.tile a { display: flex; flex-direction: column; height: 100%; border-radius: inherit; }
.tile a:focus-visible { outline-offset: -3px; }
.tile-image { overflow: hidden; aspect-ratio: 16/10; background: #26232e; }
.tile img { transition: transform .3s ease; }
.tile-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 11px clamp(10px,1.2vw,15px) 12px; }
.tile a:hover img { transform: scale(1.045); }
.tile a:hover .tile-title, .pick a:hover h3 { text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .13em; }
.tile-title { margin-top: 7px; font-size: clamp(1.22rem,1.8vw,1.53rem); line-height: 1.17; }
.tile p { margin-top: 7px; font-size: .97rem; color: var(--muted); }
.tile .meta { margin-top: auto; padding-top: 8px; }
.meta { display: block; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.picks { background: #f0ece3; border: 1px solid var(--line); border-radius: var(--radius-card); padding: 13px 16px 2px; }
.picks h2 { font-size: 1.5rem; }
.picks h2::before { content: ""; display: inline-block; width: .49em; height: .69em; margin-inline-end: 8px; vertical-align: -.04em; background: var(--gold); clip-path: var(--seven); }
.pick + .pick { border-top: 1px solid #d5cfc2; }
.pick a { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding-block: 12px; }
.pick h3 { font-size: 1.04rem; line-height: 1.18; }
.pick .tag { --tag-cut-size: 5px; margin-bottom: 4px; min-height: 20px; font-size: .76rem; padding-inline: 6px 10px; }
.pick img { border-radius: var(--radius-small); width: 61px; height: 52px; flex: none; }
.browse { margin-top: 37px; border-block: 1px solid var(--line); padding-block: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.browse strong { margin-inline-end: 10px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 50px; background: transparent; color: var(--ink); font-weight: var(--weight-emphasis); }
.pill:hover { background: var(--gold); border-color: var(--gold); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .91rem; color: var(--muted); margin-bottom: 19px; }
.crumbs a:hover { text-decoration: underline; }
.category-head { padding: 13px 0 22px; }
.category-head p { margin-top: 13px; color: var(--muted); font-size: 1.08rem; }
.category-grid { border-top: 1px solid var(--line); padding-top: 17px; }
.article-page { max-width: 1040px; margin-inline: auto; }
.story-head { margin-bottom: 18px; }
.story-head h1 { max-width: 920px; font-size: clamp(2rem,4.45vw,4.1rem); font-weight: var(--weight-title); line-height: 1.12; margin-top: 9px; text-wrap: pretty; overflow-wrap: anywhere; }
.deck { max-width: min(69ch, 850px); margin-top: 12px; font-size: clamp(1.14rem,1.85vw,1.4rem); line-height: 1.55; color: #514b46; text-wrap: pretty; }
.byline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 10px; }
.byline img { width: 34px; height: 34px; border-radius: 50%; }
.byline .meta { margin: 0; }
.byline button { margin-inline-start: auto; }
.byline .icon { width: 16px; height: 16px; margin-inline-end: 6px; }
.story-photo img { aspect-ratio: 2.45; height: auto; border-radius: var(--radius-large); background: #26232e; }
.story-photo--portrait { width: min(100%, 360px); margin-inline: auto; }
.story-photo--portrait img { aspect-ratio: 2 / 3; }
.story-photo figcaption { margin-top: 6px; font-size: .84rem; color: var(--muted); }
.story-photo figcaption a { text-decoration: underline; text-underline-offset: .14em; }
.story-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(212px,25%); gap: clamp(24px,4.1vw,52px); margin-top: 24px; align-items: start; }
.story-text p { font-size: clamp(1.07rem,1.5vw,1.18rem); line-height: 1.72; margin-bottom: 16px; }
.story-text h2 { margin: 25px 0 7px; font-size: 1.83rem; line-height: 1.15; }
.story-text a { color: #71430d; text-decoration: underline; text-underline-offset: .14em; }
.story-text a:hover { color: var(--ink); }
.story-text table { width: 100%; border-collapse: collapse; margin-block: 12px 18px; font-size: 1rem; }
.story-text th, .story-text td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: start; }
.story-text thead, .story-text tr:last-child { background: #eeeadf; }
.story-text th:last-child, .story-text td:last-child { width: 25%; }
.story-layout .picks { position: sticky; top: calc(var(--masthead-height) + 16px); }
.related { margin-top: 31px; }
.footer { background: var(--dark); color: var(--white); border-top: 3px solid var(--gold); }
.footer .wrap { padding-block: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer .brand img { width: 91px; height: 44px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer nav a:hover { color: var(--gold); }
.footer small { color: #d8d3ca; font-size: .83rem; }
dialog { width: min(560px,calc(100% - 24px)); max-height: min(620px,calc(100% - 24px)); border: 1px solid var(--line); border-radius: var(--radius-large); padding: 22px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #171518ad; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 11px; }
.dialog-head h2 { font-size: 1.75rem; }
.dialog-head button { border-color: var(--line); }
.dialog-head button:hover { color: var(--ink); }
.search-input { width: 100%; min-height: 47px; padding: 8px 11px; margin-block: 13px; border: 1px solid #a49a8a; border-radius: var(--radius-small); background: var(--white); }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.toast { position: fixed; z-index: 7; inset: auto auto 18px 18px; max-width: calc(100% - 36px); padding: 11px 15px; background: var(--dark); color: var(--white); border-radius: var(--radius-small); }
.toast:empty { display: none; }
@media (max-width: 1020px) {
  .wrap { width: calc(100% - 54px); }
}
@media (max-width: 870px) {
  .hero { grid-template-columns: minmax(0,1fr); }
  .hero-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .digest, .story-layout { grid-template-columns: minmax(0,1fr); }
  .story-layout .picks { position: static; }
  .picks { max-width: 420px; }
}
@media (max-width: 700px) {
  :root { --masthead-height: 60px; }
  .masthead-inner { grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; }
  .masthead .brand img { width: 78px; height: 43px; }
  .tools { gap: 6px; }
  .masthead-date { padding-inline-end: 3px; }
  .icon-button { width: 40px; height: 40px; }
  .menu-toggle { display: inline-grid; }
  .js .primary { display: none; position: absolute; inset: 100% 0 auto; background: var(--dark); padding: 4px 15px 10px; border-bottom: 2px solid var(--gold); }
  .js .primary.open { display: grid; gap: 0; }
  .primary a { min-height: 44px; justify-content: start; }
  .primary a[aria-current]::after { width: 4px; height: 19px; inset: auto auto auto 0; border-radius: 4px; }
}
@media (max-width: 620px) {
  :root { --radius-large: 20px; --radius-card: 15px; --radius-small: 9px; }
  .wrap { width: calc(100% - 30px); }
  main.page { padding-block: 15px 43px; }
  .category-head h1 { font-size: clamp(2.25rem,9vw,3.45rem); }
  .hero, .hero-side { gap: 10px; }
  .feature a, .feature-main a { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr; min-height: 0; }
  .feature-media { grid-column: 1; grid-row: 1; min-height: 0; aspect-ratio: 1.9; }
  .feature-main .feature-media { aspect-ratio: 1.8; }
  .feature-copy { grid-row: 2; justify-content: flex-start; padding: 10px 10px 12px; }
  .cover-signature { inset-block-start: 12px; inset-inline-end: 14px; height: clamp(87px,28vw,146px); }
  .feature-main .feature-copy { padding: 15px 16px 17px; }
  .feature-main h2 { font-size: clamp(1.8rem,7.2vw,2.65rem); margin-top: 7px; }
  .feature-copy p { margin-top: 8px; }
  .feature-main .feature-time { margin-top: 9px; }
  .hero-side .feature h2 { font-size: clamp(1.02rem,4vw,1.35rem); margin-top: 5px; line-height: 1.16; }
  .hero-side .tag { --tag-cut-size: 5px; min-height: 20px; padding-inline: 6px 10px; font-size: .74rem; }
  .hero-side .feature-time { margin-top: 6px; font-size: .73rem; }
  .digest { margin-top: 26px; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 10px; }
  .tile-title { font-size: 1.16rem; }
  .tile p { font-size: .9rem; }
  .browse { margin-top: 25px; }
  .browse strong { width: 100%; }
  .story-head h1 { font-size: clamp(1.95rem,7.8vw,2.75rem); }
  .story-photo:not(.story-photo--portrait) img { aspect-ratio: 1.75; }
  .story-layout { margin-top: 20px; }
  .story-text p { font-size: 1.1rem; line-height: 1.64; }
  .story-text h2 { font-size: 1.55rem; }
  .footer .wrap { gap: 12px 20px; }
  .footer small { width: 100%; }
  dialog { padding: 15px; }
}
@media (max-width: 370px) {
  .masthead .brand img { width: 65px; }
  .masthead-date time { font-size: .73rem; }
  .masthead-date time:first-child { font-size: .79rem; }
  .tools .icon-button { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

[hidden] { display: none !important; }
body.top7 { direction: rtl; }
.top7 .aligncenter { margin-inline: auto; }
.admin-bar .masthead { inset-block-start: 32px; }
.primary ul, .footer nav ul { display: flex; gap: inherit; }
.primary li { display: flex; }
.primary .current-menu-item > a, .primary .current-menu-ancestor > a { color: var(--gold); }

.hero--single { grid-template-columns: minmax(0,1fr); }
.feature--text a { grid-template-columns: minmax(0,1fr); grid-template-rows: 1fr; min-height: 125px; }
.feature-main.feature--text a { min-height: clamp(210px,26vw,325px); }
.feature--text .feature-copy { grid-row: 1; }
.feature-media img, .tile-image img, .story-photo img { width: 100%; object-fit: cover; }
.feature-media img, .tile-image img { height: 100%; }
.pick img { object-fit: cover; }
.tag[data-category="general"] { --tag: #eae2d5; --tag-ink: #3d352b; }

.category-description { color: var(--muted); padding-top: 10px; }
.empty-state { color: var(--muted); margin-block: 15px; font-size: 1.12rem; }
.site-search-form { display: flex; align-items: center; gap: 8px; max-width: 36rem; }
.site-search-form .search-input { flex: 1; min-width: 0; }
.site-search-form button { flex-shrink: 0; }
.menu-toggle span { display: grid; place-items: center; }
.menu-toggle[aria-expanded="false"] .menu-close-icon,
.menu-toggle[aria-expanded="true"] .menu-open-icon { display: none; }

.story-layout--single { grid-template-columns: minmax(0, 740px); }
.story-sidebar { display: grid; gap: 18px; min-width: 0; }
.story-layout .story-sidebar .picks { position: static; }
.ad-slot { min-width: 0; max-width: 100%; }
.ad-slot-widget { min-width: 0; }
.ad-slot-widget + .ad-slot-widget { margin-block-start: 16px; }
.ad-slot-title { color: var(--muted); font-size: .85rem; margin-block-end: 4px; }
.top7-ad-home, .top7-ad-after-article { margin-block-start: clamp(20px, 3.2vw, 38px); }
.top7-ad-home, .top7-ad-article-rail { min-block-size: 90px; }
.story-text { min-width: 0; overflow-wrap: anywhere; }
.story-text :is(.wp-block-table, pre) { max-width: 100%; overflow-x: auto; }
.story-text :is(ol, ul, blockquote, .wp-block-image, .wp-block-embed) { margin-block: 14px; }
.story-text :is(ol, ul) { padding-inline-start: 1.5em; }
.story-text ul { list-style: disc; }
.story-text .wp-block-image figcaption { color: var(--muted); font-size: .9rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 18px; }
.nav-links .page-numbers { display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; padding-inline: 8px; border: 1px solid var(--line); border-radius: var(--radius-small); }
.nav-links .current { background: var(--gold); }

@media (max-width: 782px) { .admin-bar .masthead { inset-block-start: 46px; } }
@media (max-width: 800px) {
  .story-sidebar { justify-items: start; }
  .story-sidebar .ad-slot { justify-self: stretch; }
}
@media (max-width: 700px) {
  .primary { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
  .primary:not(.open) a { justify-content: center; }
  .primary ul { display: contents; }
  .js .primary.open { grid-template-columns: minmax(0,1fr); }
  .primary a[aria-current]::after { inset-inline-end: 0; }
  .tools { grid-column: 2; grid-row: 1; }
}
@media (max-width: 600px) { .admin-bar .masthead { inset-block-start: 0; } }
