/*
Theme Name: Present Magazine
Theme URI: https://example.com/present-magazine
Author: Codex
Author URI: https://example.com
Description: A clean editorial WordPress theme for the PRESENT site, with Montserrat typography and magazine-style homepage sections.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: present-magazine
Tags: blog, news, grid-layout, custom-menu, featured-images, threaded-comments
*/

:root {
  --hm-text: #0e1114;
  --hm-muted: #6b7178;
  --hm-faint: #eef0f2;
  --hm-line: #dfe3e7;
  --hm-accent: #066fca;
  --hm-accent-dark: #054b8d;
  --hm-paper: #ffffff;
  --hm-page: #f4f5f6;
  --hm-card: #f8f9fa;
  --hm-radius: 2px;
  --hm-font: "Montserrat", Arial, Helvetica, sans-serif;
  --hm-serif: "Montserrat", Arial, Helvetica, sans-serif;
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--hm-page);
  color: var(--hm-text);
  font-family: var(--hm-font);
  font-weight: 500;
  line-height: 1.55;
}

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

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

a:hover,
a:focus {
  color: var(--hm-accent);
}

button,
input,
textarea {
  font: inherit;
}

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

.hm-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 72px auto;
  background: var(--hm-paper);
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.22);
}

.hm-header {
  border-bottom: 1px solid var(--hm-line);
}

.hm-header__bar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  min-height: 64px;
  padding: 8px 32px 6px;
  position: relative;
}

.hm-header__tools {
  display: none;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.hm-icon-button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #30363d;
  cursor: pointer;
}

.hm-icon-button:hover,
.hm-icon-button:focus {
  border-color: var(--hm-line);
  color: var(--hm-accent);
}

.hm-icon-button svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.hm-brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hm-text);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hm-brand a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hm-brand img,
.hm-default-logo {
  max-height: 54px;
  max-width: min(170px, 42vw);
  width: auto;
  object-fit: contain;
}

.hm-nav {
  border-top: 1px solid var(--hm-line);
}

.hm-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 34px;
  list-style: none;
  margin: 0;
  padding: 0 26px;
}

.hm-menu li {
  position: relative;
}

.hm-menu li + li::before {
  content: none;
}

.hm-menu a {
  display: block;
  padding: 15px 0;
  color: #20252b;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hm-menu a:hover,
.hm-menu a:focus,
.hm-menu .current-menu-item > a {
  color: var(--hm-accent);
}

.hm-search-panel {
  display: none;
  padding: 16px 32px 22px;
  border-top: 1px solid var(--hm-line);
}

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

.hm-search-panel form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.hm-search-panel input[type="search"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--hm-line);
  padding: 0 12px;
  color: var(--hm-text);
}

.hm-search-panel button {
  border: 0;
  min-height: 42px;
  padding: 0 18px;
  background: var(--hm-text);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.hm-main {
  padding: 24px 32px 44px;
}

.hm-topline {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 244px;
  gap: 22px;
  align-items: start;
}

.hm-side-stack {
  display: grid;
  gap: 38px;
}

.hm-mini-post {
  border-right: 1px solid var(--hm-line);
  padding-right: 16px;
}

.hm-mini-post__media,
.hm-latest__media,
.hm-card__media,
.hm-featured__media {
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--hm-card);
}

.hm-mini-post__media {
  aspect-ratio: 1.25 / 1;
  margin-bottom: 12px;
}

.hm-featured {
  text-align: center;
}

.hm-featured__media {
  aspect-ratio: 1.72 / 1;
  margin-bottom: 24px;
}

.hm-featured__title {
  width: min(680px, 100%);
  margin: 7px auto 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  font-weight: 900;
}

.hm-featured__excerpt {
  width: min(620px, 100%);
  margin: 0 auto 9px;
  color: var(--hm-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.hm-meta {
  color: var(--hm-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.hm-meta a {
  color: var(--hm-text);
  font-weight: 700;
}

.hm-category {
  display: inline-flex;
  color: var(--hm-accent);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.hm-title-small {
  margin: 6px 0 5px;
  font-size: 1rem;
  line-height: 1.13;
  font-weight: 900;
}

.hm-title-card {
  margin: 6px 0 6px;
  font-size: 1.18rem;
  line-height: 1.13;
  font-weight: 900;
}

.hm-latest {
  border-left: 1px solid var(--hm-line);
  padding-left: 18px;
}

.hm-block-title {
  margin: 0 0 18px;
  color: #161a1f;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hm-latest__list {
  display: grid;
  gap: 14px;
}

.hm-latest__item {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 12px;
  align-items: start;
}

.hm-latest__media {
  aspect-ratio: 1 / 0.78;
}

.hm-latest__title {
  margin: 0 0 2px;
  font-size: 0.95rem;
  line-height: 1.09;
  font-weight: 900;
}

.hm-section {
  margin-top: 50px;
}

.hm-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--hm-line);
  margin-bottom: 20px;
}

.hm-section__title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hm-section__link {
  color: var(--hm-accent);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.hm-card__media {
  aspect-ratio: 1.33 / 1;
  margin-bottom: 12px;
}

.hm-card__excerpt {
  margin: 8px 0 0;
  color: var(--hm-muted);
  font-size: 0.88rem;
  line-height: 1.42;
}

.hm-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

a:hover .hm-post-image,
a:focus .hm-post-image,
.hm-card:hover .hm-post-image,
.hm-featured:hover .hm-post-image,
.hm-mini-post:hover .hm-post-image {
  transform: scale(1.035);
}

.hm-fallback {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.38), transparent 38%),
    linear-gradient(145deg, #c8d9e8, #7f9fb6);
}

.hm-fallback::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.52);
}

.hm-fallback--2 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 46%),
    linear-gradient(135deg, #d9c4aa, #767f69);
}

