/*
Theme Name: Photography Portfolio
Theme URI: https://github.com/yourusername/photography-portfolio-wp
Author: Your Name
Author URI: https://yourwebsite.com
Description: A minimalist photography portfolio theme inspired by modern design aesthetics. Features masonry grid layout, lightbox gallery, and responsive design.
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: photography-portfolio
Tags: photography, portfolio, gallery, minimal, responsive, masonry

This theme, like WordPress, is licensed under the GPL.
*/

/* ==========================================================================
   Base Styles
   ========================================================================== */

:root {
    --font-cursive: 'Nothing You Could Do', cursive;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --color-dark: #1a1a1a;
    --color-light: #f5f5f5;
    --color-accent: #333;
    --spacing-unit: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* Global responsive images - force all images to fit container */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Force viewport constraint on all elements */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

#page, .site, .site-content, .site-main, article, .entry-content {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-light);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

.cursive {
    font-family: var(--font-cursive);
    font-weight: 400;
}

a {
    color: var(--color-dark);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.7;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
    padding: 2rem 4rem;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding h1 {
    font-family: var(--font-cursive);
    font-size: 1.8rem;
    margin: 0;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

.main-navigation a {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.site-main {
    overflow-x: hidden;
    width: 100%;
}

.site-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    overflow-x: hidden;
    box-sizing: border-box;
}

article {
    overflow-x: hidden;
    max-width: 100%;
}

.entry-content {
    max-width: 100%;
    overflow-x: hidden;
}

/* Single portfolio content text */
.entry-content p,
.entry-content .wp-block-paragraph {
    font-family: var(--font-sans) !important;
    font-weight: 400 !important;
    font-size: 1rem !important;
    line-height: 1.75 !important;
    margin-bottom: 1.5rem;
    color: #444 !important;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

/* ==========================================================================
   Portfolio Gallery - Masonry Grid
   ========================================================================== */

.portfolio-grid {
    column-count: 3;
    column-gap: 1.5rem;
    margin-top: 2rem;
}

.portfolio-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.portfolio-item-image-wrapper {
    position: relative;
    width: 100%;
    display: block;
    line-height: 0;
}

.portfolio-item a[data-fancybox] {
    display: block;
    position: static;
    opacity: 1 !important;
}

.portfolio-item a:not(.portfolio-item-overlay-link) {
    display: block;
    opacity: 1 !important;
}

.portfolio-item a:hover {
    opacity: 1 !important;
}

.portfolio-item a::before {
    display: none !important;
}

.portfolio-item a::after {
    display: none !important;
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

/* Overlay Link Wrapper */
.portfolio-item-overlay-link {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    display: flex !important;
    align-items: flex-end !important;
}

.portfolio-item:hover .portfolio-item-overlay-link {
    opacity: 1;
    pointer-events: auto;
}

.portfolio-item-overlay-link:hover {
    opacity: 1 !important;
    pointer-events: auto;
}

/* Force white color on all overlay link content */
.portfolio-item-overlay-link * {
    color: white !important;
}

.portfolio-item-overlay-link h3 {
    color: white !important;
}

/* Gradient Overlay at Bottom (Appears on Hover) */
.portfolio-item-overlay {
    position: relative;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.85) 50%, rgba(0,0,0,0.4) 80%, rgba(0,0,0,0) 100%);
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    margin-top: auto;
}

/* EXIF Data in Gradient Overlay */
.overlay-exif-gradient {
    color: white !important;
}

.overlay-exif-gradient * {
    color: white !important;
}

/* Title in Overlay */
.overlay-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.6);
    line-height: 1.3;
}

.overlay-exif-gradient .exif-data {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.overlay-exif-gradient .exif-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.6);
}

.overlay-exif-gradient .exif-item svg {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    fill: white !important;
}

/* Camera and Lens lines */
.overlay-exif-gradient .exif-camera span,
.overlay-exif-gradient .exif-lens span {
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.6);
    color: white !important;
}

/* Settings Row (ISO, Aperture, Shutter on one line) */
.overlay-exif-gradient .exif-settings-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.overlay-exif-gradient .exif-setting {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.6);
    color: white !important;
}

.overlay-exif-gradient .exif-setting span {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.6);
}

/* Single Portfolio Page - Featured Image */
.portfolio-featured-image {
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.portfolio-featured-image a {
    display: block;
    width: 100%;
    overflow: hidden;
}

.portfolio-featured-image img,
.portfolio-featured-image img.portfolio-single-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Single Portfolio Page - Keep Below Image Style */
.portfolio-single-exif {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    color: #333;
}

.portfolio-single-exif .exif-data {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #333;
}

.portfolio-single-exif .exif-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #333;
}

