/*
Theme Name: Kadence Child – Julia Stone
Template: kadence
Description: Child theme for juliastone.de portfolio based on Kadence.
Version: 1.0.0
Author: Julia Stone
License: GNU General Public License v3.0 (or later)
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: kadence-child
*/

/* -------------------------------------------------------
   Metropolis font
   ------------------------------------------------------- */
@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-RegularItalic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------
   Global font override – apply Metropolis everywhere
   ------------------------------------------------------- */
body,
body .entry-content,
body .site-container,
body p,
body h1, body h2, body h3, body h4, body h5, body h6 {
  font-family: 'Metropolis', sans-serif !important;
  font-weight: 400;
  color: #494949;
}

body p,
body .entry-content p {
  max-width: 65ch;
}

/* -------------------------------------------------------
   Header – match original Adobe Portfolio layout
   ------------------------------------------------------- */

/* Full-width header container, same max-width as content */
#masthead .site-main-header-wrap.site-header-row-layout-standard .site-container {
  max-width: 1600px;
  width: 100%;
}

/* Remove Kadence default min-height */
#masthead .site-main-header-inner-wrap {
  min-height: 0;
}

/* Logo / site title */
#masthead .site-branding {
  padding: 42px 0 36px 6%;
}

#masthead .site-branding p.site-title {
  font-family: 'Metropolis', sans-serif;
  font-size: 22px !important;
  font-weight: 400;
  line-height: 22px;
  text-transform: uppercase;
  color: #000;
  white-space: nowrap;
  transition: 0.15s color;
}

#masthead .site-branding a:hover .site-title,
#masthead .site-branding a:hover {
  color: #FEAFDE;
}

/* Nav – original: padding-top 36px, bottom 30px, right-aligned */
#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a {
  font-family: 'Metropolis', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 28px;
  text-transform: uppercase;
  color: #aaa;
}

#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a:hover {
  color: #111;
}

#masthead .main-navigation .primary-menu-container > ul > li.menu-item.current-menu-item > a {
  color: #111;
}

/* Nav section padding to match original */
#masthead .site-header-main-section-right {
  padding: 36px 6% 30px 0;
  align-self: flex-start;
}

/* Align items to baseline (logo bottom aligns with nav bottom) */
#masthead .site-header-main-section-left {
  align-self: flex-start;
}

/* -------------------------------------------------------
   Page hero / title bar – hide on front page
   ------------------------------------------------------- */
.home .entry-hero.page-hero-section,
.page-id-8 .entry-hero.page-hero-section {
  display: none;
}

/* -------------------------------------------------------
   Project pages – content layout
   ------------------------------------------------------- */

/* Hide page/post title (no visible title in original) */
body.page .entry-hero.page-hero-section,
body.single-post .entry-hero-container,
body.single-post .entry-header {
  display: none;
}

/* Full-width content container */
body.page .content-container.site-container,
body.single-post .content-container.site-container {
  max-width: 1600px;
  width: 100%;
}

/* Remove boxed content padding */
body.page:not(.home) .entry-content-wrap,
body.single-post .entry-content-wrap {
  padding: 0;
}

/* Remove top/bottom margin on content area */
body.page:not(.home) .content-area,
body.single-post .content-area {
  margin-top: 0;
  margin-bottom: 0;
}

/* Hide post meta (date, author, categories) on project posts */
body.single-post .posted-on,
body.single-post .byline,
body.single-post .cat-links,
body.single-post .tags-links,
body.single-post .post-author-inner-wrap,
body.single-post .entry-meta,
body.single-post .post-navigation,
body.single-post .comments-area {
  display: none !important;
}

/* Project images: full width, spacing below */
.js-project-content .wp-block-image {
  margin-bottom: 0;
}

.js-project-content .wp-block-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Project text blocks: centered, narrow, matching original */
.js-project-content .js-project-text {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 20px 40px;
}

.js-project-content .js-project-text p {
  font-family: 'Metropolis', sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  color: #999;
  text-align: left;
  margin: 0;
}

/* Captions: smaller, centered */
.js-project-content .js-project-caption {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding: 15px 20px 40px;
}

.js-project-content .js-project-caption p {
  font-family: 'Metropolis', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 19px;
  color: #999;
  text-align: center;
  margin: 0;
}

/* Two images side by side (media collection) */
.js-project-content .wp-block-columns.js-duo {
  gap: 8px;
  margin-bottom: 0;
}

.js-project-content .wp-block-columns.js-duo .wp-block-column {
  padding: 0;
  margin: 0;
}

.js-project-content .wp-block-columns.js-duo .wp-block-image {
  margin: 0;
}

/* Remove default block spacing */
.js-project-content .wp-block-image figure,
.js-project-content figure.wp-block-image {
  margin: 0;
}

/* -------------------------------------------------------
   Media collection grid (Adobe Portfolio flexbox layout)
   ------------------------------------------------------- */
.js-project-content .js-media-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -4px;
  overflow: hidden;
}

