/*
Theme Name: Present Magazine
Theme URI: https://present.ba/
Author: Codex
Description: A compact magazine WordPress theme for Present.ba, with a Valenti-inspired editorial layout, Present branding, category navigation, featured stories, cards, sidebar widgets, and a dark footer.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: present-magazine
*/

:root {
  --pm-bg: #f2f3f4;
  --pm-surface: #ffffff;
  --pm-ink: #181818;
  --pm-muted: #73787d;
  --pm-soft: #e6e9eb;
  --pm-line: #d9dee2;
  --pm-black: #111111;
  --pm-teal: #16869a;
  --pm-teal-dark: #0e6474;
  --pm-gold: #d6ad62;
  --pm-footer: #191919;
  --pm-footer-soft: #242424;
  --pm-max: 1080px;
  --pm-radius: 3px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--pm-bg);
  color: var(--pm-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, opacity 160ms ease;
}

a:hover,
a:focus {
  color: var(--pm-teal);
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.screen-reader-text,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: var(--pm-black);
  color: #fff;
}

.site {
  min-height: 100vh;
}

.site-header {
  background: var(--pm-surface);
}

.header-inner,
.nav-inner,
.content-shell,
.footer-inner {
  width: min(calc(100% - 32px), var(--pm-max));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 0 22px;
}

.site-branding {
  flex: 0 0 auto;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.custom-logo,
.present-default-logo {
  width: 150px;
  max-height: 92px;
  object-fit: contain;
}

.leaderboard {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  width: min(100%, 520px);
  border: 1px solid var(--pm-soft);
  background: #eeeeee;
  color: #a0a5a9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-nav {
  background: var(--pm-black);
  color: #fff;
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

.primary-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu li {
  margin: 0;
}

.primary-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 17px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a,
.primary-menu .current-menu-ancestor > a {
  background: var(--pm-teal);
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: auto;
}

.menu-toggle,
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.menu-toggle {
  display: none;
}

.menu-toggle svg,
.search-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.search-panel {
  display: none;
  background: #202020;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.search-panel.is-open {
  display: block;
}

.search-panel .search-form {
  width: min(calc(100% - 32px), var(--pm-max));
  margin: 0 auto;
  padding: 14px 0;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-field {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--pm-line);
  background: #fff;
  color: var(--pm-ink);
  padding: 0 12px;
  border-radius: var(--pm-radius);
}

.search-submit,
.button-link,
.comment-form .submit,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: var(--pm-radius);
  background: var(--pm-teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 0 16px;
  text-transform: uppercase;
  cursor: pointer;
}

.search-submit:hover,
.search-submit:focus,
.button-link:hover,
.button-link:focus,
.comment-form .submit:hover,
.comment-form .submit:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
  background: var(--pm-teal-dark);
  color: #fff;
}

.hero {
  width: min(calc(100% - 32px), var(--pm-max));
  margin: 18px auto 0;
  background: #d9dde0;
}

.hero-card {
  position: relative;
  display: grid;
  min-height: clamp(300px, 43vw, 500px);
  overflow: hidden;
  border-top: 3px solid var(--pm-teal);
}

.hero-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.66)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0.04) 48%, rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.hero-card .post-thumbnail,
.hero-card .post-thumbnail img,
.hero-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-card .post-thumbnail img {
  object-fit: cover;
  filter: grayscale(100%);
}

.hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d9dee0, #f2f2f2);
  color: rgba(0, 0, 0, 0.14);
  font-size: clamp(46px, 10vw, 120px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.hero-content {
  position: relative;
  z-index: 2;
  align-self: end;
  width: min(88%, 780px);
  margin: 0 auto;
  padding: 0 0 36px;
  color: #fff;
  text-align: center;
}

.hero-label,
.category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  background: var(--pm-teal);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1;
  padding: 0 8px;
  text-transform: uppercase;
}

.hero-title {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.96;
  text-transform: uppercase;
}

