/*
Theme Name: Incredible Lens
Theme URI: https://www.incredibleindiaphotogallery.com
Description: A photo-first travel journal theme made for "Incredible India thru my Lens". Works with existing posts: automatically uses the first photo of each post as its cover, turns old thumbnail rows into large galleries with a lightbox, and keeps every old URL working.
Author: Made with Claude
Version: 1.0.1
Requires at least: 6.6
Tested up to: 7.3
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: incredible-lens
Tags: blog, photography, block-patterns, full-site-editing, wide-blocks, one-column, three-columns
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; max-width: 100%; }
::selection { background: var(--wp--preset--color--saffron); color: var(--wp--preset--color--paper); }
:where(a) { text-underline-offset: .18em; text-decoration-thickness: 1px; }

/* Small uppercase label used for categories / kicker text */
.il-kicker, .il-kicker a {
	font-family: var(--wp--preset--font-family--sans);
	font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
	text-decoration: none; color: var(--wp--preset--color--saffron);
}
.il-kicker a:hover { color: var(--wp--preset--color--ink); }

/* ---------- Header ---------- */
.il-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.il-header .wp-block-site-title a { text-decoration: none; }
.il-header .wp-block-navigation a { text-decoration: none; }
.il-header .wp-block-navigation a:hover { color: var(--wp--preset--color--saffron); }
.il-wordmark-sub { margin: 0 !important; }

/* ---------- Cards ---------- */
.il-card { display: flex; flex-direction: column; height: 100%; }
.il-card .wp-block-post-featured-image { overflow: hidden; border-radius: 3px; background: var(--wp--preset--color--sand); }
.il-card .wp-block-post-featured-image img { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.il-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.il-card .wp-block-post-title a { text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .35s; }
.il-card:hover .wp-block-post-title a { background-size: 100% 1px; }
.il-card .wp-block-post-excerpt__excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.il-card .wp-block-post-excerpt__more-text { display: none; }

/* Posts without any photo get a quiet patterned placeholder */
.il-card .wp-block-post-featured-image:empty,
.il-noimage { width: 100%; aspect-ratio: 4/3; background: var(--wp--preset--color--sand) repeating-linear-gradient(135deg, transparent 0 14px, rgba(194,84,27,.06) 14px 15px); }

/* ---------- Hero ---------- */
.il-hero .wp-block-cover__inner-container { width: 100%; }
.il-hero .wp-block-post-title a { text-decoration: none; }
.il-hero .il-kicker a, .il-hero .il-kicker { color: var(--wp--preset--color--marigold); }

/* ---------- Single post ---------- */
.il-single-cover .wp-block-post-featured-image img { max-height: 78vh; object-fit: cover; }
.il-meta, .il-meta a { font-family: var(--wp--preset--font-family--sans); font-size: .85rem; color: var(--wp--preset--color--muted); text-decoration: none; }
.il-meta a:hover { color: var(--wp--preset--color--saffron); }

.single-post .wp-block-post-content > p:first-of-type::first-letter {
	float: left; font-family: var(--wp--preset--font-family--serif); font-size: 4.2em; line-height: .82;
	padding: .06em .1em 0 0; color: var(--wp--preset--color--saffron); font-weight: 500;
}

/* Galleries built from old thumbnail rows (see functions.php) */
.il-gallery {
	display: grid; gap: 10px; margin-block: 2rem !important;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.il-gallery.il-count-1 { grid-template-columns: 1fr; }
.il-gallery.il-count-2, .il-gallery.il-count-4 { grid-template-columns: repeat(2, 1fr); }
.il-gallery.il-count-3 { grid-template-columns: repeat(3, 1fr); }
.il-gallery a, .il-gallery > img { display: block; overflow: hidden; border-radius: 3px; background: var(--wp--preset--color--sand); }
.il-gallery img { width: 100%; height: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .3s; }
.il-gallery.il-count-1 img { aspect-ratio: auto; max-height: 80vh; object-fit: contain; }
.il-gallery a:hover img { transform: scale(1.03); }
@media (max-width: 600px) { .il-gallery.il-count-3, .il-gallery.il-count-4 { grid-template-columns: repeat(2, 1fr); } }

/* Old WordPress [gallery] shortcode + classic alignment classes */
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-block: 2rem; }
.gallery br { display: none; }
.gallery .gallery-item { margin: 0; width: auto !important; }
.gallery img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border: 0 !important; border-radius: 3px; }
.gallery-caption, .wp-caption-text { font-family: var(--wp--preset--font-family--sans); font-size: .8rem; color: var(--wp--preset--color--muted); margin-top: .4rem; }
.wp-caption { max-width: 100%; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }

/* ---------- Lightbox ---------- */
.il-lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(18,15,12,.96); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 4vh 4vw; }
.il-lightbox.is-open { display: flex; }
.il-lightbox img { max-width: 100%; max-height: 84vh; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.il-lightbox__bar { color: #d9cfbf; font: 500 .85rem/1.4 var(--wp--preset--font-family--sans); margin-top: 1rem; display: flex; gap: 1.5rem; align-items: center; }
.il-lightbox button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 99px; width: 44px; height: 44px; font-size: 1.1rem; cursor: pointer; }
.il-lightbox button:hover { background: var(--wp--preset--color--saffron); border-color: transparent; }
.il-lightbox__close { position: absolute; top: 18px; right: 18px; }
.il-lightbox__prev, .il-lightbox__next { position: absolute; top: 50%; transform: translateY(-50%); }
.il-lightbox__prev { left: 18px; } .il-lightbox__next { right: 18px; }

/* ---------- Attachment (image) pages ---------- */
.il-attachment-image { text-align: center; }
.il-attachment-image img { max-height: 82vh; width: auto; object-fit: contain; border-radius: 3px; }
.il-back-link { font-family: var(--wp--preset--font-family--sans); font-size: .9rem; }

/* ---------- Category chips ---------- */
.il-chips .wp-block-categories-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.il-chips .wp-block-categories-list li a {
	display: inline-block; padding: .55em 1.1em; border: 1px solid var(--wp--preset--color--line); border-radius: 99px;
	font-family: var(--wp--preset--font-family--sans); font-size: .9rem; text-decoration: none; color: var(--wp--preset--color--ink); transition: all .2s;
}
.il-chips .wp-block-categories-list li a:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); border-color: var(--wp--preset--color--ink); }
.il-chips .wp-block-categories-list li { font-family: var(--wp--preset--font-family--sans); font-size: .8rem; color: var(--wp--preset--color--muted); }

/* ---------- Pagination ---------- */
.wp-block-query-pagination { font-family: var(--wp--preset--font-family--sans); }
.wp-block-query-pagination a { text-decoration: none; }
.wp-block-query-pagination-numbers .page-numbers { display: inline-grid; place-items: center; min-width: 2.4em; height: 2.4em; border-radius: 99px; }
.wp-block-query-pagination-numbers .current { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }

/* ---------- Footer ---------- */
.il-footer a { text-decoration: none; }
.il-footer a:hover { color: var(--wp--preset--color--marigold); }
.il-footer .wp-block-categories-list, .il-footer .wp-block-archives-list { list-style: none; padding: 0; }
.il-footer .wp-block-archives-dropdown select, .il-footer select { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.25); padding: .5em .7em; border-radius: 3px; font: inherit; width: 100%; }
.il-footer .wp-block-archives-dropdown select option { color: #000; }

/* ---------- Comments ---------- */
.wp-block-comment-template { padding-left: 0; }
.wp-block-comment-template li { list-style: none; }
.wp-block-comments input:not([type=submit]):not([type=checkbox]), .wp-block-comments textarea {
	width: 100%; padding: .7em .8em; border: 1px solid var(--wp--preset--color--line); border-radius: 3px; background: #fff; font: inherit;
}