.portfolio-single-exif .exif-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.portfolio-single-exif .exif-settings-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.portfolio-single-exif .exif-setting {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .portfolio-item-overlay {
        padding: 1.5rem 1rem 1rem 1rem;
    }

    .overlay-title {
        font-size: 1.1rem;
        margin: 0 0 0.75rem 0;
    }

    .overlay-exif-gradient .exif-data {
        gap: 0.6rem;
    }

    .overlay-exif-gradient .exif-item {
        font-size: 0.75rem;
    }

    .overlay-exif-gradient .exif-item svg {
        width: 14px;
        height: 14px;
    }

    .overlay-exif-gradient .exif-setting {
        font-size: 0.7rem;
    }

    .overlay-exif-gradient .exif-setting svg {
        width: 12px;
        height: 12px;
    }

    .overlay-exif-gradient .exif-settings-row {
        gap: 0.75rem;
    }

    .portfolio-single-exif {
        padding: 1rem;
    }

    .portfolio-single-exif .exif-data {
        font-size: 0.85rem;
        gap: 0.6rem;
    }

    .portfolio-single-exif .exif-item svg {
        width: 14px;
        height: 14px;
    }
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about-section {
    max-width: 800px;
    margin: 4rem auto;
    text-align: center;
    padding: 2rem;
}

.about-section img {
    border-radius: 50%;
    width: 200px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 2rem;
}

.about-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-section {
    max-width: 600px;
    margin: 4rem auto;
    text-align: center;
    padding: 2rem;
}

.contact-info {
    margin-top: 2rem;
}

.contact-info a {
    display: inline-block;
    margin: 0.5rem 1rem;
    font-size: 1.1rem;
}

.social-links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-links a {
    font-size: 1.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.site-footer p {
    margin: 0.5rem 0;
    color: #666;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .portfolio-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 1rem 2rem;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 2rem;
        top: 1rem;
    }

    .main-navigation {
        width: 100%;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 1rem;
        display: none;
        text-align: center;
    }

    .main-navigation.toggled ul {
        display: flex;
    }

    .portfolio-grid {
        column-count: 1;
    }

    /* Portfolio images on mobile - preserve full image */
    .portfolio-item img {
        max-height: 85vh;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Improved mobile spacing */
    .site-content {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .entry-content {
        padding: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Hero section mobile */
    .hero-section {
        padding: 1.5rem 1rem;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section p {
        font-size: 0.95rem;
    }

    /* About Section Mobile Adjustments */
    .about-section {
        padding: 1rem;
        margin: 2rem auto;
    }

    .about-section img {
        width: 150px;
        height: 150px;
    }

    .about-section p {
        font-size: 1rem;
    }

    /* Single Portfolio Mobile */
    .portfolio-featured-image {
        margin: 0;
        padding: 0;
        max-width: calc(100vw - 2rem) !important;
        width: 100% !important;
        box-sizing: border-box;
        border-radius: 8px;
        overflow: hidden !important;
    }

    .portfolio-featured-image a {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .portfolio-featured-image img,
    .portfolio-featured-image img.portfolio-single-image,
    .portfolio-featured-image img[width],
    .portfolio-featured-image img[height] {
        width: 100% !important;
        max-width: calc(100vw - 2rem) !important;
        height: auto !important;
        display: block;
        object-fit: contain;
    }

    /* Override inline width/height attributes on all content images */
    .entry-content img,
    .entry-content img[width],
    .entry-content img[height],
    article img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* Mobile paragraph styling */
    .entry-content p,
    .entry-content .wp-block-paragraph {
        font-family: var(--font-sans) !important;
        font-weight: 400 !important;
        font-size: 0.95rem !important;
        line-height: 1.7 !important;
        padding: 0 0.5rem;
        max-width: 100%;
    }

    .entry-header {
        padding: 0.5rem 0 1rem 0;
    }

    .entry-header .entry-title {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }

    .portfolio-categories {
        font-size: 0.85rem;
        color: #666;
        margin: 0;
    }

    /* Mobile EXIF styling */
    .portfolio-single-exif {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 8px;
    }

    .portfolio-single-exif .exif-data {
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .portfolio-single-exif .exif-item svg {
        width: 14px;
        height: 14px;
    }

    .portfolio-single-exif .exif-settings-row {
        gap: 0.75rem;
    }

    .portfolio-single-exif .exif-setting {
        font-size: 0.8rem;
    }

    /* Back to portfolio link */
    .back-to-portfolio {
        display: inline-block;
        padding: 0.75rem 1.5rem;
        margin-top: 1.5rem;
        font-size: 0.9rem;
    }

    .portfolio-single-exif {
        padding: 1rem;
        margin: 1rem 0;
    }

    .back-to-portfolio {
        display: inline-block;
        padding: 0.75rem 1.5rem;
        margin: 1rem 0;
    }

    /* Contact Section Mobile */
    .contact-section {
        padding: 1rem;
        margin: 2rem auto;
    }

    .contact-info a {
        display: block;
        margin: 0.75rem 0;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

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

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   Image Download Protection
   ========================================================================== */

/* Prevent image dragging */
.portfolio-item img,
.portfolio-featured-image img,
.fancybox__image {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
}