.hero-title a {
  color: #fff;
}

.hero-meta,
.entry-meta,
.card-meta,
.list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--pm-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-meta {
  justify-content: center;
  color: rgba(255, 255, 255, 0.88);
}

.hero-meta a,
.entry-meta a,
.card-meta a,
.list-meta a {
  color: inherit;
}

.content-shell {
  padding: 24px 0 44px;
}

.breadcrumb-row {
  margin: 0 0 18px;
  color: #a1a6aa;
  font-size: 11px;
  text-transform: uppercase;
}

.page-title,
.archive-title,
.section-title,
.widget-title,
.footer-title {
  margin: 0;
  color: var(--pm-ink);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.archive-header {
  margin: 0 0 22px;
  padding: 20px 0 18px;
  border-top: 3px solid var(--pm-teal);
  border-bottom: 1px solid var(--pm-line);
  text-align: center;
}

.archive-description {
  max-width: 720px;
  margin: 8px auto 0;
  color: var(--pm-muted);
  font-size: 14px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.post-card {
  min-width: 0;
  background: var(--pm-surface);
  border: 1px solid var(--pm-soft);
}

.post-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dfe3e5;
}

.post-card__media img,
.post-list__media img,
.related-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.post-card:hover .post-card__media img,
.post-list:hover .post-list__media img,
.related-card:hover img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 170px;
  background: linear-gradient(135deg, #e8ebed, #f8f8f8);
  color: rgba(0, 0, 0, 0.2);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-card__body {
  padding: 14px 14px 16px;
}

.post-card__title,
.post-list__title,
.related-card__title {
  margin: 8px 0 8px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.08;
}

.post-card__title {
  text-transform: uppercase;
}

.post-card__excerpt,
.post-list__excerpt {
  margin: 0;
  color: #70757a;
  font-size: 13px;
  line-height: 1.55;
}

.post-list {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--pm-soft);
}

.post-list__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dfe3e5;
}

.post-list__title {
  font-size: 22px;
}

.site-sidebar {
  min-width: 0;
}

.widget,
.sidebar-section {
  margin: 0 0 24px;
  background: var(--pm-surface);
  border: 1px solid var(--pm-soft);
}

.widget-title,
.sidebar-title {
  position: relative;
  display: block;
  margin: 0;
  padding: 13px 14px 12px;
  background: #f4f5f6;
  color: #50555a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.widget-title::after,
.sidebar-title::after,
.footer-title::after {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 2px;
  transform: translateX(-50%);
  background: var(--pm-teal);
  content: "";
}

.widget > *:not(.widget-title),
.sidebar-section__body {
  padding: 15px;
}

.widget ul,
.sidebar-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget li,
.sidebar-section li {
  padding: 9px 0;
  border-bottom: 1px solid var(--pm-soft);
}

.widget li:last-child,
.sidebar-section li:last-child {
  border-bottom: 0;
}

.category-list a,
.tagcloud a {
  display: inline-flex;
  margin: 0 5px 7px 0;
  border: 1px solid var(--pm-line);
  background: #fafafa;
  color: #777d82;
  font-size: 11px !important;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
}

.category-list li {
  display: inline;
  padding: 0;
  border: 0;
}

.category-list a:hover,
.category-list a:focus,
.tagcloud a:hover,
.tagcloud a:focus {
  border-color: var(--pm-teal);
  background: var(--pm-teal);
  color: #fff;
}

.mini-post {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.mini-post__thumb {
  aspect-ratio: 1 / 0.72;
  overflow: hidden;
  background: #dfe3e5;
}

.mini-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-post__title {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.mini-post__date {
  color: #94999d;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
}

.pagination .page-numbers,
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--pm-line);
  background: #fff;
  color: #7b8085;
  font-size: 12px;
  font-weight: 800;
}

.pagination .current,
.pagination .page-numbers:hover,
.pagination .page-numbers:focus,
.nav-links .current,
.nav-links .page-numbers:hover,
.nav-links .page-numbers:focus {
  border-color: var(--pm-teal);
  background: var(--pm-teal);
  color: #fff;
}

.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.single-article,
.page-article {
  background: #fff;
  border: 1px solid var(--pm-soft);
}

.single-header,
.page-header {
  padding: 28px 30px 18px;
  border-top: 3px solid var(--pm-teal);
  text-align: center;
}

.single-title,
.page-article .page-title {
  margin: 10px auto 12px;
  max-width: 820px;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.02;
  text-transform: uppercase;
}

.single-featured {
  overflow: hidden;
  background: #dfe3e5;
}

.single-featured img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

.entry-content,
.entry-footer,
.comments-area {
  padding: 28px 30px;
}

.entry-content {
  color: #2f3336;
  font-size: 16px;
  line-height: 1.78;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--pm-ink);
  line-height: 1.2;
}