.hm-fallback--3 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 42%),
    linear-gradient(135deg, #c3d4d9, #39697c);
}

.hm-fallback--4 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 44%),
    linear-gradient(135deg, #d8c2c2, #735a69);
}

.hm-fallback--5 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 45%),
    linear-gradient(135deg, #b9d7cb, #4a7d73);
}

.hm-fallback--6 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 45%),
    linear-gradient(135deg, #d4d0bd, #8b6f4f);
}

.hm-page-title {
  width: min(760px, 100%);
  margin: 0 auto 34px;
  text-align: center;
}

.hm-page-title h1 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.02;
  font-weight: 900;
}

.hm-page-title p {
  margin: 0;
  color: var(--hm-muted);
}

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

.hm-pagination {
  margin-top: 38px;
  text-align: center;
}

.hm-pagination .nav-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hm-pagination a,
.hm-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--hm-line);
  padding: 0 10px;
  color: var(--hm-text);
  font-weight: 800;
}

.hm-pagination .current {
  background: var(--hm-text);
  color: #ffffff;
  border-color: var(--hm-text);
}

.hm-single {
  width: min(780px, 100%);
  margin: 0 auto;
}

.hm-single__header {
  margin-bottom: 24px;
  text-align: center;
}

.hm-single__title {
  margin: 8px 0 12px;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 0.98;
  font-weight: 900;
}

.hm-single__media {
  aspect-ratio: 1.65 / 1;
  margin: 0 0 26px;
  overflow: hidden;
  background: var(--hm-card);
}

.hm-content {
  color: #242a31;
  font-family: var(--hm-serif);
  font-size: 1rem;
  line-height: 1.75;
}

.hm-content > * {
  margin-top: 0;
  margin-bottom: 1.25em;
}

.hm-content h2,
.hm-content h3,
.hm-content h4 {
  font-family: var(--hm-font);
  line-height: 1.15;
}

.hm-content a {
  color: var(--hm-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.hm-content blockquote {
  margin-left: 0;
  padding-left: 20px;
  border-left: 3px solid var(--hm-accent);
  color: #333941;
  font-size: 1.18rem;
  line-height: 1.55;
}

.hm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--hm-line);
}

.hm-tags a {
  border: 1px solid var(--hm-line);
  padding: 6px 10px;
  color: var(--hm-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hm-comments {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--hm-line);
}

.hm-comments__title {
  margin: 0 0 18px;
  font-size: 1.4rem;
}

.hm-comment-list {
  margin: 0 0 28px;
  padding-left: 22px;
}

.hm-comment-list .comment {
  margin-bottom: 18px;
}

.hm-comment-list .comment-body {
  border: 1px solid var(--hm-line);
  padding: 16px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--hm-line);
  padding: 10px 12px;
}

.comment-form input[type="submit"] {
  width: auto;
  border: 0;
  background: var(--hm-text);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.hm-footer {
  border-top: 1px solid var(--hm-line);
  padding: 26px 32px;
  color: var(--hm-muted);
  font-size: 0.82rem;
  text-align: center;
}

.hm-footer a {
  color: var(--hm-text);
  font-weight: 800;
}

.hm-empty {
  width: min(620px, 100%);
  margin: 20px auto;
  padding: 28px;
  border: 1px solid var(--hm-line);
  background: #fafafa;
  text-align: center;
}

.hm-empty h2 {
  margin: 0 0 8px;
}

.hm-empty p {
  margin: 0;
  color: var(--hm-muted);
}

@media (max-width: 980px) {
  .hm-shell {
    width: min(100% - 22px, 860px);
    margin: 28px auto;
  }

  .hm-header__bar,
  .hm-main,
  .hm-footer {
    padding-left: 22px;
    padding-right: 22px;
  }

  .hm-topline {
    grid-template-columns: 1fr;
  }

  .hm-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .hm-mini-post,
  .hm-latest {
    border: 0;
    padding: 0;
  }

  .hm-latest__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hm-grid,
  .hm-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .hm-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    box-shadow: none;
  }

  .hm-header__bar {
    min-height: 62px;
  }

  .hm-header__tools {
    display: inline-flex;
  }

  .hm-brand {
    font-size: 2rem;
  }

  .hm-brand img,
  .hm-default-logo {
    max-height: 48px;
    max-width: 46vw;
  }

  .hm-nav {
    display: none;
  }

  .hm-nav.is-open {
    display: block;
  }

  .hm-menu {
    display: block;
    padding: 6px 0;
  }

  .hm-menu li + li::before {
    content: none;
  }

  .hm-menu a {
    padding: 12px 22px;
    border-top: 1px solid var(--hm-line);
  }

  .hm-search-panel {
    padding-left: 22px;
    padding-right: 22px;
  }

  .hm-search-panel form {
    grid-template-columns: 1fr;
  }

  .hm-main {
    padding-top: 20px;
  }

  .hm-side-stack,
  .hm-latest__list,
  .hm-grid,
  .hm-archive-grid {
    grid-template-columns: 1fr;
  }

  .hm-featured__title {
    font-size: 2rem;
  }

  .hm-section {
    margin-top: 38px;
  }

  .hm-latest__item {
    grid-template-columns: 1fr 92px;
  }
}

@media (max-width: 440px) {
  .hm-header__bar,
  .hm-main,
  .hm-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hm-brand {
    font-size: 1.66rem;
  }

  .hm-brand img,
  .hm-default-logo {
    max-height: 42px;
    max-width: 48vw;
  }

  .hm-featured__media,
  .hm-single__media {
    aspect-ratio: 1.18 / 1;
  }

  .hm-latest__item {
    grid-template-columns: 1fr 78px;
  }
}
