@font-face {
    font-family: "AvenirRegular";
    src: url("fonts/AvenirRegular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "AvenirHeavy";
    src: url("fonts/AvenirLTStd85Heavy.otf") format("opentype");
    font-weight: bold;
    font-style: normal;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    --page-gutter: clamp(2rem, 2vw, 2rem);
}

.site-wrapper {
    min-width: 375px;
    min-height: 700px;
}

main,
.content-container,
.masonry-gallery {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}

.play-icon {
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-title {
    margin-top: 1rem;
    margin-bottom: 1rem;
    opacity: 1; /* allow immediate paint */
    animation: fadeOnly 2s ease-out;
}


/* -----------------------
   Reset & Body
------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: "AvenirRegular", sans-serif;
    background-color: #000;
    color: #f5f5f5;
    line-height: 1.6;
    min-height: 100vh;
}

.content {
    flex: 1 0 auto;
}

/* Wrap hero + content to push footer down */
.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* -----------------------
   Hero Image
------------------------- */
/* Hero container flush and responsive */
.hero-container {
    width: 100vw;
    height: 60vh; /* adjust for mobile */
    max-height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.hero {
    width: 100%;
    height: 100%;
    background-image: url("images/header.jpg");
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    opacity: 0.2;
    animation: fadeOnly 2s ease-out forwards;
    animation-delay: 0.3s;
}

.about {
    width: 100%;
    height: 100%;
    background-image: url("images/presentation.jpg");
    background-size: cover;
    background-position: bottom right;
    background-repeat: no-repeat;
    opacity: 0.2;
    animation: fadeOnly 2s ease-out forwards;
    animation-delay: 0.3s;
}

/* -----------------------
   Content Below Image
------------------------- */
/* Content expands to push footer down */
.content-container {
    display: flex;
    flex-direction: column; /* vertical stacking */
    flex: 1;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    max-width: 700px;
    text-align: left;
    opacity: 0.2;
    animation: fadeOnly 2s ease-out forwards;
    animation-delay: 1s;
}

.content-container.footer-left {
    max-width: none;
    margin: 0;
    padding-left: var(--page-gutter);
    align-items: flex-start;
}

.page-footer p {
    font-size: 0.5rem;
}

.page-footer {
    margin-top: auto;
    line-height: 1.4;
    margin: 0;
}

h1 {
    font-family: "AvenirHeavy", sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #fff;
}

/* Paragraph styling */
p {
    font-weight: 400;
    font-size: 1rem;
    font-weight: normal;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin: 0 auto;
    max-width: 650px;
    margin-bottom: 1.1rem;
}

h1,
p {
    line-height: 1.6;
}

/* ------------------------------
   Masonry Gallery
-------------------------------- */
.masonry-gallery {
    display: grid;
    margin-top: 1rem;
    margin-bottom: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 0;
    opacity: 0;
    animation: fadeOnly 2s ease-out forwards;
    animation-delay: 0.5s;
}

.masonry-gallery.articles-gallery {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.masonry-item {
    overflow: hidden;
    cursor: pointer;
    background: none; /* remove any background */
    box-shadow: none; /* no shadow */
    transition: transform 0.3s ease;
}

.masonry-item img {
    width: 100%;
    height: auto; /* keep natural aspect ratio */
    display: block;
}

.masonry-item a {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 25px solid #ffffff !important; /* force full white */
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    pointer-events: none;
    text-shadow: none;
    background: none;
    display: inline-block;
    line-height: 1;
    user-select: none;
}

.caption {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    color: rgba(255, 255, 255, 1);
    font-weight: 500;
    font-size: 1rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0); /* transparent overlay */
}

/* Optional hover for captions */
.masonry-item .caption {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.masonry-item:hover .caption {
    opacity: 1;
}

.gallery-item {
    position: relative;
    display: block;
    opacity: 1; /* make sure no inherited opacity */
}

/* ------------------------------
   Modal
-------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    margin-top: min(4rem);
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85); /* adjust alpha for darkness */
    z-index: 9998; /* below modal content */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.modal.show .modal-backdrop {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    margin: 0 auto;
    max-width: 900px; /* match gallery feel */
    padding-inline: var(--page-gutter);
    box-sizing: border-box;
    background: none;
    pointer-events: auto;
    z-index: 9999;
}

.modal-inner {
    display: block;
    text-align: center;
}

.modal-inner img,
.modal-inner video {
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 10rem);
}

.modal-close {
    position: fixed; /* fixed to viewport */
    top: 1rem; /* distance from top of browser window */
    right: 2rem; /* distance from right edge */
    font-size: 2rem;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    z-index: 99999; /* above everything else */
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: rgba(255, 255, 255, 1);
}

.modal-loader-center {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    pointer-events: none;
}

.modal-loader {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: auto;
}

.expand-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-size: 2rem;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    z-index: 10001;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.3s ease;
}

.expand-btn:hover {
    color: rgba(255, 255, 255, 1);
}

.slide-text {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 0;
    background-color: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
    overflow: hidden;
    transition:
        max-height 0.5s ease,
        padding 0.5s ease;
    font-size: 0.875rem;
    padding: 0 1.5rem;
    box-sizing: border-box;
    z-index: 10000;
}

.slide-text.show {
    max-height: 1000px;
    padding: 2rem 1.5rem 2rem 1.5rem;
}

.modal-media iframe {
    width: 90vw;
    height: auto;
    aspect-ratio: 16 / 9;
}

.slide-text-inner p {
    margin: 0;
    margin-block: 0 1rem;
}

.slide-text-inner {
    left: 2rem;
    right: auto;
    text-align: left;
    font-size: clamp(0.8rem, 3.5vw, 0.9rem);
    line-height: 1.6;
    max-width: calc(100% - 2rem);
}

.slide-text p {
    font-size: inherit;
    line-height: inherit;
    max-width: none;
    opacity: 0.85;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.modal-media iframe {
    max-width: 100%;
    box-sizing: border-box;
}

/* ------------------------------
   Responsive tweaks
-------------------------------- */
@media (max-width: 900px) and (orientation: landscape) {
    .modal {
        margin-top: 0;
    }
    .modal {
        position: fixed;
        inset: 0;
        margin: 0;
    }

    .modal-content,
    .modal-inner,
    .modal-media,
    .modal-media figure,
    .modal-media .wp-block-embed__wrapper {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
    }

    .modal-media {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* True full-bleed media */
    .modal-inner img,
    .modal-inner video {
        display: block;
        width: 100vw;
        min-width: 100vw;
        max-width: 100vw;

        height: auto;
        max-height: none;

        margin: 0;
        object-fit: contain;
    }
}

@media (max-width: 900px) and (orientation: portrait) {
    .modal-inner img,
    .modal-inner video {
        width: auto;
        object-fit: contain;
    }

    .modal-content,
    .modal-inner,
    .modal-media,
    .modal-media figure,
    .modal-media .wp-block-embed__wrapper {
        width: 100%;
        height: auto;
        max-width: none;
        margin: 0;
    }

    .modal-inner img {
        transform: translateY(-7dvh);
    }
}

@media (max-width: 900px) {
    .modal {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 0;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-media iframe {
        width: 100%;
        height: auto;
        max-height: 100%;
        aspect-ratio: 16 / 9;
    }

    .modal-media iframe {
        width: 100%;
    }

    .play-icon {
        font-size: 2.5rem;
    }

    .masonry-item .caption {
        opacity: 1;
    }

    .caption {
        font-size: 0.9rem;
    }

    .modal-content {
        width: auto;
        max-width: 100%;
        padding-inline: 0;
        margin: 0;
    }

    .modal-inner {
        width: 100vw;
    }

    .hero-container {
        height: 50vh;
    }
    .content-container {
        padding: 1.5rem 1rem;
        max-width: 90%;
    }
	
    h1 {
        font-size: 2rem;
    }
    p {
        font-size: 1rem;
    }
}

/* -----------------------
   Fade Only Keyframes
------------------------- */
@keyframes fadeOnly {
    from {
        opacity: 0.2;
    }
    to {
        opacity: 1;
    }
}
/* Hero for posts */
.post-hero {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  opacity: 0.2;
  animation: fadeOnly 2s ease-out forwards;
  animation-delay: 0.3s;
}

.post-meta {
    margin-bottom: 2rem;
}

body.single .hero-container {
    height: 30vh;
}

@media (max-width: 900px) {
    body.single .hero-container {
        height: 25vh;
    }
}

/* Post content */
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: "AvenirHeavy", sans-serif;
  font-weight: bold;
  letter-spacing: 0.5px;
  line-height: 1.3;
  margin: 2em 0 0.6em;
}
.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.35rem; }
.post-content h4 { font-size: 1.1rem; }

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

.post-content p { margin: 0 0 1.25em; }

.post-content ul,
.post-content ol {
  max-width: 650px;
  margin: 0 0 1.25em;
  padding-left: 1.5em;
}
.post-content ul { list-style: disc outside; }
.post-content ol { list-style: decimal outside; }

.post-content li {
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.5px;
  opacity: 0.85;
  margin-bottom: 0.4em;
}

.post-content img {
  max-width: 100%;
  height: auto;
}


.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: 1.61rem;
}

.btn {
    display: inline-block;
    font-family: "AvenirRegular", sans-serif;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    line-height: 1;
    padding: 0.8rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
    color: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
    color: #fff;
    border-color: #fff;
}

.btn-quiet {
    color: #aaa;
}

.btn-quiet:hover {
    color: #fff;
}

.btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}