.entry-content a {
  color: var(--pm-teal-dark);
  font-weight: 700;
}

.entry-content blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--pm-teal);
  color: #555b60;
  font-size: 20px;
  font-weight: 700;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--pm-line);
  padding: 10px;
}

.entry-footer {
  border-top: 1px solid var(--pm-soft);
}

.tag-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-links a {
  display: inline-flex;
  border: 1px solid var(--pm-line);
  color: var(--pm-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
}

.related-posts {
  margin-top: 28px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.related-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--pm-soft);
}

.related-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dfe3e5;
}

.related-card__body {
  padding: 12px;
}

.related-card__title {
  font-size: 15px;
  text-transform: uppercase;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.wpcf7 input,
.wpcf7 textarea {
  width: 100%;
  border: 1px solid var(--pm-line);
  padding: 10px 12px;
}

.site-footer {
  background: var(--pm-footer);
  color: #d4d7d9;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer li:last-child {
  border-bottom: 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 34px;
  padding: 38px 0;
}

.footer-logo img {
  width: 160px;
  margin-bottom: 12px;
}

.footer-about {
  margin: 0;
  color: #a5aaae;
  font-size: 13px;
}

.footer-title {
  position: relative;
  margin-bottom: 18px;
  padding-bottom: 10px;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.footer-title::after {
  background: var(--pm-gold);
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-menu a {
  color: #b7bbbf;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-info {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #141414;
  color: #7f8589;
  font-size: 11px;
}

.site-info .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
}

.empty-state {
  padding: 36px;
  background: #fff;
  border: 1px solid var(--pm-soft);
  text-align: center;
}

.empty-state p {
  margin: 8px auto 0;
  max-width: 520px;
  color: var(--pm-muted);
}

.alignwide {
  margin-left: max(-30px, calc((100% - var(--pm-max)) / 2));
  margin-right: max(-30px, calc((100% - var(--pm-max)) / 2));
}

.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard {
    width: 100%;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-inner {
    align-items: center;
  }

  .primary-menu {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    background: var(--pm-black);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .primary-menu.is-open {
    display: flex;
  }

  .primary-menu a {
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .two-column,
  .single-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-menu,
  .site-info .footer-inner {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .header-inner,
  .nav-inner,
  .content-shell,
  .footer-inner,
  .hero {
    width: min(calc(100% - 22px), var(--pm-max));
  }

  .header-inner {
    padding-top: 18px;
  }

  .custom-logo,
  .present-default-logo {
    width: 132px;
  }

  .leaderboard {
    min-height: 54px;
  }

  .hero-card {
    min-height: 330px;
  }

  .hero-content {
    width: calc(100% - 28px);
    padding-bottom: 26px;
  }

  .post-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-list {
    grid-template-columns: 1fr;
  }

  .single-header,
  .page-header,
  .entry-content,
  .entry-footer,
  .comments-area {
    padding-left: 18px;
    padding-right: 18px;
  }

  .search-form {
    flex-direction: column;
  }

  .search-submit {
    width: 100%;
  }
}