.js-project-content .js-media-grid-item {
  box-sizing: content-box;
  border-bottom: 8px solid transparent;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: relative;
  overflow: hidden;
}

.js-project-content .js-media-grid-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Spacer prevents last-row items from stretching full width */
.js-project-content .js-media-grid .js-grid-spacer {
  flex-grow: 90000000000;
}

/* Narrower grid variant (75% width, e.g. single hero image) */
.js-project-content .js-media-grid.js-grid-narrow {
  max-width: 75%;
  margin-left: auto;
  margin-right: auto;
}

/* Hero image – narrower width (e.g. Elsewhere cover) */
.js-project-content .js-hero-narrow {
  max-width: 70%;
  margin-left: auto;
  margin-right: auto;
}

.js-project-content .js-hero-narrow figcaption {
  font-family: 'Metropolis', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 19px;
  color: #999;
  text-align: center;
  padding: 15px 0 0;
}

/* Grid image captions (figcaption) */
.js-project-content .wp-block-columns .wp-block-image figcaption {
  font-family: 'Metropolis', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 19px;
  color: #999;
  text-align: center;
  padding: 10px 0 0;
}

/* Caption links match caption style */
.js-project-content .js-project-caption a {
  color: #999;
  text-decoration: underline;
}

.js-project-content .js-project-caption a:hover {
  color: #111;
}

/* -------------------------------------------------------
   Work Grid – Portfolio Overview
   ------------------------------------------------------- */

.work-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 10px;
  row-gap: 10px !important;
  max-width: 1600px !important;
  margin: 0 auto;
  padding: 0 !important;
}

/* Override Kadence .single-content spacing inside work grid */
.single-content .work-grid,
.single-content .work-grid figure,
.single-content .work-grid p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.work-card {
  position: relative;
  margin: 0 !important;
  cursor: pointer;
  padding: 0 !important;
}

/* Image container with original aspect ratio */
.work-card .card-image {
  position: relative;
  overflow: hidden;
  padding-bottom: 78.21782%;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.work-card .card-image .wp-block-image {
  position: absolute;
  inset: 0;
  margin: 0;
}

.work-card .card-image .wp-block-image img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
}

/* Rollover image: hidden by default */
.work-card .card-image .img-rollover {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Normal image with rollover companion: transitions */
.work-card .card-image .img-normal.has-rollover {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Hover: swap images */
.work-card:hover .card-image .img-normal.has-rollover {
  opacity: 0;
  visibility: hidden;
}

.work-card:hover .card-image .img-rollover {
  opacity: 1;
  visibility: visible;
}

/* Dark overlay on hover */
.work-card .card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  z-index: 1;
  pointer-events: none;
}

.work-card:hover .card-image::after {
  opacity: 0.5;
}

/* Text overlay */
.work-card .card-details {
  position: absolute !important;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
  padding: 7% 8% 0 !important;
  -webkit-backface-visibility: hidden;
  pointer-events: none;
}

.work-card:hover .card-details {
  opacity: 1;
}

.work-card .card-details .card-title {
  color: #fff !important;
  font-family: 'Metropolis', sans-serif;
  font-size: 30px !important;
  font-weight: 400;
  line-height: 34px !important;
  padding-bottom: 15px;
  margin: 0 !important;
}

.work-card .card-details .card-desc {
  color: #fff !important;
  font-family: 'Metropolis', sans-serif;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 18px !important;
  padding-bottom: 15px;
  margin: 0 !important;
  width: 50%;
  white-space: pre-line;
  word-wrap: break-word;
}

.work-card .card-details .card-year {
  color: #fff !important;
  font-family: 'Metropolis', sans-serif;
  font-size: 13px !important;
  font-weight: 600;
  line-height: 17px !important;
  margin: 0 !important;
}

/* Empty placeholder (Bücherquelle) */
.work-card .card-image--empty {
  background: #f0f0f0;
}

/* Responsive: 2 columns at 932px */
@media (max-width: 932px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .work-card .card-details .card-title {
    font-size: 22px !important;
    line-height: 25px !important;
  }
  .work-card .card-details .card-desc {
    display: none;
  }
}

/* Responsive: 1 column at 540px */
@media (max-width: 540px) {
  .work-grid {
    grid-template-columns: 1fr !important;
  }
  .work-card .card-details .card-title {
    font-size: 19px !important;
    line-height: 22px !important;
  }
}

/* -------------------------------------------------------
   About page
   ------------------------------------------------------- */

/* Impressum section below columns */
.js-about-impressum {
  margin-top: 60px !important;
  padding-left: 0;
  max-width: 600px;
}

.js-about-impressum p {
  font-family: 'Metropolis', sans-serif;
  line-height: 1.4;
  color: #333;
  margin-bottom: 8px !important;
}

/* Portrait image: show at natural size */
.js-about-columns .wp-block-image img {
  width: 100%;
  height: auto;
}

/* Responsive: stack columns on small screens */
@media (max-width: 782px) {
  .js-about-impressum {
    margin-top: 40px !important;
  }
}
